/* ==========================================================================
   Dr. Saeid Chavoshi - site styles
   Minimal blue & white theme, matched to The PsychoEd Clinic website
   (psychoedclinic.com): clinic blue #0077b6, logo blue #0e74bc, white pages,
   a pale-blue strip, Lato headings and Roboto text.
   ========================================================================== */
:root {
  --blue: #0077b6;          /* clinic blue: buttons, links, title bands */
  --blue-logo: #0e74bc;     /* headings */
  --blue-dark: #005f92;     /* hover */
  --blue-pale: #eaf3fa;     /* light strip / soft backgrounds */
  --line: #dce8f2;          /* hairline dividers */
  --ink: #1c1c1c;           /* body text (as on the clinic site) */
  --muted: #5b6573;
  --white: #ffffff;

  --max: 1760px;
  --gutter: max(20px, 5vw);
  --room-w: min(480px, 30vw);   /* THE size of the three floating 3D rooms (Research, Clinic, Workshops).
                                   Change it only here; never give one room its own width (stamp.py checks). */
  --band-h: 260px;              /* every page's blue title band */
  --radius: 10px;
  --header-h: 106px;

  --head: "Lato", Arial, Helvetica, sans-serif;
  --sans: "Roboto", Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--head); font-weight: 700; color: var(--blue-logo); line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap > *, .grid > *, .workshop > * { min-width: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { font-family: var(--head); font-weight: 900; font-size: clamp(26px, 2.5vw, 48px); letter-spacing: -.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(4px, 1.6vw, 30px); }
.nav a {
  text-decoration: none; font-size: 17px; font-weight: 500; color: var(--ink);
  padding: 10px 6px; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 6px; border: 2px solid var(--blue);
  background: var(--blue); color: var(--white);
  font-family: var(--sans); font-weight: 500; font-size: 16px; line-height: 1.2;
  text-decoration: none; text-align: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn--outline, .btn--white { background: transparent; color: var(--blue); }
.btn--outline:hover, .btn--white:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn--sm { padding: 10px 20px; font-size: 15px; }
.btn:focus-visible, .nav a:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.text-link { font-weight: 500; text-decoration: none; }
.text-link::after { content: " \2192"; }
.text-link:hover { text-decoration: underline; }

/* ---------- Blue title band (same on every page) ---------- */
.band, .bio-head, .page-head {
  min-height: var(--band-h); padding: 72px 0 48px;
  background: var(--blue); color: var(--white);
}
.band h1, .bio-head h1, .page-head h1 { color: var(--white); font-size: clamp(34px, 3.6vw, 66px); }
.page-head p { margin: 14px 0 0; max-width: 900px; font-size: 20px; color: rgba(255, 255, 255, .92); }

/* ---------- Home: hero ---------- */
.hero .wrap {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 6vw; align-items: center;
  padding: clamp(56px, 6vw, 112px) 0;
}
.hero h1 { font-size: clamp(40px, 4.8vw, 92px); font-weight: 900; margin-bottom: 20px; }
.hero .roles { font-size: clamp(18px, 1.3vw, 24px); line-height: 1.6; color: var(--muted); max-width: 820px; margin-bottom: 34px; }
.hero-photo {
  justify-self: end; width: 100%; max-width: 680px; max-height: calc(100vh - var(--header-h) - 80px); min-height: 380px;
  aspect-ratio: 1040 / 1186; object-fit: cover; object-position: 50% 18%;
  border-radius: var(--radius);
}

/* ---------- Home: quick-link strip (pale blue, like the clinic site) ---------- */
.strip { background: var(--blue-pale); }
.strip .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 48px 0; }
.strip-item { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--ink); }
.strip-item svg { flex: none; width: 56px; height: 56px; color: var(--blue); }
.strip-item strong { display: block; font-family: var(--head); font-weight: 700; font-size: clamp(18px, 1.25vw, 23px); line-height: 1.3; }
.strip-item em { font-style: normal; color: var(--blue); font-weight: 500; font-size: 17px; }
.strip-item em::after { content: " \2192"; }
.strip-item:hover strong { color: var(--blue); }

