/* Heebo — the site's single UI/body font family across every age (screening-page students
   through teacher/admin screens): clean geometric sans-serif, wide weight range, free (SIL
   Open Font License), low visual fatigue in extended reading.
   Secular One — the display font for H1-H3 only, one weight (400), per the Libi Branding
   Guide (claude.ai/design "Libi" project df273519, "Libi Branding Guide.dc.html", imported
   12.09.2026). Rounded/geometric rather than serif, so it stays simple for developing and
   dyslexic readers while still giving headings a distinct voice from body/UI text. */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800;900&family=Secular+One&display=swap');

:root {
    /* Libi brand tokens — transcribed verbatim from the Libi Branding Guide's own
       "5 · טוקנים לקוד" :root block (claude.ai/design project df273519). These --lx-*
       names are the guide's canonical token names; treat them as the source of truth
       for any future design import, not the --color-* aliases below. */
    --lx-plum: #6D2E6B;
    --lx-plum-dark: #4F1F52;
    --lx-plum-50: #F3E4EE;
    --lx-blush: #D9527E;
    --lx-blush-dark: #9C2E53;
    --lx-blush-50: #FCE7EE;
    --lx-butter: #F2B725;
    --lx-butter-dark: #7A5605;
    --lx-butter-50: #FDF1D5;
    --lx-green: #2F7D68;
    --lx-green-50: #DCEFE8;
    --lx-ink: #2B1330;
    --lx-ink-2: #6A4F70;
    --lx-border: #E7DCE7;
    --lx-bg: #FAF4F7;
    --lx-surface: #FFFFFF;

    --lx-font-display: 'Secular One', system-ui, sans-serif;
    --lx-font-ui: 'Heebo', system-ui, sans-serif;

    /* Radius scale — the guide separates "panel" (teacher / information-dense surfaces,
       16px) from "card" (student surfaces, 26px) and "tile" (20px, e.g. a KPI stat).
       This app's chrome is teacher/admin-facing, so its generic .card uses --lx-r-panel;
       WPC5's comprehension student screen has its own scoped markup/CSS and applies
       --lx-r-card there directly. */
    --lx-r-card: 26px;   /* student surfaces */
    --lx-r-tile: 20px;   /* small stat/KPI tiles */
    --lx-r-panel: 16px;  /* teacher surfaces — this app's default .card */
    --lx-r-pill: 100px;  /* buttons, nav tabs, status chips */

    /* The guide is explicit: "one shadow only across the entire system" — no per-depth
       escalation. --elev-1 IS that one shadow. --elev-2/--elev-3 remain only for the two
       pre-existing cases that must read as visibly floating ABOVE a card (the comprehension
       student screen's Malka FAB and its floating sheet, lexiheb-comprehension/ARCHITECTURE.md
       §6) — retinted to the same plum-based hue family so they stay one consistent shadow
       "color", just deeper, rather than reintroducing the old navy-based elevation scale. */
    --lx-shadow: 0 3px 12px rgba(79, 31, 82, .10);
    --elev-1: var(--lx-shadow);
    --elev-2: 0 8px 24px rgba(79, 31, 82, 0.22);
    --elev-3: 0 14px 40px rgba(79, 31, 82, 0.24);

    /* Back-compat aliases — every existing rule/page below (and 30+ .cshtml files with
       inline styles) references these --color-* names. Repointing them here re-brands the
       whole app without touching each call site. New code should prefer the --lx-* names
       above directly. */
    --color-paper: var(--lx-bg);
    --color-paper-dark: var(--lx-plum-50);
    --color-navy: var(--lx-plum);
    --color-sage: var(--lx-green);
    --color-ochre: var(--lx-butter-dark);
    --color-clay: var(--lx-blush-dark);
    --color-gold: var(--lx-butter);
    --color-ink: var(--lx-ink);
    --color-ink-2: var(--lx-ink-2);
    --color-border: var(--lx-border);

    --color-sage-soft: var(--lx-green-50);
    --color-clay-soft: var(--lx-blush-50);
    --color-ochre-soft: var(--lx-butter-50);
    --color-gold-soft: var(--lx-butter-50);
    --color-navy-soft: var(--lx-plum-50);
    /* WP-STU1 §2.1 — student reading-tool highlight colors. Deliberately distinct from the assist-tier colors
       (sage = מל״א, ochre = navigation card, gold = Malka): tier color coding tells the student which kind of help they see. */
    --color-mark-1: #CFE3FA;
    --color-mark-2: #DDD6F7;
    --color-mark-3: #F8D7E3;

    /* ── Unified design (docs/הוראות-לקלוד-קוד-עיצוב-מאוחד-ונגישות.md §2, §9) ──
       Mapped onto the Libi palette, not the old navy one. FILL tokens are for arcs/bars (≥3:1 on
       white, graphics); -text tokens are the only ones allowed to colour a band's TEXT (≥7:1).
       tools/check_contrast.js enforces both. */
    --data-accent:      var(--color-navy);
    --band-low:         var(--lx-blush);
    --band-mid:         #B27A00;
    --band-high:        var(--lx-green);
    --band-low-text:    #8E2949;
    --band-mid-text:    #6B4800;
    --band-high-text:   #1F5C4C;
    --band-none:        #8A7F8E;

    --color-mark:       oklch(92% 0.07 82);
    --field-border:     oklch(58% 0.03 330);
    --focus-ring:       0 0 0 3px #fff, 0 0 0 5px var(--color-navy);
    --shadow-card:      var(--lx-shadow);   /* the guide allows one shadow; the doc's own value is not used */
    --r-field: 8px;  --r-btn: var(--lx-r-pill);  --r-card: var(--lx-r-panel);
    --dur-fast: 120ms;  --dur-panel: 220ms;  --dur-fill: 600ms;
    --ease: cubic-bezier(.32,.72,.35,1);

    /* Back-compat aliases for any code still referencing the old names */
    --color-bg: var(--color-paper);
    --color-accent: var(--color-sage);
    --color-accent-dark: var(--color-navy);
    --color-danger: var(--color-clay);

    font-family: var(--lx-font-ui);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--color-paper);
    color: var(--color-ink);
    line-height: 1.65;
}

