/* ============================================
   FIHNEC — Brand styles (mobile + desktop)
   Colores / tipografía de fraternidad.org.sv
   ============================================ */

:root {
  --color-primary: #a90707;
  --color-primary-dark: #8a0606;
  --color-primary-light: #ce2a2b;
  --color-accent: #046BD2;
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-whatsapp: #25d366;
  --color-email: #32373c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --container: 1120px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100dvh;
}

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(10px);
  color: white;
}

.site-header--solid {
  background: var(--color-primary);
}

.site-header__inner {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
}

.site-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  padding: 3px;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #111827;
  flex-direction: column;
  padding: 1rem;
  gap: 0.25rem;
}

.site-nav.is-open { display: flex; }

.site-nav a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.site-nav a.is-active,
.site-nav a:hover {
  background: rgba(255,255,255,0.1);
}

.nav-cta {
  background: var(--color-primary) !important;
  text-align: center;
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    background: transparent;
    padding: 0;
    gap: 0.25rem;
  }
  .nav-cta {
    margin-top: 0;
    margin-left: 0.5rem;
    padding-inline: 1.1rem !important;
  }
}

/* ---- Home hero ---- */
.home-hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: grid;
  align-items: end;
  color: white;
  overflow: hidden;
}

.home-hero__media {
  position: absolute;
  inset: 0;
}

.home-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.home-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17,24,39,0.35) 0%, rgba(169,7,7,0.82) 100%);
}

.home-hero__content {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
  padding: 3rem 0 3.5rem;
}

.home-hero__eyebrow,
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.home-hero__eyebrow,
.section-eyebrow.light { color: rgba(255,255,255,0.85); }

.section-eyebrow.center,
.section-title { text-align: center; }

.home-hero h1 {
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 16ch;
  margin-bottom: 1rem;
}

.home-hero__lead {
  font-size: 1rem;
  max-width: 42ch;
  opacity: 0.95;
  margin-bottom: 1.5rem;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
}

.btn:active { transform: scale(0.98); }
.btn--full { width: 100%; }
.btn--primary { background: var(--color-primary); color: white; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--ghost {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.55);
}
.btn--outline {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  margin-bottom: 0.75rem;
}
.btn--whatsapp { background: var(--color-whatsapp); color: white; }
.btn--email { background: var(--color-email); color: white; }

/* ---- Home sections ---- */
.about-block {
  padding: 4rem 0;
  background: var(--color-surface);
}

.about-block__grid {
  display: grid;
  gap: 2rem;
}

.about-block h2,
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.about-block p { color: var(--color-text-muted); margin-bottom: 1rem; }
.about-block__image img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.pillars {
  padding: 4rem 0;
  background: #111827;
  color: white;
}

