/* Clínica Dental Rodríguez Garbín
   Paleta: el azul cobalto del logo y de las paredes del gabinete.
   Tipografía: Newsreader (titulares) + Atkinson Hyperlegible Next (texto),
   elegida por su legibilidad para pacientes de todas las edades. */

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("../assets/fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --cobalt: #1e44b0;
  --cobalt-deep: #132f80;
  --cobalt-night: #0d2160;
  --ink: #14203b;
  --muted: #4b5873;
  --wall: #eaf0fb;
  --paper: #ffffff;
  --line: #d4ddee;
  --ok: #1b7a4d;
  --closed: #a33a2c;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Atkinson", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-small: 0.9375rem;
  --fs-body: 1.125rem;
  --fs-lead: clamp(1.1875rem, 0.6vw + 1rem, 1.375rem);
  --fs-h3: 1.4375rem;
  --fs-h2: clamp(2rem, 2.2vw + 1.2rem, 2.875rem);
  --fs-h1: clamp(2.625rem, 4.4vw + 1rem, 4.75rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 76rem;
  --radius: 6px;
  --header-h: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cobalt); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: 0; }
p { margin: 0 0 1em; max-width: 68ch; }
ul { padding-left: 1.2em; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  min-height: 3rem; padding: 0.7rem 1.35rem;
  border-radius: var(--radius); border: 2px solid transparent;
  font: 600 1.0625rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-solid { background: var(--cobalt); color: #fff; }
.btn-solid:hover { background: var(--cobalt-deep); }
.btn-white { background: #fff; color: var(--cobalt-deep); }
.btn-white:hover { background: var(--wall); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-line { border-color: var(--line); color: var(--cobalt-deep); background: #fff; }
.btn-line:hover { border-color: var(--cobalt); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand img { width: 2.5rem; height: 2.5rem; }
.brand-name {
  font-family: var(--serif); font-size: 1.3125rem; font-weight: 600;
  line-height: 1.05; letter-spacing: -0.01em;
}
.brand-name small {
  display: block; font-family: var(--sans); font-size: 0.8125rem;
  font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 0.2rem;
}
.nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500;
  padding-block: 0.4rem; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--cobalt); }
.header-call { min-height: 2.75rem; padding: 0.5rem 1.05rem; }
.menu-toggle { display: none; }

@media (max-width: 960px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.5rem;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li + li { border-top: 1px solid var(--line); }
  .nav a { display: block; padding: 1rem 0; font-size: 1.1875rem; border: 0; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; border: 1px solid var(--line);
    background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--ink);
  }
  .menu-toggle svg { width: 1.4rem; height: 1.4rem; }
}
@media (max-width: 560px) {
  .header-call span { display: none; }
  .header-call { padding: 0.5rem 0.8rem; }
  .brand-name { font-size: 1.125rem; }
  .brand-name small { display: none; }
  .brand img { width: 2.1rem; height: 2.1rem; }
  .site-header .wrap { gap: 0.6rem; }
}

/* ---------- Portada ---------- */
.hero {
  background: var(--cobalt-deep);
  color: #fff;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3rem, 7vw, 6.5rem);
}
.hero h1 { color: #fff; max-width: 14ch; }
.hero .lead { font-size: var(--fs-lead); color: #dfe7fb; max-width: 40ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2rem; font-size: var(--fs-small); color: #dfe7fb;
}
.status::before {
  content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%;
  background: #9fb1e0; flex: none;
}
.status.is-open::before { background: #5fe0a0; box-shadow: 0 0 0 4px rgba(95,224,160,.22); }
.status.is-closed::before { background: #ffb4a6; }

/* La foto del gabinete recortada con la cruz del logo */
.hero-cross {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 34rem;
  justify-self: end;
}
.hero-cross picture, .hero-cross img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-cross picture {
  clip-path: polygon(33.33% 0, 66.67% 0, 66.67% 33.33%, 100% 33.33%, 100% 66.67%, 66.67% 66.67%, 66.67% 100%, 33.33% 100%, 33.33% 66.67%, 0 66.67%, 0 33.33%, 33.33% 33.33%);
  display: block;
  animation: cross-in .9s cubic-bezier(.2,.7,.2,1) both;
}
.hero-cross figcaption {
  position: absolute; right: 0; bottom: 0;
  width: 33.33%; padding-left: 0.9rem;
  font-size: 0.8125rem; line-height: 1.35; color: #c9d5f5;
}
@keyframes cross-in {
  from { clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%); }
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-cross { max-width: 22rem; justify-self: center; grid-row: 1; }
  .hero-cross figcaption { display: none; }
}
@media (max-width: 560px) {
  .hero-cross { max-width: 11.5rem; }
  .hero .wrap { padding-block: 2rem 3rem; gap: 1.75rem; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Secciones ---------- */
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section-tint { background: var(--wall); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head p { color: var(--muted); font-size: var(--fs-lead); margin: 0; }

/* ---------- ¿Qué te trae? ---------- */
.finder {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.finder-list { list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--line); }
.finder-list li + li { border-top: 1px solid var(--line); }
.finder-list button {
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.5rem;
  background: #fff; border: 0; color: var(--ink);
  font: 500 1.1875rem/1.3 var(--sans);
  transition: background-color .15s;
}
.finder-list button::after {
  content: ""; width: 0.6rem; height: 0.6rem; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); opacity: .35;
}
.finder-list button:hover { background: var(--wall); }
.finder-list button[aria-selected="true"] {
  background: var(--cobalt); color: #fff;
}
.finder-list button[aria-selected="true"]::after { opacity: 1; }
.finder-panel { padding: clamp(1.5rem, 3vw, 2.75rem); }
.finder-panel[hidden] { display: none; }
.finder-panel h3 { font-size: 1.875rem; }
.finder-panel .who {
  font-size: var(--fs-small); color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.5rem;
}
.finder-panel .btn { margin-top: 0.5rem; }
.js .finder-panel { animation: panel-in .25s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

@media (max-width: 800px) {
  .finder { grid-template-columns: 1fr; }
  .finder-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .finder-list button { padding: 0.95rem 1.15rem; font-size: 1.0625rem; }
}

/* ---------- Tratamientos ---------- */
.treat-group {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  padding-block: 2.25rem;
  border-top: 1px solid var(--line);
}
.treat-group:last-child { border-bottom: 1px solid var(--line); }
.treat-group h3 { font-size: 1.75rem; margin: 0; }
.treat-group > div > p { color: var(--muted); font-size: var(--fs-small); margin-top: 0.6rem; }
.treat-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2.5rem;
}
.treat-list h4 {
  font-family: var(--sans); font-size: 1.125rem; font-weight: 700;
  margin: 0 0 0.3rem; line-height: 1.3;
}
.treat-list p { margin: 0; color: var(--muted); font-size: 1.03rem; }
@media (max-width: 860px) {
  .treat-group { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .treat-list { grid-template-columns: 1fr; }
}

/* ---------- La clínica ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.about-text p { font-size: var(--fs-lead); }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { padding: 1.1rem 0; border-top: 1px solid #c7d3ec; }
.facts div:last-child { border-bottom: 1px solid #c7d3ec; }
.facts dt { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--cobalt-deep); line-height: 1.2; }
.facts dd { margin: 0.2rem 0 0; color: var(--muted); font-size: 1.03rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Equipo ---------- */
.team {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 4px solid var(--cobalt);
}
.team > li { padding: 1.75rem 2rem 0.5rem 0; }
.team > li + li { padding-left: 2rem; border-left: 1px solid var(--line); }
.team h3 { margin-bottom: 0.9rem; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.9375rem; color: var(--ink); background: #fff;
}
@media (max-width: 860px) {
  .team { grid-template-columns: 1fr; }
  .team > li, .team > li + li { padding: 1.5rem 0; border-left: 0; }
  .team > li + li { border-top: 1px solid var(--line); }
}

/* ---------- Consejos ---------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.posts li { border-top: 1px solid var(--line); }
.posts a {
  display: block; padding: 1.4rem 0; text-decoration: none; color: var(--ink);
}
.posts a:hover h3 { color: var(--cobalt); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.posts h3 { font-size: 1.375rem; margin: 0 0 0.35rem; }
.posts p { margin: 0; color: var(--muted); font-size: 1rem; }
.posts-more { margin-top: 2rem; }
@media (max-width: 760px) { .posts { grid-template-columns: 1fr; } }

/* ---------- Contacto ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
}
.contact-data { margin: 0; }
.contact-data div { padding: 1rem 0; border-top: 1px solid var(--line); }
.contact-data dt { font-size: var(--fs-small); color: var(--muted); margin-bottom: 0.15rem; }
.contact-data dd { margin: 0; font-size: 1.1875rem; }
.contact-data dd a { color: var(--ink); }
.hours { border-collapse: collapse; width: 100%; font-size: 1.0625rem; }
.hours th, .hours td { text-align: left; padding: 0.3rem 0; font-weight: 400; }
.hours th { color: var(--muted); padding-right: 1rem; }
.map {
  position: relative; min-height: 26rem; height: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: var(--wall);
  display: grid; place-items: center; text-align: center;
  border: 1px solid var(--line);
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-inner { padding: 2rem; max-width: 28rem; }
.map-inner p { color: var(--muted); font-size: var(--fs-small); margin-inline: auto; }
.map-pin { width: 3rem; height: 3rem; margin: 0 auto 1rem; }
@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; }
  .map { min-height: 20rem; }
}

/* ---------- Pie ---------- */
.site-footer { background: var(--cobalt-night); color: #c9d5f5; padding-block: 3.5rem 2rem; font-size: var(--fs-small); }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-brand { display: flex; gap: 0.9rem; align-items: flex-start; }
.footer-brand img { width: 2.75rem; height: 2.75rem; background: #fff; padding: 2px; }
.footer-brand strong { display: block; font-family: var(--serif); font-size: 1.375rem; font-weight: 500; color: #fff; line-height: 1.15; margin-bottom: 0.35rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.site-footer h2 { font-family: var(--sans); font-size: var(--fs-small); font-weight: 700; color: #fff; margin-bottom: 0.75rem; letter-spacing: 0; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-bottom p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Barra fija de llamada en móvil */
.call-bar { display: none; }
@media (max-width: 560px) {
  .call-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  }
  .call-bar .btn { flex: 1; justify-content: center; }
  body.has-call-bar { padding-bottom: 4.5rem; }
}

/* ---------- Páginas interiores (consejos, legales) ---------- */
.page-head { background: var(--wall); padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2.25rem, 3.5vw + 1rem, 3.75rem); max-width: 20ch; }
.page-head .meta { color: var(--muted); margin: 0; }
.crumbs { font-size: var(--fs-small); margin-bottom: 1.5rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.prose { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem); }
.prose > * { max-width: 42rem; }
.prose p, .prose li { font-size: 1.1875rem; line-height: 1.7; }
.prose h2 { font-size: 1.75rem; margin-top: 2.25rem; }
.prose ul { margin: 0 0 1.25em; }
.prose li { margin-bottom: 0.35em; }
.prose table { border-collapse: collapse; margin-bottom: 1.5rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 1.25rem 0.55rem 0; border-top: 1px solid var(--line); font-size: 1.0625rem; }
.prose th { font-weight: 700; white-space: nowrap; }
.cta-box {
  margin-top: 3rem; padding: 1.75rem 2rem; max-width: 42rem;
  background: var(--cobalt); color: #fff; border-radius: var(--radius);
}
.cta-box h2 { color: #fff; margin-top: 0; font-size: 1.625rem; }
.cta-box p { color: #dfe7fb; font-size: 1.0625rem; }
.cta-box .hero-actions { margin-top: 1.25rem; }
