/* Taller de Arte Sacro 1 - 2027. Mobile-first, sin dependencias. */
:root {
  --rojo: #FF4242;
  --rojo-oscuro: #D92B2B;      /* hover/foco del botón primario (texto blanco AA) */
  --crema: #F4FAD2;
  --lima: #D4EE5E;
  --azul: #1F4E9E;             /* títulos de nivel (AA sobre blanco) */
  --verde-palido: #E1EDB9;
  --fondo: #F0F2EB;
  --texto: #2b2b2b;
  --texto-suave: #4a4a4a;
  --radio: 14px;
  --sombra: 0 2px 10px rgba(43, 43, 43, .10);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  color: var(--texto);
  background: var(--fondo);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: #8a1010; }
:focus-visible { outline: 3px solid var(--texto); outline-offset: 2px; }
.nobreak { white-space: nowrap; }

.saltar {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--texto); color: #fff; padding: .6rem 1rem;
}
.saltar:focus { left: 0; }

.contenedor { width: min(1100px, 100% - 2rem); margin-inline: auto; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--crema);
  border-bottom: 3px solid var(--lima);
}
.navbar__interior {
  display: flex; align-items: center; justify-content: space-between;
  width: min(1100px, 100% - 1.5rem); margin-inline: auto; min-height: 68px; position: relative;
}
.navbar__marca { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--texto); }
.navbar__logo { width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 2px solid var(--verde-palido); }
.navbar__nombre { font-family: Georgia, serif; font-weight: 700; font-size: 1rem; }

.hamburguesa {
  width: 48px; height: 48px; border: 2px solid var(--texto); border-radius: 10px;
  background: #fff; cursor: pointer; display: grid; place-items: center;
}
.hamburguesa__barras, .hamburguesa__barras::before, .hamburguesa__barras::after {
  display: block; width: 22px; height: 3px; background: var(--texto); border-radius: 2px; content: "";
  position: relative; transition: transform .2s, opacity .2s;
}
.hamburguesa__barras::before { position: absolute; top: -7px; }
.hamburguesa__barras::after { position: absolute; top: 7px; }
.hamburguesa[aria-expanded="true"] .hamburguesa__barras { background: transparent; }
.hamburguesa[aria-expanded="true"] .hamburguesa__barras::before { transform: translateY(7px) rotate(45deg); }
.hamburguesa[aria-expanded="true"] .hamburguesa__barras::after { transform: translateY(-7px) rotate(-45deg); }

.menu {
  display: none; position: absolute; top: 100%; left: -.75rem; right: -.75rem;
  background: var(--crema); border-bottom: 3px solid var(--lima); box-shadow: var(--sombra);
}
.menu.abierto { display: block; }
.menu ul { list-style: none; margin: 0; padding: .5rem 1rem 1rem; }
.menu a {
  display: block; padding: .85rem .5rem; text-decoration: none; color: var(--texto);
  font-weight: 600; border-radius: 8px;
}
.menu a:hover, .menu a.activo { background: var(--lima); }