.pillars .section-eyebrow { color: #fca5a5; }
.pillars__grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.pillar {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.pillar h3 {
  color: #fecaca;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.pillar p { color: rgba(255,255,255,0.8); font-size: 0.95rem; }

.stories {
  padding: 4rem 0;
  background: var(--color-bg);
}

.section-lead {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 60ch;
  margin: 0 auto 2rem;
}

.stories__grid,
.events__grid {
  display: grid;
  gap: 1.25rem;
}

.story-card,
.event-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.story-card img,
.event-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.story-card__body,
.event-card {
  padding: 1.25rem;
}

.event-card img { margin: -1.25rem -1.25rem 1rem; width: calc(100% + 2.5rem); max-width: none; }

.story-card h3,
.event-card h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.story-card__role {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.story-card__quote {
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.story-card p:last-child,
.event-card p { color: var(--color-text-muted); font-size: 0.9rem; }

.chapters-cta {
  position: relative;
  padding: 4.5rem 0;
  color: white;
  overflow: hidden;
}

.chapters-cta__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(169,7,7,0.9), rgba(17,24,39,0.85)),
    url('../assets/images/hero-capitulos.jpg') center / cover;
}

.chapters-cta__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.chapters-cta h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.chapters-cta p {
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.events { padding: 4rem 0 3rem; background: var(--color-surface); }

@media (min-width: 768px) {
  .about-block__grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
  .pillars__grid,
  .stories__grid,
  .events__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- Capítulos page ---- */
.page-capitulos .hero--capitulos {
  position: relative;
  min-height: 240px;
  background: var(--color-primary) url('../assets/images/hero-capitulos.jpg') center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 0;
  color: white;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(17,24,39,0.45), rgba(169,7,7,0.8));
}

.hero__content { position: relative; z-index: 1; }
.hero__title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero__subtitle {
  font-size: 0.95rem;
  max-width: 52ch;
  opacity: 0.95;
}

.search-section {
  padding: 1.25rem 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-section__intro {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.875rem;
}

.search-box { position: relative; margin-bottom: 0.75rem; }
.search-box__icon {
  position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%);
  width: 1.125rem; height: 1.125rem; color: var(--color-text-muted); pointer-events: none;
}
.search-box__input {
  width: 100%;
  padding: 0.8rem 0.875rem 0.8rem 2.5rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-bg);
}
.search-box__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(169,7,7,0.12);
  background: white;
}

.filter-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.625rem;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background: white;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.chip--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.day-filter__select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  background: var(--color-bg);
}

.results-bar {
  padding: 0.85rem 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.chapters-list {
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.zone-group { margin-top: 0.75rem; }
.zone-group__title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 0.5rem;
}

.zone-group__cards {
  display: grid;
  gap: 0.5rem;
}

.chapter-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.chapter-card:hover { border-color: var(--color-primary-light); }
.chapter-card:active { transform: scale(0.99); }

.chapter-card__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
}
.chapter-card__icon--hombres { background: #32373c; }
.chapter-card__icon--mujeres { background: var(--color-primary); }
.chapter-card__icon--jovenes { background: var(--color-accent); }

.chapter-card__body { flex: 1; min-width: 0; }
.chapter-card__name { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.125rem; }
.chapter-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}
.chapter-card__meta span::after {
  content: '·';
  margin-left: 0.5rem;
  opacity: 0.5;
}
.chapter-card__meta span:last-child::after { display: none; }
.chapter-card__arrow {
  flex-shrink: 0;
  color: var(--color-primary);
  width: 1.125rem;
  height: 1.125rem;
}

@media (min-width: 768px) {
  .page-capitulos .hero--capitulos { min-height: 300px; }
  .search-section__inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0.75rem 1rem;
    align-items: end;
  }
  .search-section__intro { grid-column: 1 / -1; }
  .search-box { margin-bottom: 0; }
  .filter-chips { grid-column: 1 / -1; }
  .zone-group__cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .zone-group__cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state__title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.375rem; }
.empty-state__text { font-size: 0.875rem; color: var(--color-text-muted); }

/* ---- Modals ---- */
.modal {
  border: none;
  padding: 0;
  margin: auto;
  max-width: 100%;
  width: 100%;
  max-height: 95dvh;
  background: transparent;
}
.modal::backdrop {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(3px);
}
.modal__content {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  position: relative;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal__content--wide { width: min(100%, 920px); }

@media (min-width: 520px) {
  .modal { max-width: 460px; }
  .modal__content {
    border-radius: var(--radius-lg);
    margin: 1rem;
  }
  .modal:has(.modal__content--wide) { max-width: 920px; }
}

.modal__close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 2rem; height: 2rem;
  border: none;
  background: var(--color-bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.modal__close svg { width: 1.125rem; height: 1.125rem; }

.modal__badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(169,7,7,0.1);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.modal__title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  padding-right: 2rem;
}
.modal__subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.modal__details { margin-bottom: 1.25rem; }
.detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  min-width: 4.5rem;
}
.detail-row dd { font-size: 0.9375rem; font-weight: 500; }

.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.form-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(169,7,7,0.12);
}
.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}
.form-status {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.form-status--ok { color: #15803d; }
.form-status--error { color: var(--color-primary); }

.invite-preview { margin-bottom: 1.25rem; }
.invite-preview__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.invite-preview__box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 7rem;
}
.invite-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.invite-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .invite-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

/* ---- Invite card (visual) ---- */
.invite-card {
  background: linear-gradient(160deg, #a90707 0%, #111827 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  min-height: 420px;
}
.invite-card__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  font-size: 0.8rem;
}
.invite-card__header img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  padding: 3px;
}
.invite-card__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.35rem;
}
.invite-card__name {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.invite-card__to {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}
.invite-card__chapter {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fecaca;
  margin-bottom: 1rem;
}
.invite-card__meta {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}
.invite-card__meta p { margin-bottom: 0.35rem; }
.invite-card__meta p:last-child { margin-bottom: 0; }
.invite-card__footer {
  font-size: 0.8rem;
  opacity: 0.9;
  line-height: 1.45;
}

.toast {
  position: fixed;
  bottom: calc(1.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 300;
}

.footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}
.footer--dark {
  background: #111827;
  color: white;
  border-top: none;
}
.footer__logo { margin: 0 auto 0.75rem; }
.footer__copy {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.footer--dark .footer__copy { color: rgba(255,255,255,0.65); }
.footer__links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer__links a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
}
.footer--dark .footer__links a { color: #fecaca; }
