/* ==========================================================================
   Maqueta — App del peregrino · Santuario Teresa de Los Andes
   Sistema visual «La luz del valle de Auco», heredado de la landing.
   ========================================================================== */

@font-face { font-family: 'Piazzolla'; src: local('Piazzolla'); }

:root {
  /* Cielos */
  --noche: #101c3d;
  --noche-hondo: #0a1329;
  --alba: #f3c49d;
  --alba-alta: #e9a377;
  --mediodia: #faf6ee;
  --tarde: #f0d9a6;
  --vigilia: #16244a;

  /* Materia */
  --tinta: #241b10;
  --teja: #a04524;
  --teja-oscura: #7c3319;
  --carmelo: #5f4a33;
  --estrella: #f7f0e0;
  --estrella-tenue: #c3c4de;
  --vigilia-tenue: #b9bedd;
  --oro: #d9a441;

  --muro-linea: rgba(36, 27, 16, 0.14);
  --muro-suave: rgba(36, 27, 16, 0.05);

  --f-display: 'Piazzolla', Georgia, 'Times New Roman', serif;
  --f-rotulo: 'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --sombra-muro: 0 10px 30px -12px rgba(56, 38, 20, 0.35);
  --sombra-noche: 0 12px 34px -14px rgba(2, 6, 20, 0.55);

  --radio: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0d1730;
  background-image:
    radial-gradient(ellipse 120% 60% at 50% 0%, #1b2c56 0%, #0d1730 60%);
  color: var(--estrella);
  font-family: var(--f-display);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Encabezado de la maqueta ---------- */

.hoja {
  width: min(100% - 2.5rem, 90rem);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 5rem;
}

.hoja__rotulo {
  font-family: var(--f-rotulo);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oro);
  margin: 0 0 0.9rem;
}

.hoja__titulo {
  font-size: clamp(2.2rem, 5vw + 0.5rem, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-weight: 640;
  max-width: 22ch;
}

.hoja__baja {
  color: var(--estrella-tenue);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 0 2rem;
}

.controles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(247, 240, 224, 0.14);
  margin-bottom: 3rem;
}

.control {
  font-family: var(--f-rotulo);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--estrella);
  background: rgba(247, 240, 224, 0.06);
  border: 1.5px solid rgba(247, 240, 224, 0.28);
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.control:hover { background: rgba(247, 240, 224, 0.14); }
.control[aria-pressed='true'] {
  background: var(--oro);
  border-color: var(--oro);
  color: #2a1c05;
}

.control__nota {
  font-family: var(--f-rotulo);
  font-size: 0.8rem;
  color: var(--estrella-tenue);
  margin-left: auto;
}

/* ---------- Rejilla de pantallas ---------- */

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(2.5rem, 4vw, 4rem) clamp(1.5rem, 3vw, 3rem);
  justify-items: center;
}

.pieza { max-width: 22rem; }

.pieza__pie {
  margin-top: 1.15rem;
}

.pieza__num {
  font-family: var(--f-rotulo);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro);
}

.pieza__nombre {
  font-size: 1.25rem;
  margin: 0.25rem 0 0.4rem;
  font-weight: 640;
}

.pieza__texto {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--estrella-tenue);
  margin: 0;
}

/* ---------- El teléfono ---------- */

.tel {
  width: 340px;
  height: 736px;
  border-radius: 40px;
  padding: 10px;
  background: linear-gradient(160deg, #2a3350, #131b30);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(247, 240, 224, 0.1);
  position: relative;
}

.tel__pantalla {
  height: 100%;
  border-radius: 31px;
  overflow: hidden;
  background: var(--mediodia);
  color: var(--tinta);
  display: flex;
  flex-direction: column;
  position: relative;
  font-size: 15px;
  line-height: 1.5;
}

/* barra de estado */
.estado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1.35rem 0.3rem;
  font-family: var(--f-rotulo);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex: none;
}
.estado--claro { color: var(--estrella); }
.estado__señal { display: flex; gap: 4px; align-items: center; opacity: 0.85; }
.estado__señal span { display: block; width: 3px; border-radius: 1px; background: currentColor; }

