/* Laboratorios MABAD · hoja de estilos
   Tipografías: Source Serif 4 (titulares) + IBM Plex Sans (texto).
   Autoalojadas en /assets/fonts (ver LEEME.md). Si no están, se usan las alternativas del sistema. */

@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/SourceSerif4-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/SourceSerif4-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --white: #ffffff;
  --blue: #57bde5;        /* azul del logotipo: rellenos y acentos, nunca texto sobre blanco */
  --blue-deep: #0f6e95;   /* azul de texto, enlaces y botones (5,7:1 sobre blanco) */
  --blue-ink: #0b5f82;
  --ink: #12313f;
  --text: #3e5560;
  --muted: #5e6b73;
  --mist: #eef7fb;
  --line: #d5e8f0;
  --gray-logo: #a6a6a6;
  --pending: #fff3bf;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 4.2vw + 1rem, 3.5rem);

  --wrap: 72rem;
  --measure: 40rem;
  --radius: 6px;
  --header-h: 4.75rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.3; }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--blue-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-ink); text-decoration-thickness: 2px; }
strong { color: var(--ink); font-weight: 600; }
sup { font-size: 0.6em; line-height: 0; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 100; border-radius: var(--radius); }
.skip:focus { top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Marcador de contenido pendiente: visible a propósito para que no llegue a producción */
.pendiente { background: var(--pending); color: #6b5200; padding: 0 0.25em; border-radius: 3px; font-weight: 500; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: var(--header-h); }
.brand img { width: 150px; }
.nav-toggle { display: none; }
.site-nav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; align-items: center; }
.site-nav a { display: block; padding: 0.5rem 0.75rem; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.97rem; border-radius: var(--radius); }
.site-nav a:hover { background: var(--mist); color: var(--blue-ink); }
.site-nav a[aria-current="page"] { color: var(--blue-deep); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.site-nav .nav-phone { margin-left: 0.5rem; background: var(--blue-deep); color: #fff; }
.site-nav .nav-phone:hover { background: var(--blue-ink); color: #fff; }

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: none; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0.5rem 0.8rem; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink); }
  .site-nav { position: absolute; inset: var(--header-h) 0 auto 0; background: #fff; border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 0.75rem 1.25rem 1.25rem; }
  .site-nav a { padding: 0.8rem 0.5rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--blue); padding-left: 0.9rem; }
  .site-nav .nav-phone { margin: 0.5rem 0 0; text-align: center; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block; padding: 0.8rem 1.35rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; text-decoration: none; line-height: 1.2;
  border: 2px solid var(--blue-deep); cursor: pointer; font-family: var(--sans);
}
.btn-primary { background: var(--blue-deep); color: #fff; }
.btn-primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.btn-secondary { background: transparent; color: var(--blue-deep); }
.btn-secondary:hover { background: var(--mist); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-mist { background: var(--mist); }
.lede { font-size: var(--step-1); color: var(--ink); line-height: 1.5; }
.kicker { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.75rem; font-weight: 500; }

/* ---------- Portada: hero con gota ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { max-width: 14ch; }
.hero .since { font-family: var(--serif); font-size: var(--step-1); color: var(--blue-deep); margin-bottom: 1.25rem; }
.drop { position: relative; width: min(100%, 26rem); margin-inline: auto; aspect-ratio: 4 / 5; }
.drop::before {
  content: ""; position: absolute; inset: 6% -8% -4% 10%;
  background: var(--blue); -webkit-clip-path: url(#drop-shape); clip-path: url(#drop-shape); opacity: 0.22;
}
.drop picture, .drop img { position: absolute; inset: 0; width: 100%; height: 100%; }
.drop img { object-fit: cover; object-position: 50% 30%; -webkit-clip-path: url(#drop-shape); clip-path: url(#drop-shape); }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
  .drop { width: min(78%, 20rem); order: -1; }
}

/* ---------- Bloque de la directora ---------- */
.founder { display: grid; grid-template-columns: 15rem 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.founder img { border-radius: 50%; width: 15rem; aspect-ratio: 1; object-fit: cover; border: 6px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.founder blockquote { margin: 0; }
.founder blockquote p { font-family: var(--serif); font-size: var(--step-2); line-height: 1.4; color: var(--ink); max-width: 34ch; }
.founder figcaption { margin-top: 1rem; font-weight: 600; color: var(--ink); }
.founder figcaption span { display: block; font-weight: 400; color: var(--muted); font-size: var(--step--1); }
@media (max-width: 720px) {
  .founder { grid-template-columns: 1fr; }
  .founder img { width: 9rem; }
}

/* ---------- Dos columnas genéricas ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split-media img { border-radius: var(--radius); width: 100%; }
.split-media .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.facts { list-style: none; padding: 0; margin: 1.5rem 0 0; border-top: 1px solid var(--line); }
.facts li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); max-width: var(--measure); }
.facts strong { display: block; }

/* ---------- Índice de especialidades (portada) ---------- */
.specialty-index { columns: 3 14rem; column-gap: 2.5rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.specialty-index li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.specialty-index a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; text-decoration: none; color: var(--ink); font-weight: 500; }
.specialty-index a:hover { color: var(--blue-deep); }
.specialty-index small { color: var(--muted); font-weight: 400; }

/* ---------- Cabecera de página interior ---------- */
.page-head { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--mist), var(--white)); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 1rem; font-size: var(--step--1); color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--gray-logo); }
.page-head .lede { max-width: 42rem; }

/* ---------- Texto largo ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; font-size: var(--step-2); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.2rem; max-width: var(--measure); }
.prose li { margin-bottom: 0.4rem; }
.callout { border-left: 4px solid var(--blue); background: var(--mist); padding: 1.1rem 1.25rem; margin: 1.75rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.callout p:last-child { margin-bottom: 0; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.article-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: 1.25rem; }
.article-aside img { border-radius: var(--radius); }
.aside-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.aside-box p { font-size: var(--step--1); }
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
}

/* ---------- Aplicaciones ---------- */
.apps-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.apps-nav { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.apps-nav ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.apps-nav a { display: block; padding: 0.35rem 0 0.35rem 1rem; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--text); font-size: 0.95rem; }
.apps-nav a:hover { color: var(--blue-deep); border-left-color: var(--blue); }
.specialty { padding-block: 2rem; border-bottom: 1px solid var(--line); }
.specialty:first-child { padding-top: 0; }
.specialty h2 { font-size: var(--step-2); }
.specialty ul { columns: 2 15rem; column-gap: 2.5rem; padding-left: 1.1rem; margin: 0; }
.specialty li { break-inside: avoid; margin-bottom: 0.35rem; }
.specialty li::marker { color: var(--blue); }
@media (max-width: 860px) {
  .apps-layout { grid-template-columns: 1fr; }
  .apps-nav { position: static; }
  .apps-nav ul { columns: 2; border-left: 0; }
  .apps-nav a { padding-left: 0; border-left: 0; margin-left: 0; }
}

/* ---------- Publicaciones: registro cronológico ---------- */
.pub-group + .pub-group { margin-top: clamp(3rem, 6vw, 4.5rem); }
.pub-group > h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.6rem; }
.pub-group > h2 small { font-family: var(--sans); font-size: var(--step--1); font-weight: 500; color: var(--muted); }
.pub-year { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.pub-year > h3 { font-size: var(--step-3); color: var(--blue-deep); margin: 0; line-height: 1; font-variant-numeric: lining-nums; }
.pub-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.pub-list li { max-width: 48rem; }
.pub-title { display: block; color: var(--ink); font-weight: 500; line-height: 1.45; }
.pub-meta { display: block; font-size: var(--step--1); color: var(--muted); margin-top: 0.2rem; }
@media (max-width: 640px) { .pub-year { grid-template-columns: 1fr; gap: 0.6rem; } }

/* ---------- Protocolo: pasos ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: paso; display: grid; gap: 0; }
.steps > li { counter-increment: paso; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1.25rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
.steps > li::before {
  content: counter(paso); font-family: var(--serif); font-weight: 600; font-size: 1.5rem; color: var(--blue-deep);
  width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--blue);
}
.steps h2 { font-size: var(--step-1); margin-bottom: 0.35rem; }
.steps ul { padding-left: 1.1rem; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-data { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.contact-data li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.contact-data li > span:first-child { display: block; font-size: var(--step--1); color: var(--muted); }
.contact-data a, .contact-data address { font-style: normal; font-weight: 500; color: var(--ink); }

.form { display: grid; gap: 1.1rem; }
.field label { display: block; font-weight: 500; color: var(--ink); margin-bottom: 0.35rem; }
.field .hint { font-size: var(--step--1); color: var(--muted); margin: 0.3rem 0 0; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #b9d3de; border-radius: var(--radius); padding: 0.75rem 0.85rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue-deep); }
.field [aria-invalid="true"] { border-color: #b3261e; }
.field .error { color: #b3261e; font-size: var(--step--1); margin: 0.3rem 0 0; }
.field-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; font-size: 0.95rem; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--blue-deep); }
.form-status { padding: 0.9rem 1rem; border-radius: var(--radius); font-weight: 500; }
.form-status[data-state="ok"] { background: #e6f4ea; color: #1e5b32; }
.form-status[data-state="error"] { background: #fdecea; color: #8a1f17; }
.form button[disabled] { opacity: 0.6; cursor: progress; }

.rgpd-first-layer { font-size: 0.85rem; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.rgpd-first-layer table { border-collapse: collapse; width: 100%; min-width: 30rem; }
.rgpd-first-layer th, .rgpd-first-layer td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.rgpd-first-layer th { color: var(--ink); font-weight: 600; width: 9rem; }
.rgpd-first-layer tr:last-child > * { border-bottom: 0; }

/* Mapa con bloqueo previo al consentimiento */
.map { position: relative; aspect-ratio: 16 / 9; min-height: 18rem; border-radius: var(--radius); overflow: hidden; background: var(--mist); border: 1px solid var(--line); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1.5rem; gap: 0.75rem; }
.map-placeholder[hidden] { display: none; }
.map-placeholder p { margin-inline: auto; max-width: 32rem; font-size: 0.95rem; }

/* ---------- Franja de contacto ---------- */
.cta-band { background: var(--blue-deep); color: #fff; }
.cta-band .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.cta-band h2 { color: #fff; margin: 0 0 0.3rem; font-size: var(--step-2); }
.cta-band p { margin: 0; color: #dff2fa; }
.cta-band .btn { background: #fff; color: var(--blue-ink); border-color: #fff; }
.cta-band .btn:hover { background: var(--mist); }
.cta-band .btn-secondary { background: transparent; color: #fff; }
.cta-band .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: #c9dbe3; font-size: 0.95rem; padding-top: 3.5rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-grid h2 { font-family: var(--sans); font-size: 1rem; color: #fff; margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.footer-grid address { font-style: normal; }
.footer-logo { width: 140px; margin-bottom: 1rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-block: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: var(--step--1); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: #fff; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.site-footer .pendiente { color: #6b5200; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- reCAPTCHA ---------- */
/* El sello flotante se oculta porque el aviso legal de Google se muestra junto al botón de envío, como permite Google */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-legal { font-size: 0.8rem; color: var(--muted); margin: 0; }
#recaptcha-field[hidden] { display: none; }

/* ---------- Tabla de cookies de CookieYes ---------- */
.cky-audit-table-element { margin: 1.25rem 0 1.75rem; overflow-x: auto; }

/* ---------- Tablas legales ---------- */
.table-scroll { overflow-x: auto; margin: 1.25rem 0 1.75rem; border: 1px solid var(--line); border-radius: var(--radius); }
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 38rem; font-size: 0.93rem; }
.table-scroll th, .table-scroll td { text-align: left; vertical-align: top; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); }
.table-scroll thead th { background: var(--mist); color: var(--ink); }
.table-scroll tr:last-child td { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .site-header, .cta-band, .site-footer, .map { display: none !important; } }
