/* Od. Leonor Granados — clinic first screen plus "Sonríe desde adentro" journal. Brand palette is mandatory (Imagen de Marca.md).
   Contrast (calculated): plum on ivory 8.0, ivory on moss 10.0, light plum on moss 7.1.
   Plum on moss is 1.25: never used. Sage is decorative only (3.8 on ivory). */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Great Vibes";
  src: url("../fonts/great-vibes-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ivory: #F4F0EB;
  --ivory-shade: #E8E2D8;
  --moss: #2C3E35;
  --forest: #1A2C23;
  --plum: #5B3E63;
  --plum-light: #D9C7DE;
  --ink: #333333;
  --sage: #66806F;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 62ch;
  --radius: 0.75rem;
  --section-space: clamp(3.5rem, 8vw, 6.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; scroll-padding-bottom: 5rem; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
  padding-bottom: 5rem; /* room for the sticky bar on phones */
}
img, svg { display: block; max-width: 100%; }
.sprite { position: absolute; }
.not-found { padding-block: var(--section-space); }
.not-found h1 { font: 650 clamp(2.4rem, 6vw, 4rem)/1.1 var(--serif); font-variation-settings: "opsz" 144; margin-bottom: 1rem; }
.not-found p { margin-bottom: 1.5rem; }
h1, h2, h3, p, ul, dl, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a, .btn { touch-action: manipulation; }
p { text-wrap: pretty; }
.board a:hover, .work a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 2px; }
.dark :focus-visible, .board :focus-visible, .sticky-cta :focus-visible { outline-color: var(--plum-light); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--plum); color: var(--ivory); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }

