/* ==========================================================================
   María Cecilia Perrín de Buide — hoja de estilos compartida (es/ it/ en/)
   Paleta de alto contraste (WCAG AA/AAA):
   - Fondo claro crema  #FBF8F2  / texto tinta azul #16213A  (≈15:1)
   - Azul profundo      #0E2A4F  (cabecera, pie, secciones oscuras) / texto #FFFFFF (≈14:1)
   - Dorado oscuro      #8A5A00  (enlaces sobre claro, ≈5.9:1)
   - Dorado claro       #F3C64B  (acentos sobre azul, ≈9:1)
   ========================================================================== */

:root {
  --bg: #FBF8F2;
  --bg-alt: #F1EADC;
  --surface: #FFFFFF;
  --ink: #16213A;
  --ink-soft: #3A4660;
  --navy: #0E2A4F;
  --navy-2: #163C6B;
  --on-navy: #FFFFFF;
  --on-navy-soft: #D9E2EF;
  --gold: #8A5A00;
  --gold-hover: #6B4500;
  --gold-light: #F3C64B;
  --line: #DCD3C2;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(14, 42, 79, .10);
  --max: 1180px;
  --prose: 760px;
  --font-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-hover); }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; box-shadow: 0 0 0 5px var(--navy); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--navy); line-height: 1.2; font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--gold-light); color: var(--navy); padding: .6rem 1rem; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 1rem; top: 1rem; }
.center { text-align: center; }

/* ---------- Cabecera ---------- */
.site-header {
  background: var(--navy);
  color: var(--on-navy);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 3px solid var(--gold-light);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: .4rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.branding { min-width: 0; }
.site-title {
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 700;
  color: var(--on-navy); text-decoration: none; line-height: 1.15; display: inline-block;
}
.site-title:hover { color: var(--gold-light); }
.site-description { margin: .1rem 0 .3rem; font-style: italic; color: var(--on-navy-soft); font-size: 1rem; }
.lang-switch { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .9rem; }
.lang-switch a { color: var(--on-navy-soft); text-decoration: none; }
.lang-switch a:hover { color: var(--gold-light); text-decoration: underline; }
.lang-switch a[aria-current="true"] { color: var(--gold-light); font-weight: 700; }

.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav .menu > li { position: relative; }
.site-nav a {
  display: block; padding: .35rem .55rem; color: var(--on-navy); text-decoration: none;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; border-radius: 6px;
}
.site-nav a:hover, .site-nav a:focus-visible { background: var(--navy-2); color: var(--gold-light); }
.site-nav a[aria-current="page"] { color: var(--gold-light); box-shadow: inset 0 -2px 0 var(--gold-light); border-radius: 0; }
.has-sub > a::after { content: " ▾"; font-size: .75em; }
.sub-menu {
  list-style: none; margin: 0; padding: .4rem; min-width: 230px;
  position: absolute; top: 100%; left: 0; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); border-top: 3px solid var(--gold-light);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease;
}
.has-sub:hover > .sub-menu, .has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sub-menu a { color: var(--ink); font-weight: 600; }
.sub-menu a:hover, .sub-menu a:focus-visible { background: var(--bg-alt); color: var(--navy); }
.sub-menu a[aria-current="page"] { color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }

.nav-toggle { display: none; background: transparent; border: 2px solid var(--on-navy-soft); border-radius: 6px; padding: .5rem; cursor: pointer; }
.nav-toggle-bar { display: block; width: 24px; height: 2px; background: var(--on-navy); margin: 5px 0; }

