/* Fairman public website. Tokens: board teal, paper, ink, highlighter, correction red. */
:root {
  --board: #0f3d3e;
  --board-2: #155153;
  --chalk: #e9f1ee;
  --paper: #f7f9f8;
  --ink: #1d2b2c;
  --muted: #5f6e6e;
  --line: #dde5e3;
  --mark: #f2d544;
  --red: #c23b2a;
  --wrap: 1140px;
  --r: 6px;
  --f: Vazirmatn, Tahoma, sans-serif;
  --latin: Georgia, "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.9 var(--f); }
img { max-width: 100%; height: auto; }
a { color: var(--board-2); }
a:hover { color: var(--board); }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--mark); color: var(--ink); padding: 8px 14px; z-index: 50; }
.skip:focus { top: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.latin { font-family: var(--latin); font-style: italic; direction: ltr; unicode-bidi: isolate; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--f); padding: 13px 22px; border-radius: var(--r); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-mark { background: var(--mark); color: var(--ink); }
.btn-mark:hover { background: #ffe25a; color: var(--ink); }
.btn-board { background: var(--board); color: #fff; }
.btn-board:hover { background: var(--board-2); color: #fff; }
.btn-quiet { color: var(--ink); border-color: var(--line); background: #fff; }
.btn-quiet:hover { border-color: var(--board); color: var(--board); }
.btn-sm { padding: 9px 14px; font-size: 14px; }

/* Header */
.hd { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.hd-in { display: flex; align-items: center; gap: 16px; min-height: 72px; position: relative; }
/* The top bar may use more width than the page content on wide screens, so the menu fits in one row. */
.hd .wrap.hd-in { max-width: max(var(--wrap), 1320px); }
.nav-actions .btn { padding: 11px 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 44px; width: auto; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--board); color: var(--mark); font-weight: 800; font-size: 22px; border-radius: var(--r); }
.brand-name { font-weight: 800; font-size: 18px; line-height: 1.3; }
@media (min-width: 601px) { .brand { flex-shrink: 0; } .brand-name { white-space: nowrap; } }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav > a, .nav-sub > a { padding: 8px 10px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; border-radius: var(--r); white-space: nowrap; }
.nav > a:hover, .nav-sub > a:hover { color: var(--ink); }
.nav > a[aria-current], .nav-sub > a[aria-current] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--mark); border-radius: 0; }
.nav-actions { display: flex; gap: 8px; margin-inline-start: 8px; }
.nav-actions .btn { white-space: nowrap; }
/* Drop-down links */
.nav-sub { position: relative; display: inline-flex; }
.nav-sub > a { display: inline-flex; align-items: center; gap: 4px; }
.nav-caret { opacity: .6; transition: transform .15s; }
.nav-drop { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 6px; z-index: 30; flex-direction: column; }
.nav-drop a { display: block; padding: 9px 12px; color: var(--ink); text-decoration: none; border-radius: var(--r); white-space: nowrap; font-size: 15px; }
.nav-drop a:hover, .nav-drop a[aria-current] { background: var(--paper, #f6f7f9); }
.nav-sub:hover .nav-drop, .nav-sub:focus-within .nav-drop { display: flex; }
.nav-sub:hover .nav-caret, .nav-sub:focus-within .nav-caret { transform: rotate(180deg); }
/* Not enough room for every link in one row: use the menu button, as on phones (set by a small script). */
.hd.compact .nav-toggle { display: inline-flex; }
.hd.compact .nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 20px 18px; gap: 0; }
.hd.compact .nav.open { display: flex; }
.hd.compact .nav > a, .hd.compact .nav-sub > a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
.hd.compact .nav > a[aria-current] { box-shadow: inset -4px 0 0 var(--mark); padding-inline-start: 12px; }
.hd.compact .nav-sub { display: block; }
.hd.compact .nav-drop { display: flex; position: static; box-shadow: none; border: 0; padding: 0 16px 6px; min-width: 0; }
.hd.compact .nav-caret { display: none; }
.hd.compact .nav-actions { margin: 14px 0 0; }
.hd.compact .nav-actions .btn { flex: 1; }
.hd.compact .nav, .hd .nav.open { box-shadow: 0 12px 24px rgba(15, 23, 42, .08); border-radius: 0 0 var(--r) var(--r); }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; color: var(--ink); cursor: pointer; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 20px 18px; gap: 0; }
  .nav.open { display: flex; }
  .nav > a, .nav-sub > a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav > a[aria-current] { box-shadow: inset -4px 0 0 var(--mark); padding-inline-start: 12px; }
  .nav-sub { display: block; }
  .nav-drop { display: flex; position: static; box-shadow: none; border: 0; padding: 0 16px 6px; min-width: 0; }
  .nav-caret { display: none; }
  .nav-actions { margin: 14px 0 0; }
  .nav-actions .btn { flex: 1; }
}

/* Hero: headline + live timetable board */
.hero { padding: 56px 0 64px; }
.hero-in { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 960px) { .hero-in { grid-template-columns: 5fr 6fr; gap: 56px; } .hero { padding: 80px 0 88px; } }
.hero h1 { font-size: clamp(32px, 5.2vw, 54px); line-height: 1.3; font-weight: 800; margin: 0 0 18px; letter-spacing: -.01em; max-width: 14em; }
.hero-text { font-size: 18px; color: var(--muted); max-width: 32em; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.hero-img { margin-top: 28px; border-radius: var(--r); overflow: hidden; }

.board { background: var(--board); color: var(--chalk); border-radius: 10px; padding: 26px 24px 18px; position: relative; box-shadow: 0 1px 0 #0a2b2c, 0 24px 48px -28px rgba(15, 61, 62, .55); }
.board::after { content: ""; position: absolute; inset-inline: 18px; bottom: -9px; height: 9px; background: #b9a27a; border-radius: 0 0 4px 4px; opacity: .9; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.board-title { font-size: 19px; font-weight: 700; color: #fff; margin: 0; }
.board-term { font-size: 14px; color: #a9c4c0; }
.tt { width: 100%; border-collapse: collapse; font-size: 15px; }
.tt th { text-align: start; font-weight: 500; font-size: 13px; color: #8fb0ab; padding: 6px 8px; border-bottom: 1px solid rgba(233, 241, 238, .18); }
.tt td { padding: 11px 8px; border-bottom: 1px dashed rgba(233, 241, 238, .16); vertical-align: top; }
.tt tr:last-child td { border-bottom: 0; }
.tt .code { font-family: var(--latin); font-style: italic; font-size: 17px; color: #fff; direction: ltr; unicode-bidi: isolate; }
.tt .lvl { display: block; font-size: 13px; color: #a9c4c0; }
.tt .when { white-space: nowrap; }
.tt .when span { display: block; }
.seats { display: inline-block; background: var(--mark); color: var(--ink); font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.seats.full { background: transparent; color: #ffb4a8; border: 1px solid rgba(255, 180, 168, .5); font-weight: 500; }
.tt a.reg { color: #fff; font-size: 13px; }
.board-foot { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.board-foot a { color: var(--mark); }
.board-empty { color: #a9c4c0; padding: 24px 0; }
@media (max-width: 600px) {
  .tt thead { display: none; }
  .tt, .tt tbody, .tt tr, .tt td { display: block; width: 100%; }
  .tt tr { padding: 12px 0; border-bottom: 1px dashed rgba(233, 241, 238, .2); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .tt td { border: 0; padding: 0; }
  .tt td.c-when { grid-column: 1 / -1; }
}

/* Sections */
.sec { padding: 64px 0; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.sec h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.4; margin: 0; font-weight: 800; }
.sec-lead { color: var(--muted); margin: 6px 0 0; max-width: 40em; }

/* Level path (levels are a real sequence) */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; counter-reset: lv; position: relative; }
.path li { counter-increment: lv; padding: 0 0 0 20px; position: relative; }
.path li a { display: block; text-decoration: none; color: var(--ink); padding: 54px 0 8px; }
.path li::before { content: counter(lv); position: absolute; top: 0; inset-inline-start: 0; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 2px solid var(--board); display: grid; place-items: center; font-weight: 700; color: var(--board); z-index: 1; }
.path li::after { content: ""; position: absolute; top: 19px; inset-inline-start: 38px; inset-inline-end: 0; height: 2px; background: var(--line); }
.path li:last-child::after { display: none; }
.path li:hover::before { background: var(--mark); }
.path .p-title { display: block; font-weight: 700; font-size: 17px; }
.path .p-code { font-family: var(--latin); font-style: italic; color: var(--muted); font-size: 15px; }
.path .p-meta { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) {
  .path { grid-template-columns: 1fr; }
  .path li { padding: 0 0 18px; }
  .path li a { padding: 4px 54px 0 0; }
  .path li::after { top: 38px; bottom: 0; inset-inline-start: 18px; inset-inline-end: auto; width: 2px; height: auto; }
}

/* Features: plain list, no cards */
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px 40px; margin: 0; }
.feats dt { font-weight: 700; font-size: 17px; margin-bottom: 4px; padding-inline-start: 14px; border-inline-start: 4px solid var(--mark); }
.feats dd { margin: 0; color: var(--muted); padding-inline-start: 18px; }

/* Teachers */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px; }
.person { text-align: start; }
.person-photo { aspect-ratio: 4 / 5; background: var(--chalk); border-radius: var(--r); overflow: hidden; display: grid; place-items: center; font-size: 56px; font-weight: 800; color: var(--board); margin-bottom: 12px; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person b { display: block; font-size: 17px; }
.person p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* News list */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 36px 28px; }
.post-item a { text-decoration: none; color: var(--ink); display: block; }
.post-item .thumb { aspect-ratio: 16 / 9; background: var(--chalk); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.post-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-item h3 { font-size: 18px; line-height: 1.6; margin: 0 0 6px; }
.post-item a:hover h3 { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 3px; }
.post-item time { font-size: 13px; color: var(--muted); }
.post-item p { color: var(--muted); margin: 6px 0 0; font-size: 15px; }

/* Placement CTA band */
.band { background: var(--board); color: var(--chalk); }
.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 48px; padding-bottom: 48px; flex-wrap: wrap; }
.band h2 { color: #fff; margin: 0 0 6px; font-size: clamp(22px, 2.6vw, 28px); }
.band p { margin: 0; color: #a9c4c0; max-width: 36em; }

/* Inner pages */
.page-head { padding: 48px 0 28px; border-bottom: 1px solid var(--line); background: #fff; }
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.35; font-weight: 800; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 40em; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.prose { max-width: 720px; font-size: 17px; line-height: 2.05; }
.prose h2, .prose h3 { line-height: 1.5; margin: 1.8em 0 .5em; }
.prose img { border-radius: var(--r); }
.prose blockquote { margin: 1.4em 0; padding: 4px 18px; border-inline-start: 4px solid var(--mark); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px; }
.cover { margin: 28px 0 8px; border-radius: var(--r); overflow: hidden; max-width: 900px; }

.level-block { padding: 36px 0; border-bottom: 1px solid var(--line); display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .level-block { grid-template-columns: 4fr 7fr; gap: 48px; } }
.level-block:last-child { border-bottom: 0; }
.level-block h2 { margin: 0; font-size: 24px; }
.level-block .fee { font-weight: 700; margin-top: 10px; }
.level-block .desc { color: var(--muted); margin: 8px 0 0; }
.slots { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.slots th { background: var(--chalk); text-align: start; font-weight: 600; font-size: 13px; padding: 9px 12px; color: var(--board); }
.slots td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
.slots .code { font-family: var(--latin); font-style: italic; }
.slots .seats { font-size: 12px; }
.slots .seats.full { color: var(--red); border-color: rgba(194, 59, 42, .4); }
.slots-empty { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--r); padding: 18px; margin: 0; }
@media (max-width: 640px) {
  .slots thead { display: none; }
  .slots tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 12px; border-top: 1px solid var(--line); gap: 2px 10px; }
  .slots td { border: 0; padding: 0; }
}

/* Forms */
.form-wrap { display: grid; gap: 40px; grid-template-columns: 1fr; padding: 40px 0 64px; }
@media (min-width: 900px) { .form-wrap { grid-template-columns: 7fr 4fr; gap: 64px; } }
.form { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.field { margin-bottom: 18px; }
.field label, .field .lbl { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .req { color: var(--red); }
.field input[type=text], .field input[type=tel], .field input[type=email], .field select, .field textarea {
  width: 100%; font: 400 16px/1.6 var(--f); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); padding: 11px 13px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--board); background: #fff; box-shadow: 0 0 0 3px rgba(242, 213, 68, .55); }
.field .help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field .err { font-size: 14px; color: var(--red); margin: 6px 0 0; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--red); }
.row2 { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 6px; accent-color: var(--board); }
.hp { position: absolute; inset-inline-start: -9999px; }
.notice { padding: 14px 18px; border-radius: var(--r); margin-bottom: 20px; border: 1px solid; }
.notice-ok { background: #e5f4ec; border-color: #b9e0ca; color: #145a37; }
.notice-err { background: #fbe9e6; border-color: #f0c2b9; color: #8a2717; }
.aside h3 { margin: 0 0 10px; font-size: 18px; }
.aside ol { margin: 0; padding-inline-start: 20px; color: var(--muted); }
.aside ol li { margin-bottom: 8px; }
.aside .contact-line { display: block; font-size: 22px; font-weight: 700; color: var(--ink); text-decoration: none; margin: 4px 0 18px; }
.map { margin-top: 18px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 280px; border: 0; display: block; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 13px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); background: #fff; }
.pager .on { background: var(--board); color: #fff; border-color: var(--board); }
.empty { color: var(--muted); padding: 32px 0; }

/* Footer */
.ft { background: #fff; border-top: 1px solid var(--line); margin-top: 0; }
.ft-in { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding-top: 44px; padding-bottom: 28px; }
.ft-col b { display: block; margin-bottom: 8px; }
.ft-col p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.ft-col a { color: var(--muted); }
.ft-col a:hover { color: var(--board); }
.ft-name { font-size: 18px; }
.ft-legal { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 22px; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .board { animation: board-in .6s cubic-bezier(.2, .7, .2, 1) both; }
  .board tbody tr { animation: row-in .5s ease both; }
  .board tbody tr:nth-child(2) { animation-delay: .08s; } .board tbody tr:nth-child(3) { animation-delay: .16s; }
  .board tbody tr:nth-child(4) { animation-delay: .24s; } .board tbody tr:nth-child(5) { animation-delay: .32s; }
  @keyframes board-in { from { opacity: 0; transform: translateY(10px); } }
  @keyframes row-in { from { opacity: 0; } }
}
@media print { .hd, .ft, .band, .nav-toggle { display: none; } }
.tt .code-fa { font-weight: 700; color: #fff; font-size: 16px; }
.prose > p, .prose > li, .prose > h2, .prose > h3 { unicode-bidi: plaintext; text-align: start; }

[lang="fa"] .path li::before { content: counter(lv, persian); }
