/* ==========================================================================
   Dr. Rodrigo Guridi · estilos del sitio
   Colores y tipografías se cambian aquí arriba, en un solo lugar.
   ========================================================================== */

:root {
  --verde: #034547;          /* principal */
  --verde-oscuro: #022e30;
  --verde-tarjeta: #0B5254;  /* tarjetas sobre fondo verde */
  --dorado: #E6CE84;         /* acento sobre fondos oscuros */
  --dorado-texto: #8A6D1F;   /* textos pequeños dorados sobre crema (AA) */
  --crema: #FBF8EF;          /* fondo general */
  --crema-oscuro: #F3EEDD;   /* secciones alternas */
  --linea: #E7DFC6;
  --texto: #1F2A2A;
  --texto-suave: #3B4646;
  --texto-tenue: #4E5959;
  --texto-claro: #D9E4E1;    /* texto secundario sobre verde */
  --blanco: #FFFFFF;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;

  --ancho: 1240px;
  --margen: clamp(16px, 4vw, 32px);
  --radio: 24px;
  --radio-grande: 32px;
  --transicion: 200ms ease;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--texto);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--verde); text-underline-offset: 3px; }
a:hover { color: var(--verde-oscuro); }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; border-radius: 6px; }
.fondo-verde :focus-visible, .cta :focus-visible { outline-color: var(--dorado); }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; }
p { margin: 0; }
ul, ol { margin: 0; }

.saltar {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--verde); color: var(--blanco); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.saltar:focus { top: 12px; color: var(--blanco); }

.contenedor { max-width: var(--ancho); margin: 0 auto; padding-left: var(--margen); padding-right: var(--margen); }
.seccion { padding-top: clamp(64px, 9vw, 104px); padding-bottom: clamp(64px, 9vw, 104px); }
.fondo-alterno { background: var(--crema-oscuro); --dorado-texto: #7A5F17; } /* más oscuro para mantener contraste AA */
.fondo-verde { background: var(--verde); color: var(--crema); }

/* ---------- Tipografía ---------- */
.antetitulo {
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: var(--dorado-texto);
}
.fondo-verde .antetitulo, .cta .antetitulo { color: var(--dorado); }
.titulo-1 {
  font-family: var(--serif); font-weight: 500; color: var(--verde);
  font-size: clamp(42px, 5.4vw, 76px); line-height: 1.04; letter-spacing: -0.005em;
}
.titulo-2 {
  font-family: var(--serif); font-weight: 500; color: var(--verde);
  font-size: clamp(34px, 4vw, 54px); line-height: 1.08;
}
.fondo-verde .titulo-2, .cta .titulo-2 { color: var(--crema); }
.titulo-3 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.bajada { font-size: 19px; line-height: 1.6; color: var(--texto-suave); max-width: 560px; }
.encabezado-seccion { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.encabezado-fila {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
}

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 14px 28px; border-radius: 999px;
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; text-align: center; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color var(--transicion), color var(--transicion), border-color var(--transicion);
}
.boton-principal { background: var(--verde); color: var(--blanco); }
.boton-principal:hover { background: var(--verde-oscuro); color: var(--blanco); }
.boton-borde { color: var(--verde); border-color: var(--verde); background: transparent; }
.boton-borde:hover { background: var(--verde); color: var(--blanco); }
.boton-dorado { background: var(--dorado); color: #023335; font-weight: 700; }
.boton-dorado:hover { background: #F0DCA0; color: #023335; }
.boton svg { width: 20px; height: 20px; flex: none; }
.grupo-botones { display: flex; flex-wrap: wrap; gap: 14px; }

.enlace-flecha {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--verde);
}
.enlace-flecha::after { content: "→"; margin-left: 8px; transition: transform var(--transicion); }
.enlace-flecha:hover::after { transform: translateX(3px); }
.fondo-verde .enlace-flecha { color: var(--dorado); }

/* ---------- Encabezado ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 239, 0.96);
  border-bottom: 1px solid var(--linea);
}
@supports (backdrop-filter: blur(8px)) {
  .cabecera { background: rgba(251, 248, 239, 0.88); backdrop-filter: blur(8px); }
}
.cabecera-interior {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 80px; padding-top: 12px; padding-bottom: 12px;
}
.logo { display: block; flex: none; }
.logo img { height: 48px; width: auto; }
.menu ul { list-style: none; padding: 0; display: flex; align-items: center; gap: 4px; }
.menu a:not(.boton) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--texto); font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 999px;
  transition: color var(--transicion);
}
.menu a:not(.boton):hover { color: var(--verde); }
.menu a[aria-current="page"] { color: var(--verde); font-weight: 700; }
.menu .boton { margin-left: 12px; min-height: 44px; padding: 12px 22px; font-size: 15px; }
.boton-menu { display: none; }

@media (max-width: 960px) {
  .logo img { height: 40px; }
  .cabecera-interior { min-height: 68px; }
  .js .boton-menu {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-width: 48px; min-height: 48px; padding: 0 14px;
    background: transparent; border: 1.5px solid var(--linea); border-radius: 999px;
    color: var(--verde); font: 600 15px var(--sans); cursor: pointer;
  }
  .boton-menu .barras { position: relative; width: 18px; height: 2px; background: currentColor; transition: background-color var(--transicion); }
  .boton-menu .barras::before, .boton-menu .barras::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
    transition: transform var(--transicion);
  }
  .boton-menu .barras::before { top: -6px; }
  .boton-menu .barras::after { top: 6px; }
  .boton-menu[aria-expanded="true"] .barras { background: transparent; }
  .boton-menu[aria-expanded="true"] .barras::before { transform: translateY(6px) rotate(45deg); }
  .boton-menu[aria-expanded="true"] .barras::after { transform: translateY(-6px) rotate(-45deg); }

  /* Sin JavaScript el menú queda visible debajo del logo */
  .cabecera-interior { flex-wrap: wrap; }
  .menu { width: 100%; }
  .menu ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 16px; }
  .menu a:not(.boton) { width: 100%; padding: 0 4px; font-size: 17px; min-height: 52px; border-bottom: 1px solid var(--linea); border-radius: 0; }
  .menu .boton { margin: 16px 0 0; width: 100%; min-height: 52px; font-size: 16px; }
  .js .menu { display: none; }
  .js .menu.abierto { display: block; }
}

