/*
  Landmark public website.
  Print-like, institutional look: paper background, one ink colour, a serif
  for headings, hairline rules instead of cards, no gradients or motion.
  The admin panel and setup page keep site.css + admin.css.
*/
:root {
  --paper: #f7f4ee;
  --paper-2: #efeadf;
  --white: #fffdf9;
  --ink: #1e2430;
  --ink-soft: #4a5261;
  --muted: #6f7684;
  --navy: #16324f;
  --navy-2: #0f2438;
  --ochre: #a8661a;
  --rule: #d9d2c3;
  --rule-strong: #b9b09d;
  --danger: #a1301f;
  --success: #2f6b3a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, "Segoe UI", Arial, sans-serif;
}
.lang-ar {
  --serif: "Noto Naskh Arabic", "Times New Roman", serif;
  --sans: "IBM Plex Sans Arabic", system-ui, Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.7; color: var(--ink); background: var(--paper); }
.lang-ar body, body.lang-ar { font-size: 17px; line-height: 1.85; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .2em; }
a:hover { color: var(--ochre); text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy-2); font-weight: 600; line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(760px, 100% - 32px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--navy); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

/* Buttons and links */
.btn { display: inline-block; font: inherit; font-weight: 600; padding: .7em 1.5em; border: 1px solid var(--navy); border-radius: 2px; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
.text-link { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--ochre); padding-bottom: 1px; }
.text-link::after { content: " ←"; }
[dir="ltr"] .text-link::after, .lang-en .text-link::after { content: " →"; }

/* Top strip */
.topbar { background: var(--navy-2); color: #d5dbe3; font-size: .85rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 7px 0; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar-end { display: flex; gap: 18px; align-items: center; }
.lang-switch { font-weight: 600; }

/* Masthead */
.site-header { background: var(--white); border-bottom: 3px double var(--rule-strong); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 14px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--navy-2); }
.brand img { width: 56px; height: 56px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.brand-text small { color: var(--muted); font-size: .85rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule-strong); border-radius: 2px; color: var(--navy); padding: 6px; cursor: pointer; }
.main-nav { border-top: 1px solid var(--rule); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav ul a { display: block; padding: 11px 16px; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.main-nav ul li:first-child a { padding-inline-start: 0; }
.main-nav ul a:hover { color: var(--navy); border-bottom-color: var(--rule-strong); }
.main-nav ul a.active { color: var(--navy-2); font-weight: 600; border-bottom-color: var(--ochre); }
.nav-apply { font-weight: 600; text-decoration: none; color: var(--ochre); }
.nav-apply:hover { text-decoration: underline; }

/* Home: intro */
.intro { background: var(--white); border-bottom: 1px solid var(--rule); }
.intro-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; padding: 64px 0 72px; align-items: start; }
.eyebrow { font-size: .9rem; color: var(--ochre); font-weight: 600; margin-bottom: 1.2em; }
.intro h1 { max-width: 20ch; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 52ch; }
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 32px; }
.notice { background: var(--paper); border: 1px solid var(--rule-strong); border-top: 4px solid var(--navy); padding: 26px 28px 22px; }
.notice-title { font-size: 1.25rem; margin-bottom: .2em; }
.notice-sub { color: var(--muted); font-size: .92rem; margin-bottom: 1em; }
.notice-steps { margin: 0 0 1.2em; padding: 0; list-style: none; counter-reset: step; }
.notice-steps li { counter-increment: step; display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--rule); }
.notice-steps li::before { content: counter(step); font-family: var(--serif); font-weight: 700; color: var(--ochre); min-width: 1.2em; }
.notice-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 0; padding-top: 12px; border-top: 1px solid var(--rule-strong); font-size: .92rem; }
.notice-foot > a { font-weight: 600; }

