/* ==========================================================
   LAYOUT VARIANT: sidebar-nav
   Source: design-system/layouts/sidebar-nav/site-layout.css
   ========================================================== */

/* ==========================================================
   LAYOUT: Sidebar-Nav — Navigation-First Split Pane
   ==========================================================
   Visual: Left sidebar with sticky category list + right
   main content area. Deep navigation feel, like a docs site.
   Categories are always visible for fast access.
   ========================================================== */

/* ── Homepage: 2-Column Split ── */
.homepage {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 0 2.5rem;
  max-width: 1400px;
}

/* Hero spans full width */
.hero {
  grid-column: 1 / -1;
  padding: 3.5rem 2rem 3rem;
  text-align: left;
  border-radius: 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.hero .subtitle {
  text-align: left;
  margin-left: 0;
}

/* Intro spans full width */
.intro-section {
  grid-column: 1 / -1;
  text-align: left;
}

/* Categories become sidebar */
.categories-section {
  grid-column: 1;
  grid-row: 3;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  margin: 0;
  align-self: start;
}

.section-header h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-card {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  border: none;
}

.category-card::before {
  display: none;
}

.category-card:hover {
  transform: none;
  background: var(--site-bg-alt, #f9fafb);
  box-shadow: none;
}

.category-icon {
  font-size: 1.25rem;
  margin-bottom: 0;
  display: inline;
  margin-right: 0.5rem;
}

.category-card h3 {
  font-size: 0.95rem;
  display: inline;
}

.category-card p {
  display: none;
}

.category-meta {
  display: none;
}

/* Content area (SEO body etc.) flows in right column */
.homepage > .content {
  grid-column: 2;
  grid-row: 3;
}

/* SEO components span full width below */
.seo-components {
  grid-column: 1 / -1;
}

.seo-components--primary {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.seo-components--secondary {
  grid-column: 1 / -1;
}

/* ── List Page: Sidebar Navigation ── */
.list-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0 2rem;
  max-width: 1400px;
}

.breadcrumb {
  grid-column: 1 / -1;
}

.list-page > .page-header {
  grid-column: 2;
}

.list-page > .intro {
  grid-column: 2;
}

.subcategories {
  grid-column: 1;
  grid-row: 3 / 6;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  align-self: start;
}

.subcategories h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
}

.category-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.category-list li a {
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  display: block;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--dur-fast, 150ms) ease;
  border-left: 3px solid transparent;
}

.category-list li a:hover {
  background: var(--site-bg-alt, #f9fafb);
  border-left-color: var(--site-primary, #3b82f6);
}

.category-list li a .description {
  display: none;
}

.list-page > .body-content {
  grid-column: 2;
}

.list-page > .content-pages {
  grid-column: 2;
}

.list-page .seo-components {
  grid-column: 1 / -1;
}

.list-page .seo-components--primary {
  grid-column: 1 / -1;
}

.list-page .seo-components--secondary {
  grid-column: 1 / -1;
}

/* ── SEO Components — Horizontal Scroll Cards ── */
.seo-components--primary {
  display: flex;
  overflow-x: auto;
  gap: 1.25rem;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
}

.seo-card {
  min-width: 300px;
  max-width: 360px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.seo-more-grid {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  scroll-snap-type: x mandatory;
}

.seo-more-grid .seo-block {
  min-width: 260px;
  max-width: 320px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ── Responsive: Collapse sidebar on tablet/mobile ── */
@media (max-width: 1024px) {
  .homepage {
    grid-template-columns: 1fr;
  }

  .categories-section {
    position: static;
    max-height: none;
    overflow: visible;
    grid-column: 1;
    grid-row: auto;
  }

  .categories-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .category-card {
    flex: 0 0 auto;
    padding: 0.625rem 1rem;
  }

  .list-page {
    grid-template-columns: 1fr;
  }

  .subcategories {
    position: static;
    max-height: none;
    overflow: visible;
    grid-column: 1;
    grid-row: auto;
  }

  .category-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .category-list li a {
    border-left: none;
    border: 1.5px solid var(--site-border, #e5e7eb);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .list-page > .page-header,
  .list-page > .intro,
  .list-page > .body-content,
  .list-page > .content-pages {
    grid-column: 1;
  }

  /* SEO back to grid */
  .seo-components--primary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    overflow: visible;
  }

  .seo-card {
    min-width: auto;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .seo-components--primary {
    grid-template-columns: 1fr;
  }
}


/**
 * Site-Specific Custom Styles (Layer 5)
 * =====================================
 *
 * This is the 5th and final layer in the CSS cascade:
 *
 * 1. main.css           → Platform base (header, footer, buttons)
 * 2. base-structure.css → Page layout (grids, sections, cards)
 * 3. tokens.css         → Design tokens (colors, spacing, typography)
 * 4. skin.css           → Theme skin (gradients, shadows, effects)
 * 5. site.css           → Site-specific customization (THIS FILE)
 *
 * THIS FILE HAS TWO SECTIONS:
 * ────────────────────────────────────────────────────────────
 *
 * Section A:  LAYOUT VARIANT CSS
 *   Loaded from design-system/layouts/<layout>/site-layout.css
 *   during cloning (Phase 5). Defines homepage grid, category page,
 *   and SEO component structures unique to each layout type.
 *
 *   Available layouts:
 *   - grid-cards   : Equal-height square product cards (default)
 *   - magazine     : Editorial 3-col with featured cards
 *   - masonry      : Pinterest-style CSS columns
 *   - list-rows    : Full-width horizontal rows
 *   - sidebar-nav  : 2-column split with sticky sidebar
 *
 *   The layout is set in site-profile.json → design.layout
 *   and auto-applied by generate-design-tokens.py during cloning.
 *
 * Section B:  CONTENT-TYPE-SPECIFIC STYLES
 *   Manually added per site for puzzle/content rendering.
 *   Examples: sudoku grids, arithmetic layouts, bingo cards.
 *
 * GUIDELINES:
 * -----------
 * DO:
 *    - Keep layout CSS in Section A (auto-generated)
 *    - Add content-specific layouts in Section B
 *    - Override generic styles for your site's unique needs
 *
 * DON'T:
 *    - Redefine design tokens (use tokens.css)
 *    - Copy/paste from other sites (each site is unique)
 *    - Modify Section A manually (re-run pipeline instead)
 */

/* ==========================================================
   Section A: LAYOUT VARIANT CSS
   ==========================================================
   AUTO-GENERATED — Do not edit manually.
   Layout: [will be set during cloning based on site-profile.json]
   Source: design-system/layouts/<layout>/site-layout.css
   ========================================================== */

/* Layout CSS will be injected here by generate-design-tokens.py */


/* ==========================================================
   Section B: CONTENT-TYPE-SPECIFIC STYLES
   ==========================================================
   Add your site's unique content styles below.
   Examples: sudoku grids, math layouts, word search, etc.
   ========================================================== */

