/* Shared public theme. Keep page geometry here, not in individual templates. */
:root {
  --fz-width: 75rem;
  --fz-gutter: clamp(1rem, 3vw, 2rem);
  --fz-primary: #6941a5;
  --fz-primary-dark: #4e2c80;
  --fz-text: #292633;
  --fz-muted: #65616e;
  --fz-bg: #f6f5f8;
  --fz-soft: #f4f0fa;
  --fz-border: #e7e2ed;
  --fz-radius: 1.25rem;
  --fz-shadow: 0 6px 24px rgb(44 30 65 / 5%);
  --bs-primary: #6941a5;
  --bs-primary-rgb: 105, 65, 165;
  --bs-link-color: #6941a5;
  --bs-link-hover-color: #4e2c80;
}

body {
  background: var(--fz-bg);
  color: var(--fz-text);
  font-family: "Nunito", "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Identical outer edges for navigation, notices, every page and footer. */
body > .site-main.container,
body .main-navbar > .container,
body .sitewide-notices > .container,
body .site-footer > .container {
  width: calc(100% - 2 * var(--fz-gutter));
  max-width: var(--fz-width);
  margin-inline: auto;
  padding-inline: 0;
}

body > .site-main {
  padding-block: clamp(1.5rem, 3vw, 2.5rem) !important;
  min-width: 0;
}

/* Higher specificity than the historical, page-local width declarations. */
.site-main > :is(
  .articles-page, .article-page, .events-page, .event-detail-wrap,
  .announcements-page, .announcement-page, .masses-page, .regular-page,
  .churches-page, .church-page, .about-page, .contact-page, .pl-page,
  .cookies-page
) {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  min-width: 0;
}

body .main-navbar {
  background: rgb(255 255 255 / 97%);
  border-bottom-color: var(--fz-border);
  box-shadow: 0 2px 16px rgb(44 30 65 / 3%);
}

body .brand-mark {
  background: var(--fz-primary);
  box-shadow: none;
  border-radius: .85rem;
}

body .main-brand { gap: .8rem; }
body .brand-text { letter-spacing: -.035em; }
body .main-nav-link { font-size: .94rem; }
body .main-nav-link:hover,
body .main-nav-link.active,
body .nav-item.dropdown:hover > .main-nav-link {
  color: var(--fz-primary) !important;
  background: var(--fz-soft);
}
body .main-nav-link.active:not(.dropdown-toggle)::after { background: var(--fz-primary); }
body .main-dropdown-item.active { background: var(--fz-primary); }

/* A quiet, consistent heading panel across listings and detail pages. */
.site-main :is(
  .articles-hero, .events-hero, .announcements-hero, .masses-hero,
  .regular-hero, .churches-hero, .contact-hero, .cookies-hero,
  .article-hero, .event-detail-hero, .announcement-hero,
  .church-title-block, .about-hero, .pl-hero
) {
  background: linear-gradient(115deg, #fff 40%, #f3eef9);
  padding: clamp(1.4rem, 3.5vw, 2.75rem);
  border-color: var(--fz-border);
  box-shadow: none;
}

.site-main :is(
  .articles-hero, .events-hero, .announcements-hero, .masses-hero,
  .regular-hero, .churches-hero, .contact-hero, .cookies-hero
) {
  border-radius: var(--fz-radius);
  margin-bottom: 1.75rem !important;
}

.site-main :is(
  .articles-hero, .events-hero, .announcements-hero, .masses-hero,
  .regular-hero, .churches-hero, .contact-hero, .cookies-hero,
  .article-hero, .event-detail-hero, .announcement-hero,
  .church-title-block, .about-hero, .pl-hero
) h1 {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(1.75rem, 3.2vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.2;
  text-wrap: balance;
}

.site-main :is(
  .articles-hero-icon, .events-hero-icon, .announcements-hero-icon,
  .masses-hero-icon, .regular-hero-icon, .churches-hero-icon,
  .contact-hero-icon, .church-title-icon
) {
  background: #ede5f6;
  color: var(--fz-primary);
  border-radius: .9rem;
}

.site-main :is(
  .article-card, .event-card, .announcement-card, .church-card,
  .about-card, .cookies-card, .regular-card, .mass-card, .contact-card,
  .home-news-card, .home-wide-card, .home-quick-item, .home-pl-card,
  .home-mass-item, .home-event-card, .pl-shell
) {
  border-color: var(--fz-border);
  border-radius: var(--fz-radius);
  box-shadow: var(--fz-shadow);
}

.site-main :is(.articles-grid, .events-grid) { gap: 1.5rem; }

.site-main .home-more {
  background: var(--fz-soft);
  border-color: var(--fz-border);
  box-shadow: none;
}
.site-main .home-btn-primary {
  background: var(--fz-primary);
  box-shadow: none;
}
.site-main .home-btn-primary:hover { background: var(--fz-primary-dark); }
.site-main .home-hero-content h1 { font-weight: 600; text-wrap: balance; }

/* Text keeps its reading width while the page shell stays aligned. */
.site-main :is(.article-content, .about-content, .event-content, .announcement-content, .church-content) {
  overflow-wrap: anywhere;
}
.site-main img { max-width: 100%; }
.site-main iframe { max-width: 100%; }
.site-main :is(input, textarea, select) { max-width: 100%; }
.site-main :is(.form-control, .form-select) {
  border-color: #d9d1e3;
  border-radius: .75rem;
  padding: .65rem .85rem;
}
.site-main :is(.form-control, .form-select):focus {
  border-color: var(--fz-primary);
  box-shadow: 0 0 0 .2rem rgb(105 65 165 / 12%);
}
.site-main .btn {
  border-radius: .75rem;
  font-weight: 700;
}
.site-main .btn-primary {
  --bs-btn-bg: var(--fz-primary);
  --bs-btn-border-color: var(--fz-primary);
  --bs-btn-hover-bg: var(--fz-primary-dark);
  --bs-btn-hover-border-color: var(--fz-primary-dark);
  --bs-btn-active-bg: var(--fz-primary-dark);
  --bs-btn-active-border-color: var(--fz-primary-dark);
}
.site-main .btn-outline-primary {
  --bs-btn-color: var(--fz-primary);
  --bs-btn-border-color: var(--fz-primary);
  --bs-btn-hover-bg: var(--fz-primary);
  --bs-btn-hover-border-color: var(--fz-primary);
  --bs-btn-active-bg: var(--fz-primary-dark);
  --bs-btn-active-border-color: var(--fz-primary-dark);
}
.site-main .page-link { color: var(--fz-primary); }
.site-main .active > .page-link {
  color: #fff;
  background: var(--fz-primary);
  border-color: var(--fz-primary);
}

body .home-carousel,
body .home-hero-inner { border-radius: var(--fz-radius); }
body .site-footer { padding-bottom: 1.5rem; }
body .footer-card {
  border-radius: var(--fz-radius);
  background: #292334;
  box-shadow: none;
}
body .footer-small-links { flex-wrap: wrap; }

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--fz-primary);
  outline-offset: 4px;
}
[id] { scroll-margin-top: 6rem; }
.skip-link {
  position: fixed;
  z-index: 2000;
  top: .75rem;
  left: 1rem;
  transform: translateY(-200%);
  padding: .75rem 1.25rem;
  color: #fff;
  background: var(--fz-primary-dark);
  border-radius: .75rem;
}
.skip-link:focus { transform: none; color: #fff; }

@media (max-width: 575.98px) {
  .site-main :is(.articles-grid, .events-grid) { gap: 1rem; }
  body .main-collapse { max-height: calc(100dvh - 5rem); }
  body .footer-main { padding: 1.5rem; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
