/* ==========================================================
   Real Cofradía de Nuestro Señor en la Oración del Huerto
   Paleta: terciopelo marrón del estandarte, oro del bordado,
   olivo de Getsemaní y piedra clara.
   ========================================================== */

@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --piedra: #f3f3ef;
  --piedra-2: #e7e5dd;
  --tierra: #2b1e17;
  --terciopelo: #4a2f22;
  --terciopelo-claro: #6b4a38;
  --oro: #b8913f;
  --oro-texto: #7a5b1e;
  --olivo: #5e6b3e;
  --hoja: #8f9a68;
  --gris: #6a615a;

  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;

  --ancho: 72rem;
  --ancho-texto: 40rem;
  --margen: clamp(1.25rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --piedra: #1b1410;
    --piedra-2: #2a201a;
    --tierra: #ece6de;
    --terciopelo: #34221a;
    --terciopelo-claro: #d8b98f;
    --oro-texto: #d9b46a;
    --gris: #b3a89e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--piedra);
  color: var(--tierra);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.65;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--terciopelo-claro); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--oro-texto); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; border-radius: 2px; }

.saltar { position: absolute; left: -999px; top: 0.5rem; background: var(--tierra); color: var(--piedra); padding: 0.5rem 1rem; z-index: 10; }
.saltar:focus { left: 0.5rem; }
.lista-limpia { list-style: none; margin: 0; padding: 0; }

/* ---------- Cabecera ---------- */
.cabecera { border-bottom: 1px solid var(--piedra-2); }
.cabecera__interior {
  max-width: var(--ancho); margin: 0 auto; padding: 0.9rem var(--margen);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.marca { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--tierra); }
.marca img { width: 44px; height: 44px; }
.marca__texto { font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.marca__texto small { display: block; font-family: var(--sans); font-weight: 500; font-size: 0.8rem; color: var(--gris); }

.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.menu a { font-family: var(--sans); font-weight: 500; font-size: 1.05rem; color: var(--tierra); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--oro-texto); }
.menu a[aria-current="page"] { border-bottom-color: var(--oro); }
.menu-boton { display: none; }

@media (max-width: 52rem) {
  .js .menu-boton {
    display: block; font: 500 1rem var(--sans); background: none; color: var(--tierra);
    border: 1px solid var(--tierra); border-radius: 2rem; padding: 0.35rem 1rem; cursor: pointer;
  }
  .js .menu { display: none; width: 100%; }
  .js .menu.menu--abierto { display: block; }
  .menu ul { flex-direction: column; padding: 0.5rem 0 0.25rem; }
  .menu a { display: block; padding: 0.55rem 0; border-bottom: 1px solid var(--piedra-2); }
  .menu a[aria-current="page"] { border-bottom-color: var(--oro); }
}