/* Home: figures */
.figures { padding: 36px 0 8px; }
.figures-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.figure { padding: 18px 20px; display: flex; flex-direction: column-reverse; }
.figure + .figure { border-inline-start: 1px solid var(--rule); }
.figure dd { margin: 0; font-family: var(--serif); font-size: 2.3rem; font-weight: 600; line-height: 1.2; color: var(--navy-2); font-variant-numeric: lining-nums; }
.figure dt { color: var(--ink-soft); font-size: .95rem; }
.figures-note { color: var(--muted); font-size: .85rem; margin: 8px 0 0; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: baseline; margin-bottom: 32px; padding-bottom: 14px; border-bottom: 1px solid var(--rule-strong); }
.section-head h2 { margin: 0; }
.section-head p { grid-column: 2; color: var(--ink-soft); margin: 6px 0 0; max-width: 62ch; }
.section-no { font-family: var(--serif); color: var(--ochre); font-size: 1.1rem; font-weight: 700; }
.empty-note { color: var(--muted); border-inline-start: 3px solid var(--rule-strong); padding: 6px 16px; margin: 0; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.about-copy p { font-size: 1.05rem; color: var(--ink-soft); }
.principles { list-style: none; margin: 0; padding: 0; counter-reset: pr; }
.principles li { counter-increment: pr; display: grid; grid-template-columns: 2.4em 1fr; padding: 16px 0; border-top: 1px solid var(--rule); }
.principles li:last-child { border-bottom: 1px solid var(--rule); }
.principles li::before { content: counter(pr, decimal-leading-zero); font-family: var(--serif); color: var(--ochre); font-weight: 700; grid-row: span 2; }
.principles h3 { margin: 0 0 .2em; }
.principles p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* Tables */
.school-table, .stage-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; background: var(--white); }
.school-table th, .school-table td, .stage-table th, .stage-table td { text-align: start; padding: 14px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.school-table thead th { font-size: .85rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--rule-strong); background: var(--paper); }
.school-table tbody th { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--navy-2); }
.school-table tbody th small { display: block; font-family: var(--sans); font-size: .85rem; font-weight: 400; color: var(--muted); }
.school-table .num { text-align: center; font-variant-numeric: tabular-nums; width: 9em; }
.school-table .end { text-align: end; white-space: nowrap; }

/* Programs page */
.branch-title { font-size: 1.3rem; margin: 40px 0 16px; color: var(--ochre); }
.program { padding: 28px 0 12px; border-top: 1px solid var(--rule-strong); }
.program:first-child, .branch-title + .program { border-top: 0; padding-top: 0; }
.program-head p { color: var(--muted); margin-top: -.3em; }
.stage-table th { width: 30%; font-weight: 600; color: var(--navy-2); background: var(--paper); }
.subjects-line { color: var(--ink-soft); }
.subjects-line strong { color: var(--navy-2); }

/* News */
.news-list { border-top: 1px solid var(--rule-strong); margin-bottom: 24px; }
.news-item { display: grid; grid-template-columns: 7.5em 1fr auto; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.news-date { display: flex; flex-direction: column; line-height: 1.2; color: var(--muted); font-size: .85rem; }
.news-date .d { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--navy-2); }
.news-text h3 { font-size: 1.2rem; margin-bottom: .3em; }
.news-text h3 a { text-decoration: none; color: var(--navy-2); }
.news-text h3 a:hover { color: var(--ochre); }
.news-text p { margin: 0; color: var(--ink-soft); }
.news-thumb img { width: 168px; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); }
.pager { display: flex; gap: 20px; align-items: center; justify-content: center; }

/* Closing band */
.closing { padding: 0 0 64px; }
.closing-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--rule-strong); border-inline-start: 4px solid var(--ochre); padding: 28px 32px; }
.closing h2 { font-size: 1.5rem; margin-bottom: .2em; }
.closing p { margin: 0; color: var(--ink-soft); }

