/*
 * Home 2026, v3 («کلینیک»). Scoped to body.home-2026 (/app/ only).
 * Tokens come from brand-2026.css; this file is layout and components only.
 *
 * One container (.h26-wrap) for every section, so both edges line up all the
 * way down; one family (YekanBakh) with weight for hierarchy; one row
 * pattern for every list; one filled action per screen (the lead's).
 */

html body.home-2026 { background: var(--bg-body) !important; }
body.home-2026 .background-overlay,
body.home-2026 .home-background-aura { display: none !important; }

body.home-2026 {
    --h26-gut: 20px;
    --h26-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --h26-head: var(--font-main);
}
@media (min-width: 600px) { body.home-2026 { --h26-gut: 32px; } }
@media (min-width: 1024px) { body.home-2026 { --h26-gut: 48px; } }

/* legacy shell rules pad and grid this main; the sections own the edges now */
html body.home-2026 main.app-home-main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 0 48px !important;
}
body.home-2026 .h26-wrap {
    width: min(100% - 2 * var(--h26-gut), 1120px);
    margin-inline: auto;
}
body.home-2026 .h26-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
body.home-2026 [hidden] { display: none !important; }

/* ---------------------------------------------------------------------------
 * Lead: what is sold, one hard fact, and the one thing to do now (continue an
 * exam, else the newest set with its indicator tape and a direct buy). On a
 * phone it is the whole first screen, with the action low, under the thumb.
 * ------------------------------------------------------------------------- */
body.home-2026 .h26-lead {
    background: var(--brand-navy-950);
    color: var(--on-shell);
}
body.home-2026 .h26-lead__wrap {
    display: flex;
    flex-direction: column;
    gap: 28px;
    /* content height: a full-screen band left a void under the copy, and
       the first rows peeking above the bottom bar say the page goes on */
    padding-block: 20px 28px;
}
body.home-2026 .h26-lead__copy { display: grid; gap: 12px; }
body.home-2026 .h26-lead__hello {
    margin: 0;
    font: 500 0.95rem/1.6 var(--font-main);
    color: var(--on-shell-muted);
}
body.home-2026 .h26-lead__hello .h26-greeting {
    margin-inline-end: 4px;
    font: 700 0.95rem/1.6 var(--font-main) !important;
    color: var(--on-shell-strong) !important;
}
body.home-2026 .h26-lead__title {
    margin: 0;
    max-width: 22ch;
    font: 800 clamp(1.7rem, 7vw, 2.1rem)/1.4 var(--h26-head);
    letter-spacing: -0.01em;
    color: var(--on-shell-strong);
    text-wrap: balance;
}
body.home-2026 .h26-lead__fact {
    margin: 0;
    max-width: 44ch;
    font: 400 1rem/1.85 var(--font-main);
    color: var(--on-shell);
}
body.home-2026 .h26-lead__feature {
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid color-mix(in srgb, var(--on-shell-strong) 16%, transparent);
}

/* the featured set, or the exam to continue: straight on the band, no card */
body.home-2026 .h26-feature,
body.home-2026 .h26-continue {
    display: grid;
    gap: 8px;
    color: var(--on-shell);
    text-decoration: none;
}
body.home-2026 .h26-feature__title,
body.home-2026 .h26-continue__title {
    margin: 0;
    font: 800 1.3rem/1.55 var(--h26-head);
    color: var(--on-shell-strong);
}
body.home-2026 .h26-feature__title a { color: inherit; text-decoration: none; }
body.home-2026 .h26-feature__title a:hover { color: var(--shell-mark); }
body.home-2026 .h26-feature__meta,
body.home-2026 .h26-continue__meta,
body.home-2026 .h26-continue__count {
    margin: 0;
    font: 400 0.95rem/1.7 var(--font-main);
    color: var(--on-shell-muted);
}
body.home-2026 .h26-sample__fresh {
    display: inline-block;
    margin-inline-start: 8px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--shell-mark);
    color: var(--brand-navy-950);
    font: 700 0.75rem/1.75 var(--font-main);
    vertical-align: 2px;
}

/* the signature: indicator tape, one cell per question (grouped past 60) */
body.home-2026 .h26-tape {
    direction: rtl;
    display: grid;
    grid-template-columns: repeat(var(--cells, 20), minmax(0, 1fr));
    gap: 2px;
    height: 20px;
    margin: 8px 0 6px;
    border-radius: 4px;
    overflow: hidden;
}
body.home-2026 .h26-tape i { display: block; background: repeating-linear-gradient(-45deg, var(--shell-tape-raw) 0 4px, var(--shell-tape-raw-line) 4px 6px); }
body.home-2026 .h26-tape i.is-done { background: repeating-linear-gradient(-45deg, var(--shell-tape-done) 0 4px, var(--shell-tape-done-line) 4px 6px); }

