/* Página QR de IDP Salinas Pueblo.
   Una sola columna para celular: logo, versículo, botones, eventos, horario.
   Los formularios y detalles se abren en hojas que suben desde abajo. */

/* ---------- Colores y fuentes ---------- */

:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --ink: #1b2438;
  --muted: #5b6478;
  --line: #d9dee7;
  --accent: #b8862b;
  --accent-ink: #ffffff;
  --deep: #1f2e4d;
  --deep-ink: #f3efe4;
  --error: #b42318;
  --display: "Young Serif", Georgia, serif;
  --body: "Figtree", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141d;
    --surface: #1a2030;
    --ink: #e9ecf2;
    --muted: #9aa3b6;
    --line: #2b3346;
    --accent: #d9a84a;
    --accent-ink: #1a1408;
    --deep: #24345a;
    --error: #f97066;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #10141d;
  --surface: #1a2030;
  --ink: #e9ecf2;
  --muted: #9aa3b6;
  --line: #2b3346;
  --accent: #d9a84a;
  --accent-ink: #1a1408;
  --deep: #24345a;
  --error: #f97066;
  color-scheme: dark;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Con una hoja abierta, la página de atrás no se mueve al deslizar. */
body:has(.scrim:not([hidden])) { overflow: hidden; }
img { max-width: 100%; }

body {
  margin: 0;
  /* viewport-fit=cover: en iPhone de lado, el notch tapa el borde si no se respeta el área segura. */
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 440px;
  margin: 0 auto;
  padding-block: 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

:is(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sec-title {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

footer { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Encabezado ---------- */

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}
.logo img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.04); }

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  text-wrap: balance;
}

.tag { margin: 0; color: var(--muted); font-size: 15px; text-wrap: balance; }

.demo {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Versículo del día ---------- */

.verse {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  border-radius: 18px;
  background: var(--deep);
  color: var(--deep-ink);
}
.verse .lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.verse blockquote { margin: 0; font-family: var(--display); font-size: 19px; line-height: 1.4; }
.verse cite { font-style: normal; font-size: 14px; color: var(--accent); }

/* ---------- Botones principales ---------- */

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

.btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: 500 16px var(--body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }

.btn .ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--accent);
}
.btn .ic svg { width: 20px; height: 20px; }
.btn .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.btn small { color: var(--muted); font-weight: 400; font-size: 13px; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary .ic { background: rgba(255, 255, 255, .22); color: var(--accent-ink); }
.btn.primary small { color: var(--accent-ink); opacity: .85; }

/* Iconos: assets/iconos.svg */
.icono {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Tarjetas con filas (eventos y horario) ---------- */

.card {
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.row:last-child { border-bottom: 0; }
.row span:last-child { color: var(--muted); }

/* ---------- Próximos eventos ---------- */

.ev-sec { display: flex; flex-direction: column; gap: 24px; }

.ev { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }

.ev-date {
  flex: none;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.ev-date b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ev-date span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.ev-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.ev-info strong { font-weight: 600; }
.ev-info small { color: var(--muted); font-size: 13px; }
.ev-info a { color: var(--accent); font-size: 13px; }
.ev-info p { margin: 0; font-size: 14px; color: var(--muted); white-space: pre-line; }

.ev-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.ev-info .ev-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font: 600 14px var(--body);
  text-decoration: none;
  cursor: pointer;
}
.ev-info .ev-btn.primario { background: var(--accent); color: var(--accent-ink); }

.ev-img { display: block; margin-top: 8px; }
.ev-img img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.empty { margin: 0; padding: 12px 0; color: var(--muted); }

/* ---------- Hojas inferiores ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 14, 24, .5);
}

.sheet {
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90%;
  overflow: auto;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--ink);
}
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; }
.sheet p { margin: 0; color: var(--muted); }

.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.x {
  min-width: 44px;
  min-height: 44px;
  margin: -6px -10px -6px 0;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Formularios ---------- */

form { display: flex; flex-direction: column; gap: 12px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }

input,
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: 16px var(--body);
}
textarea { min-height: 96px; resize: vertical; }

.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }

.submit {
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 16px var(--body);
  cursor: pointer;
}
.submit:disabled { opacity: .6; cursor: wait; }

.sheet .err { color: var(--error); font-size: 14px; }

/* Campo trampa para bots: invisible para las personas. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ok {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
}
.ok strong { font-family: var(--display); font-weight: 400; font-size: 18px; }

/* ---------- Contactos y ofrendas ---------- */

.contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.contact:last-child { border-bottom: 0; }
.contact div { min-width: 0; overflow-wrap: anywhere; }
.contact b { display: block; font-weight: 600; }
.contact span { color: var(--muted); user-select: all; font-variant-numeric: tabular-nums; }

.copy {
  flex: none;
  min-height: 44px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: 500 13px var(--body);
  cursor: pointer;
}

.ath { padding: 12px 14px 0; border-radius: 12px; background: var(--bg); }
.ath .contact { border-bottom: 0; }
.ath-lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

.steps { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; }
.sheet .note { font-size: 13px; }

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