/* lienzo desplazable */
.lienzo {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.lienzo::-webkit-scrollbar { display: none; }

/* barra inferior */
.barra {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 0.5rem 0.4rem 0.85rem;
  background: rgba(250, 246, 238, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--muro-linea);
}
.barra--noche {
  background: rgba(16, 28, 61, 0.94);
  border-top-color: rgba(247, 240, 224, 0.16);
}

.barra__it {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--f-rotulo);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--carmelo);
  text-decoration: none;
  padding: 0.25rem 0;
  border-radius: 8px;
}
.barra--noche .barra__it { color: var(--estrella-tenue); }
.barra__it svg { width: 22px; height: 22px; }
.barra__it[aria-current='page'] { color: var(--teja); }
.barra--noche .barra__it[aria-current='page'] { color: var(--oro); }

/* ---------- Piezas de interfaz dentro del teléfono ---------- */

.cielo {
  position: relative;
  padding: 1rem 1.35rem 0;
  color: var(--estrella);
  background: linear-gradient(178deg, var(--noche) 0%, #1b2b57 100%);
}
.cielo--vigilia { background: linear-gradient(178deg, var(--vigilia) 0%, #0d1733 100%); }
.cielo__foto {
  position: absolute; inset: 0;
  object-fit: cover; width: 100%; height: 100%;
  opacity: 0.42;
  filter: saturate(0.85);
}
.cielo__cuerpo { position: relative; padding-bottom: 1.5rem; }

.cerro { display: block; width: 100%; margin-top: -1px; }

.zona { padding: 1.4rem 1.35rem; }
.zona + .zona { border-top: 1px solid var(--muro-suave); }

.rot {
  font-family: var(--f-rotulo);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--carmelo);
  margin: 0 0 0.6rem;
}
.rot--luz { color: rgba(247, 240, 224, 0.72); }
.rot--teja { color: var(--teja); }

h1.tit { font-size: 1.85rem; line-height: 1.1; margin: 0 0 0.4rem; font-weight: 640; letter-spacing: -0.015em; }
h2.tit { font-size: 1.35rem; line-height: 1.15; margin: 0 0 0.5rem; font-weight: 640; }
h3.tit { font-size: 1.05rem; margin: 0 0 0.25rem; font-weight: 640; }
p { margin: 0 0 0.7rem; }
p:last-child { margin-bottom: 0; }

.tenue { color: var(--carmelo); font-size: 0.88rem; }
.tenue--luz { color: var(--estrella-tenue); }

/* tarjeta de próxima misa: la pieza más importante de la app */
.misa {
  background: rgba(250, 246, 238, 0.97);
  color: var(--tinta);
  border-radius: var(--radio);
  padding: 1rem 1.1rem;
  box-shadow: var(--sombra-noche);
  border-left: 5px solid var(--teja);
}
.misa__hora {
  font-family: var(--f-rotulo);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0.2rem;
}
.misa__falta { font-family: var(--f-rotulo); font-size: 0.8rem; font-weight: 600; color: var(--teja); }

.estados { display: grid; gap: 0.5rem; }
.est {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--f-rotulo); font-size: 0.82rem; font-weight: 600;
}
.punto { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.punto--abierto { background: #3f7d4a; box-shadow: 0 0 0 3px rgba(63, 125, 74, 0.18); }
.punto--cerrado { background: #9a9186; }
.est__cierre { margin-left: auto; color: var(--carmelo); font-weight: 500; }

/* avisos */
.aviso {
  display: flex; gap: 0.75rem;
  background: #fdf2dd;
  border: 1.5px solid rgba(217, 164, 65, 0.55);
  border-radius: var(--radio);
  padding: 0.85rem 0.95rem;
}
.aviso__icono { flex: none; color: var(--teja); }
.aviso__t { font-family: var(--f-rotulo); font-weight: 700; font-size: 0.88rem; margin: 0 0 0.15rem; }
.aviso__d { font-size: 0.85rem; margin: 0; color: var(--carmelo); }

/* cita */
.cita {
  font-size: 1.15rem;
  line-height: 1.45;
  font-style: italic;
  margin: 0 0 0.5rem;
}
.cita__firma { font-family: var(--f-rotulo); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--carmelo); }

/* accesos rápidos */
.accesos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.acceso {
  display: flex; flex-direction: column; gap: 0.45rem;
  min-height: 84px;
  padding: 0.8rem;
  border-radius: var(--radio);
  border: 1.5px solid var(--muro-linea);
  background: #fff;
  color: var(--tinta);
  text-decoration: none;
  font-family: var(--f-rotulo);
  font-weight: 600;
  font-size: 0.88rem;
}
.acceso svg { color: var(--teja); }
.acceso--fuerte { background: var(--teja); border-color: var(--teja); color: var(--estrella); }
.acceso--fuerte svg { color: var(--estrella); }

/* tabla de horarios */
.tabla { width: 100%; border-collapse: collapse; font-family: var(--f-rotulo); font-size: 0.92rem; }
.tabla th, .tabla td { text-align: left; padding: 0.6rem 0; border-bottom: 1px solid var(--muro-linea); vertical-align: baseline; }
.tabla th { font-weight: 600; color: var(--carmelo); }
.tabla td { font-weight: 700; text-align: right; }
.tabla tr:last-child th, .tabla tr:last-child td { border-bottom: 0; }

.salvedad {
  display: flex; gap: 0.6rem;
  font-size: 0.8rem; line-height: 1.45; color: var(--carmelo);
  background: var(--muro-suave);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-top: 0.9rem;
}
.salvedad svg { flex: none; color: var(--teja); margin-top: 1px; }

/* dato con acción (teléfono) */
.linea {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--muro-linea);
  font-family: var(--f-rotulo);
  font-size: 0.9rem;
}
.linea:last-child { border-bottom: 0; }
.linea__t { font-weight: 700; }
.linea__d { font-size: 0.78rem; color: var(--carmelo); font-weight: 500; }
.linea__ir { margin-left: auto; color: var(--teja); }

/* botón grande */
.boton {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%;
  min-height: 52px;
  border-radius: var(--radio);
  background: var(--teja);
  color: var(--estrella);
  font-family: var(--f-rotulo);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 0;
  box-shadow: var(--sombra-muro);
}
.boton--calado {
  background: transparent;
  color: var(--teja);
  border: 2px solid var(--teja);
  box-shadow: none;
}
.boton--luz { background: var(--oro); color: #2a1c05; }

/* paradas del recorrido */
.parada {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--muro-linea);
}
.parada:last-child { border-bottom: 0; }
.parada__n {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--teja);
  color: var(--teja);
  font-family: var(--f-rotulo);
  font-weight: 700;
  font-size: 0.95rem;
}
.parada__n--hecha { background: var(--teja); color: var(--estrella); }
.parada__t { font-weight: 640; font-size: 1rem; margin: 0 0 0.1rem; line-height: 1.25; }
.parada__d { font-family: var(--f-rotulo); font-size: 0.75rem; color: var(--carmelo); display: flex; gap: 0.5rem; align-items: center; }

/* reproductor */
.audio {
  background: var(--vigilia);
  color: var(--estrella);
  border-radius: var(--radio);
  padding: 1rem;
}
.audio__fila { display: flex; align-items: center; gap: 0.9rem; }
.audio__play {
  width: 54px; height: 54px; flex: none;
  border-radius: 50%;
  background: var(--oro);
  color: #2a1c05;
  display: grid; place-items: center;
  border: 0;
}
.audio__barra { height: 4px; border-radius: 2px; background: rgba(247, 240, 224, 0.25); position: relative; margin-bottom: 0.4rem; }
.audio__avance { position: absolute; inset: 0 auto 0 0; width: 34%; background: var(--oro); border-radius: 2px; }
.audio__tiempos { display: flex; justify-content: space-between; font-family: var(--f-rotulo); font-size: 0.72rem; color: var(--vigilia-tenue); }

/* oración: los versos no deben quebrarse, se leen con el brazo estirado */
.verso {
  font-size: 1.06rem;
  line-height: 1.75;
  margin: 0;
  color: var(--estrella);
}
.verso span { display: block; text-indent: -0.6rem; padding-left: 0.6rem; }

/* novena */
.dias { display: flex; gap: 0.4rem; }
.dia {
  flex: 1;
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1.5px solid rgba(247, 240, 224, 0.3);
  font-family: var(--f-rotulo);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--estrella-tenue);
}
.dia--hecho { background: rgba(217, 164, 65, 0.9); border-color: transparent; color: #2a1c05; }
.dia--hoy { border-color: var(--oro); color: var(--oro); border-width: 2.5px; }

.paso { display: flex; gap: 0.7rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(247, 240, 224, 0.14); }
.paso:last-child { border-bottom: 0; }
.paso__n { font-family: var(--f-rotulo); font-size: 0.78rem; font-weight: 700; color: var(--oro); flex: none; width: 1.2rem; }
.paso__t { font-size: 0.95rem; margin: 0 0 0.1rem; font-weight: 640; }
.paso__d { font-size: 0.82rem; color: var(--vigilia-tenue); margin: 0; }

/* hitos */
.hito { display: flex; gap: 0.9rem; }
.hito__anio {
  font-family: var(--f-rotulo);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--teja);
  flex: none;
  width: 2.7rem;
  padding-top: 0.15rem;
}
.hito__riel { flex: none; width: 2px; background: var(--muro-linea); position: relative; }
.hito__riel::before {
  content: ''; position: absolute; top: 0.35rem; left: -4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--mediodia); border: 2px solid var(--teja);
}
.hito__texto { padding-bottom: 1.1rem; font-size: 0.95rem; }