/* ---------- Portada: hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center;
  gap: clamp(32px, 5vw, 64px);
  padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(64px, 8vw, 96px);
}
.hero-texto { display: flex; flex-direction: column; gap: 24px; }
.hero-texto .grupo-botones { margin-top: 8px; }
.hero-imagen { position: relative; }
.hero-imagen img {
  width: 100%; aspect-ratio: 4 / 4.2; object-fit: cover; border-radius: 28px;
}
.sello {
  position: absolute; left: 24px; bottom: 24px;
  display: flex; align-items: center; gap: 14px;
  background: var(--blanco); border-radius: 18px; padding: 16px 22px;
  box-shadow: 0 12px 32px rgba(3, 69, 71, 0.14);
}
.sello strong { font-family: var(--serif); font-size: 44px; line-height: 1; font-weight: 600; color: var(--verde); }
.sello span { font-size: 14px; line-height: 1.35; color: var(--texto-suave); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-imagen img { aspect-ratio: 4 / 3.4; }
  .sello { left: 16px; bottom: 16px; padding: 12px 18px; }
  .sello strong { font-size: 36px; }
}
@media (max-width: 480px) {
  .hero-texto .boton { width: 100%; }
}

/* ---------- Tarjetas de líneas de servicio ---------- */
.lineas { display: flex; flex-direction: column; gap: 48px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .rejilla-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rejilla-3 { grid-template-columns: 1fr; } }

