/* Tali School — public school website. Plain CSS (no build step); logical properties so the
   same rules work right to left. The school's colour arrives as --brand. */

:root {
    --brand: #4f46e5;
    --brand-dark: color-mix(in oklab, var(--brand) 78%, black);
    --brand-soft: color-mix(in oklab, var(--brand) 9%, white);
    --brand-line: color-mix(in oklab, var(--brand) 22%, white);
    --ink: #0f172a;
    --text: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --white: #ffffff;
    --danger: #b91c1c;
    --success: #15803d;
    --radius: 16px;
    --shadow: 0 1px 2px rgb(15 23 42 / .06), 0 8px 24px -12px rgb(15 23 42 / .18);
    --font: "Inter", "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[dir="rtl"] { --font: "Vazirmatn", "Inter", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.trap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip { transform: scaleX(-1); }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--brand) 55%, white); outline-offset: 2px; border-radius: 6px; }

/* Buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .75em 1.4em; border-radius: 999px; font-weight: 700; font-size: .95rem; border: 2px solid transparent; cursor: pointer; text-decoration: none !important; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; font-family: inherit; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--white); box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--brand) 60%, transparent); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgb(255 255 255 / .7); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand-line); }
.btn-block { width: 100%; }

/* Preview and notices */
.preview-bar { background: #fef3c7; color: #78350f; text-align: center; font-size: .9rem; padding: .5em 1em; }
.flash { margin: 1rem 0; padding: 1em 1.2em; border-radius: 12px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); font-weight: 800; font-size: 1.05rem; line-height: 1.2; margin-inline-end: auto; text-decoration: none !important; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { color: var(--text); font-weight: 600; font-size: .95rem; padding: .5em .8em; border-radius: 999px; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
.lang { display: flex; gap: .15rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang a { font-size: .8rem; font-weight: 700; color: var(--muted); padding: .25em .6em; border-radius: 999px; text-decoration: none; }
.lang a[aria-current="true"] { background: var(--brand); color: var(--white); }
.menu-toggle { display: none; background: none; border: 0; padding: .4rem; color: var(--ink); cursor: pointer; }
.menu-toggle .icon { width: 28px; height: 28px; }
@media (max-width: 960px) {
    .menu-toggle { display: inline-flex; }
    .nav { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--white); padding: 1rem 20px 1.5rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; max-height: calc(100vh - 72px); overflow-y: auto; }
    .nav.open { display: flex; }
    .nav a { padding: .8em 1em; }
    .header-cta { display: none; }
}

/* Hero */
.hero { position: relative; color: var(--white); overflow: hidden; background: var(--brand-dark); }
.hero-slides { position: relative; height: clamp(380px, 68vh, 640px); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(2 6 23 / .78), rgb(2 6 23 / .15) 60%, rgb(2 6 23 / .05)); }
.hero-caption { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding-block: 3rem 4.5rem; }
.hero-caption h1, .hero-caption h2 { color: var(--white); max-width: 760px; text-shadow: 0 2px 16px rgb(0 0 0 / .35); }
.hero-caption p { max-width: 640px; font-size: 1.1rem; opacity: .95; }
.hero-dots { position: absolute; z-index: 3; bottom: 1.5rem; inset-inline: 0; display: flex; justify-content: center; gap: .5rem; }
.hero-dots button { width: 10px; height: 10px; border-radius: 999px; border: 0; background: rgb(255 255 255 / .5); cursor: pointer; padding: 0; transition: width .2s ease; }
.hero-dots button.active { width: 28px; background: var(--white); }
.hero-arrow { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); border: 0; background: rgb(255 255 255 / .18); color: var(--white); width: 44px; height: 44px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(4px); }
.hero-arrow:hover { background: rgb(255 255 255 / .32); }
.hero-arrow.prev { inset-inline-start: 1rem; }
.hero-arrow.next { inset-inline-end: 1rem; }
@media (max-width: 640px) { .hero-arrow { display: none; } }
.hero-plain { padding-block: clamp(4rem, 10vw, 7.5rem); background:
    radial-gradient(1200px 400px at 85% -10%, color-mix(in oklab, var(--brand) 55%, white) 0, transparent 60%),
    radial-gradient(800px 400px at -10% 110%, color-mix(in oklab, var(--brand) 60%, black) 0, transparent 60%),
    var(--brand); }
.hero-plain h1 { color: var(--white); }
.hero-plain p { font-size: 1.15rem; max-width: 640px; opacity: .92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-soft { background: var(--soft); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: .25rem 0 0; color: var(--muted); }
.eyebrow { display: inline-block; color: var(--brand); font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .4rem; }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
.more-link { font-weight: 700; display: inline-flex; align-items: center; gap: .35em; }

/* Page header */
.page-head { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: var(--white); padding-block: clamp(2.5rem, 6vw, 4rem); }
.page-head h1 { color: var(--white); margin: 0; }
.page-head p { margin: .5rem 0 0; opacity: .9; }
.crumbs { font-size: .85rem; opacity: .85; margin-bottom: .5rem; }
.crumbs a { color: var(--white); }
.cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; box-shadow: var(--shadow); }
.cover img { width: 100%; max-height: 460px; object-fit: cover; }

/* Counters */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.counter { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; box-shadow: var(--shadow); }
.counter .icon { width: 2.2rem; height: 2.2rem; color: var(--brand); margin: 0 auto .5rem; }
.counter strong { display: block; font-size: 2.3rem; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.counter span { color: var(--muted); font-weight: 600; }

/* About */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Cards */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; color: inherit; text-decoration: none !important; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgb(15 23 42 / .06), 0 18px 40px -18px rgb(15 23 42 / .35); }
.card-media { aspect-ratio: 16 / 10; background: var(--brand-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.placeholder { display: grid; place-items: center; color: var(--brand); }
.card-media.placeholder .icon { width: 3rem; height: 3rem; opacity: .6; }
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; color: var(--muted); font-size: .95rem; }
.meta { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.meta .icon { width: 1em; height: 1em; }

/* Events */
.event-list { display: grid; gap: 1rem; }
.event-row { display: flex; gap: 1.25rem; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); color: inherit; text-decoration: none !important; }
.event-row:hover { border-color: var(--brand-line); }
.date-badge { flex-shrink: 0; width: 68px; text-align: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); padding: .5rem 0; line-height: 1.1; }
.date-badge strong { display: block; font-size: 1.6rem; }
.date-badge span { font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.event-row h3 { margin: 0 0 .2rem; }

/* Gallery */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.photo-grid a, .photo-grid button { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 1; padding: 0; border: 0; cursor: zoom-in; background: var(--soft); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photo-grid a:hover img, .photo-grid button:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgb(2 6 23 / .92); display: none; align-items: center; justify-content: center; padding: 3rem 1rem; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.lightbox img { max-height: calc(100vh - 8rem); width: auto; border-radius: 8px; }
.lightbox figcaption { color: #e2e8f0; text-align: center; }
.lightbox button { position: absolute; background: rgb(255 255 255 / .12); color: var(--white); border: 0; width: 48px; height: 48px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.lightbox .lb-close { top: 1rem; inset-inline-end: 1rem; }
.lightbox .lb-prev { inset-inline-start: 1rem; top: 50%; }
.lightbox .lb-next { inset-inline-end: 1rem; top: 50%; }

/* Admission call to action */
.cta { border-radius: calc(var(--radius) + 8px); background: linear-gradient(120deg, var(--brand-dark), var(--brand)); color: var(--white); padding: clamp(2rem, 5vw, 3.5rem); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; box-shadow: 0 24px 48px -24px color-mix(in oklab, var(--brand) 70%, transparent); }
.cta h2 { color: var(--white); margin: 0 0 .25rem; }
.cta p { margin: 0; opacity: .92; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; gap: .85rem; align-items: flex-start; }
.contact-list .icon { color: var(--brand); width: 1.4rem; height: 1.4rem; margin-top: .15rem; }
.contact-list strong { display: block; color: var(--ink); }
.map { position: relative; isolation: isolate; height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--soft); z-index: 0; }

/* Forms */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .field .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--ink); }
.field .req { color: var(--danger); }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.field .error { color: var(--danger); font-size: .85rem; margin-top: .3rem; }
.input, select.input, textarea.input { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid #cbd5e1; border-radius: 10px; padding: .7em .85em; transition: border-color .15s ease, box-shadow .15s ease; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 18%, transparent); }
.has-error .input { border-color: var(--danger); }
textarea.input { min-height: 120px; resize: vertical; }
input[type="file"].input { padding: .5em; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.choices label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; margin: 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; }
.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 2rem; }
legend { font-size: 1.2rem; font-weight: 800; color: var(--ink); margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; }
legend .step { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--brand); color: var(--white); font-size: .95rem; }
.fee-note { display: flex; gap: .75rem; align-items: center; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 12px; padding: .9rem 1.1rem; color: var(--brand-dark); font-weight: 600; margin-bottom: 1.5rem; }

/* Status timeline */
.status-card { text-align: center; }
.status-number { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.timeline { display: flex; justify-content: space-between; gap: .5rem; margin: 2rem 0 1rem; position: relative; }
.timeline::before { content: ""; position: absolute; top: 18px; inset-inline: 10%; height: 3px; background: var(--line); }
.timeline .step { position: relative; flex: 1; text-align: center; font-size: .85rem; color: var(--muted); font-weight: 600; }
.timeline .dot { width: 38px; height: 38px; margin: 0 auto .5rem; border-radius: 999px; display: grid; place-items: center; background: var(--white); border: 3px solid var(--line); color: var(--muted); position: relative; }
.timeline .step:not(.done):not(.stopped) .dot .icon { opacity: 0; }
.timeline .done .dot { background: var(--brand); border-color: var(--brand); color: var(--white); }
.timeline .done { color: var(--ink); }
.timeline .stopped .dot { background: var(--danger); border-color: var(--danger); color: var(--white); }
.badge { display: inline-block; padding: .3em .8em; border-radius: 999px; font-weight: 700; font-size: .85rem; background: var(--brand-soft); color: var(--brand-dark); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-danger { background: #fee2e2; color: var(--danger); }

/* Rich text */
.prose { font-size: 1.05rem; color: var(--text); max-width: 780px; }
.prose h2 { margin-top: 1.8em; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { margin-top: 1.5em; }
.prose img { border-radius: 12px; margin: 1.5em 0; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-inline-start: 4px solid var(--brand); background: var(--brand-soft); border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5em .75em; text-align: start; }
.prose th { background: var(--soft); }
.prose a { text-decoration: underline; }

/* Pagination */
.pager { display: flex; justify-content: center; gap: .5rem; margin-top: 2.5rem; }
.pager a, .pager span { padding: .55em 1.1em; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; color: var(--text); text-decoration: none; }
.pager span { opacity: .45; }

/* Footer */
.site-footer { background: #0b1222; color: #cbd5e1; padding-block: 3.5rem 1.5rem; margin-top: 0; }
.site-footer a { color: #e2e8f0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2.5rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: var(--white); font-size: 1rem; }
.footer-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; color: var(--white); font-weight: 800; font-size: 1.1rem; }
.footer-brand img { width: 48px; height: 48px; object-fit: contain; background: var(--white); border-radius: 12px; padding: 4px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.social { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.social a { width: 40px; height: 40px; border-radius: 999px; background: rgb(255 255 255 / .08); display: grid; place-items: center; color: var(--white); }
.social a:hover { background: var(--brand); text-decoration: none; }
.subscribe { display: flex; gap: .5rem; margin-top: .75rem; }
.subscribe .input { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .18); color: var(--white); }
.subscribe .input::placeholder { color: #94a3b8; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .1); margin-top: 2.5rem; padding-top: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: #94a3b8; }
.footer-bottom a { color: #94a3b8; }
.whatsapp-float { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 50; width: 56px; height: 56px; border-radius: 999px; background: #25d366; color: var(--white); display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgb(0 0 0 / .4); }
.whatsapp-float .icon { width: 28px; height: 28px; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
