/* Eventos Ayarco 385 — Mesa Comunitaria */
:root {
  --lights-h: 72px;     /* alto de la guirnalda de luces */
  --top-space: 92px;    /* espacio superior de ambas columnas */
  --cream: #f5efe2;
  --paper: #fbf8f1;
  --ink: #1d241f;
  --muted: #5a5f57;        /* 5.7:1 sobre crema */
  --placeholder: #676b63;  /* ≥4.5:1 sobre crema */
  --line: #7a7d75;         /* ≥3:1 sobre crema (bordes de campos) */
  --forest: #0e2219;
  --green: #163a2b;
  --red: #9b2a22;
  --gold: #d9b46a;
  --gold-light: #f5d58f;
  --hero-text: #e8e0cf;
  --pad-x: clamp(20px, 4vw, 48px);
  --serif: "Gloock", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

a { color: var(--red); }
a:hover { color: var(--green); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--forest);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; outline-color: var(--cream); }

/* ---------- Luces navideñas (decorativas) ---------- */
.lights {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--lights-h);
  z-index: 5;
  pointer-events: none;
  /* Recorta solo a los lados (evita scroll horizontal); el brillo puede bajar libremente */
  overflow-x: clip;
  overflow-y: visible;
}
.lights__wire {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 22px;
}
.lights__wire path {
  fill: none;
  stroke: #1c2a20;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.lights__bulbs {
  list-style: none;
  margin: 0; padding: 0;
  position: absolute; inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}
.lights__bulbs li {
  --c: #ff3b45; --dk: #8a0f18; --rot: -12deg; --delay: 0s;
  display: flex; flex-direction: column; align-items: center;
  margin-top: 9px;
  transform: rotate(var(--rot));
  transform-origin: top center;
}
.lights__bulbs li::before { /* casquillo */
  content: "";
  width: 7px; height: 8px;
  border-radius: 2px 2px 1px 1px;
  background: repeating-linear-gradient(180deg, #3d4a3c 0 2px, #1d2a1f 2px 3px);
}
.lights__bulbs li::after { /* bombillo */
  content: "";
  width: 11px; height: 17px;
  margin-top: -1px;
  border-radius: 50% 50% 50% 50% / 34% 34% 66% 66%;
  background: radial-gradient(ellipse at 34% 28%, #ffffffd9 0 14%, var(--c) 42%, var(--dk) 100%);
  box-shadow: 0 0 4px 1px var(--c), 0 6px 18px 6px color-mix(in srgb, var(--c) 47%, transparent);
  animation: twinkle 2.6s ease-in-out infinite;
  animation-delay: var(--delay);
}
.lights__bulbs li:nth-child(5n+2) { --c: #ff9f3a; --dk: #9a4a08; --rot: 6deg; }
.lights__bulbs li:nth-child(5n+3) { --c: #2fd47a; --dk: #0c6a36; --rot: -4deg; }
.lights__bulbs li:nth-child(5n+4) { --c: #ffd84a; --dk: #a07a08; --rot: 10deg; }
.lights__bulbs li:nth-child(5n+5) { --c: #4cb8ff; --dk: #0c4f8f; --rot: -8deg; }
.lights__bulbs li:nth-child(3n+1) { --delay: .45s; }
.lights__bulbs li:nth-child(3n+2) { --delay: 1.35s; }
.lights__bulbs li:nth-child(4n)   { --delay: .9s; }
.lights__bulbs li:nth-child(7n)   { --delay: 1.8s; }
/* Menos bombillos en pantallas angostas */
@media (max-width: 599px) {
  .lights__bulbs li:nth-child(n+13) { display: none; }
}

@keyframes twinkle {
  0%, 100% { opacity: 1; filter: brightness(1.1); }
  50% { opacity: .6; filter: brightness(.75); }
}
@media (prefers-reduced-motion: reduce) {
  .lights__bulbs li::after { animation: none; }
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: var(--top-space) var(--pad-x) 24px;
  background: var(--forest);
  color: var(--cream);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.hero::before {
  inset: -30px;
  background: url("/img/hero-bg.webp") center 30% / cover no-repeat;
  filter: blur(10px) brightness(.5) saturate(1.2);
}
.hero::after {
  inset: 0;
  background: linear-gradient(180deg, #0e2219cc 0%, #0e2219b3 45%, #0e2219f2 100%);
}

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.8rem; /* 20% más grande que el diseño original (1.5rem) */
  letter-spacing: .02em;
}
.brand__hat {
  position: absolute;
  /* En em para que el gorro escale junto con el título */
  left: -.79em; top: -.375em;
  width: 1.25em; height: auto;
  transform: rotate(24deg) scaleX(-1);
  filter: drop-shadow(0 2px 2px #0007);
  pointer-events: none;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--forest);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}
.hero__cta:hover, .hero__cta:active { background: var(--gold-light); color: var(--forest); }
.hero__cta:focus-visible { outline-color: var(--gold-light); }

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 14px 0;
  border-block: 1px solid #d9b46a66;
}
.details dt {
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}
.details dd {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: .8125rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.375rem, 4.6vw, 3.875rem);
  line-height: .98;
  text-wrap: balance;
}
.hero h1 em {
  display: block;
  color: var(--gold);
}
.lede {
  max-width: 460px;
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--hero-text);
  text-wrap: pretty;
}

.hero__figure {
  position: relative;
  margin: auto calc(-1 * var(--pad-x)) -24px;
  height: 300px;
  flex: none;
}
.hero__figure img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  -webkit-mask-image: linear-gradient(180deg, #0000 0%, #000 38%);
  mask-image: linear-gradient(180deg, #0000 0%, #000 38%);
}
.hero__figure::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, #0e221900 40%, #0e2219cc 100%),
    radial-gradient(ellipse at 50% 70%, #0000 40%, #0e221999 100%);
}
.hero__figure figcaption {
  position: absolute;
  z-index: 1;
  left: var(--pad-x); right: var(--pad-x); bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-light);
}

/* Una columna (móvil): sin foto, con botón de inscripción */
@media (max-width: 899px) {
  .hero__figure { display: none; }
}
@media (min-width: 900px) {
  .hero__cta { display: none; }
}

/* ---------- Inscripción ---------- */
.signup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--top-space) var(--pad-x) 40px;
}
.signup:focus { outline: none; }
.signup__inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--red);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 28px; height: 1px;
  background: currentColor;
}
.signup h2 {
  margin: 6px 0 2px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.15;
  color: var(--green);
}
.signup__lede {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: .9375rem;
}

