/* ==========================================================
   Boda — estilo moderno minimalista
   Escrito mobile-first: primero funciona en celular, luego crece.
   Cambia --accent para retematizar todo el sitio.
   ========================================================== */

/* Pinyon Script — solo para los nombres de la portada.
   Licencia SIL Open Font License 1.1. Convertida a WOFF2 (40 KB). */
@font-face {
  font-family: "Pinyon Script";
  src: url("/fonts/pinyon-script.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f6f5f3;
  --ink: #111111;
  --ink-soft: #5c5c5c;
  --line: #e4e2de;
  --accent: #b08d57; /* <- único color de acento */
  --accent-soft: #f3ede3;
  --radius: 2px;
  --maxw: 1080px;
  --pad: clamp(18px, 5vw, 24px);       /* margen lateral fluido */
  --sec: clamp(56px, 11vw, 96px);      /* alto de sección fluido */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-nombres: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
}

* { box-sizing: border-box; min-width: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 70px;            /* que el nav fijo no tape los títulos */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;                  /* red de seguridad contra desbordes */
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

/* ---------- tipografía ---------- */
h1, h2, h3 { font-weight: 300; letter-spacing: -0.01em; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(2.1rem, 11vw, 5.5rem); line-height: 1.08; }
h2 { font-size: clamp(1.45rem, 5.5vw, 2.4rem); line-height: 1.25; }
h3 { font-size: 1.05rem; font-weight: 500; letter-spacing: 0.02em; }

.eyebrow {
  font-size: clamp(0.64rem, 2.6vw, 0.72rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.lead { color: var(--ink-soft); max-width: 60ch; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { padding: var(--sec) 0; border-top: 1px solid var(--line); }
section.alt { background: var(--bg-alt); }
.center { text-align: center; }
.section-head { text-align: center; margin-bottom: clamp(32px, 7vw, 48px); }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }

.nav-mark {
  font-size: clamp(0.68rem, 3vw, 0.8rem);
  letter-spacing: 0.22em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  text-decoration: none; font-size: 0.8rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft); transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* botón hamburguesa (solo móvil) */
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 12px 10px; margin-right: -10px;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span {
  display: block; height: 1.5px; width: 100%; background: var(--ink);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .nav-links:not(.compact) {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav-links:not(.compact).open { max-height: 340px; }
  .nav-links:not(.compact) a {
    padding: 15px var(--pad); border-top: 1px solid var(--line);
    font-size: 0.82rem; color: var(--ink);
  }
  /* nav del panel de admin: siempre visible, más compacto */
  .nav-links.compact { gap: 16px; }
  .nav-links.compact a { font-size: 0.7rem; }
  .nav-toggle.hidden-toggle { display: none; }
}

/* ---------- hero ---------- */
.hero {
  min-height: 86vh;
  min-height: 86svh;                   /* evita el salto por la barra del navegador móvil */
  display: grid; place-items: center; text-align: center;
  position: relative; overflow: hidden; border-top: 0; padding: 0;
  color: #fff;
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.hero-inner { position: relative; padding: clamp(48px, 12vw, 72px) var(--pad); width: 100%; }
/* Los nombres van en Pinyon Script.
   La caligráfica se ve más pequeña a igual tamaño, así que sube; y como sus
   trazos ya se enlazan, se le quita el espaciado negativo y se le da aire
   vertical para que no se corten las colas de las letras. */
.hero h1 {
  font-family: var(--font-nombres);
  font-size: clamp(2.9rem, 14vw, 7rem);
  line-height: 1.18;
  letter-spacing: 0;
  padding-bottom: 0.08em;
}
.hero h1 .amp {
  font-size: 0.62em;
  margin: -0.06em 0;
  line-height: 1;
}

.hero .eyebrow { color: rgba(255, 255, 255, 0.88); }
.hero .date {
  margin-top: 1.4rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-size: clamp(0.7rem, 3vw, 0.8rem);
}
.amp { display: block; font-size: 0.5em; margin: 0.12em 0; color: var(--accent); }
.hero-cta { margin-top: clamp(2rem, 6vw, 2.6rem); }

/* ---------- cuenta regresiva ---------- */
.countdown {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(14px, 5vw, 34px);
  margin-top: clamp(1.8rem, 5vw, 2.4rem);
}
.countdown div { min-width: clamp(48px, 15vw, 62px); }
.countdown .n {
  font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 300; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown .l {
  font-size: clamp(0.55rem, 2.4vw, 0.62rem); letter-spacing: 0.16em;
  text-transform: uppercase; opacity: 0.85; margin-top: 6px;
}

/* ---------- grid de tarjetas ---------- */
/* min() evita que el minmax fuerce un ancho mayor al de la pantalla */
.grid { display: grid; gap: clamp(14px, 3vw, 24px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

.card { background: var(--bg); border: 1px solid var(--line); padding: clamp(22px, 5vw, 32px); }
.card h3 { margin-bottom: 0.6rem; }
.card .meta { color: var(--ink-soft); font-size: 0.92rem; overflow-wrap: break-word; }
.card .meta a { overflow-wrap: anywhere; }

.card-vestimenta { display: flex; flex-direction: column; }
.ilustracion {
  width: 100%; max-width: 260px; margin: auto auto 0; padding-top: 18px;
  align-self: center;
}
.contacto { margin: 0 0 14px; }
.contacto a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contacto a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- foto destacada ---------- */
.foto-destacada {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius);
}

/* ---------- botones ---------- */
.btn {
  display: inline-block; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: 14px clamp(22px, 6vw, 34px);
  font-size: clamp(0.72rem, 2.9vw, 0.78rem); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border-radius: var(--radius);
  transition: background .2s, color .2s, border-color .2s;
  font-family: inherit; text-align: center; min-height: 44px;  /* área táctil cómoda */
  max-width: 100%;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- formulario ---------- */
form { max-width: 640px; margin: 0 auto; }
.field { margin-bottom: 22px; }
.field label {
  display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%; max-width: 100%; padding: 13px 14px;
  border: 1px solid var(--line); background: #fff;
  font-family: inherit;
  font-size: 16px;                     /* 16px exactos: evita que iOS haga zoom al enfocar */
  color: var(--ink); border-radius: var(--radius);
  transition: border-color .2s; -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235c5c5c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 6px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; gap: 0; } }

.choice { display: flex; flex-wrap: wrap; gap: 10px; }
.choice label {
  flex: 1 1 140px; border: 1px solid var(--line); padding: 15px 12px; text-align: center;
  cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 0.95rem;
  color: var(--ink); margin: 0; transition: all .2s; border-radius: var(--radius);
  position: relative; min-height: 44px;
}
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.choice input:checked + span { font-weight: 500; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.msg { padding: 14px 16px; border-radius: var(--radius); font-size: 0.92rem; margin-top: 16px; }
.msg.ok { background: #edf7ed; border: 1px solid #cbe6cb; color: #1e4620; }
.msg.err { background: #fdeded; border: 1px solid #f5c6c6; color: #5f2120; }
.hidden { display: none !important; }

/* ---------- footer ---------- */
footer {
  padding: clamp(40px, 9vw, 56px) 0;
  padding-bottom: calc(clamp(40px, 9vw, 56px) + env(safe-area-inset-bottom, 0px));
  text-align: center; color: var(--ink-soft); font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
footer .footer-nombres {
  color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 0.8rem; margin-bottom: 10px;
}

/* ---------- admin ---------- */
.admin-bar {
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between; margin-bottom: 28px;
}
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .admin-actions { width: 100%; }
  .admin-actions .btn { flex: 1 1 140px; }
}

.stats {
  display: grid; gap: 12px; margin-bottom: 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 45%), 1fr));
}
.stat { border: 1px solid var(--line); padding: clamp(14px, 4vw, 20px); }
.stat .n { font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 300; line-height: 1; }
.stat .l {
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 8px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500; white-space: nowrap;
}
td { min-width: 110px; }
tbody tr:hover { background: var(--bg-alt); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.pill { display: inline-block; padding: 3px 10px; font-size: 0.72rem; border-radius: 999px; white-space: nowrap; }
.pill.si { background: #e8f4ea; color: #1e4620; }
.pill.no { background: #f4e8e8; color: #5f2120; }

.col-borrar { min-width: 0; text-align: right; }
.btn-borrar {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  font-family: inherit; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 12px; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
  transition: all .2s;
}
.btn-borrar:hover { border-color: #b3261e; color: #b3261e; background: #fdeded; }
.btn-borrar[disabled] { opacity: 0.5; cursor: wait; }

.login-box { max-width: 380px; margin: clamp(48px, 12vh, 120px) auto; }

/* ---------- accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