@media (min-width: 760px) {
  .hamburguesa { display: none; }
  .menu { display: block; position: static; background: none; border: 0; box-shadow: none; }
  .menu ul { display: flex; gap: .25rem; padding: 0; }
  .menu a { padding: .6rem 1rem; }
  .navbar__nombre { font-size: 1.15rem; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: 999px; padding: .7rem 1.4rem; cursor: pointer;
  min-height: 46px; margin: 0 .5rem .5rem 0;
}
/* Texto blanco en negrita y tamaño >= 1.1rem sobre el rojo (contraste 3.4:1, válido para texto grande AA). */
.btn--primario { background: var(--rojo); color: #fff; font-size: 1.1rem; }
.btn--primario:hover { background: var(--rojo-oscuro); }
.btn--primario:disabled { background: #c9c9c0; color: #444; cursor: not-allowed; }
.btn--secundario { background: #fff; color: var(--texto); border-color: var(--texto); }
.btn--secundario:hover { background: var(--lima); }
.btn--grande { padding: .85rem 2rem; font-size: 1.2rem; }
.btn--bloque { display: block; width: 100%; margin: 0; }

/* ---------- Hero ---------- */
.hero { background: var(--crema); padding: 2rem 0 2.5rem; }
.hero__interior { display: grid; gap: 1.5rem; align-items: center; }
.hero__sobre { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; margin-bottom: .5rem; }
.datos { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .5rem; }
.datos li { background: #fff; border-left: 6px solid var(--lima); border-radius: 8px; padding: .55rem .8rem; }
.datos__etq {
  display: inline-block; min-width: 5.5rem; font-weight: 700; margin-right: .4rem;
}
.hero__imagen img {
  border-radius: var(--radio); border: 6px solid #fff; box-shadow: var(--sombra);
  width: 100%; height: auto; aspect-ratio: 1320 / 1160; object-fit: contain; background: #fff;
}
.hero__credito { margin: .5rem 0 0; font-size: .85rem; color: var(--texto-suave); text-align: center; }
@media (min-width: 800px) {
  .hero { padding: 3.5rem 0; }
  .hero__interior { grid-template-columns: 1.2fr .8fr; gap: 3rem; }
}
@media (min-width: 1024px) {
  .hero__interior { grid-template-columns: 1.3fr .8fr; }
  .hero h1 { font-size: clamp(1.9rem, 2.6vw, 2.5rem); }
}

/* ---------- Secciones ---------- */
.seccion { padding: 2.5rem 0; }
.seccion--crema { background: var(--crema); }
.rejilla { display: grid; gap: 1rem; }
@media (min-width: 800px) {
  .rejilla { grid-template-columns: repeat(2, 1fr); }
  .tarjeta--ancha { grid-column: 1 / -1; }
}
.tarjeta--ancha p { max-width: 70ch; }
.nivel-titulo { color: var(--azul); font-weight: 700; margin: 0 0 .25rem; }
.niveles { display: grid; gap: 1rem; margin-top: .5rem; }
.niveles p { margin: 0; }
@media (min-width: 800px) { .niveles { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }
.tarjeta {
  background: #fff; border: 2px solid var(--verde-palido); border-radius: var(--radio);
  padding: 1.25rem; box-shadow: var(--sombra);
}
.vacio {
  background: var(--verde-palido); border: 2px dashed #a9bd62; border-radius: var(--radio);
  padding: 2rem 1rem; text-align: center; font-size: 1.1rem;
}
.galeria { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.galeria:empty { display: none; }
.galeria__item { margin: 0; background: #fff; border: 2px solid var(--verde-palido); border-radius: var(--radio); overflow: hidden; }
.galeria__item figcaption { padding: .6rem .8rem; font-size: .9rem; }

.pie { background: var(--texto); color: #f0f2eb; padding: 1.5rem 0; text-align: center; }
.pie p { margin: .2rem 0; }

/* ---------- Stepper ---------- */
.stepper {
  list-style: none; margin: 0 0 1.25rem; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.stepper__paso {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem;
  font-size: .85rem; font-weight: 600; color: var(--texto-suave); position: relative;
}
.stepper__paso::before {
  content: ""; position: absolute; top: 19px; left: -50%; width: 100%; height: 4px;
  background: var(--verde-palido); z-index: 0;
}
.stepper__paso:first-child::before { display: none; }
.stepper__num {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  background: #fff; border: 3px solid var(--verde-palido); color: var(--texto);
}
.stepper__paso.activo { color: var(--texto); }
.stepper__paso.activo .stepper__num { background: var(--lima); border-color: var(--texto); }
.stepper__paso.completado::before { background: var(--lima); }
.stepper__paso.completado .stepper__num { background: var(--texto); border-color: var(--texto); color: var(--lima); font-size: 0; }
.stepper__paso.completado .stepper__num::after { content: "\2713"; font-size: 1.15rem; }
@media (min-width: 600px) {
  .stepper__paso { font-size: 1rem; }
}

/* ---------- Panel de registro ---------- */
.panel {
  background: #fff; border: 2px solid var(--verde-palido); border-radius: var(--radio);
  padding: 1.5rem; box-shadow: var(--sombra);
}
.nota { font-size: .9rem; color: var(--texto-suave); }
.acciones { margin-top: 1rem; }

.resumen { display: grid; gap: .5rem; margin: 0 0 1rem; }
.resumen div { background: var(--crema); border-radius: 8px; padding: .5rem .8rem; }
.resumen dt { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-suave); }
.resumen dd { margin: 0; font-size: 1.05rem; }
.resumen__imagen { margin: 0 0 1rem; max-width: 260px; }
.resumen__imagen img { border-radius: 10px; border: 4px solid var(--verde-palido); aspect-ratio: 1; object-fit: cover; width: 100%; }
@media (min-width: 700px) {
  .resumen { grid-template-columns: 1fr 1fr; }
}

.mensaje { border-radius: 8px; padding: .7rem .9rem; font-weight: 600; }
.mensaje--error { background: #fff; border: 2px solid var(--rojo); color: var(--texto); }
.mensaje--aviso { background: var(--lima); border: 2px solid var(--texto); }

.exito { text-align: center; padding: 1rem 0; }
.exito__marca {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--lima);
  border: 3px solid var(--texto); display: grid; place-items: center; font-size: 2rem; font-weight: 800;
}
.exito__codigo-etq { margin-bottom: .25rem; font-weight: 600; }
.exito__codigo {
  display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800; letter-spacing: .12em; background: var(--crema); border: 3px dashed var(--texto);
  border-radius: 12px; padding: .5rem 1.25rem; margin-bottom: 1rem; user-select: all;
}

/* ---------- Dialogs (modal y drawer) ---------- */
dialog { color: var(--texto); padding: 0; border: 0; }
dialog::backdrop { background: rgba(43, 43, 43, .55); }

.modal {
  width: min(520px, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); overflow: auto;
  border-radius: var(--radio); background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.modal form { padding: 1.25rem; }
.modal__cabecera, .drawer__cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.modal__cabecera h2, .drawer__cabecera h2 { margin: 0 0 1rem; }
.modal__pie { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.modal__pie .btn { margin: 0; }
.cerrar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--texto);
  background: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--texto);
}
.cerrar:hover { background: var(--lima); }

.campo { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.campo label, .campo legend { display: block; font-weight: 700; margin-bottom: .3rem; padding: 0; }
.campo input[type="text"], .campo input[type="tel"], .campo input[type="email"] {
  width: 100%; font: inherit; padding: .7rem .8rem; min-height: 46px;
  border: 2px solid #8b9564; border-radius: 10px; background: #fff; color: var(--texto);
}
.campo input[aria-invalid="true"] { border-color: var(--rojo); background: #fff6f6; }
.campo__ayuda { font-size: .85rem; color: var(--texto-suave); margin: .25rem 0 0; }
.campo__error { color: #a31212; font-weight: 600; font-size: .9rem; margin: .3rem 0 0; }
.campo--radios { display: grid; gap: .5rem; }
.radio {
  display: flex !important; align-items: center; gap: .6rem; font-weight: 600 !important;
  border: 2px solid var(--verde-palido); border-radius: 10px; padding: .7rem .8rem; cursor: pointer; margin: 0 !important;
}
.radio input { width: 22px; height: 22px; accent-color: var(--rojo); margin: 0; }
.radio:has(input:checked) { background: var(--lima); border-color: var(--texto); }
.radio:has(input:focus-visible) { outline: 3px solid var(--texto); outline-offset: 2px; }

/* Drawer lateral derecho */
.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh;
  width: 94vw; max-width: 520px; background: var(--fondo);
  padding: 1rem; overflow: auto;
  border-radius: var(--radio) 0 0 var(--radio); box-shadow: -8px 0 30px rgba(0,0,0,.3);
}
.drawer[open] { display: flex; flex-direction: column; animation: entra .25s ease-out; }
@keyframes entra { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .drawer[open] { animation: none; }
  html { scroll-behavior: auto; }
}
.drawer__sub { margin-top: -.5rem; font-weight: 600; }
.obras { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; flex: 1; align-content: start; }
.obra {
  position: relative; padding: 0; font: inherit; text-align: left; cursor: pointer; color: var(--texto);
  background: #fff; border: 3px solid var(--verde-palido); border-radius: 12px; overflow: hidden;
}
.obra img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.obra__info { display: block; padding: .5rem .6rem .65rem; }
.obra__titulo { display: block; font-weight: 700; font-size: .95rem; }
.obra__cupos { display: inline-block; margin-top: .25rem; font-size: .8rem; font-weight: 700; background: var(--lima); border-radius: 999px; padding: .1rem .55rem; }
.obra:hover:not([aria-disabled="true"]) { border-color: var(--texto); }
.obra[aria-pressed="true"] { border-color: var(--texto); box-shadow: 0 0 0 4px var(--lima); }
.obra[aria-pressed="true"]::after {
  content: "\2713 Elegida"; position: absolute; top: .5rem; right: .5rem; background: var(--texto); color: var(--lima);
  font-weight: 800; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px;
}
.obra[aria-disabled="true"] { cursor: not-allowed; }
.obra[aria-disabled="true"] img { filter: grayscale(1); opacity: .45; }
.obra[aria-disabled="true"] .obra__cupos { background: var(--texto); color: #fff; }
.obra[aria-disabled="true"] .obra__titulo { color: var(--texto-suave); }
.obra--cargando { opacity: .6; }
.drawer__pie { position: sticky; bottom: 0; background: var(--fondo); padding-top: .75rem; margin-top: .75rem; }
@media (min-width: 600px) {
  .drawer { width: 520px; padding: 1.25rem; }
}

/* Estado del paso para lectores de pantalla */
.stepper__txt::after {
  content: attr(data-estado);
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
