/* Baptist Medical Centre, Saki — public site
   Mobile first. One file, no frameworks, system fonts only. */

:root {
  --paper: #f7f5f0;
  --paper-2: #efebe2;
  --ink: #1f1e1b;
  --ink-2: #4c4a44;
  --muted: #6d6a62;
  --rule: #d9d3c6;
  --green: #22513d;
  --green-ink: #183a2c;
  --notice: #fbf3dc;
  --notice-rule: #e2cf94;
  --error: #9b2c1f;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 1.25rem;
  --max: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.3rem, 1.15rem + .7vw, 1.65rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
address { font-style: normal; margin-bottom: 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: #fff; padding: .5rem .75rem; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.kicker { font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.kicker a { color: inherit; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 40rem; }

/* ---------- Header ---------- */

.topline { background: var(--green-ink); color: #e9efe9; font-size: .84rem; }
.topline .wrap { display: flex; justify-content: space-between; gap: 1rem; padding-top: .4rem; padding-bottom: .4rem; }
.topline a { color: #fff; text-decoration: none; white-space: nowrap; }
.topline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; position: relative; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.15; }
.brand small { display: block; font-size: .76rem; color: var(--muted); }

.nav-wide { display: none; }

.nav-small summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: .5rem .8rem; border: 1px solid var(--ink); border-radius: 2px;
  font-size: .9rem; font-weight: 500;
}
.nav-small summary::-webkit-details-marker { display: none; }
.nav-small[open] summary { background: var(--ink); color: var(--paper); }
.nav-small nav {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding: .25rem var(--gutter) 1rem;
  box-shadow: 0 12px 24px -18px rgba(0,0,0,.35);
}
.nav-small nav a {
  display: block; padding: .8rem 0; border-bottom: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; font-size: 1.05rem;
}
.nav-small nav a:last-child { border-bottom: 0; color: var(--green); }
.nav-small nav a[aria-current="page"] { font-weight: 600; }

@media (min-width: 60rem) {
  .nav-small { display: none; }
  .nav-wide { display: flex; align-items: center; gap: 1.4rem; font-size: .94rem; }
  .nav-wide a { color: var(--ink); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
  .nav-wide a:hover { border-bottom-color: var(--rule); }
  .nav-wide a[aria-current="page"] { border-bottom-color: var(--green); }
  .nav-wide .nav-cta { border: 1px solid var(--green); color: var(--green); padding: .35rem .8rem; border-radius: 2px; }
  .nav-wide .nav-cta:hover { background: var(--green); color: #fff; }
}

/* ---------- Sections ---------- */

main { padding-bottom: 2rem; }
section, aside.notice { margin-top: 2.5rem; }
/* the rule lines up with the text, not the screen edge */
.rule-top { position: relative; padding-top: 2rem; }
.rule-top::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--rule); }

.page-head { padding-top: 2.5rem; }
.page-head h1 { max-width: 46rem; }

/* label column + content column on wide screens */
.split { display: grid; gap: .25rem; }
@media (min-width: 48rem) {
  .split { grid-template-columns: minmax(12rem, 1fr) 3fr; gap: 2rem; }
}

/* photo + text side by side */
.pair { display: grid; gap: 1.5rem; align-items: center; }
.pair-top { align-items: start; }
@media (min-width: 48rem) {
  .pair { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

.pair-tables { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .pair-tables { grid-template-columns: 1fr 1fr; gap: 3rem; } }

.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }

.section-title { margin-bottom: 1.25rem; }

/* ---------- Home ---------- */

.intro { display: grid; gap: 1.75rem; padding-top: 2rem; margin-top: 0; }
.intro h1 { max-width: 15em; }
.intro-photo img { width: 100%; object-fit: cover; aspect-ratio: 4/3 !important; }
@media (min-width: 48rem) {
  .intro { grid-template-columns: 1.15fr 1fr; gap: 3.5rem; align-items: center; padding-top: 3.5rem; }
  .intro-photo img { aspect-ratio: 4/5 !important; }
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; margin-top: 1.25rem; }

.btn {
  display: inline-block; background: var(--green); color: #fff; text-decoration: none;
  padding: .7rem 1.15rem; border: 1px solid var(--green); border-radius: 2px;
  font: 500 .97rem/1.2 var(--sans); cursor: pointer;
}
.btn:hover { background: var(--green-ink); border-color: var(--green-ink); color: #fff; text-decoration: none; }
.btn-small { padding: .45rem .8rem; font-size: .88rem; }
.link { font-weight: 500; }

.notice {
  display: grid; gap: 1.25rem;
  background: var(--notice); border: 1px solid var(--notice-rule);
  padding: 1.5rem var(--gutter);
  max-width: calc(var(--max) - 2 * var(--gutter));
}
.notice h2 a { color: var(--ink); text-decoration: none; }
.notice .actions { margin-top: .5rem; }
.notice-photo img { max-height: 16rem; width: auto; border: 1px solid var(--notice-rule); }
@media (min-width: 48rem) {
  .notice { grid-template-columns: 1fr auto; padding: 1.75rem 2rem; margin-left: auto; margin-right: auto; }
}
@media (max-width: 47.99rem) {
  .notice { margin-left: var(--gutter); margin-right: var(--gutter); width: auto; }
}

.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem 1rem; margin-top: 3rem; margin-bottom: 1rem; }
.figures p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.35; }
.figures span { display: block; font-family: var(--serif); font-size: 2rem; color: var(--ink); line-height: 1.1; }
@media (min-width: 48rem) { .figures { grid-template-columns: repeat(4, 1fr); } }

.cols-2 { columns: 1; column-gap: 2rem; }
@media (min-width: 36rem) { .cols-2 { columns: 2; } }
.plain { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.plain li { padding: .45rem 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.ticks li { padding-left: 1.2rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: .55rem; height: 1px; background: var(--green); }

/* numbered list of schools */
.index { list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: idx; }
.index li { border-top: 1px solid var(--rule); counter-increment: idx; }
.index li:last-child { border-bottom: 1px solid var(--rule); }
.index a { display: grid; grid-template-columns: 2rem 1fr; gap: .15rem .75rem; padding: 1rem 0; color: var(--ink); text-decoration: none; }
.index a::before { content: counter(idx, decimal-leading-zero); grid-row: span 3; color: var(--muted); font-size: .85rem; padding-top: .2rem; font-variant-numeric: tabular-nums; }
.index a:hover .index-name { color: var(--green); text-decoration: underline; }
.index-name { font-family: var(--serif); font-size: 1.15rem; }
.index-note { color: var(--ink-2); font-size: .95rem; }
.index-year { color: var(--muted); font-size: .82rem; }
.index-large .index-name { font-size: 1.35rem; }
@media (min-width: 48rem) {
  .index a { grid-template-columns: 2.5rem 1fr 6rem; align-items: baseline; }
  .index a::before { grid-row: span 2; }
  .index-year { grid-column: 3; grid-row: 1; text-align: right; }
  .index-note { grid-column: 2; }
}

.visit address { font-size: 1.05rem; }

/* ---------- Photos ---------- */

.photo { margin: 0; }
.photo img { width: 100%; object-fit: cover; background: var(--paper-2); }
.photo figcaption, .strip figcaption, .gallery figcaption { font-size: .84rem; color: var(--muted); margin-top: .5rem; }
.wide img { aspect-ratio: 4/3 !important; }
@media (min-width: 48rem) { .wide img { aspect-ratio: 21/9 !important; } }

/* horizontal strip: swipe on phones, grid on desktop */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.strip-item { margin: 0; scroll-snap-align: start; }
.strip-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--paper-2); }
@media (min-width: 48rem) {
  .strip { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); overflow: visible; }
}

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-2); }
@media (min-width: 40rem) { .gallery { grid-template-columns: repeat(3, 1fr); gap: .9rem; } }
@media (min-width: 64rem) { .gallery { grid-template-columns: repeat(4, 1fr); } }