/* ---------- Type ---------- */
.script {
  font-family: var(--script);
  font-weight: 400;
  color: var(--plum);
  font-size: 1.18em;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.dark .script, .board .script { color: var(--plum-light); }
.section-title {
  font: 600 clamp(1.75rem, 3.2vw, 2.5rem)/1.1 var(--serif);
  font-variation-settings: "opsz" 72;
  margin-bottom: 1.5rem;
}
.section-name {
  font: italic 500 1rem/1.3 var(--serif);
  color: var(--plum);
  margin-bottom: 0.35rem;
}
.dark .section-name { color: var(--plum-light); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-plum { background: var(--plum); color: var(--ivory); }
.btn-plum:hover { background: var(--forest); }
.btn-ivory { background: var(--ivory); color: var(--forest); }
.btn-ivory:hover { background: var(--plum-light); }
.btn-ghost { border-color: currentColor; color: var(--plum); padding: 0.55rem 1.2rem; font-size: 0.95rem; }
.dark .btn-ghost { color: var(--plum-light); }
.btn-ghost:hover, .story:hover .btn-ghost { background: var(--plum); color: var(--ivory); border-color: var(--plum); }
.dark .btn-ghost:hover, .dark .story:hover .btn-ghost { background: var(--plum-light); color: var(--forest); border-color: var(--plum-light); }

/* ---------- Top bar ---------- */
.topbar { padding-block: 1rem 0.9rem; border-bottom: 4px double var(--plum); }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.site-name { font: 650 1.3rem/1.2 var(--serif); font-variation-settings: "opsz" 36; color: var(--forest); text-decoration: none; }
/* Phones: only the name on top; the hero button and the sticky bar carry "Agendar". */
.topbar .btn, .edition-nav { display: none; }
.edition-nav { align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; }
.edition-nav ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font: 500 1rem/1.4 var(--sans); }
.edition-nav li a { text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.edition-nav li a:hover { border-bottom-color: var(--plum); }

/* Shapes inside <symbol> live in a shadow tree: colors come from custom properties set on the <svg>. */
.d-tooth, .d-leaf, .d-core, .d-flower ellipse { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-tooth { stroke: var(--line-main, var(--plum)); stroke-width: 3; }
.d-leaf { stroke: var(--line-leaf, var(--sage)); stroke-width: 3; }
.d-flower ellipse, .d-core { stroke: var(--line-main, var(--plum)); stroke-width: 1.4; }
.portrait-frame svg { --line-main: var(--plum-light); }
.herbs { --line-main: var(--plum-light); }

/* ---------- Clinic first screen ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) var(--section-space); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 {
  font: 650 clamp(3rem, 9vw, 6.5rem)/0.98 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 650;
  letter-spacing: -0.02em;
  color: var(--forest);
}
.hero h1 .script { display: block; font-size: 0.8em; margin-top: 0.1em; padding: 0.05em 0.15em 0.15em; }
.hero-text { margin-top: 1.25rem; max-width: 36ch; font: 400 clamp(1.2rem, 2.2vw, 1.5rem)/1.45 var(--serif); font-variation-settings: "opsz" 24; }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.hero-actions .btn-plum { padding: 0.9rem 1.8rem; font-size: 1.05rem; }
.lead-art, .portrait-frame {
  background: var(--ivory-shade);
  border-radius: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}
.lead-art svg, .portrait-frame svg { width: min(100%, 15rem); margin-inline: auto; aspect-ratio: 200 / 250; }
.hero-place { margin-top: 1rem; max-width: 40ch; font-size: 1rem; }
.hero-place + .hero-place { margin-top: 0.25rem; }
.lead-photo { margin-inline: auto; width: min(100%, 26rem); padding: 0.6rem; background: var(--moss); border-radius: 1.5rem; }
.lead-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 1.05rem; }
figcaption { margin-top: 1rem; font-size: 1rem; }

/* ---------- Journal: "Sonríe desde adentro" ---------- */
.diary { padding-block: 0 var(--section-space); }
.nameplate { text-align: center; padding: 0 0 1rem; border-top: 4px double var(--plum); padding-top: clamp(2rem, 5vw, 3.5rem); }
.mark { width: clamp(2.75rem, 5vw, 3.75rem); height: clamp(3.4rem, 6.2vw, 4.7rem); margin: 0 auto 0.5rem; overflow: visible; }
.nameplate h2 {
  font: 650 clamp(3rem, 9vw, 6.5rem)/0.95 var(--serif);
  font-variation-settings: "opsz" 144, "wght" 650;
  letter-spacing: -0.02em;
  color: var(--forest);
}
.nameplate h2 .script { display: block; font-size: 0.82em; margin-top: -0.02em; padding: 0.05em 0.15em 0.15em; }
.tagline { margin-top: 0.75rem; font: italic 500 clamp(1.1rem, 2.4vw, 1.5rem)/1.3 var(--serif); color: var(--ink); }

.lead { margin-top: clamp(2rem, 5vw, 3.5rem); max-width: 48rem; }
.lead h3 {
  font: 650 clamp(2.2rem, 5vw, 4rem)/1.06 var(--serif);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.015em;
  color: var(--forest);
  text-wrap: balance;
}
.lead h3 a, .story-title a { text-decoration: none; }
.lead h3 a:hover, .story-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.lead h3 .script { font-size: 1.12em; }
.deck { margin-top: 1.5rem; max-width: 44ch; font: 400 clamp(1.2rem, 2.2vw, 1.5rem)/1.45 var(--serif); font-variation-settings: "opsz" 24; }
.byline { margin-top: 1.25rem; font-weight: 600; font-size: 1rem; }
.lead .btn { margin-top: 1.5rem; }

/* ---------- Dark bands ---------- */
.dark { background: var(--moss); color: var(--ivory); }
.headlines, .work, .doctor { padding-block: var(--section-space); }

.headline-grid { display: grid; gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 3rem); }
.story { position: relative; display: grid; gap: 0.5rem; justify-items: start; }
.story-title { font: 600 clamp(1.4rem, 2.4vw, 1.8rem)/1.2 var(--serif); font-variation-settings: "opsz" 48; text-wrap: balance; }
/* One link per story: the title link stretches over the whole card. */
.story-title a::after { content: ""; position: absolute; inset: -0.5rem; }
.story-wide .story-title { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1; font-variation-settings: "opsz" 144; }
.story-teaser { max-width: 40ch; }
.story .btn { margin-top: 0.5rem; }
.story-strip { padding-top: 1rem; }

/* ---------- The question ---------- */
.question { padding-block: var(--section-space); }
.questions { display: grid; gap: clamp(1.25rem, 3vw, 2.25rem); margin-top: 1rem; }
.questions li {
  font: 500 clamp(1.7rem, 4.6vw, 3.4rem)/1.12 var(--serif);
  font-variation-settings: "opsz" 144;
  color: var(--forest);
  max-width: 22ch;
  text-wrap: balance;
}
.questions li:nth-child(2) { margin-left: auto; text-align: right; }
.questions .script { font-size: 1.15em; }

/* ---------- How we work ---------- */
.work-grid { display: grid; gap: 2.5rem; align-items: center; }
.work p { max-width: var(--measure); }
.work p + p, .work h3 + p { margin-top: 1rem; }
.work h3 { margin-top: 2rem; font: 600 1.25rem/1.2 var(--serif); font-variation-settings: "opsz" 36; color: var(--plum-light); }
.approaches { margin-top: 1.5rem; display: grid; gap: 0.6rem; max-width: var(--measure); }
.herbs { width: min(100%, 11rem); margin-inline: auto; overflow: visible; }
.photo { margin: 0; width: min(100%, 26rem); margin-inline: auto; padding: 0.6rem; background: var(--moss); border-radius: 1.5rem; }
.photo img { width: 100%; height: auto; display: block; object-fit: cover; border-radius: 1.05rem; }
.work-photos { display: grid; gap: 1.25rem; align-content: start; }

/* ---------- Classifieds ---------- */
.classifieds { padding-block: var(--section-space); }
.class-grid { display: grid; gap: 2rem; }
.class-block { padding: 1.75rem; background: var(--ivory-shade); border-radius: var(--radius); }
.class-block h3 { font: 600 1.4rem/1.2 var(--serif); font-variation-settings: "opsz" 48; margin-bottom: 0.9rem; color: var(--plum); }
.class-block li { padding: 0.4rem 0; }

/* ---------- Doctor ---------- */
.doctor-grid { display: grid; gap: 2.5rem; align-items: center; }
.doctor-name { font: 600 clamp(1.5rem, 3vw, 2.1rem)/1.2 var(--serif); margin-bottom: 0.75rem; }
.portrait-frame { background: var(--forest); }
.portrait-frame figcaption { color: var(--ivory); }

/* ---------- Note pages ---------- */
.note-page { padding-block: clamp(2rem, 5vw, 4rem) var(--section-space); }
.note-page .wrap { width: min(100% - 2 * var(--gutter), 46rem); }
.crumb { margin-bottom: 2rem; font-weight: 600; }
.note-page h1 {
  font: 650 clamp(2.2rem, 5vw, 3.8rem)/1.08 var(--serif);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.015em;
  color: var(--forest);
  text-wrap: balance;
}
.note-page .deck { max-width: none; }
.note-body { padding-top: 1.5rem; }
.note-body > * + * { margin-top: 1.1rem; }
.note-body .kicker { font: 500 clamp(1.25rem, 2.4vw, 1.6rem)/1.4 var(--serif); font-variation-settings: "opsz" 36; color: var(--forest); }
.note-body h2 { margin-top: 2rem; font: 600 1.4rem/1.2 var(--serif); font-variation-settings: "opsz" 48; color: var(--plum); }
.note-body ul, .doctor ul { list-style: disc; padding-left: 1.25rem; display: grid; gap: 0.6rem; }
.pull { margin-top: 1.5rem; padding-left: 1.25rem; border-left: 3px solid var(--plum); font: italic 500 1.25rem/1.45 var(--serif); }
.doctor .pull { border-left-color: var(--plum-light); }
.doctor h3 { margin-top: 2rem; font: 600 1.25rem/1.2 var(--serif); font-variation-settings: "opsz" 36; color: var(--plum-light); }
.doctor p + p, .doctor h3 + p { margin-top: 1rem; }
.aviso { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--ivory-shade); font-size: 1rem; font-style: italic; }
.more-notes { margin-top: 3rem; padding: 1.75rem; background: var(--ivory-shade); border-radius: var(--radius); }
.more-notes h2 { font: 600 1.4rem/1.2 var(--serif); font-variation-settings: "opsz" 48; margin-bottom: 0.9rem; color: var(--plum); }
.more-notes li { padding: 0.4rem 0; }

/* ---------- Notice board ---------- */
.board { background: var(--forest); color: var(--ivory); padding-block: var(--section-space) 2rem; }
.board-grid { display: grid; gap: 2rem; }
.board h3 { font: 600 1.25rem/1.2 var(--serif); font-variation-settings: "opsz" 36; color: var(--plum-light); margin-bottom: 0.6rem; }
.hours div { padding: 0.35rem 0; }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; }
.board a { text-decoration-thickness: 1px; }
.board-cta { margin-top: 3rem; padding: 2rem; background: var(--moss); border-radius: var(--radius); display: grid; gap: 1.25rem; justify-items: start; }
.board-cta-text { font: 500 clamp(1.3rem, 2.6vw, 1.8rem)/1.3 var(--serif); font-variation-settings: "opsz" 48; max-width: 34ch; }
.colophon { margin-top: 2.5rem; font-size: 1rem; opacity: 0.85; }

