/* ===================================================
   M300 — Estilos compartidos
   =================================================== */

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

:root {
  --black:      #111111;
  --warm-white: #f8f7f5;
  --off-white:  #f0ede8;
  --gray-dark:  #3a3832;
  --gray-mid:   #6b6860;
  --gray-light: #d5d2cc;
  --serif:      'Cormorant Garamond', Georgia, serif;
  --sans:       'Inter', system-ui, sans-serif;
  /* Semánticas */
  --footer-bg:   #353330;
  --color-error: #c0392b;
  --lh-body:     1.75;
}

@keyframes m300-fadein { from { opacity: 0; } to { opacity: 1; } }

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--black);
  background: #fff;
  font-size: 16px;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  animation: m300-fadein .45s ease-out both;
}

/* ===================================================
   NAV
   =================================================== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.nav-logo img { height: 22px; display: block; }
.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a {
  font-family: var(--sans); font-size: 12px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--black); text-decoration: none; transition: opacity .2s;
  display: inline-flex; align-items: center; padding: 15px 0; /* touch target >=44px */
}
.nav-links a:hover { opacity: .55; }
.nav-links a.active { opacity: 1; font-weight: 500; border-bottom: 1px solid var(--black); padding-bottom: 3px; }
.nav-cta {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--black); background: transparent;
  border: 1px solid var(--black); padding: 14px 22px; cursor: pointer; /* touch target >=44px */
  text-decoration: none; transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--black); color: #fff; }
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; flex-direction: column; gap: 5px;
}
.nav-hamburger span { display: block; width: 22px; height: 1px; background: var(--black); }
.nav-lang { display: flex; align-items: center; gap: 8px; margin: 0 4px; }
.nav-lang-link {
  position: relative; /* ancla del subrayado en ::after, no afecta a la altura de la caja */
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  letter-spacing: 0.1em; color: var(--gray-mid); text-decoration: none;
  transition: color .2s; padding: 15px 0; /* alinea con touch target de .nav-links a */
  line-height: 1;
}
.nav-lang-link:hover { color: var(--black); }
.nav-lang-link.active { color: var(--black); font-weight: 500; }
.nav-lang-link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 13px; /* pegado al texto, no al borde de la caja */
  height: 1px; background: var(--black);
}
.nav-lang-sep { color: var(--gray-light); font-size: 11px; line-height: 1; }


/* ===================================================
   LAYOUT COMUN
   =================================================== */
section { padding: 100px 0; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 48px; }
.footer-container { max-width: 1160px; margin: 0 auto; padding: 0 48px; }
.section-label {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--black); margin-bottom: 20px; display: block;
  border-left: 2px solid var(--black); padding-left: 12px;
}
h2 {
  font-family: var(--serif); font-size: clamp(36px, 4vw, 54px);
  font-weight: 300; line-height: 1.15; letter-spacing: -.01em; margin-bottom: 40px;
}
h3 { font-family: var(--serif); font-size: 26px; font-weight: 300; line-height: 1.2; margin-bottom: 10px; }
p.body-text { font-size: 14px; line-height: var(--lh-body); color: var(--gray-dark); max-width: 600px; margin-bottom: 16px; }
.divider { width: 40px; height: 1px; background: var(--black); margin: 32px 0; }

/* (footer inline en _footer.php — clases antiguas eliminadas) */

/* ===================================================
   NEWSLETTER MODAL
   =================================================== */
.newsletter-modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
.newsletter-modal.open { display: flex; }
.newsletter-box {
  background: #fff; max-width: 520px; width: 100%;
  padding: 56px 48px 48px; position: relative;
}
.newsletter-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--gray-mid); line-height: 1; padding: 4px;
}
.newsletter-close:hover { color: var(--black); }
.newsletter-label {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gray-mid); margin-bottom: 16px; display: block;
}
.newsletter-title {
  font-family: var(--serif); font-size: 28px; font-weight: 300;
  line-height: 1.2; margin-bottom: 12px;
}
.newsletter-desc { font-size: 13px; line-height: 1.7; color: var(--gray-mid); margin-bottom: 28px; }
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.newsletter-input {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--gray-light);
  font-family: var(--sans); font-size: 14px; font-weight: 300;
  outline: none; transition: border-color .2s; background: #fff;
}
.newsletter-input:focus { border-color: var(--black); }
.newsletter-submit {
  padding: 15px; background: var(--black); color: #fff;
  border: none; cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; transition: opacity .2s;
}
.newsletter-submit:hover { opacity: .8; }
.newsletter-ok { display: none; text-align: center; padding: 24px 0; }
.newsletter-ok p { font-family: var(--serif); font-size: 20px; font-weight: 300; color: var(--black); }