/* Guide §2: Secular One, headings only, one weight (400) — do not bold it. */
h1, h2, h3, h4 {
    font-family: var(--lx-font-display);
    font-weight: 400;
    color: var(--color-navy);
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

h1 { font-size: 1.9rem; }  /* guide: H1 30-44px */
h2 { font-size: 1.4rem; }  /* guide: H2 20-26px */
h3 { font-size: 1.1rem; }  /* guide: H3 16-18px */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header {
    background: var(--lx-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--lx-font-display);
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--color-navy);
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--color-navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--lx-font-display);
    font-weight: 400;
    font-size: 0.95rem;
    flex-shrink: 0;
}

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

nav.main-nav a {
    color: var(--color-ink-2);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--lx-r-pill);
    transition: background 0.12s, color 0.12s;
}

nav.main-nav a:hover,
nav.main-nav a.active,
nav.main-nav a[aria-current="page"] {
    background: var(--color-paper-dark);
    color: var(--color-navy);
}

nav.main-nav a[aria-current="page"] { background: var(--color-navy-soft); font-weight: 600; }

/* Unified design §4: round account button with initials; on phones the nav drops to its own row (no hamburger yet). */
.account-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--color-navy-soft); color: var(--color-navy);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}

@media (max-width: 640px) {
    .header-row { flex-wrap: wrap; }
    nav.main-nav { order: 3; width: 100%; flex-wrap: wrap; }
}

.account-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

main.container {
    padding-top: 2rem;
    padding-bottom: 3.5rem;
    min-height: 60vh;
}

footer.container {
    color: var(--color-ink-2);
    padding-bottom: 1.5rem;
    font-size: 0.85rem;
}

a { color: var(--color-navy); }

/* Guide §4 "כפתורים": primary = solid plum, full pill radius. The guide's 52px minimum
   tap height is a STUDENT-screen rule; this app's chrome is teacher/admin-facing, so .btn
   stays at its existing compact height (the comprehension student screen has its own
   scoped button styling for that 52px rule). */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--color-navy);
    color: #fff;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: var(--lx-r-pill);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: var(--lx-font-ui);
    text-decoration: none;
    transition: opacity 0.12s;
}

.btn:hover { opacity: 0.88; }

