/* =====================================================================
   Almaviva — Eventos (hub /eventos/ y eventos /eventos/<slug>/)
   ---------------------------------------------------------------------
   Lo usan SOLO las páginas que genera scripts/build-eventos.py.
   Estilo boletera: banner con el flyer, datos en fichas cortas y el
   registro como un boleto (talón + perforación + formulario en 2 pasos).
   Colores del sistema Almaviva (mismos valores que blog.css), contraste AA.
   ===================================================================== */

@font-face { font-family: 'Averta'; src: url('/assets/fonts/Averta-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Averta'; src: url('/assets/fonts/Averta-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Averta'; src: url('/assets/fonts/Averta-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ev-navy: #0B1D3A;
  --ev-ink: #063C4A;          /* petróleo del logo: botones y enlaces */
  --ev-ink-hover: #0A5163;
  --ev-text: #2C3E50;
  --ev-muted: #5B6B7A;
  --ev-gold: #C4985A;
  --ev-gold-light: #D4AD6E;
  --ev-gold-ink: #835A22;
  --ev-paper: #FBF8F3;
  --ev-sand: #F3EDE3;
  --ev-line: rgba(11, 29, 58, 0.12);
  --ev-ok: #0C7A43;
  --ev-radius: 16px;
  --ev-header: var(--av-header-h, 76px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: 'Averta', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ev-text);
  background: var(--ev-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ev-ink); }
:focus-visible { outline: 2px solid var(--ev-gold-ink); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.ev-wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.ev-ico { width: 20px; height: 20px; flex: none; }
.ev-main { padding-top: var(--ev-header); }
.ev-kicker { margin: 0 0 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ev-gold-ink); }

/* -------------------------------------------------------------- botones */
.ev-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border: 0; border-radius: 12px;
  background: var(--ev-ink); color: #fff; font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
}
.ev-btn:hover { background: var(--ev-ink-hover); }
.ev-btn:active { transform: scale(0.98); }
.ev-btn-full { width: 100%; }
.ev-btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.92rem; }
.ev-btn-line { background: transparent; color: var(--ev-ink); box-shadow: inset 0 0 0 1.5px var(--ev-ink); }
.ev-btn-line:hover { background: var(--ev-ink); color: #fff; }
.ev-btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }

.ev-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: #E3F1EA; color: var(--ev-ok); font-size: 0.75rem; font-weight: 700;
}
.ev-pill.is-off { background: var(--ev-sand); color: var(--ev-muted); }
.ev-live { width: 8px; height: 8px; border-radius: 50%; background: #2BB673; box-shadow: 0 0 0 0 rgba(43, 182, 115, 0.5); animation: evPulse 2s infinite; flex: none; }
@keyframes evPulse { 70% { box-shadow: 0 0 0 7px rgba(43, 182, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0); } }
@media (prefers-reduced-motion: reduce) { .ev-live { animation: none; } }

/* --------------------------------------------------------- evento: banner */
.ev-banner { position: relative; overflow: hidden; background: var(--ev-navy); }
.ev-banner::before {
  content: ""; position: absolute; inset: -40px; background: var(--ev-bg) center / cover no-repeat;
  filter: blur(36px) saturate(1.1); opacity: 0.55; transform: scale(1.1);
}
.ev-banner-in { position: relative; max-width: 940px; margin: 0 auto; }
@media (min-width: 760px) { .ev-banner-in { max-width: min(700px, calc((100vh - var(--ev-header) - 120px) * 1.5)); } }
.ev-banner-in img { width: 100%; }

/* ------------------------------------------------- evento: estructura */
.ev-layout { display: grid; gap: 28px; padding-top: 24px; padding-bottom: 72px; }
.ev-head, .ev-more { min-width: 0; }

.ev-crumbs ol { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; font-size: 0.82rem; color: var(--ev-muted); }
.ev-crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--ev-gold); }
.ev-crumbs a { color: var(--ev-muted); text-decoration: none; padding: 6px 0; }
.ev-crumbs a:hover { color: var(--ev-ink); text-decoration: underline; }
.ev-head h1 { margin: 0 0 8px; color: var(--ev-navy); font-size: clamp(2rem, 5.6vw, 3.1rem); line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
.ev-frase { margin: 0 0 22px; font-size: 1.1rem; line-height: 1.45; color: var(--ev-muted); max-width: 34ch; }

.ev-facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ev-facts li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #fff; border: 1px solid var(--ev-line); border-radius: 14px; }
.ev-facts .ev-ico { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--ev-sand); color: var(--ev-gold-ink); }
.ev-facts span { display: grid; gap: 2px; min-width: 0; }
.ev-facts strong { color: var(--ev-navy); font-size: 0.98rem; line-height: 1.25; }
.ev-facts small { color: var(--ev-muted); font-size: 0.82rem; line-height: 1.35; }
.ev-flyer-dl { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; text-decoration: none; padding: 8px 0; }
.ev-flyer-dl .ev-ico { width: 18px; height: 18px; }
.ev-flyer-dl:hover { text-decoration: underline; }

