/*
 * Syllables World / SynonymGuide — Playful Geometric design system.
 * Base layer is real Bulma (static/bulma.min.css, loaded before this file).
 * This file overrides Bulma's defaults with the site's visual identity.
 */

:root {
  /* ============================================================
     Syllables World design kit — canonical tokens.
     Source: docs/design-kit/syllables-kit.css (authored in the
     claude.ai/design project). Accessibility corrections below are
     binding over the kit as authored — see "Corrections to the kit"
     in docs/superpowers/specs/2026-08-20-design-kit-adoption-design.md
     ============================================================ */

  /* Ground */
  --paper:        #FBF7F0;   /* bone — the page */
  --paper-2:      #FFFFFF;   /* raised blocks */
  --paper-3:      #F1E9DC;   /* quiet fill, tracks, wells */

  /* Ink */
  --ink:          #2A1B33;   /* blackcurrant — all body text */
  --ink-soft:     #6E5E78;   /* secondary text */
  --ink-faint:    #B7ABBD;   /* dividers, placeholder borders, disabled fills.
                                NEVER text a user must read — 2.05:1 on --paper. */
  --currant:      #4A2B5C;   /* deep brand block */

  /* Action */
  --tangerine:      #EE5F0A;
  --tangerine-dark: #C44A03; /* also: the fill to use when white text is
                                smaller than 18.66px bold — 4.85:1 with #fff */
  --tangerine-tint: #FFE6D2;

  /* Feedback */
  --mint:       #0E9E77;
  --mint-tint:  #D3F3E8;
  --berry:      #D63A5E;
  --berry-tint: #FBDDE3;

  /* Reward + info */
  --sun:      #FFC331;
  --sun-tint: #FFF0C7;
  --sky:      #2C7FD1;
  --sky-tint: #DBEBFA;

  /* Corrected ink variants — for text and icons that must be READ.
     The bright tokens above are fills, borders, and decorative shapes only.
     Ratios measured against --paper (#FBF7F0). */
  --sun-ink:   #8A6100;   /* 5.19:1 — --sun is 1.60:1 on white */
  --mint-ink:  #097054;   /* 5.68:1 — --mint is 3.40:1 on white */
  --berry-ink: #A8213F;   /* 6.65:1 — --berry is 3.58:1 on --berry-tint */
  --sky-ink:   #1F5F9F;   /* 6.16:1 — --sky is 3.88:1, fails as a link colour */

  /* Type */
  --font-display: "Chivo", system-ui, sans-serif;
  --font-body:    "Atkinson Hyperlegible", system-ui, sans-serif;
  --w-display:    900;
  --w-strong:     700;

  /* Shape */
  --r-sm:   8px;
  --r-md:  14px;
  --r-lg:  22px;
  --r-xl:  30px;
  --r-pill: 999px;

  /* Space (4-based) */
  --s-1:  4px;  --s-2:  8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Rules */
  --rule-color: #E4DACC;
  --line:      1.5px solid #E4DACC;
  --line-ink:  2px solid var(--ink);

  --container: 1180px;
  --tap-min:   52px;   /* never smaller for a child's target */

  /* ============================================================
     TRANSITIONAL ALIAS BLOCK — DELETE BY END OF PHASE 4.

     These 73 names are the old --ds-*, --sw-*, and legacy token
     families. Roughly 172 var() references across
     static/kids-browse-components.css, static/kids-game-layout.css,
     static/synonyms-site.css, and template inline <style> blocks
     still point at them. They exist so Phase 1 can land without
     simultaneously rewriting a 1876-line stylesheet and every
     template that carries inline styles.

     Each later phase deletes the aliases for the rules and templates
     it rewrites. Phase 4 does not pass review while this block still
     exists. This file has already accumulated two dead token families
     this way; a third is not acceptable.
     ============================================================ */

  /* --ds-* core */
  --ds-ink: var(--ink);
  --ds-border-width-sm: 1.5px;
  --ds-border-width-md: 2px;
  --ds-radius-sm: var(--r-sm);
  --ds-radius-md: var(--r-md);
  --ds-radius-lg: var(--r-lg);
  --ds-radius-xl: var(--r-xl);
  --ds-shadow-sm: none;
  --ds-shadow-md: none;
  --ds-shadow-lg: none;
  --ds-font-display: var(--font-display);
  --ds-font-body: var(--font-body);
  --ds-primary: var(--tangerine);
  --ds-primary-hover: var(--tangerine-dark);
  --ds-primary-pressed: var(--tangerine-dark);
  --ds-link: var(--sky-ink);
  --ds-link-hover: var(--sky-ink);
  --ds-accent-yellow: var(--sun);
  --ds-accent-green: var(--mint);
  --ds-bg: var(--paper);
  --ds-surface: var(--paper-2);
  --ds-text: var(--ink);
  --ds-text-soft: var(--ink-soft);
  --ds-border: var(--rule-color);
  --ds-tag-info-bg: var(--sky-tint);
  --ds-tag-info-text: var(--sky-ink);
  --ds-tag-success-bg: var(--mint-tint);
  --ds-tag-success-text: var(--mint-ink);
  --ds-tag-warning-bg: var(--sun-tint);
  --ds-tag-warning-text: var(--sun-ink);
  --ds-tag-danger-bg: var(--berry-tint);
  --ds-tag-danger-text: var(--berry-ink);
  --ds-button-primary-background-color: var(--tangerine);
  --ds-button-primary-background-color-hover: var(--tangerine-dark);
  --ds-button-primary-text-color: #ffffff;
  --ds-link-primary-color: var(--sky-ink);
  --ds-text-on-surface: var(--ink);
  --ds-text-on-mint-wash: var(--ink);
  --ds-eyebrow-banner-light-positive-background-color: var(--mint-tint);

  /* --sw-* legacy palette */
  --sw-primary: var(--tangerine);
  --sw-surface: var(--paper-2);
  --sw-font-display: var(--font-display);
  --sw-bg: var(--paper);
  --sw-surface-soft: var(--paper-3);
  --sw-text: var(--ink);
  --sw-text-soft: var(--ink-soft);
  --sw-primary-hover: var(--tangerine-dark);
  --sw-primary-light: var(--tangerine-tint);
  --sw-secondary: var(--currant);
  --sw-accent-yellow: var(--sun);
  --sw-accent-green: var(--mint);
  --sw-accent-coral: var(--tangerine);
  --sw-accent-orange: var(--tangerine);
  --sw-border: var(--rule-color);
  --sw-shadow: none;
  --sw-shadow-hover: none;
  --sw-radius-sm: var(--r-sm);
  --sw-radius-md: var(--r-md);
  --sw-radius-lg: var(--r-lg);
  --sw-container: var(--container);
  --sw-font-body: var(--font-body);

  /* unprefixed legacy */
  --text-color: var(--ink);
  --text-color-light: var(--ink-soft);
  --heading-color: var(--ink);
  --background-color: var(--paper-2);
  --background-light: var(--paper-3);
  --background-dark: var(--rule-color);
  --border-radius: var(--r-md);
  --box-shadow: none;
  --transition-speed: 0.18s;
  --font-family: var(--font-body);
  --font-family-heading: var(--font-display);
  --font-weight-strong: var(--w-strong);
  --primary-color: var(--tangerine);
  --primary-color-dark: var(--tangerine-dark);
  --secondary-color: var(--mint);
  --background-positive-light: var(--mint-tint);
  --background-positive-dark: var(--mint-ink);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ds-font-body);
  color: var(--ds-text);
  background: var(--ds-bg);
  line-height: 1.6;
  font-size: 1.05rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1, h2, h3, h4, h5, h6, .title, .subtitle {
  font-family: var(--ds-font-display);
  color: var(--ds-text);
  line-height: 1.2;
}

