/* BioLife links page. Colors and type follow the approved Instagram set,
   see ../../automation/cover-template/TYPE-AND-MEASUREMENTS.md */
:root {
  --ivory: #faf7f2;
  --surface: #ffffff;
  --ink: #24261a;
  --ink-soft: #5a5c4d;
  --line: #e7ded1;
  --caramel: #965f3b;
  --sage: #55663f;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--ivory);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font: 400 16px/1.5 var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 3px solid var(--caramel); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 550;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.page { max-width: 480px; margin: 0 auto; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }

/* Header: the Instagram composition, words on the calm side, olive leaves on the right */
.hero {
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) 4px;
  background: url("/assets/header.jpg") right top / cover no-repeat;
  /* fade into the page so the photo has no hard bottom edge */
  position: relative;
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 55% 0 -1px;
  background: linear-gradient(to bottom, rgb(250 247 242 / 0), var(--ivory));
  z-index: -1;
}
.hero-logo { width: 76px; height: auto; }
h1 { font-size: 34px; line-height: 1.08; max-width: 9.6em; margin-top: 18px; }
.doctor { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.doctor img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--surface); }
.doctor strong, .doctor span { display: block; line-height: 1.35; }
.doctor strong { font-weight: 600; font-size: 15px; }
.doctor span { font-size: 14px; color: var(--ink-soft); }

.block { padding: 28px var(--gutter) 0; }
h2 { font-size: 24px; line-height: 1.2; margin-bottom: 14px; }

/* Buttons */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
}
.button svg { width: 22px; height: 22px; flex: none; }
.button-solid { background: var(--caramel); color: #fff; }
.button-whatsapp { background: var(--sage); color: #fff; }
.button-outline { border: 1.5px solid var(--caramel); color: var(--caramel); }

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Latest article */
.latest { display: block; margin-bottom: 12px; background: var(--surface); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.latest img { width: 100%; aspect-ratio: 2688 / 1520; object-fit: cover; background: var(--line); }
.latest h3 { font-size: 21px; line-height: 1.25; padding: 14px 16px 0; }
.latest .button { margin: 14px 12px 12px; }

/* Contact rows: one grouped list */
.rows { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px 10px 16px; }
.rows svg { width: 22px; height: 22px; flex: none; color: var(--caramel); }
.rows span { flex: 1; min-width: 0; }
.rows strong, .rows small { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.rows strong { font-weight: 600; }
.rows small { font-size: 14px; color: var(--ink-soft); }
.rows .go { width: 18px; height: 18px; color: var(--ink-soft); }

/* Location */
.visit { display: grid; grid-template-columns: 22px 1fr; column-gap: 14px; }
.visit svg { width: 22px; height: 22px; color: var(--caramel); margin-top: 2px; }
.visit address { font-style: normal; }
.visit address strong { display: block; font-weight: 600; }
.visit p { grid-column: 2; margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.maps .button { padding-inline: 10px; }

/* Article grid */
#articles { scroll-margin-top: 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; }
.grid a { display: block; }
.grid img { width: 100%; aspect-ratio: 2688 / 1520; object-fit: cover; border-radius: 12px; background: var(--line); }
.grid h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.3;
}
.grid .read { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--caramel); }

.message { grid-column: 1 / -1; margin-bottom: 12px; color: var(--ink-soft); }
.message a { color: var(--caramel); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.skeleton { background: var(--line); border-radius: 18px; }
.skeleton-latest { aspect-ratio: 350 / 345; margin-bottom: 12px; }
.skeleton-tile { aspect-ratio: 2688 / 1520; border-radius: 12px; }

footer { padding: 40px var(--gutter) calc(env(safe-area-inset-bottom) + 32px); text-align: center; }
footer a { display: inline-block; padding: 12px 16px; color: var(--ink-soft); font-size: 14px; }

/* Wider screens: keep the phone-shaped column, centred */
@media (min-width: 520px) {
  .page { padding-top: 24px; }
  .hero { border-radius: 24px 24px 0 0; overflow: hidden; }
}

/* Press feedback: the page is touch first, so the response is on press, not hover */
.button, .rows a, .latest, .grid a { transition: transform 160ms var(--ease-out), background-color 160ms ease, opacity 160ms ease; }
.button:active, .grid a:active { transform: scale(0.97); }
.latest:active { transform: scale(0.985); } /* a big surface needs a smaller move */
/* rows light up the moment they're touched and fade back on release */
.rows a:active { background: #f1eadf; transition-duration: 0ms; }

/* the list arrives from the blog a moment after the page: fade it in rather than snapping */
.latest, .grid li:not(.skeleton) { @starting-style { opacity: 0; } }
.grid li { transition: opacity 220ms ease; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.rows a:focus-visible { outline-offset: -3px; border-radius: 14px; }

@media (hover: hover) and (pointer: fine) {
  .button:hover, .grid a:hover { opacity: 0.88; }
  .rows a:hover { background: var(--ivory); }
}

@media (prefers-reduced-motion: reduce) {
  .button, .rows a, .latest, .grid a { transition: none; }
  .button:active, .latest:active, .grid a:active { transform: none; opacity: 0.8; }
}