/* ---------- Hero (inicio) ---------- */
.hero {
  position: relative; min-height: 62vh; display: grid; place-items: center; text-align: center;
  background: linear-gradient(rgba(14, 42, 79, .72), rgba(14, 42, 79, .82)), var(--hero-img) center 30% / cover no-repeat;
  color: var(--on-navy); padding: 5rem 1.25rem;
}
.hero-title { color: var(--on-navy); font-size: clamp(2.4rem, 6vw, 4.4rem); margin: 0 0 .6rem; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.hero-tagline { font-family: var(--font-head); font-style: italic; font-size: clamp(1.3rem, 3vw, 2rem); color: var(--gold-light); margin: 0; }

/* ---------- Secciones ---------- */
.section { padding: 4.5rem 1.25rem; max-width: var(--max); margin: 0 auto; }
.section-alt { max-width: none; background: var(--bg-alt); }
.section-alt > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-dark { max-width: none; background: var(--navy); color: var(--on-navy); }
.section-dark > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-kicker { margin: 0 0 .3rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .85rem; color: var(--gold); }
.section-title { margin: 0; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section-dark .section-kicker { color: var(--gold-light); }
.section-dark .section-title { color: var(--on-navy); }

/* Tarjetas de material */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.75rem; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.card-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s ease; }
.card-media:hover img { transform: scale(1.04); }
.card-media { overflow: hidden; display: block; }
.card-body { padding: 1.25rem 1.4rem 1.5rem; }
.card-title { margin: 0 0 .4rem; font-size: 1.6rem; text-transform: capitalize; }
.card-title a { color: var(--navy); text-decoration: none; }
.card-title a:hover { color: var(--gold); text-decoration: underline; }
.card-body p { margin: 0; color: var(--ink-soft); }

/* Etapas de la vida */
.stages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stage { position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); }
.stage img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .35s ease; }
.stage:hover img, .stage:focus-visible img { transform: scale(1.05); }
.stage-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(14, 42, 79, .95));
  color: var(--on-navy); font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; text-transform: capitalize;
}

.btn {
  display: inline-block; background: var(--navy); color: var(--on-navy); border: 2px solid var(--navy);
  padding: .8rem 1.8rem; border-radius: 999px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; font-family: var(--font-body); font-size: .95rem; cursor: pointer;
}
.btn:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--navy); }

/* Testimonios */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.75rem; }
.testimonial { margin: 0; background: var(--navy-2); border-radius: var(--radius); padding: 1.75rem; display: flex; flex-direction: column; justify-content: space-between; border-left: 4px solid var(--gold-light); }
.testimonial blockquote { margin: 0 0 1.5rem; }
.testimonial blockquote p { margin: 0; font-size: 1.05rem; color: var(--on-navy); font-style: italic; }
.testimonial figcaption { display: flex; align-items: center; gap: .9rem; }
.testimonial figcaption img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-light); }
.testimonial cite { display: block; font-style: normal; font-weight: 700; color: var(--gold-light); }
.testimonial .role { display: block; font-size: .92rem; color: var(--on-navy-soft); }