.ev-sec { padding-top: 36px; }
.ev-sec h2 { margin: 0 0 14px; color: var(--ev-navy); font-size: 1.3rem; line-height: 1.2; }
.ev-sec p { margin: 0 0 16px; font-size: 1.04rem; line-height: 1.65; max-width: 60ch; }

.ev-tiles { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ev-tiles li { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 14px; background: var(--ev-sand); color: var(--ev-navy); font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.ev-tiles .ev-ico { color: var(--ev-ink); width: 24px; height: 24px; }
.ev-perk { display: flex !important; align-items: center; gap: 12px; margin: 0 !important; padding: 14px 16px; border-radius: 14px; background: var(--ev-navy); color: #fff; font-weight: 700; font-size: 1rem !important; max-width: none !important; }
.ev-perk .ev-ico { color: var(--ev-gold-light); width: 24px; height: 24px; }

.ev-projs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ev-proj { display: grid; gap: 2px; text-decoration: none; color: inherit; }
.ev-proj img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin-bottom: 8px; transition: transform 0.3s ease; }
.ev-proj:hover img { transform: translateY(-2px); }
.ev-proj-n { font-weight: 700; color: var(--ev-navy); font-size: 0.98rem; line-height: 1.25; }
.ev-proj-k { font-size: 0.8rem; color: var(--ev-muted); }

.ev-ponentes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px 22px; }
.ev-ponentes li { display: grid; justify-items: center; gap: 8px; width: 96px; text-align: center; font-size: 0.9rem; font-weight: 700; color: var(--ev-navy); line-height: 1.25; }
.ev-ponentes img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--ev-gold); }

.ev-place { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: start; padding: 16px; background: #fff; border: 1px solid var(--ev-line); border-radius: 14px; }
.ev-place-ico { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--ev-sand); color: var(--ev-gold-ink); }
.ev-place p { margin: 0 !important; font-size: 0.92rem !important; line-height: 1.45 !important; color: var(--ev-muted); }
.ev-place .ev-place-n { color: var(--ev-navy); font-weight: 700; font-size: 1rem !important; margin-bottom: 2px !important; }
.ev-place .ev-btn { grid-column: 1 / -1; min-height: 44px; }

/* --------------------------------------------- evento: boleto (registro) */
.ev-ticket {
  --cut: var(--ev-paper);
  background: #fff; border-radius: 20px; box-shadow: 0 0 0 1px var(--ev-line), 0 20px 44px rgba(11, 29, 58, 0.12);
  scroll-margin-top: calc(var(--ev-header) + 16px);
}
.ev-tk-top { padding: 20px 22px 18px; background: var(--ev-navy); color: #fff; border-radius: 20px 20px 0 0; }
.ev-tk-k { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ev-gold-light); }
.ev-tk-price { margin: 2px 0 6px; font-size: 2.2rem; line-height: 1.05; letter-spacing: -0.01em; }
.ev-tk-cupo { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.86rem; color: rgba(255, 255, 255, 0.82); }

/* perforación con muescas a los lados */
.ev-tk-cut {
  position: relative; height: 22px; margin: 0 14px;
  background: linear-gradient(90deg, rgba(11, 29, 58, 0.18) 50%, transparent 0) 0 50% / 12px 2px repeat-x;
}
.ev-tk-cut::before, .ev-tk-cut::after {
  content: ""; position: absolute; top: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--cut); box-shadow: inset 0 0 0 1px var(--ev-line);
}
.ev-tk-cut::before { left: -25px; clip-path: inset(0 0 0 calc(50% - 2px)); }
.ev-tk-cut::after { right: -25px; clip-path: inset(0 calc(50% - 2px) 0 0); }

.ev-form { padding: 6px 22px 22px; display: grid; gap: 18px; }
.ev-step { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 12px; }
.ev-step legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 12px; font-size: 0.95rem; font-weight: 700; color: var(--ev-navy); }
.ev-step legend span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ev-sand); color: var(--ev-gold-ink); font-size: 0.8rem; }