/* ---------- Portada ---------- */
.portada-hero {
  position: relative; overflow: hidden;
  background: var(--terciopelo); color: #f1ebe2;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center; gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2.5rem, 7vw, 5.5rem) max(var(--margen), calc((100% - var(--ancho)) / 2 + var(--margen))) clamp(6rem, 13vw, 10rem);
}
.portada-hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); line-height: 1.04; max-width: 14ch; margin-bottom: 0.5em; }
.portada-hero__lema { font-style: italic; font-size: clamp(1.2rem, 2vw, 1.45rem); max-width: 30ch; color: #e0d4c3; }
.portada-hero__imagen { margin: 0; position: relative; z-index: 1; }
.portada-hero__imagen img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12rem 12rem 0 0; }
.portada-hero a { color: #f1ebe2; }

.cita-martes { margin: 2rem 0; padding-top: 0.9rem; border-top: 1px solid var(--oro); max-width: 28rem; }
.cita-martes__que { display: block; font-family: var(--sans); font-weight: 500; font-size: 0.95rem; color: #cdb98f; }
.cita-martes__cuando time { white-space: nowrap; }
.cita-martes__cuando { display: block; font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; line-height: 1.25; }

.botones { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
.boton {
  display: inline-block; font: 700 1.05rem var(--sans); text-decoration: none;
  padding: 0.7rem 1.4rem; border-radius: 2rem;
  background: var(--oro); color: #24170f !important; border: 1px solid var(--oro);
}
.boton:hover { background: #cda75a; border-color: #cda75a; }
.boton--claro { background: transparent; color: #f1ebe2 !important; border-color: #b9a58a; }
.boton--claro:hover { background: rgba(255, 255, 255, 0.08); border-color: #f1ebe2; }

/* Rama de olivo: el único gesto animado de la web */
.olivo { position: absolute; z-index: 2; left: 0; bottom: -0.5rem; width: min(70%, 820px); height: auto; pointer-events: none; }
@media (max-width: 52rem) { .olivo { width: 100%; } }
.olivo__rama { stroke: var(--oro); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 800; stroke-dashoffset: 0; }
.olivo__hojas use { fill: var(--hoja); }
.olivo__frutos ellipse { fill: #2e3a1d; stroke: var(--hoja); stroke-width: 1; }

@media (prefers-reduced-motion: no-preference) {
  .olivo__rama { animation: dibujar 2.2s ease-out both; }
  .olivo__hojas, .olivo__frutos { animation: aparecer 1.4s 1.2s ease-out both; }
}
@keyframes dibujar { from { stroke-dashoffset: 800; } to { stroke-dashoffset: 0; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 52rem) {
  .portada-hero { grid-template-columns: 1fr; }
  .portada-hero__imagen { max-width: 22rem; }
}

/* ---------- Bloques generales ---------- */
.bloque { max-width: var(--ancho); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--margen); }
.bloque + .bloque { padding-top: 0; }
.bloque--estrecho > * { max-width: var(--ancho-texto); }
.entradilla { font-size: 1.35rem; line-height: 1.5; }
.enlace-flecha { font-family: var(--sans); font-weight: 700; }
.bloque__cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.bloque__cabecera a { font-family: var(--sans); font-weight: 500; }

.lista-noticias { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 2.5rem; }
.noticia-resumen { border-top: 1px solid var(--tierra); padding: 1rem 0 1.5rem; }
.noticia-resumen time { font-family: var(--sans); font-weight: 500; font-size: 0.95rem; color: var(--gris); }
.noticia-resumen h2, .noticia-resumen h3 { font-size: 1.35rem; margin: 0.3rem 0 0.5rem; }
.noticia-resumen h2 a, .noticia-resumen h3 a { color: var(--tierra); text-decoration: none; }
.noticia-resumen h2 a:hover, .noticia-resumen h3 a:hover { color: var(--oro-texto); text-decoration: underline; }
.noticia-resumen p { margin: 0; font-size: 1.05rem; color: var(--gris); }
.lista-noticias--completa { grid-template-columns: 1fr; max-width: var(--ancho-texto); }

.tres-columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 2.5rem; }
.tres-columnas article { padding-top: 1rem; border-top: 3px solid var(--olivo); }
.tres-columnas h3 a { color: var(--tierra); text-decoration: none; }
.tres-columnas h3 a:hover { color: var(--oro-texto); text-decoration: underline; }
.tres-columnas p { font-size: 1.05rem; margin: 0; }

.aviso-difuntos h2 { font-size: 1.4rem; }
.aviso-difuntos__marco { max-width: var(--ancho-texto); border-left: 4px solid var(--terciopelo-claro); padding: 0.25rem 0 0.25rem 1.25rem; }
.aviso-difuntos__marco p:last-child { margin-bottom: 0; }

/* ---------- Páginas interiores ---------- */
.cabecera-pagina { max-width: var(--ancho); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) var(--margen) 1.5rem; }
.cabecera-pagina h1 { margin-bottom: 0.3em; }
.cabecera-pagina > p { font-style: italic; font-size: 1.3rem; color: var(--gris); max-width: 40ch; }
.indice { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--piedra-2); }
.indice a { font-family: var(--sans); font-weight: 500; }

.texto-largo { max-width: var(--ancho); margin: 0 auto; padding: 1rem var(--margen) 4rem; }
.texto-largo > * { max-width: var(--ancho-texto); }
.romano { font-variant-ligatures: no-common-ligatures; font-feature-settings: "liga" 0, "dlig" 0; }
.texto-largo section { padding-top: 2rem; scroll-margin-top: 1rem; }
.texto-largo h3 { margin-top: 1.75rem; }
.figura-ancha { margin: 1.5rem 0; }
.figura-ancha img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.noticia__cabecera { padding: 2rem 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--piedra-2); }
.noticia__cabecera p { font-family: var(--sans); font-weight: 500; margin: 0 0 0.5rem; }
.noticia__cabecera time { font-family: var(--sans); color: var(--gris); }
.noticia img { margin: 1.5rem 0; }

.cargos { margin: 0; }
.cargos div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--piedra-2); }
.cargos dt { font-family: var(--sans); font-weight: 700; }
.cargos dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 30rem) { .cargos div { grid-template-columns: 1fr; gap: 0; } }

.contacto { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2rem 4rem; padding-top: 1rem; }

.galeria { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.25rem; }
.galeria figure { margin: 0; }
.galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.galeria figcaption { font-family: var(--sans); font-size: 0.95rem; color: var(--gris); margin-top: 0.4rem; }

.error { text-align: left; min-height: 40vh; }

/* ---------- Pie ---------- */
.pie { background: var(--terciopelo); color: #e6dccf; margin-top: 2rem; }
.pie a { color: #e6dccf; }
.pie a:hover { color: #e3c27f; }
.pie__interior { max-width: var(--ancho); margin: 0 auto; padding: 3rem var(--margen) 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; font-size: 1rem; }
.pie__nombre { font-weight: 700; font-size: 1.15rem; }
.pie__titulo { font-family: var(--sans); font-weight: 700; margin-bottom: 0.4rem; color: #cdb98f; }
.pie li { margin-bottom: 0.25rem; overflow-wrap: anywhere; }
.pie__legal { max-width: var(--ancho); margin: 0 auto; padding: 1rem var(--margen) 2rem; border-top: 1px solid rgba(255,255,255,0.15); font-family: var(--sans); font-size: 0.9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }

@media print {
  .cabecera, .pie, .olivo, .botones { display: none; }
  .portada-hero { background: none; color: #000; }
}