/* ---------- Páginas interiores ---------- */
.page-header { background: var(--navy); color: var(--on-navy); padding: 3rem 1.25rem 2.5rem; }
.page-header-inner { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.page-header h1 { color: var(--on-navy); margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: .02em; }
.breadcrumb { font-size: .95rem; color: var(--on-navy-soft); }
.breadcrumb a { color: var(--gold-light); }
.breadcrumb a:hover { color: var(--on-navy); }

.page-wrap { max-width: var(--max); margin: 0 auto; padding: 3rem 1.25rem 4.5rem; }
.page-wrap.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
.prose { max-width: var(--prose); margin: 0 auto; }
.with-sidebar .prose { margin: 0; max-width: none; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 { margin: 1.8em 0 .6em; }
.prose h2 { font-size: 2rem; } .prose h3 { font-size: 1.6rem; } .prose h4 { font-size: 1.35rem; }
.prose strong { color: var(--navy); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.15em; }
.prose figure { margin: 2rem 0; }
.prose img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 1.5rem auto; }
.prose figcaption { text-align: center; font-size: .95rem; color: var(--ink-soft); margin-top: .5rem; font-weight: 600; letter-spacing: .05em; }
.page-cover { margin: 0 0 2.5rem !important; }
.page-cover img { width: 100%; margin: 0; }
.prose blockquote {
  margin: 2rem 0; padding: 1.25rem 1.5rem; background: var(--surface);
  border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose cite { display: block; font-style: normal; color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose .faq-q { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.3; color: var(--navy); margin: 2.2rem 0 .6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.prose .faq-q:first-child { border-top: 0; padding-top: 0; }
.prose .faq-q strong { color: inherit; }
.prose a[href^="http"], .prose a[href^="mailto"] { font-weight: 600; word-break: break-word; }

.gallery { max-width: none; }
.gallery figure { margin: 0; }
.gallery img { margin: 0 0 1rem; width: 100%; }
@media (min-width: 700px) { .gallery { columns: 2; column-gap: 1rem; } .gallery figure, .gallery img { break-inside: avoid; } }
@media (min-width: 1000px) { .gallery { columns: 3; } }

.embed { position: relative; margin: 1.5rem 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.embed iframe { border: 0; width: 100%; display: block; }
.embed-map iframe { height: 420px; }
.embed-form iframe { height: 1700px; }

/* Barra lateral */
.sidebar .widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.widget-title { margin: 0 0 .8rem; font-size: 1.5rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li + li { border-top: 1px solid var(--line); }
.sidebar a { display: block; padding: .6rem 0; font-weight: 600; text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }

/* Formulario de contacto */
.contact-form { margin-top: 2rem; background: var(--surface); padding: 1.75rem; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.contact-form .field { margin: 0 0 1.2rem; }
.contact-form label { display: block; font-weight: 700; color: var(--navy); margin-bottom: .35rem; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: .75rem .9rem; font: inherit; color: var(--ink); background: var(--bg);
  border: 2px solid #8C96A8; border-radius: 8px;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--navy); outline: 3px solid var(--gold-light); outline-offset: 1px; }

/* ---------- Pie ---------- */
.site-footer { background: var(--navy); color: var(--on-navy-soft); border-top: 3px solid var(--gold-light); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 2.25rem 1.25rem; text-align: center; }
.footer-title { font-family: var(--font-head); font-size: 1.5rem; color: var(--on-navy); margin: 0; font-weight: 700; }
.footer-tagline { margin: .2rem 0 0; font-style: italic; color: var(--gold-light); }

.back-to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold-light); color: var(--navy);
  font-size: 1.4rem; font-weight: 700; text-decoration: none; box-shadow: var(--shadow); z-index: 40;
}
.back-to-top:hover { background: var(--navy); color: var(--gold-light); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { display: none; width: 100%; }
  .nav-open .site-nav { display: block; }
  .site-nav .menu { flex-direction: column; align-items: stretch; padding-bottom: .5rem; }
  .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: var(--navy-2); border-top: 0; margin: 0 0 .25rem .75rem; min-width: 0; }
  .sub-menu a { color: var(--on-navy); }
  .sub-menu a:hover, .sub-menu a:focus-visible { background: var(--navy); color: var(--gold-light); }
  .sub-menu a[aria-current="page"] { color: var(--gold-light); box-shadow: inset 3px 0 0 var(--gold-light); }
  .page-wrap.with-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .site-title { font-size: 1.3rem; }
  .section { padding: 3.25rem 1rem; }
  .page-header { padding: 2.25rem 1rem 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ── Language switch – animated pill buttons ──────────── */
.lang-switch {
  display: flex;
  gap: .35rem;
  align-items: center;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .6rem;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,.45);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  color: rgba(255,255,255,.75);
  background: transparent;
  transition: background .22s, color .22s, border-color .22s, transform .15s;
}
.lang-btn:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: #fff;
  transform: translateY(-1px);
}
.lang-btn.lang-active {
  background: #fff;
  color: #0E2A4F;
  border-color: #fff;
  pointer-events: none;
}