.ev-slot-list { display: grid; gap: 8px; }
.ev-slot { position: relative; display: block; }
.ev-slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ev-slot-box {
  display: grid; grid-template-columns: 1fr auto 22px; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px 0 16px;
  border: 1.5px solid rgba(11, 29, 58, 0.16); border-radius: 12px; background: #fff; transition: border-color 0.15s ease, background 0.15s ease;
}
.ev-slot-h { font-size: 1.12rem; font-weight: 700; color: var(--ev-navy); }
.ev-slot-e { font-size: 0.78rem; font-weight: 700; color: var(--ev-ok); }
.ev-slot-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(11, 29, 58, 0.25); background: #fff; transition: all 0.15s ease; }
.ev-slot input:hover + .ev-slot-box { border-color: var(--ev-ink); }
.ev-slot input:checked + .ev-slot-box { border-color: var(--ev-ink); background: #EEF5F6; }
.ev-slot input:checked + .ev-slot-box .ev-slot-dot { border-color: var(--ev-ink); background: var(--ev-ink); box-shadow: inset 0 0 0 4px #fff; }
.ev-slot input:focus-visible + .ev-slot-box { outline: 2px solid var(--ev-gold-ink); outline-offset: 2px; }
.ev-slot.is-off .ev-slot-box { background: var(--ev-paper); }
.ev-slot.is-off .ev-slot-h { color: var(--ev-muted); text-decoration: line-through; }
.ev-slot.is-off .ev-slot-e { color: var(--ev-muted); }

.ev-field { display: grid; gap: 6px; min-width: 0; }
.ev-field label { font-size: 0.85rem; font-weight: 700; color: var(--ev-navy); }
.ev-field input, .ev-field select {
  width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid rgba(11, 29, 58, 0.16); border-radius: 12px;
  background: #fff; color: var(--ev-navy); font: inherit; font-size: 1rem; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ev-field input:focus, .ev-field select:focus { outline: none; border-color: var(--ev-ink); box-shadow: 0 0 0 3px rgba(6, 60, 74, 0.14); }
.ev-field input::placeholder { color: #8796A3; }
.ev-check { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; background: var(--ev-paper); font-size: 0.98rem; color: var(--ev-navy); cursor: pointer; }
.ev-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ev-ink); flex: none; }
.ev-err { margin: -6px 0 0; padding: 10px 12px; border-radius: 10px; background: #FBEAEA; color: #8A1F1F; font-size: 0.9rem; line-height: 1.45; }
.ev-err a { color: inherit; font-weight: 700; }
.ev-legal { margin: -6px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--ev-muted); text-align: center; }
.ev-hp { display: none; }

/* confirmación: el boleto ya emitido */
.ev-ok, .ev-fin-msg { padding: 6px 22px 22px; outline: none; display: grid; gap: 14px; }
.ev-ok-k { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--ev-ok); font-size: 1.02rem; }
.ev-ok-k .ev-ico { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: #E3F1EA; }
.ev-pass { padding: 16px; border-radius: 14px; background: var(--ev-sand); border: 1.5px dashed rgba(131, 90, 34, 0.35); }
.ev-pass-n { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ev-gold-ink); }
.ev-pass-who { margin: 4px 0 12px; font-size: 1.25rem; font-weight: 700; color: var(--ev-navy); line-height: 1.2; }
.ev-pass-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.ev-pass-grid dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ev-muted); }
.ev-pass-grid dd { margin: 0; font-weight: 700; color: var(--ev-navy); }
.ev-ok-t { margin: 0; font-size: 0.92rem; line-height: 1.55; color: var(--ev-text); }
.ev-cal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ev-cal .ev-btn { min-height: 46px; padding: 0 10px; font-size: 0.86rem; }
.ev-cal .ev-ico { width: 18px; height: 18px; }

