/* Iglesia Anglicana Reformada de Chile — hoja base compartida
   Paleta, cabecera, navegación y pie comunes a todas las páginas. */

:root {
  --navy: #10283b;
  --wine: #751831;
  --gold: #c49b54;
  --paper: #faf6ef;
  --white: #fffdf9;
  --ink: #192d41;
  --muted: #506071;
  --line: #e5d8c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#contenido { flex: 1 0 auto; }

img { max-width: 100%; }

a { color: inherit; text-underline-offset: 4px; }

.sg-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.sg-skip:focus { left: 8px; top: 8px; }

/* ---------- Cabecera ---------- */
.sg-bar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}
.sg-wrap {
  width: min(1160px, calc(100% - 40px));
  margin: auto;
}
.sg-bar > .sg-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 10px;
  flex-wrap: wrap;
}
.sg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 1.05rem Georgia, "Times New Roman", serif;
  color: var(--ink);
}
.sg-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  flex: none;
}

.sg-nav {
  display: flex;
  align-items: center;
  gap: 4px 18px;
  flex-wrap: wrap;
  font-size: 0.93rem;
  font-weight: 650;
  background: none;
  border: 0;
}
.sg-nav > a,
.sg-sub > summary {
  text-decoration: none;
  padding: 8px 2px;
  color: var(--ink);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  list-style: none;
}
.sg-sub > summary::-webkit-details-marker { display: none; }
.sg-sub > summary::after { content: " ▾"; font-size: 0.75em; }
.sg-nav > a:hover,
.sg-sub > summary:hover { border-bottom-color: var(--gold); }
.sg-nav > a[aria-current="page"],
.sg-sub[data-active] > summary { border-bottom-color: var(--gold); }

.sg-sub { position: relative; }
.sg-submenu {
  position: absolute;
  top: calc(100% + 4px);
  left: -12px;
  min-width: 208px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(16, 40, 59, 0.14);
  padding: 8px;
  display: grid;
  gap: 2px;
  z-index: 70;
}
.sg-submenu a {
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 7px;
  font-weight: 600;
}
.sg-submenu a:hover { background: #f2e6dd; }

.sg-mobile { display: none; }
.sg-mobile > summary {
  font: 700 0.95rem system-ui, sans-serif;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: var(--white);
  list-style: none;
  white-space: nowrap;
}
.sg-mobile > summary::-webkit-details-marker { display: none; }
.sg-mobile nav {
  position: absolute;
  right: 20px;
  left: 20px;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(16, 40, 59, 0.16);
  padding: 10px;
  display: grid;
  gap: 2px;
  z-index: 80;
}
.sg-mobile a {
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.95rem;
}
.sg-mobile a:hover { background: #f2e6dd; }
.sg-mobile a[aria-current="page"] { background: #f2e6dd; }

@media (max-width: 900px) {
  .sg-nav { display: none; }
  .sg-mobile { display: block; }
  .sg-brand span { font-size: 0.98rem; }
}

/* ---------- Píe de página ---------- */
.sg-foot {
  background: var(--wine);
  color: #fdf3e6;
  margin-top: 0;
  font-size: 0.9rem;
}
.sg-foot > .sg-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  align-items: center;
  justify-content: center;
  padding-block: 22px;
  text-align: center;
}
.sg-foot a { color: inherit; }

/* ---------- Avisos (generados desde datos) ---------- */
.sg-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sg-card time {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.sg-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--wine);
  font-size: 1.4rem;
  margin: 0;
  line-height: 1.15;
}
.sg-card p { margin: 6px 0 10px; }
.sg-card .sg-more {
  margin-top: auto;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  align-self: flex-start;
  padding-bottom: 2px;
}
.sg-avisos-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.sg-aviso-full { grid-column: 1 / -1; }

/* ---------- Secciones generadas ---------- */
.sg-section { padding: clamp(34px, 5.5vw, 64px) 0; }
.sg-section > .sg-wrap > h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--wine);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  margin: 0 0 8px;
}
.sg-section > .sg-wrap > h2::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  background: var(--gold);
  margin: 16px 0 26px;
}
