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

/* ==========================================================
   LAYOUT: Masonry — Pinterest-Style Gallery
   ==========================================================
   Visual: Categories flow like a waterfall/Pinterest board.
   Variable height cards stack into columns naturally.
   Organic, art-gallery feel. Cards have generous whitespace.
   ========================================================== */

/* ── Homepage: Hero Section ── */
.hero {
  padding: 4rem 2rem 3.5rem;
  text-align: center;
  border-bottom: none;
  border-radius: 0 0 24px 24px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
}

/* ── Homepage: Categories — CSS Columns Masonry ── */
.categories-grid {
  display: block;
  column-count: 3;
  column-gap: 1.75rem;
}

.category-card {
  break-inside: avoid;
  margin-bottom: 1.75rem;
  display: block;
}

/* Variable heights through padding variation */
.category-card:nth-child(3n) {
  padding: 2.5rem 2rem;
}

.category-card:nth-child(3n+1) {
  padding: 1.75rem 2rem 2.25rem;
}

.category-card:nth-child(3n+2) {
  padding: 2rem;
}

/* Hide the "Browse →" row for a cleaner gallery look */
.category-meta {
  border-top: none;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  opacity: 0;
  transition: opacity var(--dur-fast, 150ms) ease;
}

.category-card:hover .category-meta {
  opacity: 1;
}

/* ── Homepage: Intro Section ── */
.intro-section {
  border-radius: 16px;
  text-align: center;
}

/* ── List Page: Subcategories — 2-Column Masonry ── */
.subcategories {
  column-count: 2;
  column-gap: 1.5rem;
}

.category-list {
  display: block;
  list-style: none;
  padding: 0;
}

.category-list li {
  break-inside: avoid;
  margin-bottom: 1rem;
}

.category-list li a {
  border-radius: 12px;
}

/* ── List Page: Worksheets — Compact Pills ── */
.worksheet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
}

.worksheet-list li a {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--site-border, #e5e7eb);
  border-radius: 999px;
  text-decoration: none;
}

.worksheet-list li a:hover {
  border-color: var(--site-primary, #fbbf24);
  background: var(--site-primary-light, #fffbeb);
}

/* ── SEO Components — Tight 2-Column ── */
.seo-components--primary {
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.seo-card {
  border-radius: 14px;
}

.seo-more-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .categories-grid {
    column-count: 2;
  }
  .seo-more-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .categories-grid {
    column-count: 1;
  }
  .subcategories {
    column-count: 1;
  }
  .seo-components--primary {
    grid-template-columns: 1fr;
  }
  .seo-more-grid {
    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.
   ========================================================== */

/* ════════════════════════════════════════════════
   PHASE 1 — TRACING INTERACTION ENHANCEMENTS
   ════════════════════════════════════════════════ */

/* ── Tracing Canvas ───────────────────────────── */
.tr-canvas-wrap {
  position: relative;
  width: 100%;
  border: 1.5px solid var(--site-primary-border, #fde68a);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(251,191,36,0.08);
}
.tr-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
.tr-guide-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.3;
}

/* ── Stroke Toolbar ───────────────────────────── */
.tr-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  background: var(--site-primary-light, #fffbeb);
  border: 1.5px solid var(--site-primary-border, #fde68a);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}
.tr-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  font-size: 1.2rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.tr-tool-btn:hover {
  background: var(--site-primary-light, #fffbeb);
  border-color: var(--site-primary-border, #fde68a);
}
.tr-tool-btn.is-active {
  border-color: var(--site-primary, #fbbf24);
  background: var(--site-primary-light, #fffbeb);
  box-shadow: 0 0 0 3px rgba(251,191,36,0.18);
}
.tr-tool-btn:focus-visible {
  outline: 2px solid var(--site-primary, #fbbf24);
  outline-offset: 2px;
}

/* ── Coverage Score / Feedback ────────────────── */
.tr-score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--site-primary-light, #fffbeb);
  border: 1.5px solid var(--site-primary-border, #fde68a);
  border-radius: 10px;
  margin-top: 0.75rem;
}
.tr-score__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--site-text-muted, #78716c);
}
.tr-score__track {
  flex: 1;
  height: 8px;
  background: var(--site-border, #fef3c7);
  border-radius: 4px;
  overflow: hidden;
}
.tr-score__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.tr-score__fill--low  { background: #ef4444; }
.tr-score__fill--mid  { background: var(--site-primary, #fbbf24); }
.tr-score__fill--high { background: #22c55e; }
.tr-score__pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--site-text, #1c1400);
  min-width: 3rem;
  text-align: right;
}

/* ── Letter Navigation ────────────────────────── */
.tr-letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
}
.tr-letter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--site-border, #fef3c7);
  border-radius: 10px;
  background: #ffffff;
  color: var(--site-text, #1c1400);
  cursor: pointer;
  font-family: var(--font-heading, 'Fredoka One', sans-serif);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.tr-letter-btn:hover {
  border-color: var(--site-primary, #fbbf24);
  background: var(--site-primary-light, #fffbeb);
}
.tr-letter-btn.is-active {
  border-color: var(--site-primary, #fbbf24);
  background: var(--site-primary-light, #fffbeb);
  color: var(--site-primary-dark, #92400e);
  box-shadow: 0 0 0 3px rgba(251,191,36,0.18);
}
.tr-letter-btn.is-complete {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

/* ── Streak Badge ─────────────────────────────── */
.tr-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill, 9999px);
  background: linear-gradient(135deg, var(--site-primary, #fbbf24), var(--site-accent, #38bdf8));
  color: var(--site-primary-dark, #92400e);
  font-family: var(--font-heading, 'Fredoka One', sans-serif);
}

/* ── Phase 1 Print Suppression ────────────────── */
@media print {
  .tr-toolbar,
  .tr-score,
  .tr-letter-nav,
  .tr-streak,
  .tr-canvas-wrap { display: none !important; }
}