body.home-2026 .h26-feature__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-top: 6px;
}
body.home-2026 .h26-feature__buy,
body.home-2026 .h26-continue__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 8px;
    background: var(--on-shell-strong);
    color: var(--brand-navy-950);
    font: 700 1.05rem/1 var(--font-main);
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    cursor: pointer;
}
body.home-2026 .h26-continue__cta { margin-top: 6px; }
body.home-2026 .h26-continue__cta svg { width: 20px; height: 20px; }
html[data-theme="dark"] body.home-2026 :is(.h26-feature__buy, .h26-continue__cta) { background: var(--brand-brass); color: var(--text-on-accent); }
body.home-2026 .h26-feature__more {
    align-self: center;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
    color: var(--on-shell-strong);
    font: 600 0.95rem/1.4 var(--font-main);
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--on-shell-strong) 35%, transparent);
    text-underline-offset: 6px;
}
body.home-2026 .h26-feature__more:hover { text-decoration-color: currentColor; }

/* focus on the band: a white ring reads; the page ring does not */
html body.home-2026 .h26-lead :is(a, button):focus-visible {
    outline: 2px solid var(--on-shell-strong) !important;
    outline-offset: 3px;
    border-radius: 6px;
}

@media (min-width: 900px) {
    html body.home-2026 main.app-home-main { padding-top: 24px !important; }
    body.home-2026 .h26-lead { background: none; padding-bottom: 8px; }
    body.home-2026 .h26-lead__wrap {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        align-items: start;
        gap: 56px;
        min-height: 0;
        padding: 48px;
        border-radius: 8px;
        background: var(--brand-navy-950);
    }
    body.home-2026 .h26-lead__title { max-width: none; font-size: clamp(1.9rem, 2.5vw, 2.35rem); line-height: 1.4; }
    body.home-2026 .h26-lead__feature {
        margin-top: 0;
        padding-top: 0;
        padding-inline-start: 40px;
        border-top: 0;
        border-inline-start: 1px solid color-mix(in srgb, var(--on-shell-strong) 16%, transparent);
    }
    body.home-2026 .h26-feature__actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
    body.home-2026 .h26-feature__more { align-self: auto; padding-inline: 0; }
    body.home-2026 .h26-continue__cta { justify-self: start; }
}

/* ---------------------------------------------------------------------------
 * Sections and their heads
 * ------------------------------------------------------------------------- */
body.home-2026 .h26-section { padding-top: 44px; }
body.home-2026 .h26-lead + .h26-section { padding-top: 36px; }
@media (min-width: 900px) { body.home-2026 .h26-section { padding-top: 64px; } }

body.home-2026 .h26-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    margin-bottom: 8px;
}
body.home-2026 .h26-head h2 {
    margin: 0;
    font: 800 1.3rem/1.5 var(--h26-head);
    color: var(--text-primary);
}
@media (min-width: 900px) { body.home-2026 .h26-head h2 { font-size: 1.5rem; } }
body.home-2026 .h26-head__meta { font-size: 0.875rem; color: var(--text-secondary); }
body.home-2026 .h26-head__more,
body.home-2026 .h26-terms__all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    color: var(--accent-strong);
    font: 600 0.95rem/1.4 var(--font-main);
    text-decoration: none;
    white-space: nowrap;
}
body.home-2026 :is(.h26-head__more, .h26-terms__all) svg { width: 18px; height: 18px; flex: none; }
body.home-2026 :is(.h26-head__more, .h26-terms__all):hover { text-decoration: underline; text-underline-offset: 6px; }

/* ---------------------------------------------------------------------------
 * Rows: one pattern for sample sets and courses. The name first, one meta
 * line, and a light action at the end; hairlines, no cards.
 * ------------------------------------------------------------------------- */
body.home-2026 .h26-rows {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border-top: 1px solid var(--border-color);
}
@media (min-width: 900px) {
    body.home-2026 .h26-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
}
body.home-2026 :is(.h26-sample, .h26-unit) {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
}
body.home-2026 :is(.h26-sample__copy, .h26-unit__copy) {
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
body.home-2026 :is(.h26-sample__copy, .h26-unit__copy) strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font: 700 1rem/1.6 var(--font-main);
}
body.home-2026 :is(.h26-sample__copy, .h26-unit__copy) small {
    font: 400 0.875rem/1.6 var(--font-main);
    color: var(--text-secondary);
}
body.home-2026 .h26-sample__copy:hover strong,
body.home-2026 .h26-unit:hover strong { color: var(--accent-strong); }
body.home-2026 :is(.h26-sample__copy, .h26-unit):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