/* plano del recinto */
.plano { background: #efe6d4; border-radius: var(--radio); overflow: hidden; border: 1.5px solid var(--muro-linea); }

/* ajustes */
.ajuste { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 0; border-bottom: 1px solid var(--muro-linea); }
.ajuste:last-child { border-bottom: 0; }
.ajuste__t { font-family: var(--f-rotulo); font-weight: 600; font-size: 0.92rem; }
.ajuste__d { font-size: 0.78rem; color: var(--carmelo); }
.palanca { margin-left: auto; flex: none; width: 46px; height: 27px; border-radius: 999px; background: #d6cec0; position: relative; }
.palanca::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.palanca--on { background: var(--teja); }
.palanca--on::after { left: auto; right: 3px; }

.foto-sangre { width: 100%; height: 190px; object-fit: cover; }

/* ---------- Modo «sol de frente» ---------- */

body.sol .tel__pantalla { font-size: 16px; }
body.sol .tel__pantalla .tenue,
body.sol .tel__pantalla .linea__d,
body.sol .tel__pantalla .ajuste__d,
body.sol .tel__pantalla .parada__d,
body.sol .tel__pantalla .aviso__d,
body.sol .tel__pantalla .cita__firma,
body.sol .tel__pantalla .tabla th,
body.sol .tel__pantalla .salvedad { color: #3a2c1c; }
body.sol .tel__pantalla .cielo__foto { display: none; }
body.sol .tel__pantalla .cielo { background: var(--noche-hondo); }
body.sol .tel__pantalla .acceso,
body.sol .tel__pantalla .plano,
body.sol .tel__pantalla .misa { border-width: 2.5px; border-color: var(--tinta); }
body.sol .tel__pantalla .misa { border-left-color: var(--teja); border-left-width: 6px; }
body.sol .tel__pantalla .boton { box-shadow: none; border: 2.5px solid var(--teja-oscura); background: var(--teja-oscura); }
body.sol .tel__pantalla .rot { color: #3a2c1c; }

/* Sobre cielo de noche o vigilia el contraste se refuerza al revés: más luz, no más tinta. */
body.sol .tel__pantalla .rot--luz { color: rgba(247, 240, 224, 0.92); }
body.sol .tel__pantalla .tenue--luz,
body.sol .tel__pantalla .cielo .tenue,
body.sol .tel__pantalla .audio .tenue { color: #e8e4d6; }
body.sol .tel__pantalla .linea__d[style] { color: #e8e4d6 !important; }
body.sol .tel__pantalla .paso__d { color: #ded9c9; }
body.sol .tel__pantalla .audio__tiempos { color: #ded9c9; }

/* ---------- Cierre de la hoja ---------- */

.notas {
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(247, 240, 224, 0.14);
  max-width: 62ch;
}
.notas h2 { font-size: 1.5rem; margin: 0 0 1rem; }
.notas ul { padding-left: 1.1rem; color: var(--estrella-tenue); line-height: 1.65; }
.notas li { margin-bottom: 0.6rem; }
.notas a { color: var(--oro); }

@media (max-width: 420px) {
  .tel { width: 100%; max-width: 340px; height: auto; aspect-ratio: 340 / 736; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