/* ---------- Formulario ---------- */
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px 20px;
}
.form__note,
.form__errors,
.submit,
#form-status { grid-column: 1 / -1; }

.form__note {
  margin: 0;
  font-size: .8125rem;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field--full { grid-column: 1 / -1; }

.field > label,
.field > legend {
  padding: 0;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field > legend { margin-bottom: 10px; }
.req { color: var(--red); }

.field input:not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* evita zoom automático en iOS */
}
.field select {
  appearance: none;
  padding-right: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231d241f' stroke-width='1.6'/%3E%3C/svg%3E") right 4px center no-repeat;
}
.field textarea { resize: vertical; line-height: 1.4; }
.field ::placeholder { color: var(--placeholder); opacity: 1; }

.field input:not([type="radio"]):focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--red);
  box-shadow: 0 2px 0 0 var(--red);
}

/* Igual de específico que la regla base de los campos (y va después), para que gane */
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-bottom-color: var(--red);
  border-bottom-width: 2px;
}
.field__error {
  margin: 0;
  color: var(--red);
  font-size: .875rem;
  font-weight: 500;
}

/* Botones tipo "pastilla" (radios reales) */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill { position: relative; }
.pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 16px;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-size: .9375rem;
  cursor: pointer;
}
.pill input:hover + span { background: #163a2b14; }
.pill input:checked + span {
  background: var(--green);
  color: var(--cream);
}
.pill input:focus-visible + span {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  .pill input:checked + span { outline: 3px solid Highlight; }
}

/* Mesas y sillas: solo si responde "Sí" */
.bring__counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px; /* igual que el formulario, para alinear con las columnas de arriba */
  margin-top: 14px;
}
.bring:has(input[value="no"]:checked) .bring__counts { display: none; }

/* Honeypot */
.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 13px 24px;
  border: 0;
  background: var(--green);
  color: var(--cream);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.submit:hover { background: var(--red); }
.submit[aria-disabled="true"] { opacity: .7; cursor: progress; }

.form__errors {
  padding: 16px 18px;
  border-left: 4px solid var(--red);
  background: #9b2a2210;
  color: var(--ink);
}
.form__errors:focus { outline: 3px solid var(--red); outline-offset: 2px; }
.form__errors h2,
.form__errors h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--red);
}
.form__errors ul { margin: 0; padding-left: 1.2em; }

/* ---------- Confirmación ---------- */
.success {
  padding: 36px;
  border: 1px solid #163a2b33;
  background: var(--paper);
}
.success__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 1.1;
  color: var(--green);
}
.success__title:focus { outline: none; }
.success p {
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.5;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--green); }
.success .button-link { font-weight: 600; }

/* ---------- Edición ---------- */
.edit-banner {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 4px solid var(--gold);
  background: #d9b46a26;
  font-size: .9375rem;
}
.edit-banner a { font-weight: 600; }

.field__hint:empty { display: none; }
.field__hint {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #d9b46a26;
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.4;
}
.field__hint a { font-weight: 600; }
.field__hint.is-error {
  border-left-color: var(--red);
  background: #9b2a2214;
}
.field__hint.is-error strong { color: var(--red); }

.form__errors p { margin: 0; }
.form__errors p + p { margin-top: 6px; }

.edit-link {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px dashed #163a2b66;
  background: var(--cream);
}
.edit-link p { margin: 0 0 6px; font-size: .9375rem; color: var(--ink); }
.edit-link__url { overflow-wrap: anywhere; }

.page-header {
  padding: 18px var(--pad-x);
  background: var(--forest);
}
.page-header__brand {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.5rem;
  text-decoration: none;
}
.page-header__brand:hover { color: var(--gold-light); }
.page-header__brand:focus-visible { outline-color: var(--gold); }

.signup--page { padding-top: 40px; justify-content: flex-start; }
.page-title {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.15;
  color: var(--green);
}
.page-title:focus { outline: none; }

.flash {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--green);
  background: #163a2b14;
  font-weight: 500;
}
.flash:focus { outline: 3px solid var(--green); outline-offset: 2px; }

.notice {
  padding: 20px;
  border-left: 4px solid var(--gold);
  background: #d9b46a26;
}
.notice h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.2;
  color: var(--green);
}

.cancel {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #163a2b33;
}
.cancel h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}
.cancel p { margin: 0; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.submit--danger { background: var(--red); gap: 16px; }
.submit--danger:hover { background: #7a1f19; }
.back-link { margin-top: 24px; }

[hidden] { display: none !important; }
.form__errors h1 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 1.75rem; color: var(--red); }
.signup__inner > .form__errors { margin-bottom: 24px; }
