/* ============================================================
   Charreada Universitaria Masiva — styles.css
   Dirección: cartel charro moderno, minimalista y nocturno.
   Oro con disciplina: hairlines, small caps y un solo ornamento.
   Diseñado primero a 380px; desktop = columna centrada.
   ============================================================ */

:root {
  /* Paleta (muestreada del flyer) */
  --bg:        #1b0507;
  --bg-soft:   #240709;
  --line:      rgba(217, 169, 78, .28);   /* hairlines oro */
  --line-soft: rgba(246, 236, 217, .10);  /* hairlines crema */
  --gold:      #d0a04a;
  --gold-soft: #b98f42;
  --red:       #c8102e;
  --cream:     #f3ead9;
  --muted:     #b3a186;
  --ink:       #1b0507;                    /* texto sobre oro */
  --err:       #e05555;

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  --touch: 56px;
  --maxw: 440px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  /* safe areas: notch y home indicator de iPhone */
  padding: 0
    max(24px, env(safe-area-inset-right))
    calc(64px + env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
}

/* ---------- Ornamento firma: hairline con diamante ---------- */
.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}
.rule::before, .rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.rule .diamond {
  width: 5px; height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  flex: none;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding-top: 36px;
}

.hero .logo {
  max-width: 150px;
  max-height: 84px;
  margin: 0 auto 28px;
  display: block;
}

/* Si el logo carga, ÉL es el título: se agranda y el h1 pasa a solo-lectores
   (el logo del evento es el mismo wordmark; evitamos duplicarlo). */
.hero.has-logo .logo {
  max-width: 280px;
  max-height: 170px;
  margin-bottom: 6px;
}
.hero.has-logo h1 {
  position: absolute;
  width: 1px; height: 1px;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 12vw, 52px);
  line-height: .98;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--cream);
  margin-top: 14px;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--red); }

/* ---------- Ficha compacta del evento ---------- */
.event-card {
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 20px;
  background: rgba(217, 169, 78, .03);
}
/* Ornamento firma: diamante sobre el borde superior */
.event-card::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  width: 7px; height: 7px;
  margin-left: -4px;
  background: var(--gold);
  transform: rotate(45deg);
}
.event-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
  padding: 14px 6px 12px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.event-cell + .event-cell { border-left: 1px solid var(--line-soft); }
.event-cell:nth-child(2) { flex: 1.5; }
#info-lugar { font-size: 13px; }
#info-fecha, #info-precio { white-space: nowrap; font-size: 13.5px; }
#info-precio-sub { font-size: 11px; }
a.event-cell { -webkit-tap-highlight-color: transparent; }
a.event-cell:hover .ec-link, a.event-cell:focus-visible .ec-link { color: var(--cream); }
a.event-cell:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; border-radius: 8px; }
.ec-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.ec-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.25;
}
.ec-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ec-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.event-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.event-note[hidden] { display: none; }

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 26px;
  font-variant-numeric: tabular-nums;
}
.countdown[hidden] { display: none; }
.countdown .unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}
.countdown .num {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  color: var(--cream);
  letter-spacing: .02em;
}
.countdown .lbl {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Botones ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--touch);
  padding: 15px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active { opacity: .85; }
.btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

.btn-primary {
  /* Oro plano sobre vino — AA: #1b0507 sobre #d0a04a ≈ 8.1:1 */
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover { background: #ddb05c; }

.btn-secondary {
  background: transparent;
  color: var(--cream);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--gold); }

.btn-wa {
  background: transparent;
  color: var(--cream);
  border-color: var(--line);
}
.btn-wa:hover { border-color: #4caf72; color: #fff; }

.btn-sm { min-height: 48px; font-size: 14px; padding: 10px 16px; width: auto; }

.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Tarjetas de opción (canales de compra) ---------- */
.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 14px 16px;
  border: 1.5px solid rgba(217, 169, 78, .5);
  border-radius: 12px;
  background: linear-gradient(180deg, #380e12, #2b090d);
  color: var(--cream);
  font-family: var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4);
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease, box-shadow .1s ease;
}
.opt:hover { border-color: var(--gold); }
.opt:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(0, 0, 0, .4); }
.opt:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
.opt-text { display: flex; flex-direction: column; gap: 3px; }
.opt-title { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.opt-desc { font-size: 13px; color: var(--muted); line-height: 1.35; }
.opt-icon { color: var(--gold); font-size: 20px; line-height: 1; flex: none; transition: transform .15s ease; }
.opt[aria-expanded="true"] .opt-chev { transform: rotate(180deg); }
.opt[aria-expanded="true"] { border-color: var(--gold); }

.opt-primary {
  background: linear-gradient(180deg, #e0b45e, var(--gold));
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--gold-soft), 0 4px 14px rgba(217, 169, 78, .2);
}
.opt-primary .opt-desc { color: rgba(27, 5, 7, .72); }
.opt-primary .opt-icon { color: var(--ink); }
.opt-primary:hover { filter: brightness(1.05); }
.opt-primary:active { transform: translateY(2px); box-shadow: 0 0 0 var(--gold-soft); }

.mini-q {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  margin-top: 16px;
}

.section-help {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: -8px 0 16px;
}
.panel-intro { font-size: 13px; color: var(--muted); padding: 2px 2px 4px; }

/* ---------- Sección ---------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.section-label::before, .section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Paneles expandibles ---------- */
.panel { padding: 4px 0 8px; }
.panel[hidden] { display: none; }

.punto, .sede, .near-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.punto:last-child, .sede:last-child, .near-card:last-child { border-bottom: none; }

.punto h3, .sede h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
}
.punto p, .sede p { font-size: 14px; color: var(--muted); margin-top: 2px; }