/* ------------------------------------------------------------- hub */
.ev-hub-head { background: var(--ev-navy); color: #fff; padding: 40px 0 44px; }
.ev-hub-head .ev-kicker { color: var(--ev-gold-light); }
.ev-hub-head h1 { margin: 0 0 10px; font-size: clamp(2rem, 5.4vw, 3rem); line-height: 1.08; text-wrap: balance; max-width: 20ch; }
.ev-hub-sub { margin: 0; font-size: 1.05rem; line-height: 1.6; max-width: 52ch; color: rgba(255, 255, 255, 0.8); }
.ev-hub { padding-bottom: 80px; }
.ev-hub-sec { padding-top: 36px; }
.ev-hub-sec h2 { margin: 0 0 16px; color: var(--ev-navy); font-size: 1.3rem; }
.ev-cards { display: grid; gap: 20px; }

.ev-card { --cut: var(--ev-paper); }
.ev-card-link {
  display: grid; background: #fff; border-radius: 20px; text-decoration: none; color: inherit;
  box-shadow: 0 0 0 1px var(--ev-line), 0 10px 30px rgba(11, 29, 58, 0.06); transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.ev-card-link:hover { box-shadow: 0 0 0 1px var(--ev-line), 0 18px 40px rgba(11, 29, 58, 0.14); transform: translateY(-2px); }
.ev-card-img { display: block; overflow: hidden; border-radius: 20px 20px 0 0; background: var(--ev-navy); }
.ev-card-img img { width: 100%; }
.ev-card-stub { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; padding: 22px 20px 20px; border-top: 2px dashed var(--ev-line); }
.ev-card-stub::before, .ev-card-stub::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--cut); box-shadow: inset 0 0 0 1px var(--ev-line); }
.ev-card-stub::before { left: -11px; clip-path: inset(0 0 0 50%); }
.ev-card-stub::after { right: -11px; clip-path: inset(0 50% 0 0); }
.ev-date { display: grid; justify-items: center; align-content: center; min-width: 64px; padding: 10px 8px; border-radius: 14px; background: var(--ev-navy); color: #fff; line-height: 1.05; text-transform: uppercase; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; align-self: start; }
.ev-date strong { font-size: 1.9rem; letter-spacing: 0; margin: 2px 0; }
.ev-date span:first-child { color: var(--ev-gold-light); }
.ev-card-body { display: grid; gap: 8px; align-content: start; justify-items: start; min-width: 0; }
.ev-card-t { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.15; color: var(--ev-navy); }
.ev-card-meta { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--ev-muted); }
.ev-card-meta .ev-ico { width: 18px; height: 18px; color: var(--ev-gold-ink); }
.ev-card-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--ev-line); }
.ev-card-foot strong { font-size: 1.2rem; color: var(--ev-navy); }

.ev-empty { display: grid; justify-items: center; gap: 14px; padding: 34px 24px; border: 2px dashed var(--ev-line); border-radius: 20px; text-align: center; }
.ev-empty-t { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--ev-navy); }
.ev-pasados { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ev-line); }
.ev-past a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--ev-line); text-decoration: none; color: inherit; }
.ev-past a > span:first-child { grid-column: 1; font-size: 0.85rem; color: var(--ev-muted); }
.ev-past strong { grid-column: 1; color: var(--ev-navy); }
.ev-past .ev-pill { grid-column: 2; grid-row: 1 / span 2; }

/* --------------------------------------------------------- pantallas */
@media (max-width: 759px) {
  .ev-facts { grid-template-columns: 1fr; gap: 0; background: #fff; border: 1px solid var(--ev-line); border-radius: 14px; overflow: hidden; }
  .ev-facts li { align-items: center; padding: 10px 14px; border: 0; border-radius: 0; }
  .ev-facts li + li { border-top: 1px solid var(--ev-line); }
  .ev-facts .ev-ico { width: 32px; height: 32px; padding: 7px; }
}
@media (max-width: 420px) {
  .ev-projs { grid-template-columns: 1fr 1fr; }
  .ev-cal { grid-template-columns: 1fr; }
}
@media (min-width: 760px) {
  .ev-wrap { padding-inline: 32px; }
  .ev-banner { padding: 32px 32px 0; }
  .ev-banner-in img { border-radius: 18px 18px 0 0; }
  .ev-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ev-place { grid-template-columns: auto 1fr auto; align-items: center; }
  .ev-place .ev-btn { grid-column: auto; }
  .ev-card-link { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .ev-card-img { border-radius: 20px 0 0 20px; display: flex; align-items: center; }
  .ev-card-stub { border-top: 0; border-left: 2px dashed var(--ev-line); padding: 28px 28px 24px; align-content: center; }
  .ev-card-stub::before { left: -12px; top: -11px; clip-path: inset(50% 0 0 0); }
  .ev-card-stub::after { left: -12px; right: auto; top: auto; bottom: -11px; clip-path: inset(0 0 50% 0); }
}
@media (min-width: 1000px) {
  .ev-layout { grid-template-columns: minmax(0, 1fr) 390px; column-gap: 56px; padding-top: 36px; padding-bottom: 96px; align-items: start; }
  .ev-head { grid-column: 1; grid-row: 1; }
  .ev-more { grid-column: 1; grid-row: 2; }
  .ev-ticket { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--ev-header) + 20px); }
  .ev-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ev-facts li { flex-direction: column; gap: 10px; }
}