.tarjeta-linea {
  background: var(--verde-tarjeta); border-radius: var(--radio); overflow: hidden;
  display: flex; flex-direction: column;
}
.tarjeta-linea img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.tarjeta-linea-cuerpo { padding: 28px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.tarjeta-linea p { font-size: 15px; line-height: 1.6; color: var(--texto-claro); }
.tarjeta-linea .enlace-flecha { margin-top: auto; }

/* ---------- El doctor ---------- */
.doctor {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 72px); align-items: center;
}
.doctor-foto img {
  width: 100%; max-width: 460px; aspect-ratio: 460 / 580; object-fit: cover; object-position: top;
  border-radius: 28px;
}
.doctor-texto { display: flex; flex-direction: column; gap: 22px; }
.doctor-texto > p { font-size: 17px; line-height: 1.7; color: var(--texto-suave); }
.trayectoria { list-style: none; padding: 0; margin-top: 8px; border-top: 1px solid var(--linea); }
.trayectoria li { display: flex; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--linea); }
.trayectoria .anio { flex: 0 0 104px; font-weight: 700; color: var(--verde); }
.trayectoria .hito { font-size: 15px; line-height: 1.55; }
@media (max-width: 860px) {
  .doctor { grid-template-columns: 1fr; }
  .doctor-foto img { max-width: 100%; aspect-ratio: 4 / 4.4; }
}
@media (max-width: 480px) {
  .trayectoria li { flex-direction: column; gap: 4px; }
  .trayectoria .anio { flex-basis: auto; }
}

/* ---------- Tarjetas del blog ---------- */
.tarjetas-blog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .tarjetas-blog { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tarjetas-blog { grid-template-columns: 1fr; } }
.tarjeta-blog {
  display: flex; flex-direction: column; background: var(--blanco); border-radius: 20px; overflow: hidden;
  color: var(--texto); text-decoration: none;
  box-shadow: 0 1px 0 rgba(3, 69, 71, 0.04);
  transition: box-shadow var(--transicion), transform var(--transicion);
}
.tarjeta-blog:hover { color: var(--texto); box-shadow: 0 14px 34px rgba(3, 69, 71, 0.12); transform: translateY(-2px); }
.tarjeta-blog img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.tarjeta-blog-cuerpo { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.meta { font-size: 13px; font-weight: 600; color: var(--dorado-texto); }
.tarjeta-blog h3 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.tarjeta-blog .extracto { font-size: 15px; line-height: 1.6; color: var(--texto-tenue); }
.fondo-alterno .tarjetas-blog { margin-top: 40px; }

/* ---------- Bloque de contacto (CTA) ---------- */
.cta {
  background: var(--verde); color: var(--crema); border-radius: var(--radio-grande);
  padding: clamp(32px, 5vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px 48px; align-items: center;
}
.cta-texto { display: flex; flex-direction: column; gap: 16px; }
.cta-texto p { font-size: 17px; line-height: 1.6; color: var(--texto-claro); }
.cta-acciones { display: flex; flex-direction: column; gap: 18px; }
.cta-acciones .boton { width: 100%; min-height: 56px; }
.cta-datos { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.55; color: var(--texto-claro); font-style: normal; }
.cta-datos strong { color: var(--crema); }
.cta-datos a { color: var(--crema); }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } }

/* ---------- Pie de página ---------- */
.pie { border-top: 1px solid var(--linea); }
.pie-interior {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  padding-top: 24px; padding-bottom: 24px; font-size: 14px; color: var(--texto-tenue);
}
.pie ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.pie a { color: var(--texto-tenue); display: inline-flex; align-items: center; min-height: 44px; }
.pie a:hover { color: var(--verde); }

/* ---------- Páginas interiores ---------- */
.cabecera-pagina { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(32px, 5vw, 56px); }
.cabecera-pagina .encabezado-seccion { max-width: 820px; gap: 18px; }
.migas { font-size: 14px; color: var(--texto-tenue); }
.migas ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.migas li + li::before { content: "/"; margin-right: 6px; color: var(--linea); }
.migas a { color: var(--texto-tenue); }

/* Índice de anclas */
.indice { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.indice a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  background: var(--blanco); border: 1px solid var(--linea); color: var(--verde);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background-color var(--transicion), color var(--transicion), border-color var(--transicion);
}
.indice a:hover { background: var(--verde); border-color: var(--verde); color: var(--blanco); }
.indice-titulo { font-size: 14px; font-weight: 700; color: var(--texto-tenue); margin-bottom: 12px; }
.bloque-indice + .bloque-indice { margin-top: 24px; }