.content a:not(.button):not(.navbar-item):not(.nav-panel-link):not(.nav-grade-pill):not(.site-logo) {
  color: var(--ds-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:not(.button):not(.navbar-item):not(.nav-panel-link):not(.nav-grade-pill):not(.site-logo):hover {
  color: var(--ds-link-hover);
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.button {
  font-family: var(--ds-font-body);
  font-weight: 700;
  border-radius: var(--ds-radius-md);
  border: var(--ds-border-width-md) solid var(--ds-ink);
  box-shadow: var(--ds-shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(1px);
  box-shadow: var(--ds-shadow-sm);
}

.button.is-primary {
  background-color: var(--ds-primary) !important;
  border-color: var(--ds-ink) !important;
  color: #fff !important;
}
.button.is-primary:hover, .button.is-primary:focus {
  background-color: var(--ds-primary-hover) !important;
}
.button.is-primary:active {
  background-color: var(--ds-primary-pressed) !important;
}

.button.is-link {
  background-color: #fff !important;
  border-color: var(--ds-ink) !important;
  color: var(--ds-link) !important;
}
.button.is-link:hover, .button.is-link:focus {
  background-color: #fff !important;
  color: var(--ds-link-hover) !important;
}

.button.is-info {
  background-color: var(--ds-tag-info-bg) !important;
  border-color: var(--ds-ink) !important;
  color: var(--ds-tag-info-text) !important;
}
.button.is-success {
  background-color: var(--ds-tag-success-bg) !important;
  border-color: var(--ds-ink) !important;
  color: var(--ds-tag-success-text) !important;
}
.button.is-warning {
  background-color: var(--ds-tag-warning-bg) !important;
  border-color: var(--ds-ink) !important;
  color: var(--ds-tag-warning-text) !important;
}
.button.is-danger {
  background-color: #E5484D !important;
  border-color: var(--ds-ink) !important;
  color: #fff !important;
}
.button.is-light {
  background-color: #fff !important;
  border-color: var(--ds-ink) !important;
  color: var(--ds-text) !important;
  box-shadow: var(--ds-shadow-sm);
  border-width: var(--ds-border-width-sm);
}
.button.is-dark {
  background-color: var(--ds-ink) !important;
  border-color: var(--ds-ink) !important;
  color: #fff !important;
}
.button.is-ghost {
  background: transparent !important;
  border: var(--ds-border-width-sm) dashed var(--ds-ink) !important;
  box-shadow: none !important;
  color: var(--ds-text) !important;
}
.button.is-ghost:hover {
  background: rgba(26, 26, 46, 0.05) !important;
}

.button.is-small {
  border-width: var(--ds-border-width-sm);
  border-radius: var(--ds-radius-sm);
  box-shadow: var(--ds-shadow-sm);
  font-size: 0.85rem;
  padding: 0.35em 0.75em;
}
.button.is-small:active {
  box-shadow: 1px 1px 0 var(--ds-ink);
}
.button.is-medium {
  font-size: 1.15rem;
  padding: 0.65em 1.25em;
}
.button.is-large {
  font-size: 1.35rem;
  padding: 0.85em 1.6em;
  border-radius: var(--ds-radius-lg);
}
.button.is-fullwidth {
  display: flex;
}

/* ─── Tags ─────────────────────────────────────────────────────────────── */
/* :not(body) matches Bulma 0.9.3's own .tag:not(body) specificity — plain
   .tag/.tag.is-info lost to Bulma's built-in colors otherwise (final-review
   fix, 2026-08-10; this re-reverts a silent regression of commit b1f9a8a). */
.tag:not(body) {
  font-family: var(--ds-font-body);
  font-weight: 800;
  border: var(--ds-border-width-sm) solid var(--ds-ink);
  border-radius: var(--ds-radius-sm);
  background-color: #fff;
  color: var(--ds-text);
}
.tag:not(body).is-info { background-color: var(--ds-tag-info-bg); color: var(--ds-tag-info-text); }
.tag:not(body).is-success { background-color: var(--ds-tag-success-bg); color: var(--ds-tag-success-text); }
.tag:not(body).is-warning { background-color: var(--ds-tag-warning-bg); color: var(--ds-tag-warning-text); }
.tag:not(body).is-danger { background-color: var(--ds-tag-danger-bg); color: var(--ds-tag-danger-text); }
.tag:not(body).is-light { background-color: #fff; border-width: 1px; }

/* ─── Box / card ───────────────────────────────────────────────────────── */
.box {
  border-radius: var(--ds-radius-lg);
  border: var(--ds-border-width-md) solid var(--ds-ink);
  box-shadow: var(--ds-shadow-lg);
  background: var(--ds-surface);
  color: var(--ds-text);
}

/* ─── Breadcrumb ───────────────────────────────────────────────────────── */
.breadcrumb {
  font-family: var(--ds-font-body);
  font-weight: 700;
  background-color: rgba(26, 26, 46, 0.04);
  border-radius: var(--ds-radius-sm);
  padding: 0.6rem 1rem;
}
.breadcrumb a { color: var(--ds-text-soft); }
.breadcrumb a:hover { color: var(--ds-link); }
.breadcrumb li.is-active a { color: var(--ds-text); }

/* ─── Notification ─────────────────────────────────────────────────────── */
.notification {
  border-radius: var(--ds-radius-lg);
  border: var(--ds-border-width-sm) solid var(--ds-ink);
}
.notification.is-light {
  background-color: rgba(255, 216, 77, 0.15);
}

/* ─── Custom (non-Bulma) modifiers already used in templates ──────────────
   Same bug class as is-small/is-light: a modifier class with no definition
   anywhere. Found via full-repo grep, not in the original inventory. */
.button.is-kids-primary {
  background-color: var(--ds-primary) !important;
  border-color: var(--ds-ink) !important;
  color: #fff !important;
}
.button.is-kids-primary:hover, .button.is-kids-primary:focus {
  background-color: var(--ds-primary-hover) !important;
}
.box.is-nice {
  border-color: var(--ds-accent-yellow);
  box-shadow: var(--ds-shadow-lg), 0 0 0 3px rgba(255, 216, 77, 0.35);
}

/* ─── Tables ───────────────────────────────────────────────────────────── */
.table {
  border-radius: var(--ds-radius-md);
  overflow: hidden;
}
.table.is-bordered td, .table.is-bordered th {
  border: 1px solid var(--ds-border);
}
.table.is-striped tbody tr:nth-child(even) {
  background-color: rgba(26, 26, 46, 0.03);
}
.table.is-hoverable tbody tr:hover {
  background-color: rgba(255, 216, 77, 0.12);
}

/* ═══════════════════════════════════════════════════════════════════════
   Nav / header / mobile-drawer / hero / forms / footer chrome
   Moved verbatim from layout.html's embedded <style> block (Task 3), then
   reskinned to Playful Geometric tokens (ink borders, hard offset shadows,
   yellow/coral accent washes in place of the old soft-shadow/mint-wash
   look). Structural/behavioral properties (display, position, z-index,
   media query breakpoints, transition timing) are unchanged from source.
   layout.html's own <style> block is untouched until Task 4 deletes it.

   Fix-up pass (2026-08-10, coordinator review): also swept remaining
   old sky-blue-family colors inside the mobile-drawer media query that
   the original substitution list didn't name individually, and added the
   site-wide accessibility-toggle widget (.a11y-toggle*, body.a11y-dyslexia,
   body.a11y-contrast) that was missing from the first pass. See task-3
   report for the exact color-mapping rationale per selector.
   ═══════════════════════════════════════════════════════════════════════ */

/* Header styles - single row, compact */
.site-header {
    background-color: var(--sw-surface);
    position: relative;
    z-index: 1000;
    padding: 0;
    min-height: 3.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-logo {
    font-family: var(--sw-font-display), var(--font-family-heading);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--sw-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: currentColor;
    background-clip: unset;
    letter-spacing: 0.02em;
}

.site-logo:hover {
    text-decoration: none;
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.main-nav .navbar-item {
    font-weight: 600;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

.main-nav .navbar-item:hover,
.main-nav .navbar-item.is-active {
    background-color: rgba(255, 216, 77, 0.1);
    color: var(--ds-text-on-mint-wash);
    transform: translateY(-2px);
}

/* Hero section */
.hero-section {
    background: var(--ds-primary);
    color: var(--ds-button-primary-text-color);
    padding: 4rem 2rem;
    margin-bottom: 2rem;
    border-radius: var(--ds-radius-lg);
    border: var(--ds-border-width-md) solid var(--ds-ink);
    position: relative;
    overflow: hidden;
    box-shadow: var(--ds-shadow-lg);
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M0,0 L100,100 M0,100 L100,0" stroke="rgba(23, 62, 62, 0.05)" stroke-width="2"/></svg>');
    background-size: 20px 20px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--ds-button-primary-text-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--ds-button-primary-text-color);
    position: relative;
    opacity: 0.9;
}

/* Content sections */
.content-section {
    margin-bottom: 3rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.section-title {
    font-size: 1.75rem;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--ds-button-primary-background-color);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--ds-button-primary-background-color-hover);
}

/* Content spacing */
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.content h1 {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

.content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.content ul, .content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* Button group container */
.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Cards and boxes */
.feature-card {
    height: 100%;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border-radius: var(--ds-radius-lg);
    border: var(--ds-border-width-md) solid var(--ds-ink);
    background-color: #fff;
    box-shadow: var(--ds-shadow-md);
    padding: 1.5rem;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--ds-button-primary-background-color-hover);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--ds-button-primary-background-color);
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}
/* Example boxes */
.example-box {
    background-color: rgba(255, 216, 77, 0.1);
    border-left: 4px solid var(--ds-button-primary-background-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.example-word {
    font-weight: var(--font-weight-strong);
    color: var(--heading-color);
    background-color: rgba(255, 216, 77, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.syllable-highlight {
    background-color: rgba(255, 216, 77, 0.2);
    padding: 0 4px;
    border-radius: 4px;
    margin: 0 2px;
}

/* Practice tips */
.practice-tip {
    background-color: var(--ds-eyebrow-banner-light-positive-background-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 2px solid var(--ds-button-primary-background-color);
}

.tip-title {
    color: var(--heading-color);
    font-weight: var(--font-weight-strong);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

/* Conclusion section */
.conclusion-section {
    background-color: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    border: 1px solid var(--background-dark);
}

/* Footer styles */
.footer {
    background-color: var(--ds-button-primary-background-color);
    color: var(--ds-button-primary-text-color);
    padding: 3rem 1.5rem;
    margin-top: 3rem;
    border-top: 3px solid var(--ds-button-primary-background-color-hover);
}

.footer a {
    color: var(--ds-button-primary-text-color);
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer a:hover {
    color: var(--ds-button-primary-text-color);
    opacity: 1;
    transform: translateY(-2px);
}

.bd-footer-link-title {
    color: var(--ds-button-primary-text-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.bd-footer-link {
    margin-top: 0.5rem;
}

/* Tool sections */
.tool-container {
    background-color: white;
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.tool-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--ds-link-primary-color);
}

/* Form elements */
.input, .textarea {
    border-radius: var(--ds-radius-sm);
    border: var(--ds-border-width-sm) solid var(--ds-ink);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    font-family: var(--font-family);
    font-size: 1rem;
    padding: 0.8rem 1rem;
}

.input:focus, .textarea:focus {
    border-color: var(--ds-button-primary-background-color);
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.25);
    outline: none;
}

.textarea {
    min-height: 120px;
    line-height: 1.6;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-section {
        padding: 3rem 1.5rem;
    }

    /* Prevent hero overflow on mobile */
    .hero .hero-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Utility classes */
.has-text-primary {
    color: var(--ds-link-primary-color) !important;
}

.has-text-accent {
    color: var(--ds-link-primary-color) !important;
}

.has-background-primary {
    background-color: var(--ds-button-primary-background-color) !important;
}

.has-background-accent {
    background-color: var(--ds-link-primary-color) !important;
}

.has-background-light {
    background-color: rgba(255, 216, 77, 0.1) !important;
}

/* Speak button */
.js-speak {
    background: url("/static/img/speaker.aa8bb5ff3afc.png") no-repeat right center;
    width: 16px;
    height: 16px;
    display: inline-block;
    background-size: contain;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 5px;
    opacity: 0.7;
    transition: opacity var(--transition-speed) ease;
}

.js-speak:hover {
    opacity: 1;
}

/* Enhanced Input Styles */
.input-enhanced {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    background-clip: padding-box;
    border: var(--ds-border-width-sm) solid var(--ds-ink);
    border-radius: var(--ds-radius-sm);
    transition: border-color var(--transition-speed) ease-in-out, box-shadow var(--transition-speed) ease-in-out;
    font-family: var(--font-family);
}

.input-enhanced:focus {
    border-color: var(--ds-button-primary-background-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.25);
}

.input-enhanced::placeholder {
    color: var(--text-color-light);
    opacity: 0.7;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    margin-bottom: 1rem;
}

.input-group .input-enhanced {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    margin-bottom: 0;
}

.input-group-append {
    display: flex;
    margin-left: -1px;
}

.input-group .input-enhanced:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-append .button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Hero search: same visual height for field + button (mobile) */
.input-group-append .button-enhanced {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    height: 3.5rem;
}

.search-form .input-group .input-enhanced {
    min-height: 3.5rem;
    box-sizing: border-box;
}

/* Enhanced Button Styles */
.button-enhanced {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: var(--ds-border-width-md) solid var(--ds-ink);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--ds-radius-md);
    transition: transform 0.2s ease,
               box-shadow 0.2s ease,
               background-color var(--transition-speed) ease-in-out,
               border-color var(--transition-speed) ease-in-out;
    cursor: pointer;
    font-family: var(--font-family);
    letter-spacing: 0.02em;
    box-shadow: var(--ds-shadow-md);
    transform: translateY(0);
}

.button-enhanced:focus, .button-enhanced:hover {
    text-decoration: none;
    outline: 0;
    box-shadow: var(--ds-shadow-md);
    transform: translateY(-2px);
}

.button-enhanced:active {
    transform: translateY(1px);
    box-shadow: var(--ds-shadow-sm);
}

.button-enhanced:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-enhanced.primary {
    color: #fff;
    background-color: var(--ds-primary);
}

.button-enhanced.primary:hover {
    background-color: var(--ds-primary-hover);
}

.button-enhanced.primary:active {
    background-color: var(--ds-primary-pressed);
}

.button-enhanced.secondary {
    color: #fff;
    background-color: var(--ds-primary);
}

.button-enhanced.secondary:hover {
    background-color: var(--ds-primary-hover);
}

.button-enhanced.secondary:active {
    background-color: var(--ds-primary-pressed);
}

/* Button Sizes */
.button-enhanced.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: calc(var(--border-radius) - 2px);
}

.button-enhanced.large {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

/* Button with Icon */
.button-enhanced.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-enhanced.icon-button .icon {
    margin-right: 0.5rem;
}

.button-enhanced.icon-button.icon-right .icon {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Search Form Specific Styles */
.search-form {
    max-width: 600px;
    margin: 2rem auto;
}

.search-form .input-group {
    margin-bottom: 0;
}

.search-form .button-enhanced {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Floating Label Input */
.floating-label {
    position: relative;
    margin-bottom: 1.5rem;
}

.floating-label input {
    height: 3.5rem;
    padding: 1rem 0.75rem;
}

.floating-label label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity .15s ease-in-out, transform .15s ease-in-out;
    color: var(--text-color-light);
}

.floating-label input:focus ~ label,
.floating-label input:not(:placeholder-shown) ~ label {
    opacity: .65;
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Custom Checkbox */
.custom-checkbox {
    position: relative;
    padding-left: 2.2rem;
    cursor: pointer;
    display: inline-block;
    margin-right: 1rem;
    font-family: var(--font-family);
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 1.4rem;
    width: 1.4rem;
    background-color: #fff;
    border: 2px solid var(--ds-button-primary-background-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--ds-button-primary-background-color-hover);
    transform: scale(1.05);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--ds-button-primary-background-color);
    border-color: var(--ds-button-primary-background-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 8px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid var(--ds-button-primary-text-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Accent CTAs on white cards — sky primary + white text (no green + link-blue clash) */
.button-enhanced.accent {
    color: #ffffff;
    background-color: var(--ds-primary);
    border: var(--ds-border-width-md) solid var(--ds-ink);
}

.button-enhanced.accent:hover {
    color: #ffffff;
    background-color: var(--ds-primary-hover);
}

.button-enhanced.accent:active {
    color: #ffffff;
    background-color: var(--ds-primary-pressed);
}

a.button-enhanced {
    text-decoration: none;
}

a.button-enhanced:hover {
    text-decoration: none;
}

.button-enhanced.outline-accent {
    color: var(--ds-text-on-surface);
    background-color: transparent;
    border: var(--ds-border-width-md) solid var(--ds-ink);
    box-shadow: var(--ds-shadow-md);
}

.button-enhanced.outline-accent:hover {
    color: var(--heading-color);
    background-color: rgba(255, 216, 77, 0.1);
    border-color: var(--ds-ink);
}

.button-enhanced.outline-accent:active {
    background-color: rgba(255, 216, 77, 0.2);
    transform: translateY(1px);
    box-shadow: var(--ds-shadow-sm);
}

.button-enhanced.outline-primary {
    color: var(--ds-text-on-surface);
    background-color: transparent;
    border: var(--ds-border-width-md) solid var(--ds-ink);
    box-shadow: var(--ds-shadow-md);
}

.button-enhanced.outline-primary:hover {
    color: var(--heading-color);
    background-color: rgba(255, 216, 77, 0.1);
    border-color: var(--ds-ink);
}

.button-enhanced.outline-primary:active {
    background-color: rgba(255, 216, 77, 0.2);
    transform: translateY(1px);
    box-shadow: var(--ds-shadow-sm);
}

.button-enhanced.outline-secondary {
    color: var(--ds-text-on-surface);
    background-color: transparent;
    border: var(--ds-border-width-md) solid var(--ds-ink);
    box-shadow: var(--ds-shadow-md);
}

.button-enhanced.outline-secondary:hover {
    color: var(--heading-color);
    background-color: rgba(255, 216, 77, 0.1);
    border-color: var(--ds-ink);
}

.button-enhanced.outline-secondary:active {
    background-color: rgba(255, 216, 77, 0.2);
    transform: translateY(1px);
    box-shadow: var(--ds-shadow-sm);
}

.navbar {
    background-color: #fff;
    border-bottom: var(--line);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
}

.main-nav .navbar-item {
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

/* ── Megamenu dropdown ──────────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-menu-intro {
    display: none;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #363636;
    cursor: pointer;
    border-radius: var(--ds-radius-lg);
    border: none;
    background: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
    height: 3.25rem;
    text-decoration: none;
    box-sizing: border-box;
    font-family: var(--font-family, system-ui, sans-serif);
}

.nav-trigger-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.nav-trigger-emoji {
    font-size: 1.1rem;
    line-height: 1;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.is-active {
    background-color: rgba(255, 216, 77, 0.25);
    border-radius: var(--ds-radius-sm);
    transform: translateY(-2px);
    color: #363636;
}

.nav-dropdown-trigger .nav-caret {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    opacity: 0.55;
    flex-shrink: 0;
    min-width: 1rem;
    text-align: center;
}

.nav-dropdown.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: var(--ds-radius-lg);
    border: var(--ds-border-width-md) solid var(--ds-ink);
    box-shadow: var(--ds-shadow-lg);
    padding: 1rem;
    min-width: 200px;
    z-index: 2000;
    animation: dropIn 0.15s ease;
}

.nav-dropdown.is-open .nav-dropdown-panel {
    display: block;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-dropdown-panel.is-wide {
    min-width: 480px;
}

.nav-panel-section {
    margin-bottom: 0.75rem;
}

.nav-panel-section:last-child {
    margin-bottom: 0;
}

.nav-panel-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    padding: 0 0.5rem 0.35rem;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0.35rem;
}

.nav-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem;
}

.nav-panel-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.nav-panel-link:hover {
    background-color: rgba(255, 90, 95, 0.10);
    color: var(--ds-primary);
}

.nav-panel-link .nav-icon {
    font-size: 1rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-panel-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 0.5rem 0;
}

.nav-panel-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
    border: 1px solid rgba(255, 216, 77, 0.4);
    transition: background-color 0.15s ease;
}

.nav-panel-footer-link:hover {
    background-color: rgba(255, 216, 77, 0.1);
}

/* Grade badge pills in worksheets dropdown */
.nav-grade-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.nav-grade-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.25rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    background: #f9fafb;
    color: #374151;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.nav-grade-pill:hover {
    background: rgba(255, 216, 77, 0.15);
    border-color: #10B981;
    color: #059669;
}

/* Mobile accordion for dropdowns */
@media screen and (max-width: 1023px) {
    .nav-dropdown {
        border-bottom: 1px solid rgba(34, 48, 73, 0.06);
    }

    .nav-dropdown-panel {
        position: static;
        transform: none;
        border-radius: 0 0 12px 12px;
        margin: 0 0.75rem 0.5rem;
        padding: 0.5rem 0.75rem 0.75rem;
        background: rgba(26, 26, 46, 0.06);
        border: 1px solid var(--ds-border);
        animation: none;
        min-width: unset;
    }

    .nav-dropdown-panel.is-wide {
        min-width: unset;
    }

    .nav-panel-grid {
        grid-template-columns: 1fr;
    }

    .nav-grade-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-dropdown-trigger {
        height: auto;
        min-height: 3.25rem;
        padding: 1rem 1.1rem;
        margin: 0 0.35rem 0.5rem;
        width: calc(100% - 0.7rem);
        border-bottom: none;
        border-radius: 14px;
        justify-content: space-between;
        font-size: 1.05rem;
        background: #fff;
        border: 2px solid var(--ds-border);
    }

    .nav-dropdown-trigger .nav-caret {
        font-size: 0.8rem;
        opacity: 0.65;
    }

    .nav-dropdown-trigger:hover {
        transform: none;
        background-color: rgba(255, 216, 77, 0.06);
    }

    .nav-panel-link {
        padding: 0.75rem 0.65rem;
        border-bottom: none;
        border-radius: 10px;
        white-space: normal;
        font-size: 0.95rem;
    }

    .nav-panel-link:hover {
        background-color: #fff;
    }

    .nav-panel-label {
        padding-top: 0.35rem;
        padding-left: 0.35rem;
    }

    .nav-panel-footer-link {
        margin-top: 0.35rem;
    }
}

.site-logo {
    font-weight: bold;
    font-size: 1.25rem;
    color: #363636;
    height: 3.25rem;
    display: flex;
    align-items: center;
}

.navbar-burger {
    height: 2.75rem;
    width: 2.75rem;
    margin-left: auto;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    border: var(--ds-border-width-sm) solid var(--ds-ink);
    border-radius: var(--ds-radius-sm);
    background: var(--sw-surface-soft, #f7fbff);
    box-shadow: var(--ds-shadow-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar-burger:hover {
    background: #fff;
    border-color: var(--ds-link);
}

.navbar-burger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(55, 168, 255, 0.35);
}

.navbar-burger span {
    background-color: var(--ds-ink);
    height: 2px;
    width: 18px;
    margin: 0;
    display: block;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.navbar-burger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0;
}

.navbar-burger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.navbar-menu {
    box-shadow: none;
    transition: all 0.3s ease;
    display: flex;
    flex-grow: 1;
    justify-content: flex-end;
}

.navbar-item {
    padding: 0.4rem 0.75rem;
    transition: all 0.3s ease;
}

.section {
    padding: 3rem 1.5rem;
    margin-top: 0;
}

/* Reserve space for fixed navbar - prevent content overlap */
main {
    padding-top: 3.25rem;
}

@media screen and (min-width: 1024px) {
    .navbar-burger {
        display: none;
    }

    .nav-dropdown-trigger {
        width: auto;
    }
}

@media screen and (max-width: 1023px) {
    .navbar-burger {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 3.25rem;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: calc(100vh - 3.25rem);
        max-height: calc(100dvh - 3.25rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        padding: 0.75rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0));
        border-top: 1px solid var(--ds-border);
        display: none;
        flex-grow: unset;
        justify-content: unset;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.22s ease, transform 0.22s ease;
        z-index: 1002;
    }

    .navbar-menu.is-active {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-menu-intro {
        display: block;
        margin: 0;
        padding: 0.6rem 1.25rem 0.35rem;
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--sw-text-soft, #5b6780);
    }

    .navbar-start {
        display: flex;
        flex-direction: column;
        width: 100%;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0 0.35rem;
    }

    .navbar-item {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(34, 48, 73, 0.06);
        width: 100%;
        text-align: left;
        font-size: 1.05rem;
        font-weight: 600;
    }

    a.navbar-item.nav-menu-plain-link {
        margin: 0.35rem 0.65rem 0.85rem;
        padding: 0.95rem 1.1rem !important;
        border-radius: 14px !important;
        background: #fff !important;
        border: 2px solid var(--ds-border) !important;
        border-bottom: 2px solid var(--ds-border) !important;
        text-align: left !important;
        color: var(--ds-ink) !important;
    }

    a.navbar-item.nav-menu-plain-link:hover {
        background: rgba(255, 216, 77, 0.18) !important;
        border-color: var(--ds-ink) !important;
    }

    .navbar-item:last-child {
        border-bottom: none;
    }

    .navbar-item:hover {
        background-color: rgba(255, 216, 77, 0.08);
    }

    .section {
        padding: 2rem 1rem;
    }

    .navbar-brand {
        width: auto;
        flex: 1;
        min-width: 0;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .navbar-inner {
        padding: 0.5rem 1rem;
        flex-wrap: nowrap;
    }

    .site-logo {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ── Utilities absent from purge.min.css (Bulma was purged before
      these classes were used; see CLAUDE.md "purged Bulma subset").
      Keep additions here, never re-add classes to purge.min.css. ── */
.has-text-white { color: #fff !important; }
.has-text-dark { color: #363b45 !important; }
.has-text-grey { color: #8a8f98 !important; }
/* Card grids on list pages: never break words mid-word */
.box a, .card a, .title { overflow-wrap: normal; word-break: normal; }
[data-star-word].word-star-btn--saved { border-color: #f0b400; color: #a17700; }

/* Accessibility toggle: dyslexia-friendly font + high contrast, CSS-only, no new font asset */
.a11y-toggle { position: fixed; bottom: 16px; right: 16px; z-index: 1000; }
.a11y-toggle__btn {
    width: 44px; height: 44px; border-radius: 50%; border: var(--ds-border-width-sm) solid var(--ds-ink);
    background: #363b45; color: #fff; font-weight: 700; font-size: 14px;
    cursor: pointer; box-shadow: var(--ds-shadow-sm);
}
.a11y-toggle__panel {
    position: absolute; bottom: 52px; right: 0; background: #fff; color: #363b45;
    border: 1px solid #d6d9e0; border-radius: 10px; padding: 12px 16px;
    white-space: nowrap;
}
.a11y-toggle__option { display: block; font-size: .9rem; padding: 4px 0; cursor: pointer; }
body.a11y-dyslexia, body.a11y-dyslexia * { font-family: Verdana, Tahoma, sans-serif !important; letter-spacing: .04em !important; word-spacing: .1em !important; line-height: 1.7 !important; }
body.a11y-contrast { background: #000 !important; color: #fff !important; }
body.a11y-contrast * { background-color: #000 !important; color: #fff !important; border-color: #fff !important; }
body.a11y-contrast a { color: #ffeb3b !important; text-decoration: underline !important; }
body.a11y-contrast img, body.a11y-contrast svg { filter: grayscale(1) contrast(1.2); }
body.a11y-contrast .a11y-toggle__btn { background: #ffeb3b !important; color: #000 !important; }

/* ═══════════════════════════════════════════════════════════════════════
   Restored behavioral rules (final-review fix, 2026-08-10)
   These are layout/behavior rules from the deleted site-design-system.css
   that other templates/files still need — not decoration, so they were
   restored verbatim where they have no color reference, and reskinned to
   --ds-* tokens where they do. Structural/behavioral properties (flex,
   media breakpoints, overflow, padding math) are unchanged from source.
   ═══════════════════════════════════════════════════════════════════════ */

/* Mobile nav drawer: prevent page scroll behind overlay (layout.html JS toggle) */
body.nav-drawer-open {
  overflow: hidden;
}

@media (min-width: 1024px) {
  body.nav-drawer-open {
    overflow: visible;
  }
}

/* Reserve space so fixed/anchor ads (e.g. AdSense) do not cover CTAs on mobile */
@media (max-width: 900px) {
  body {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0));
  }
}

/* Syllable word list cards (home.html): avoid equal-height columns creating huge empty areas */
.home-words-by-syllable .columns.is-multiline {
  align-items: flex-start;
}

.home-words-by-syllable .box {
  overflow: visible;
}

/* Home — interactive tools CTAs: full-width stack on phone, no overlap */
.home-tool-cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.home-tool-cta-row .home-tool-cta-btn {
  width: 100%;
  margin: 0 !important;
  white-space: normal;
  line-height: 1.35;
  min-height: 3rem;
}

@media (min-width: 769px) {
  .home-tool-cta-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: none;
    gap: 1rem;
  }

  .home-tool-cta-row .home-tool-cta-btn {
    width: auto;
    white-space: nowrap;
  }
}

/**
 * Stacked primary actions on small screens (prevents overlapping Bulma button rows).
 * Use with Bulma `.buttons` or alone on a flex wrapper. Optional `.is-centered` for CTAs.
 * Used on 8+ templates: home, worksheets-index, games-landing, games-placement,
 * games-dashboard, blog-post, others.
 */
.buttons.sw-stack-buttons,
.sw-stack-buttons {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap !important;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.buttons.sw-stack-buttons .button,
.sw-stack-buttons .button,
.sw-stack-buttons .button-enhanced,
.sw-stack-buttons a.button {
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.35;
  min-height: 2.75rem;
  justify-content: center;
  text-align: center;
}

.sw-stack-buttons.is-centered {
  align-items: stretch;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 769px) {
  .buttons.sw-stack-buttons,
  .sw-stack-buttons {
    flex-direction: row;
    flex-wrap: wrap !important;
    align-items: center;
    width: auto;
    max-width: none;
  }

  .buttons.sw-stack-buttons.is-centered,
  .sw-stack-buttons.is-centered {
    justify-content: center;
    max-width: none;
  }

  .buttons.sw-stack-buttons .button,
  .sw-stack-buttons .button,
  .sw-stack-buttons .button-enhanced,
  .sw-stack-buttons a.button {
    width: auto;
    white-space: nowrap;
    flex: 0 1 auto;
  }
}

/* Syllable counter tool (syllables-counter.html) — aligned full-width actions on mobile */
.syllable-counter-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.syllable-counter-actions .control {
  width: 100%;
  margin: 0 !important;
}

.syllable-counter-actions .button-enhanced {
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.35;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (min-width: 769px) {
  .syllable-counter-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: none;
    gap: 1rem;
  }

  .syllable-counter-actions .control {
    width: auto;
  }

  .syllable-counter-actions .button-enhanced {
    width: auto;
    white-space: nowrap;
    min-width: 11rem;
  }
}

/* Worksheet print pages (worksheet-base.html) — align with design tokens (screen) */
body.worksheet-page {
  background: linear-gradient(180deg, var(--ds-bg) 0%, #f6fbff 100%) !important;
}

body.worksheet-page .ws-toolbar {
  background: var(--ds-surface);
  border-bottom: var(--ds-border-width-sm) solid var(--ds-ink);
}

body.worksheet-page .ws-sheet {
  border-radius: var(--ds-radius-md);
  border: var(--ds-border-width-sm) solid var(--ds-ink);
  box-shadow: var(--ds-shadow-md);
  font-family: var(--ds-font-body), "Nunito", Arial, sans-serif;
}

@media print {
  body.worksheet-page {
    background: #fff !important;
  }
}

/* Motion utilities (opt-in) */
@keyframes sw-floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes sw-pop-in {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.sw-floaty {
  animation: sw-floaty 3.6s ease-in-out infinite;
}

.sw-pop-in {
  animation: sw-pop-in 320ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .sw-floaty,
  .sw-pop-in {
    animation: none !important;
  }
}

/* ─── Heading sizes (final-review fix, 2026-08-10) ────────────────────────
   Bulma's minireset zeroes h1-h6 font-size/weight/margin; the h1..h6/.title
   rule above only restores font-family/color/line-height. Restore a real
   type scale for bare <hN> tags outside a .content/.title context (values
   sourced from the pre-Bulma layout.html embedded <style> block). */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-strong);
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}
h1 { font-size: 2.5rem; margin-top: 1rem; margin-bottom: 2rem; }
h2 { font-size: 2rem; margin-top: 2.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.75rem; margin-top: 2rem; margin-bottom: 1.25rem; }
h4 { font-size: 1.5rem; margin-top: 1.75rem; margin-bottom: 1rem; }
h5 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
h6 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: 0.75rem; }