.row-btns { display: flex; gap: 8px; margin-top: 12px; }

.rp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(217, 169, 78, .14);
}
.rp-row:last-child { border-bottom: none; }
.rp-row .name { font-size: 15px; color: var(--cream); }

/* ---------- Universidad colapsable (una por sede) ---------- */
.sede-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}
.sede-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  min-height: 52px;
  cursor: pointer;
  list-style: none;
  /* Encabezado dorado: separa cada universidad del fondo */
  background: linear-gradient(180deg, #e4b862, var(--gold));
  color: var(--ink);
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.sede-head::-webkit-details-marker { display: none; }
.sede-head:focus-visible { outline: 2px solid var(--cream); outline-offset: -2px; }
.sede-name { flex: 1; font-size: 15px; letter-spacing: .01em; }
.sede-count {
  font-size: 12px;
  font-weight: 600;
  background: rgba(27, 5, 7, .16);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.sede-chev { font-size: 13px; transition: transform .2s ease; flex: none; }
.sede-group[open] .sede-chev { transform: rotate(180deg); }
.sede-body {
  padding: 4px 14px 8px;
  /* Fondo más claro que la página, para que el bloque se note distinto */
  background: #2c0b10;
}

/* ---------- Cards de cercanía ---------- */
.near-card .badge {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.near-card p { font-size: 15px; color: var(--cream); }
.near-card p strong { font-weight: 600; }
.near-card .dist { color: var(--muted); font-weight: 400; white-space: nowrap; }
.near-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  text-align: center;
}

/* ---------- Modal ---------- */
dialog.sheet {
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  background: var(--bg-soft);
  color: var(--cream);
  width: 100%;
  max-width: var(--maxw);
  margin: auto auto 0;
  padding: 26px 24px calc(34px + env(safe-area-inset-bottom));
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Fallback para iOS < 15.4 (sin dialog.showModal) */
dialog.sheet.fallback-open {
  display: block;
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, .8);
}
dialog.sheet::backdrop { background: rgba(10, 2, 3, .72); }
@media (min-width: 560px) {
  dialog.sheet { border: 1px solid var(--line); border-radius: 10px; margin: auto; }
}
.sheet h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--cream);
  font-size: 22px;
  letter-spacing: .02em;
  margin-bottom: 4px;
  padding-right: 44px;
}
.sheet .close {
  position: absolute;
  top: 10px; right: 10px;
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.sheet .close:hover { color: var(--cream); }
.sheet .close:focus-visible { outline: 2px solid var(--cream); }

.status-msg { font-size: 14px; color: var(--muted); padding: 8px 0; }

.hint {
  font-size: 13px;
  border-left: 2px solid var(--gold);
  padding: 4px 0 4px 12px;
  margin-top: 12px;
  color: var(--muted);
}

/* ---------- Inputs ---------- */
.zone-box { margin-top: 14px; }
.zone-box label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
input[type="text"], input[type="url"], input[type="datetime-local"],
input[type="password"], textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px; /* evita zoom de iOS */
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--gold);
}
::placeholder { color: rgba(179, 161, 134, .55); }

.zone-results { list-style: none; margin-top: 4px; }
.zone-results li button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  min-height: 48px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--cream);
  font-size: 15px;
  cursor: pointer;
}
.zone-results li button:hover, .zone-results li button:focus-visible {
  background: rgba(217, 169, 78, .08);
  outline: none;
}

/* ---------- Skeletons ---------- */
.skeleton {
  border-radius: 6px;
  background: var(--bg-soft);
  height: 52px;
  margin-top: 10px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- Footer ---------- */
footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
footer a, footer button.linklike {
  color: var(--muted);
  background: none;
  border: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  min-height: 44px;
}
footer a:hover, footer button.linklike:hover { color: var(--cream); }

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .skeleton { animation: none; opacity: .6; }
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ============================================================
   ADMIN
   ============================================================ */
body.admin .wrap { max-width: 720px; padding-top: 8px; }

.admin-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 24px;
  letter-spacing: .02em;
  color: var(--cream);
  text-align: center;
  margin-top: 36px;
}

.tabs { display: flex; gap: 0; margin: 20px 0 8px; border-bottom: 1px solid var(--line-soft); }
.tabs button {
  flex: 1;
  min-height: 48px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 4px;
}
.tabs button[aria-selected="true"] { color: var(--cream); border-bottom-color: var(--gold); }
.tabs button:focus-visible { outline: 2px solid var(--cream); outline-offset: -2px; }

.field { margin-top: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .grid-2 { grid-template-columns: 1fr; } }

.admin-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
  margin-top: 10px;
}
.admin-item h3 { font-size: 15px; font-weight: 600; color: var(--cream); }
.admin-item .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.admin-item .raw {
  border-left: 2px solid var(--gold);
  padding: 8px 0 8px 12px;
  font-size: 14px;
  margin: 12px 0;
  white-space: pre-wrap;
  color: var(--cream);
}
.admin-item .row-btns { flex-wrap: wrap; }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--gold); }

.toast {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 6px;
  z-index: 99;
  max-width: 92vw;
  text-align: center;
}
.toast.error { background: var(--err); color: #fff; }

.warn-note {
  border: 1px solid rgba(200, 16, 46, .5);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin: 14px 0;
  color: var(--cream);
}

img.logo-preview {
  max-width: 160px; max-height: 90px;
  display: block; margin-top: 8px;
  background: rgba(255,255,255,.05);
  border-radius: 6px; padding: 6px;
}