/* people */
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
@media (min-width: 40rem) { .people { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 64rem) { .people { grid-template-columns: repeat(4, 1fr); } }
.people-small { max-width: 44rem; }
@media (min-width: 64rem) { .people-small { grid-template-columns: repeat(3, 1fr); } }
.person { margin: 0; }
.person img, .person-initials { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 20%; background: var(--paper-2); }
.person-initials { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 2rem; color: var(--muted); }
.person figcaption { margin-top: .6rem; line-height: 1.35; }
.person strong { display: block; font-weight: 600; font-size: .98rem; }
.person span { color: var(--muted); font-size: .88rem; }

/* ---------- Text blocks ---------- */

.motto { margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--green); max-width: 44rem; }
.motto p { font-family: var(--serif); font-size: clamp(1.2rem, 1rem + 1vw, 1.55rem); line-height: 1.4; margin-bottom: .5rem; }
.motto cite { font-style: normal; color: var(--muted); font-size: .88rem; }

.entry { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }
.entry-meta { font-size: .84rem; color: var(--muted); margin-bottom: .25rem; font-variant-numeric: tabular-nums; }
.entry h3 { margin-bottom: .4rem; }
.entry p:last-child { margin-bottom: 0; }
.entry-photo, .entry-portrait { display: grid; gap: 1rem; }
.entry-photo img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.entry-portrait { grid-template-columns: 5.5rem 1fr; align-items: start; }
.entry-portrait img { width: 5.5rem; aspect-ratio: 4/5; object-fit: cover; object-position: center 20%; }
@media (min-width: 40rem) {
  .entry-photo { grid-template-columns: 12rem 1fr; align-items: start; }
  .entry-portrait { grid-template-columns: 7rem 1fr; }
  .entry-portrait img { width: 7rem; }
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 4.5rem 1fr; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.timeline li:first-child { padding-top: 0; }
.timeline p { margin: 0; }
.year { font-family: var(--serif); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 48rem) { .timeline li { grid-template-columns: 6rem 1fr; gap: 1.25rem; } }

.services { margin: 0; display: grid; gap: 0; }
.services > div { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.services > div:first-child { padding-top: 0; }
.services dt { font-weight: 600; }
.services dd { margin: .15rem 0 0; color: var(--ink-2); }
@media (min-width: 40rem) {
  .services { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .services > div:nth-child(2) { padding-top: 0; }
}

.facts { margin: 0; display: grid; gap: 0; }
.facts > div { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: .15rem 0 0; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(2, 1fr); column-gap: 2rem; } }
@media (min-width: 64rem) { .facts { grid-template-columns: repeat(3, 1fr); } }

.hours { margin: 0 0 1rem; display: grid; grid-template-columns: 1fr; }
.hours dt { font-weight: 600; margin-top: .5rem; }
.hours dd { margin: 0; color: var(--ink-2); }
@media (min-width: 36rem) {
  .hours { grid-template-columns: max-content 1fr; column-gap: 1.5rem; row-gap: .4rem; }
  .hours dt { margin: 0; }
}

.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .97rem; }
.table th, .table td { text-align: left; padding: .65rem .5rem .65rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table thead th { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table tbody th { font-weight: 500; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
.table .end { text-align: right; padding-right: 0; }
.table-narrow { max-width: 20rem; }
@media (max-width: 35.99rem) {
  .table-pay thead { display: none; }
  .table-pay tr { display: grid; grid-template-columns: 1fr auto; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
  .table-pay th, .table-pay td { border: 0; padding: 0; }
  .table-pay td:nth-child(2) { grid-row: 2; color: var(--muted); font-size: .9rem; }
  .table-pay .end { grid-row: span 2; grid-column: 2; grid-row-start: 1; align-self: center; }
}

/* ---------- News ---------- */

.posts { list-style: none; margin: 0 0 1rem; padding: 0; }
.posts li { border-bottom: 1px solid var(--rule); }
.posts li:first-child { border-top: 1px solid var(--rule); }
.posts a { display: grid; gap: .15rem; padding: .9rem 0; color: var(--ink); text-decoration: none; }
.posts time { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-title { font-family: var(--serif); font-size: 1.1rem; }
.posts a:hover .post-title { color: var(--green); text-decoration: underline; }
.post-summary { color: var(--ink-2); font-size: .95rem; }
@media (min-width: 48rem) {
  .posts a { grid-template-columns: 7.5rem 1fr; column-gap: 1rem; }
  .posts time { grid-row: span 2; padding-top: .25rem; }
}
.pager { display: flex; justify-content: space-between; margin-top: 1rem; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: 1.6fr 1fr; gap: 4rem; } }
.contact-side h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.contact-side h2:first-child { margin-top: 0; }

.form { max-width: 36rem; }
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 36rem) { .field-row { grid-template-columns: 1fr 1fr; } }
.form label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: .95rem; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid #bdb6a6; border-radius: 2px; padding: .65rem .7rem;
}
.form textarea { resize: vertical; min-height: 9rem; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--green); outline: 2px solid rgba(34,81,61,.18); outline-offset: 0; }
.hint { font-size: .84rem; color: var(--muted); margin: .35rem 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flash { background: #e8f0ea; border-left: 3px solid var(--green); padding: .85rem 1rem; margin-bottom: 1.5rem; }
.flash p:last-child, .flash ul:last-child { margin-bottom: 0; }
.flash-error { background: #f8e9e6; border-left-color: var(--error); }

.map { width: 100%; height: 20rem; border: 1px solid var(--rule); background: var(--paper-2); display: block; }
@media (min-width: 48rem) { .map { height: 26rem; } }

/* ---------- Footer ---------- */

.footer { margin-top: 3rem; border-top: 1px solid var(--rule); background: var(--paper-2); font-size: .93rem; padding: 2.5rem 0 1.5rem; }
.footer-grid { display: grid; gap: 1.75rem; grid-template-columns: 1fr 1fr; }
.footer-grid > div:first-child { grid-column: 1 / -1; }
@media (min-width: 56rem) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.3fr .8fr; }
  .footer-grid > div:first-child { grid-column: auto; }
}
.footer-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-bottom: .6rem; }
.footer-head { font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .45rem; }
.footer a { color: var(--ink); }
.footer-base { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
.footer-base cite { font-style: normal; white-space: nowrap; }

@media print {
  .topline, .nav-wide, .nav-small, .footer, .map, .btn { display: none !important; }
  body { background: #fff; }
}