/* ---------- Home: about + clinic ---------- */
.about-short .wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: center;
  padding: clamp(72px, 7vw, 128px) 0;
}
.about-short img { border-radius: var(--radius); width: 100%; }
.about-short h2, .clinic-feature h2 { font-size: clamp(30px, 3vw, 54px); margin-bottom: 18px; }
.about-short p { font-size: clamp(18px, 1.25vw, 22px); color: var(--ink); max-width: 760px; }
.about-short .text-link { display: inline-block; margin-top: 8px; font-size: 17px; }
.clinic-feature { border-top: 1px solid var(--line); }
.clinic-feature .wrap { display: grid; justify-items: center; text-align: center; padding: 88px 0 96px; }
.clinic-logo { width: 96px; margin-bottom: 20px; }
.clinic-feature p { color: var(--muted); margin-bottom: 28px; }
.clinic-feature .actions { justify-content: center; }

/* ---------- Inner pages ---------- */
.section { padding: 72px 0; }
.section > .wrap > h2, .upcoming-main > h2 { font-size: clamp(28px, 2.8vw, 48px); margin-bottom: 24px; }

/* About Dr. Saeid */
.bio > .wrap { display: grid; grid-template-columns: clamp(260px, 22vw, 420px) 1fr; gap: 5vw; align-items: start; padding: 72px 0 96px; }
.bio-photo { border-radius: var(--radius); position: sticky; top: calc(var(--header-h) + 24px); }
.bio-card p { font-size: 18px; line-height: 1.8; margin-bottom: 1.3em; break-inside: avoid-column; }
@media (min-width: 1400px) { .bio-card { columns: 2; column-gap: 4vw; } }

/* Research: simple list of three items, divided by hairlines */
.research .body { padding: 56px 0 88px; }
.research .grid {
  width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; grid-template-columns: var(--room-w) minmax(0, 1fr); gap: 22px 6vw; align-items: center;
}
.research-room { grid-row: 1 / span 3; }
.research .box {
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  padding: 30px 0; border-bottom: 1px solid var(--line);
}
.research .box:last-child { border-bottom: 0; }
.research .box h3, .workshop h3 { font-size: clamp(22px, 1.5vw, 28px); margin-bottom: 8px; }
.research .box p { font-size: 18px; color: var(--ink); }
/* solid clinic-blue buttons */
.research .box .btn { background: var(--blue); color: var(--white); border-color: var(--blue); }
.research .box .btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.research .box .btns { display: grid; gap: 10px; }