/* the row's action: tonal, never a second filled primary */
body.home-2026 .h26-sample__go {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid color-mix(in srgb, var(--accent-strong) 55%, transparent);
    border-radius: 8px;
    background: none;
    color: var(--accent-strong);
    font: 700 0.95rem/1 var(--font-main);
    text-decoration: none;
}
body.home-2026 .h26-sample__go.is-owned { background: none; border-color: var(--border-color-strong); color: var(--text-primary); }
body.home-2026 .h26-sample__go:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
body.home-2026 .h26-unit__end {
    flex: none;
    font: 700 0.95rem/1.4 var(--font-main);
    color: var(--accent-strong);
    white-space: nowrap;
}
body.home-2026 .h26-unit__end.is-owned {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------
 * Courses, term by term
 * ------------------------------------------------------------------------- */
body.home-2026 .h26-terms__tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(60px, 1fr);
    gap: 6px;
    margin: 4px 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
body.home-2026 .h26-terms__tabs::-webkit-scrollbar { display: none; }
body.home-2026 .h26-terms__tabs button {
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-solid);
    color: var(--text-secondary);
    font: 600 0.95rem/1 var(--font-main);
    white-space: nowrap;
    cursor: pointer;
}
body.home-2026 .h26-terms__tabs button:hover { border-color: var(--border-color-strong); color: var(--text-primary); }
body.home-2026 .h26-terms__tabs button.is-on {
    border-color: var(--brand-navy-950);
    background: var(--brand-navy-950);
    color: var(--on-shell-strong);
}
html[data-theme="dark"] body.home-2026 .h26-terms__tabs button.is-on { border-color: var(--brand-brass); background: var(--brand-brass); color: var(--text-on-accent); }
body.home-2026 .h26-terms__tabs button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
body.home-2026 .h26-terms__all { margin-top: 8px; }

/* ---------------------------------------------------------------------------
 * Class plan (weekly ClassOps digest)
 * ------------------------------------------------------------------------- */
body.home-2026 .h26-plan { display: grid; gap: 20px; }
@media (min-width: 900px) { body.home-2026 .h26-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; } }
body.home-2026 .h26-plan__group h4 { margin: 0 0 4px; font: 700 0.95rem/1.6 var(--font-main); color: var(--accent-strong); }
body.home-2026 .h26-plan__row { padding: 10px 0; border-top: 1px solid var(--border-color); }
body.home-2026 .h26-plan__row strong { display: block; font: 700 1rem/1.6 var(--font-main); color: var(--text-primary); }
body.home-2026 .h26-plan__row small { font-size: 0.875rem; color: var(--text-secondary); }
body.home-2026 .h26-plan__row--schedule p { margin: 4px 0 0; white-space: pre-line; font-size: 0.95rem; line-height: 1.9; color: var(--text-secondary); }
body.home-2026 .h26-plan__more { border-top: 1px solid var(--border-color); }
body.home-2026 .h26-plan__more summary { display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font: 600 0.95rem var(--font-main); color: var(--accent-strong); list-style: none; }
body.home-2026 .h26-plan__more summary::-webkit-details-marker { display: none; }
body.home-2026 .h26-plan__more summary::before { content: "▾"; transition: transform 160ms var(--h26-ease-out); }
body.home-2026 .h26-plan__more[open] summary::before { transform: rotate(180deg); }
body.home-2026 .h26-plan__more summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
body.home-2026 .h26-tag {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font: 700 0.8rem/1.6 var(--font-main);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * University sites and owner tools: the same rows, two up on a phone
 * ------------------------------------------------------------------------- */
body.home-2026 .h26-links { margin: 0; padding-inline: 0; padding-bottom: 16px; border: 0; background: none; }
body.home-2026 .home-service-groups { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 36px !important; }
body.home-2026 .home-service-group:not([hidden]) {
    display: block !important;
    grid-column: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
}
body.home-2026 :is(.home-service-group, .home-service-group__head, .home-service-link, .home-service-link__meta)::before,
body.home-2026 :is(.home-service-group, .home-service-group__head, .home-service-link, .home-service-link__meta)::after { content: none !important; display: none !important; }
body.home-2026 .home-service-group__head { display: block !important; margin: 0 0 8px !important; padding: 0 !important; border: 0 !important; background: none !important; text-align: start !important; }
html body.home-2026 .h26-links__title { margin: 0; text-align: start !important; font: 800 1.15rem/1.5 var(--h26-head); color: var(--text-primary); }
@media (min-width: 900px) { body.home-2026 .h26-links__title { font-size: 1.25rem; } }
body.home-2026 .home-service-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    border-top: 1px solid var(--border-color);
}
@media (min-width: 600px) { body.home-2026 .home-service-strip { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important; gap: 0 32px !important; } }
body.home-2026 .home-service-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    min-height: 72px;
    margin: 0 !important;
    padding: 12px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
    text-align: start !important;
    text-decoration: none;
    transform: none !important;
}
body.home-2026 .home-service-link__icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 40px !important;
    height: 40px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--accent-soft) !important;
    color: var(--accent-strong) !important;
    box-shadow: none !important;
}
body.home-2026 .home-service-link__icon svg { width: 22px; height: 22px; }
body.home-2026 .home-service-link__meta { display: grid; gap: 2px; min-width: 0; }
body.home-2026 .home-service-link__meta strong { font: 700 1rem/1.5 var(--font-main); color: var(--text-primary); }
body.home-2026 .home-service-link__meta small { font: 400 0.875rem/1.5 var(--font-main); color: var(--text-secondary); }
body.home-2026 .home-service-link:hover strong { color: var(--accent-strong); }
body.home-2026 .home-service-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px !important; }