/* ===================================================
   LIGHTBOX
   =================================================== */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(248,247,245,0.97);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain; display: block;
  box-shadow: 0 8px 48px rgba(0,0,0,.12);
}
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  background: none; border: none; cursor: pointer;
  font-size: 28px; color: var(--gray-dark); line-height: 1;
  font-weight: 300; transition: color .2s;
}
.lightbox-close:hover { color: var(--black); }
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 32px; color: var(--gray-dark); padding: 16px;
  transition: color .2s; font-weight: 300; line-height: 1;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--black); }
.lightbox-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gray-mid);
}

/* ===================================================
   NAV PANEL LATERAL (mobile ≤ 768px)
   =================================================== */
.nav-overlay {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 110;
  background: rgba(0,0,0,0.38);
  opacity: 0;
  transition: opacity 300ms ease;
}
.nav-overlay.open { display: block; opacity: 1; }

.nav-panel {
  position: fixed; top: 64px; right: 0; bottom: 0;
  width: 280px; z-index: 120;
  background: #fff;
  display: flex; flex-direction: column;
  padding: 0 32px 40px;
  transform: translateX(100%);
  transition: transform 300ms ease;
  box-shadow: -4px 0 24px rgba(0,0,0,.10);
}
.nav-panel.open { transform: translateX(0); }

.nav-panel-links {
  list-style: none; display: flex; flex-direction: column;
  gap: 0; flex: 1;
}
.nav-panel-links li { border-bottom: 1px solid var(--gray-light); }
.nav-panel-links li:first-child { border-top: 1px solid var(--gray-light); }
.nav-panel-links a {
  display: block; padding: 18px 0;
  font-family: var(--sans); font-size: 12px; font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--black); text-decoration: none;
  text-align: right; transition: opacity .2s;
}
.nav-panel-links a:hover { opacity: .45; }
.nav-panel-links a.active { opacity: 1; font-weight: 500; }
.nav-panel-lang {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px; margin-top: 24px;
}
.nav-panel-lang .nav-lang-link { padding: 8px 0; } /* toque >=44px junto al gap */
.nav-panel-lang .nav-lang-link.active::after { bottom: 6px; } /* mismo criterio, ajustado al padding reducido del panel */


.nav-panel-newsletter {
  margin-top: 32px; align-self: flex-end;
  background: none; border: 1px solid var(--black);
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--black); padding: 10px 20px; cursor: pointer;
  transition: background .2s, color .2s;
}
.nav-panel-newsletter:hover { background: var(--black); color: #fff; }

/* Hamburger → morph X cuando panel abierto */
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-hamburger span { transition: transform .28s ease, opacity .2s ease; }


/* ===================================================
   ACCESIBILIDAD
   =================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* Foco visible global -- !important porque algunas plantillas fijan
   outline:none en inputs/botones en <style> propios que se cargan
   despues de este fichero (misma especificidad, orden de cascada). */
:focus-visible {
  outline: 2px solid var(--black) !important;
  outline-offset: 2px !important;
}
/* ===================================================
   RESPONSIVE COMPARTIDO
   =================================================== */
@media (max-width: 900px) {
  .footer-grid-5col { grid-template-columns: 1fr 1fr 1fr !important; gap: 32px 40px !important; }
  .footer-container { padding: 0 24px; }
  nav { padding: 0 24px; }
  .nav-links { gap: 24px; }
  .container { padding: 0 24px; }
  h2 { font-size: 36px; }
  section { padding: 72px 0; }
}
/* Panel oculto en desktop */
@media (min-width: 769px) {
  .nav-overlay, .nav-panel { display: none !important; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-cta { display: none; }
}
@media (max-width: 600px) {
  .newsletter-row { grid-template-columns: 1fr; }
  .newsletter-box { padding: 40px 24px 32px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  section { padding: 56px 0; }
  /* Footer — colapsar a 1 col */
  .footer-grid-5col { grid-template-columns: 1fr 1fr !important; gap: 28px 24px !important; }
  .footer-container { padding: 0 24px; }
  /* Cookie banner */
  .cookie-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 16px !important;
  }
  /* Newsletter modal */
  .nl-row-2 { grid-template-columns: 1fr !important; }
  .nl-box { padding: 32px 20px !important; }
  /* Modal "Propon un evento" / "Forma parte de la programacion" — mismo criterio que nl-row-2/nl-box */
  .prop-row-2 { grid-template-columns: 1fr !important; }
  .prop-box { padding: 32px 20px !important; }
}
/* ── Mobile estrecho (< 480px) ─────────────────────── */
@media (max-width: 480px) {
  .footer-grid-5col { grid-template-columns: 1fr !important; gap: 24px !important; }
  .footer-container { padding: 0 16px; }
  .container { padding: 0 16px; }
  nav { padding: 0 16px; }
  section { padding: 48px 0; }
  h2 { font-size: 28px; }
}

/* ── Accesibilidad: sin movimiento si el usuario lo prefiere ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration:  .01ms !important;
  }
  html { scroll-behavior: auto; }
}