/* Guide §4 secondary button: outlined in Blush, plum text — distinct from the plum-solid
   primary rather than a plain tonal variant of it. */
.btn-secondary {
    background: transparent;
    color: var(--color-navy);
    border: 2px solid var(--lx-blush);
    padding: calc(0.65rem - 2px) calc(1.4rem - 2px);
}

/* Guide §1 usage rule: "Butter is reserved for rewards/streaks only — never as an action
   button" and text on Butter must always be the dark ink shade, never white. Kept for
   genuine reward/streak surfaces; the public landing page's CTA below was moved off this
   class onto the plum primary because a "request a demo" CTA is an action, not a reward. */
.btn-gold {
    background: var(--color-gold);
    color: var(--lx-butter-dark);
}

.btn-danger {
    background: var(--color-clay);
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-navy);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.inline-form { display: inline; }

form .field {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-ink);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--lx-font-ui);
    background: var(--lx-surface);
    color: var(--color-ink);
}

/* Was: max-width:420px on every textarea/input above, unconditionally. WPC5's comprehension
   student screen (Pages/Student/Solve.cshtml) needs full-width answer/organizer textareas and
   has no <form> wrapper of its own (lexiheb-comprehension/ARCHITECTURE.md §6) — scoping the cap
   to descendants of a <form> leaves every existing page (which all wrap their inputs in a real
   <form>) unaffected while freeing that screen's textareas from the cap. */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form textarea,
form select {
    max-width: 420px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-navy);
}

/* Keyboard focus must still be visible (WP10 §F3) — the rule above wins over a later bare
   :focus-visible by specificity alone, so it needs its own higher-specificity override. */
input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
}

.validation-summary-errors,
.text-danger {
    color: var(--color-clay);
    font-size: 0.85rem;
}

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.alert-success {
    background: var(--color-sage-soft);
    color: var(--color-sage);
    border: 1px solid var(--lx-green-50);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--lx-surface);
    border-radius: var(--lx-r-panel);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

thead tr {
    background: var(--color-paper);
}

th {
    text-align: start;
    padding: 0.7rem 0.9rem;
    font-size: 0.72rem;  /* guide: 11.5px absolute minimum for labels */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-ink-2);
    border-bottom: 1px solid var(--color-border);
}

td {
    text-align: start;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-paper); }

.card {
    background: var(--lx-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--lx-r-panel);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--elev-1);
}

.empty-state {
    color: var(--color-ink-2);
    padding: 2.5rem 0;
    text-align: center;
}

/* Small reusable primitives for dashboard-style pages.
   Guide §4 status chips: בקצב(green)/מעקב(butter)/פיגור(blush) map onto the existing
   sage/ochre/clay names by how they're actually used across the app (see grep of
   badge-sage/ochre/clay call sites: success, needs-follow-up, and failure/inactive,
   respectively). badge-navy's call sites are all neutral metadata labels (owner, grade,
   a code) rather than an active state, so it takes the guide's neutral/"locked" gray
   treatment instead of plum — plum stays reserved for genuinely active/selected UI. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--lx-r-pill);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-sage { background: var(--color-sage-soft); color: var(--color-sage); }
.badge-ochre { background: var(--color-ochre-soft); color: var(--color-ochre); }
.badge-clay { background: var(--color-clay-soft); color: var(--color-clay); }
.badge-navy { background: var(--color-border); color: var(--color-ink-2); }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.kpi-card {
    background: var(--lx-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--lx-r-tile);
    padding: 1rem 1.1rem;
}

.kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-ink-2);
    margin-bottom: 0.4rem;
}

.kpi-value {
    font-family: var(--lx-font-display);
    font-weight: 400;
    font-size: 1.9rem;
    color: var(--color-navy);
    line-height: 1;
}

/* Guide §4 progress bars: background is always the light ("-50") version of the fill
   color — height varies by context (10px student / 8px card / 6px table); this generic
   card-context track uses the 8px card height. */
.progress-track {
    background: var(--color-navy-soft);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--color-navy);
}

.mock-banner {
    background: var(--color-ochre-soft);
    border: 1px solid var(--lx-butter-50);
    color: var(--color-ochre);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* WP10 §F3 — visible keyboard-focus outline, every focusable element, site-wide. */
:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
}