/* Tratamiento: texto + imagen */
.tratamiento {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 5vw, 64px); align-items: start;
  padding-top: clamp(48px, 6vw, 72px); padding-bottom: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--linea);
  scroll-margin-top: 96px;
}
.tratamiento:nth-of-type(even) .tratamiento-imagen { order: -1; }
.tratamiento-imagen img { width: 100%; border-radius: var(--radio); object-fit: cover; }
.tratamiento-imagen { position: sticky; top: 112px; }
.tratamiento-texto { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 860px) {
  .tratamiento { grid-template-columns: 1fr; }
  .tratamiento:nth-of-type(even) .tratamiento-imagen { order: 0; }
  .tratamiento-imagen { position: static; }
}
[id] { scroll-margin-top: 96px; }

/* Texto largo (artículos, legales, tratamientos) */
.prosa { font-size: 17px; line-height: 1.75; color: var(--texto); }
.prosa > * + * { margin-top: 1.1em; }
.prosa h2 { font-family: var(--serif); font-weight: 500; color: var(--verde); font-size: clamp(30px, 3.4vw, 40px); margin-top: 1.6em; }
.prosa h3 { font-size: 20px; font-weight: 700; color: var(--verde); margin-top: 1.8em; line-height: 1.3; }
.prosa h4 { font-size: 17px; font-weight: 700; margin-top: 1.5em; }
.prosa ul, .prosa ol { padding-left: 1.3em; }
.prosa li + li { margin-top: 0.4em; }
.prosa li::marker { color: var(--dorado-texto); }
.prosa strong { font-weight: 700; }
.prosa > :first-child { margin-top: 0; }
.ancho-lectura { max-width: 760px; }

.destacado {
  background: var(--blanco); border-radius: var(--radio); padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--linea);
}

/* Preguntas frecuentes */
.faq-grupo + .faq-grupo { margin-top: 48px; }
.faq-grupo > h2 { margin-bottom: 20px; }
.faq { border-top: 1px solid var(--linea); }
.faq details { border-bottom: 1px solid var(--linea); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  min-height: 64px; padding: 16px 0; font-size: 18px; font-weight: 600; color: var(--verde);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--linea);
  font-size: 22px; font-weight: 400; line-height: 1; transition: transform var(--transicion);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .respuesta { padding: 0 52px 24px 0; color: var(--texto-suave); }
.faq .respuesta p + p { margin-top: 0.8em; }
@media (max-width: 640px) { .faq .respuesta { padding-right: 0; } .faq summary { font-size: 17px; } }

/* Contacto */
.contacto-rejilla { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 56px); align-items: stretch; }
.contacto-datos { display: flex; flex-direction: column; gap: 28px; }
.dato h2 { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; color: var(--dorado-texto); margin-bottom: 8px; font-family: var(--sans); }
.dato p, .dato address { font-style: normal; font-size: 18px; line-height: 1.6; }
.mapa { border-radius: var(--radio); overflow: hidden; min-height: 380px; background: var(--crema-oscuro); }
.mapa iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: 0; }
@media (max-width: 860px) { .contacto-rejilla { grid-template-columns: 1fr; } }

/* Artículo del blog */
.articulo-cabecera { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.articulo-cabecera .titulo-1 { font-size: clamp(38px, 4.6vw, 62px); }
.articulo-imagen img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--radio-grande); }
.articulo-cuerpo { margin-top: clamp(40px, 5vw, 64px); }
.etiquetas { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--texto-tenue); }
.etiquetas .meta { font-size: 14px; }

/* Página 404 */
.error { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.error .grupo-botones { justify-content: center; }

/* Marcador de dato pendiente */
.por-confirmar { background: #FFF1B8; color: #5C4600; padding: 0 6px; border-radius: 4px; font-weight: 600; }

.solo-lectores {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