/* ---------------------------------------------------------------------------
 * Motion: short and purposeful. The lead enters once per session (the class
 * is set in <head> only then; a page opened many times a day does not
 * replay it), the tape draws once, buttons press. Rows do not animate.
 * ------------------------------------------------------------------------- */
@keyframes h26-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes h26-tape-draw { from { clip-path: inset(0 0 0 100%); } }
html.h26-enter body.home-2026 .h26-lead [data-h26-enter] { animation: h26-in 280ms var(--h26-ease-out) both; }
/* the featured set or continue card plays when it actually arrives (it leaves display:none) */
html.h26-enter body.home-2026 .h26-lead__feature [data-h26-enter] { animation-delay: 60ms; }
html.h26-enter body.home-2026 .h26-lead .h26-tape { animation: h26-tape-draw 300ms var(--h26-ease-out) 100ms both; }

body.home-2026 :is(.h26-feature__buy, .h26-continue__cta, .h26-sample__go, .h26-terms__tabs button) {
    transition: transform 120ms var(--h26-ease-out), background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
body.home-2026 :is(.h26-feature__buy, .h26-continue__cta):hover { background: color-mix(in srgb, var(--on-shell-strong) 88%, var(--shell-mark)); }
html[data-theme="dark"] body.home-2026 :is(.h26-feature__buy, .h26-continue__cta):hover { background: var(--brand-brass-strong); }
body.home-2026 .h26-sample__go:hover { background: var(--accent-soft); border-color: var(--accent-strong); }
body.home-2026 .h26-sample__go.is-owned:hover { background: var(--surface-muted); }
body.home-2026 :is(.h26-feature__buy, .h26-continue__cta, .h26-sample__go, .h26-terms__tabs button):active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
    body.home-2026 * { animation: none !important; transition: none !important; }
}

/* the class bots: where announcements, reminders and quick buys live */
body.home-2026 .h26-bots { display: grid; gap: 8px; margin-top: 36px; }
body.home-2026 .h26-bots p { margin: 0; max-width: 52ch; font: 400 1rem/1.8 var(--font-main); color: var(--text-secondary); }
body.home-2026 .h26-bots__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
@media (min-width: 600px) { body.home-2026 .h26-bots__actions { display: flex; flex-wrap: wrap; } }
body.home-2026 .h26-bots__go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid color-mix(in srgb, var(--accent-strong) 55%, transparent);
    border-radius: 8px;
    color: var(--accent-strong);
    font: 700 0.95rem/1 var(--font-main);
    text-align: center;
    text-decoration: none;
    transition: transform 120ms var(--h26-ease-out), background-color 150ms ease-out;
}
body.home-2026 .h26-bots__go:hover { background: var(--accent-soft); border-color: var(--accent-strong); }
body.home-2026 .h26-bots__go:active { transform: scale(0.97); }
body.home-2026 .h26-bots__go:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* the header bar lines up with the page container on wide screens */
@media (min-width: 1024px) {
    html body.home-2026:not(.chat-page) .site-header.site-header--minimal { padding-inline: max(48px, calc((100% - 1120px) / 2)) !important; }
}

/* beside the rail, under ~1180px the split leaves the featured set ~190px: stack it */
@media (min-width: 900px) and (max-width: 1179.98px) {
    body.home-2026 .h26-lead__wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    body.home-2026 .h26-lead__feature {
        padding-inline-start: 0;
        padding-top: 24px;
        border-inline-start: 0;
        border-top: 1px solid color-mix(in srgb, var(--on-shell-strong) 16%, transparent);
    }
}