/* WP10 §B — breadcrumbs ("הכיתות שלי › כיתה ג'2 › דנה כהן › מיפוי 8.8.2026"). */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-ink-2);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--color-ink-2);
    text-decoration: none;
}

.breadcrumbs a:hover { color: var(--color-navy); text-decoration: underline; }
.breadcrumbs .current { color: var(--color-navy); font-weight: 600; }
.breadcrumbs .sep { color: var(--color-border); }

/* WP10 §A1/§C — draft-pattern-rules tag: never let a demo-derived profile look like
   approved pedagogy. Deliberately loud (blush), distinct from every other badge color. */
.tag-draft {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-clay-soft);
    color: var(--color-clay);
    border: 1px solid var(--lx-blush-50);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
}

/* WP10 §C/§F4 — comparisons between two observations: color is never alone, every
   improvement/decline also gets an arrow AND a word ("▲ השתפר" / "▼ ירד"). */
.delta { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 700; font-size: 0.85rem; }
.delta-up { color: var(--color-sage); }
.delta-down { color: var(--color-clay); }
.delta-same { color: var(--color-ink-2); }

/* WP10 §D5 — the expanded practice screen's example block is the page's hero: on print,
   everything else (nav, breadcrumbs, buttons) disappears and only the example remains.
   Sized/leaded to the guide's adult reading-text spec (§2: 18px / line-height 1.95). */
.example-block {
    background: var(--color-paper);
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-size: 1.15rem;
    line-height: 1.95;
    white-space: pre-line;
    margin: 0.75rem 0;
}

@media print {
    .site-header, footer.container, .no-print { display: none !important; }
    main.container { padding-top: 0; }
    .example-block { border: 1px solid #000; }
}

/* WP-ASSIST1 — עזרת הכתיבה של מלכה (assist-write.js). החץ הוא רכיב מצויר, לא תו בטקסט: ב-RTL ←
   מצביע בכיוון הקריאה (סיבה ← תוצאה). */
.wa-block{border:1px solid var(--color-border);border-radius:12px;padding:12px;margin-bottom:12px;background:#fff;white-space:normal}
.wa-title{margin:0 0 8px;font-size:.88rem;font-weight:700;color:var(--color-ink-2)}
.wa-chain{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:6px}
.wa-node{border-radius:10px;padding:7px 12px;font-weight:700;font-size:.9rem}
.wa-cause{background:var(--color-gold-soft);border:1.5px solid var(--color-gold);color:var(--color-ochre)}
.wa-effect{background:var(--color-sage-soft);border:1.5px solid var(--color-sage);color:var(--color-sage)}
.wa-arrow{color:var(--color-navy);font-size:1.3rem;font-weight:800;display:inline-block}
.wa-arrow::before{content:"\2190"}
.wa-more{font-size:.82rem;color:var(--color-ink-2);margin-top:8px}
.wa-frame{font-size:1rem;line-height:2.2}
.wa-blank{border:0;border-bottom:2px solid var(--color-navy);background:var(--color-navy-soft);min-width:110px;padding:2px 8px;font:inherit;border-radius:6px 6px 0 0;color:var(--color-ink)}
.wa-insert{margin-top:10px}
.wa-nogive{font-size:.78rem;color:var(--color-ink-2);margin-top:6px}
/* התוכן גבוה יותר עכשיו — הגיליון עצמו גולל, לא רק .malka-say */
.malka-sheet{max-height:calc(100vh - 52px);overflow-y:auto}
.malka-say:has(.wa-block){max-height:none;white-space:normal;padding:10px}

/* תג גרסה בתחתית — מידע שקט, לא כפתור: מספר גרסה + מתי עודכן. אותם טוקנים כמו שאר ה-footer. */
.ver-tag{display:inline-flex;align-items:center;gap:.25rem;margin-inline-start:.75rem;padding:.1rem .6rem;border:1px solid var(--color-border);border-radius:999px;background:var(--color-navy-soft);color:var(--color-ink-2);font-size:.75rem;line-height:1.6;white-space:nowrap}
.ver-num{font-weight:700;color:var(--color-navy);font-variant-numeric:tabular-nums}
.ver-date{font-variant-numeric:tabular-nums}

/* Unified design §9 — one global switch for reduced motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