/* Clinic page */
.clinic2 .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--room-w); gap: 0 6vw; align-items: center;
  padding: 72px 0 104px;
}
.clinic2-main { display: contents; }
.clinic2 .clinic-title { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.clinic2 .card { grid-column: 1; grid-row: 2; }
.clinic-room { grid-column: 2; grid-row: 1 / span 2; }
.clinic-title h2 { font-size: clamp(28px, 2.8vw, 48px); }
.clinic2 .card p { font-size: clamp(18px, 1.2vw, 21px); }
.logo-tile { flex: none; width: 76px; }
.logo-tile img { width: 100%; }
.clinic2 .card .actions { margin-top: 28px; }

/* Workshops */
.upcoming-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--room-w); gap: 0 6vw; align-items: center; }
.upcoming-main { grid-column: 1; }
.upcoming-main > h2 { margin-bottom: 24px; }
.workshop-room { grid-column: 2; }
.notice { padding: 26px 30px; border-left: 4px solid var(--blue); background: var(--blue-pale); border-radius: 0 var(--radius) var(--radius) 0; }
.notice .btn { margin-top: 18px; }
.workshops { display: grid; }
.workshop {
  display: grid; grid-template-columns: clamp(260px, 24vw, 460px) 1fr; gap: 4vw; align-items: start;
  padding: 44px 0; border-top: 1px solid var(--line);
}
.workshop:first-child { border-top: 0; padding-top: 8px; }
.workshop img { border-radius: var(--radius); width: 100%; }
.workshop .meta { font-size: 13px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.workshop p { font-size: 18px; max-width: 1000px; }
.workshop .links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.archive-note { margin-top: 32px; font-size: 16px; font-style: italic; color: var(--muted); }

/* Clinic research list */
.crumb { margin: 0 0 16px; font-size: 16px; }
.crumb a { text-decoration: none; font-weight: 500; }
.crumb a:hover { text-decoration: underline; }
.section-lead { max-width: 1000px; font-size: 20px; margin-bottom: 48px; }
.section-intro { max-width: 1000px; margin: -8px 0 24px; }
.study .byline, .workshop .byline { font-weight: 500; color: var(--muted); font-size: 16px; margin-bottom: 14px; }
.study .note { font-style: italic; color: var(--muted); font-size: 16px; }
.hub-cta { margin-top: 24px; }

/* ---------- Floating 3D rooms (no shadow) ---------- */
.room-float { width: 100%; justify-self: center; align-self: center; padding: 24px 0; }
.room-float img { width: 100%; animation: room-float 4.6s ease-in-out infinite alternate; }
@keyframes room-float { from { transform: translateY(0); } to { transform: translateY(-24px); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue); color: rgba(255, 255, 255, .9); padding: 36px 0; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* gentle fade-in as content scrolls into view (JS only) */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (min-width: 1600px) {
  .btn { padding: 15px 30px; font-size: 17px; }
  .btn--sm { padding: 12px 24px; font-size: 16px; }
}
@media (max-width: 1000px) {
  .strip .wrap { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 900px) {
  body { font-size: 17px; }
  :root { --band-h: 140px; --header-h: 68px; }
  .brand { font-size: 26px; }
  .hero-photo { max-height: none; min-height: 0; }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 14px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); }

  .band, .bio-head, .page-head { padding: 36px 0 28px; }
  .page-head p { font-size: 17px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding: 44px 0 56px; }
  .hero .roles { font-size: 18px; }
  .hero-photo { justify-self: start; max-width: 340px; }
  .about-short .wrap { grid-template-columns: 1fr; gap: 32px; padding: 56px 0; }
  .about-short p { font-size: 17px; }
  .clinic-feature .wrap { padding: 56px 0 64px; }
  .bio > .wrap { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 64px; }
  .bio-photo { position: static; width: 200px; }
  .bio-card p { font-size: 17px; }
  .section { padding: 48px 0; }
  .workshop { grid-template-columns: 1fr; gap: 20px; }
  .research .box { grid-template-columns: 1fr; gap: 16px; }
  .research .box .btns { display: flex; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .research .grid, .clinic2 .wrap, .upcoming-grid { grid-template-columns: 1fr; }
  .research-room, .clinic-room, .workshop-room,
  .clinic2 .clinic-title, .clinic2 .card, .upcoming-main { grid-column: 1; grid-row: auto; }
  .research-room, .clinic-room, .workshop-room { max-width: 400px; margin: 0 auto; }
  .clinic2 .wrap { padding: 44px 0 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .room-float img { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* TRACP page */
.tracp .section-lead { margin-bottom: 40px; }
.tracp-sub { font-size: clamp(22px, 1.5vw, 28px); color: var(--blue); margin: 0 0 16px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 48px; background: var(--blue-pale); border-radius: var(--radius); }
.facts > div { padding: 28px 32px; border-left: 1px solid var(--line); }
.facts > div:first-child { border-left: 0; }
.facts dt { font-size: 16px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.facts dd { margin: 0; font-family: var(--head); font-weight: 900; font-size: clamp(28px, 2.4vw, 44px); color: var(--blue); line-height: 1.15; }
.dates { margin: 0 0 56px; max-width: 1000px; }
.dates > div { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dates > div:last-child { border-bottom: 0; }
.dates dt { font-weight: 500; color: var(--muted); }
.dates dd { margin: 0; font-weight: 700; color: var(--ink); }
.tracp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 5vw; margin-bottom: 56px; }
.tracp-cols p, .tracp-list { font-size: 18px; }
.tracp-list { padding-left: 1.2em; margin: 0 0 1.2em; }
.tracp-list li { margin-bottom: 8px; }
.tracp .notice .contact { margin-top: 10px; }
@media (max-width: 900px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div { border-left: 0; border-top: 1px solid var(--line); padding: 20px 22px; }
  .facts > div:first-child { border-top: 0; }
  .dates > div { grid-template-columns: 1fr; gap: 2px; }
  .tracp-cols { grid-template-columns: 1fr; }
}
.tracp .jump { margin: -24px 0 40px; font-weight: 500; }
.tracp .jump a { text-decoration: none; }
.tracp .jump a::after { content: " \2193"; }
.award { border-top: 1px solid var(--line); scroll-margin-top: var(--header-h); }
.facts dd.small { font-family: var(--body, inherit); font-weight: 500; font-size: 16px; color: var(--muted); margin-top: 4px; }
.tracp-cols .tracp-sub + p, .tracp-cols ul + .tracp-sub { margin-top: 0; }
.tracp-cols ul + .tracp-sub { padding-top: 12px; }
.byline-plain { font-weight: 500; color: var(--muted); margin-bottom: 12px; }

/* Wintre Award: its own full-width blue section, so it reads as a separate topic from the residency */
.award { background: var(--blue); color: var(--white); border-top: 0; padding: 88px 0 96px; }
.award .eyebrow { display: inline-block; margin: 0 0 14px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.award h2, .award .tracp-sub { color: var(--white); }
.award p, .award li, .award .section-lead { color: rgba(255, 255, 255, .95); }
.award .byline-plain { color: rgba(255, 255, 255, .8); }
.award a:not(.btn) { color: var(--white); }
.award .facts { background: rgba(255, 255, 255, .1); }
.award .facts > div { border-left-color: rgba(255, 255, 255, .25); }
.award .facts dt, .award .facts dd.small { color: rgba(255, 255, 255, .85); }
.award .facts dd { color: var(--white); }
.award .notice { background: rgba(255, 255, 255, .1); border-left-color: var(--white); }
.award .btn--white { background: var(--white); color: var(--blue); border-color: var(--white); }
.award .btn--white:hover { background: var(--blue-pale); border-color: var(--blue-pale); color: var(--blue-dark); }
.award .btn--outline { background: transparent; color: var(--white); border-color: var(--white); }
.award .btn--outline:hover { background: var(--white); color: var(--blue); }
.award .btn:focus-visible, .award a:focus-visible { outline-color: var(--white); }
@media (max-width: 900px) {
  .award { padding: 56px 0 64px; }
  .award .facts > div { border-top-color: rgba(255, 255, 255, .25); }
}
.award { margin-bottom: 72px; }   /* white gap so the blue award section does not merge with the blue footer */
@media (max-width: 900px) { .award { margin-bottom: 48px; } }

/* TRACP dropdown in the top bar */
.nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 17px; font-weight: 500; color: var(--ink);
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 6px; cursor: pointer;
}
.nav-drop-btn svg { width: 12px; height: 12px; transition: transform .2s ease; }
.nav-drop-btn:hover, .nav-drop.open .nav-drop-btn { color: var(--blue); }
.nav-drop.open .nav-drop-btn svg { transform: rotate(180deg); }
.nav-drop.is-current .nav-drop-btn { color: var(--blue); border-bottom-color: var(--blue); }
.nav-drop-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.nav-sub {
  display: none; position: absolute; top: 100%; right: 0; z-index: 60;
  flex-direction: column; min-width: 220px; padding: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(14, 40, 70, .12);
}
.nav-drop.open .nav-sub { display: flex; }
@media (hover: hover) and (min-width: 901px) { .nav-drop:hover .nav-sub { display: flex; } }
.nav .nav-sub a { padding: 11px 14px; border-bottom: 0; border-radius: 6px; white-space: nowrap; }
.nav .nav-sub a:hover { background: var(--blue-pale); }
.nav .nav-sub a[aria-current="page"] { background: var(--blue-pale); color: var(--blue); border-bottom: 0; }
@media (max-width: 900px) {
  .nav-drop-btn { width: 100%; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-drop.is-current .nav-drop-btn { border-bottom-color: var(--line); }
  .nav-sub { position: static; display: flex; min-width: 0; padding: 0 0 0 18px; border: 0; border-radius: 0; box-shadow: none; }
  .nav-drop-btn svg { display: none; }
  .nav .nav-sub a { padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line); white-space: normal; }
  .nav .nav-sub a[aria-current="page"] { background: none; }
}

/* keep top-bar labels on one line; tighten on narrow desktops (901-1080px) */
.nav a, .nav-drop-btn { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1080px) {
  .site-header .wrap { gap: 10px; }
  .brand { font-size: 22px; }
  .nav { gap: 2px; }
  .nav a, .nav-drop-btn { font-size: 15px; padding-left: 5px; padding-right: 5px; }
}

.course .modules-title { font-weight: 700; margin: 6px 0 6px; }
.course .tracp-list { font-size: 17px; margin-bottom: 20px; }

.bio-name { column-span: all; font-size: clamp(24px, 1.8vw, 32px); margin-bottom: 18px; }

/* Workshops & Courses: even rhythm - every thumbnail sits in the same 4:3 frame
   (whole image shown, pale-blue letterbox), so rows are evenly spaced.
   The classroom uses the shared --room-w like the other two rooms. */
.workshops-page .workshop img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--blue-pale); }
.workshops-page #upcoming { padding-bottom: 24px; }