/* ---------- Sticky bar (phones) ---------- */
.sticky-cta {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: flex-end;
  padding: 0 var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  pointer-events: none;
}
.sticky-cta .btn { pointer-events: auto; background: var(--plum); color: var(--ivory); border-color: var(--ivory); }

/* ---------- Wider screens ---------- */
@media (min-width: 48rem) {
  .edition-nav { display: flex; }
  .topbar .btn { display: inline-block; }
  .edition-nav ul { gap: 0.4rem 1.8rem; }
  .class-grid { grid-template-columns: 1.4fr 1fr; }
  .board-grid { grid-template-columns: repeat(3, 1fr); }
  .board-cta { grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
}
@media (min-width: 64rem) {
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }
  .hero-grid { grid-template-columns: 1.5fr 1fr; gap: 4rem; }
  .headline-grid { grid-template-columns: 1.25fr 1fr; align-items: start; }
  .story-wide { grid-row: span 2; }
  .story-strip { grid-column: 1 / -1; }
  .work-grid { grid-template-columns: 1.6fr 1fr; gap: 5rem; }
  .doctor-grid { grid-template-columns: 1fr 1.4fr; gap: 5rem; }
}

/* ---------- Dark theme: follows the phone or computer setting ---------- */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --line-main: var(--plum-light); }
  body { background: var(--forest); color: var(--ivory); }
  .topbar, .nameplate { border-color: var(--plum-light); }
  .site-name, .hero h1, .nameplate h2, .lead h3, .note-page h1, .questions li, .note-body .kicker, .tagline { color: var(--ivory); }
  .script, .section-name, .note-body h2, .class-block h3, .more-notes h2 { color: var(--plum-light); }
  .pull { border-left-color: var(--plum-light); }
  .btn-plum, .sticky-cta .btn { background: var(--plum-light); color: var(--forest); border-color: var(--plum-light); }
  .btn-plum:hover { background: var(--ivory); }
  .btn-ghost { color: var(--plum-light); }
  .btn-ghost:hover, .story:hover .btn-ghost { background: var(--plum-light); color: var(--forest); border-color: var(--plum-light); }
  .edition-nav li a:hover { border-bottom-color: var(--plum-light); }
  .skip { background: var(--plum-light); color: var(--forest); }
  :focus-visible { outline-color: var(--plum-light); }
  .lead-art, .class-block, .more-notes { background: var(--moss); }
  .aviso { border-top-color: rgba(244, 240, 235, 0.3); }
  .board { background: #0F1B15; }
}

/* ---------- Motion: one moment on load ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
  .write {
    clip-path: inset(-0.3em 100% -0.4em 0);
    animation: write 1.5s 0.5s cubic-bezier(0.55, 0.1, 0.25, 1) forwards;
  }
  @keyframes write { to { clip-path: inset(-0.3em -0.2em -0.4em 0); } }
}

@media (min-width: 48rem) {
  .doctor-grid, .work-grid { align-items: start; }
  .doctor .photo, .work-photos { position: sticky; top: 5.5rem; }
}