/* Inner page header */
.page-head { background: var(--white); border-bottom: 1px solid var(--rule); padding: 36px 0 32px; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 1em; }
.crumbs a { color: var(--muted); }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { margin: 0; }
.article-date { color: var(--muted); margin: 0; }
.article-body { padding: 40px 0 64px; font-size: 1.07rem; }
.article-image { margin-bottom: 28px; border: 1px solid var(--rule); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.contact-list { margin: 0; border-top: 1px solid var(--rule-strong); }
.contact-list > div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.contact-list dt { color: var(--muted); font-size: .95rem; }
.contact-list dd { margin: 0; font-weight: 500; }
.map { width: 100%; height: 300px; border: 1px solid var(--rule-strong); margin-bottom: 24px; }
.contact-apply { background: var(--white); border: 1px solid var(--rule-strong); border-top: 4px solid var(--navy); padding: 24px 26px; }
.contact-apply h2 { font-size: 1.3rem; }

/* Admission */
.admission-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; align-items: start; }
.admission-aside h2 { font-size: 1.25rem; padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); }
.steps { list-style: none; margin: 0 0 20px; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(st); font-family: var(--serif); color: var(--ochre); font-weight: 700; min-width: 1.2em; }
.aside-contact { color: var(--ink-soft); }
.form-card { background: var(--white); border: 1px solid var(--rule-strong); padding: 32px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form legend { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--navy-2); width: 100%; padding: 0 0 8px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label, .field .label { font-weight: 600; font-size: .93rem; color: var(--ink); }
.req { color: var(--danger); }
.form input:not([type="radio"]), .form select, .form textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 2px; background: #fff; color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(22, 50, 79, .15); }
.form select:disabled { background: var(--paper); color: var(--muted); }
.segmented { display: flex; }
.segmented label { flex: 1; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; text-align: center; padding: 10px; border: 1px solid var(--rule-strong); background: #fff; font-weight: 500; }
.segmented label + label span { border-inline-start: 0; }
.segmented input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--ochre); outline-offset: 2px; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 14px 16px; margin-bottom: 22px; border: 1px solid; border-inline-start-width: 4px; font-weight: 500; }
.alert-success { background: #eef5ee; color: var(--success); border-color: #a9c9ad; }
.alert-error { background: #f9ecea; color: var(--danger); border-color: #dfb1aa; }

/* Footer */
.site-footer { background: var(--navy-2); color: #c3cad4; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, .35); }
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding: 52px 0 36px; }
.footer-brand img { width: 64px; height: 64px; margin-bottom: 14px; }
.footer-name { font-family: var(--serif); font-size: 1.15rem; color: #fff; margin-bottom: .4em; }
.site-footer h3 { font-family: var(--sans); font-size: .82rem; font-weight: 600; color: #8f9bab; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.lang-ar .site-footer h3 { text-transform: none; letter-spacing: 0; font-size: .92rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { padding: 3px 0; }
.footer-contact { margin: 0; }
.footer-contact dt { color: #8f9bab; font-size: .85rem; }
.footer-contact dd { margin: 0 0 10px; }
.social { display: flex; gap: 16px; margin-top: 12px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 16px 0 22px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .85rem; color: #8f9bab; }
.footer-meta { display: flex; gap: 20px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 920px) {
  .intro-grid, .about-grid, .contact-grid, .admission-grid { grid-template-columns: 1fr; gap: 36px; }
  .intro-grid { padding: 44px 0 52px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .nav-inner { flex-direction: column; align-items: stretch; padding: 4px 0 14px; }
  .main-nav ul { flex-direction: column; }
  .main-nav ul a, .main-nav ul li:first-child a { padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0; }
  .main-nav ul a.active { border-bottom-color: var(--rule); border-inline-start: 3px solid var(--ochre); padding-inline-start: 10px; }
  .nav-apply { padding-top: 10px; }
  .brand-text strong { font-size: 1.05rem; }
  .brand img { width: 46px; height: 46px; }
  .topbar-inner > span:first-child { display: none; }
  .topbar-inner { justify-content: flex-end; }
  .section { padding: 48px 0; }
  .news-item { grid-template-columns: 1fr; gap: 6px; }
  .news-date { flex-direction: row; gap: 6px; align-items: baseline; }
  .news-date .d { font-size: 1rem; font-family: var(--sans); color: var(--muted); font-weight: 400; }
  .news-thumb img { width: 100%; }
  .school-table thead { display: none; }
  .school-table tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--rule); }
  .school-table th, .school-table td { border: 0; padding: 6px 12px; }
  .school-table tbody th { grid-column: 1 / -1; padding-top: 14px; }
  .school-table .num { text-align: start; width: auto; color: var(--ink-soft); font-size: .9rem; }
  .school-table td.num::before { content: attr(data-label) ": "; }
  .school-table .end { grid-column: 1 / -1; text-align: start; padding-bottom: 14px; }
  .stage-table th { width: 40%; }
  .contact-list > div { grid-template-columns: 1fr; gap: 2px; }
  .form-card { padding: 22px 18px; }
  .form fieldset { grid-template-columns: 1fr; }
  .closing-inner { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media print {
  .topbar, .main-nav, .nav-toggle, .closing, .site-footer { display: none; }
  body { background: #fff; }
}
