:root {
  --navy: #07152e;
  --navy-2: #10233f;
  --burgundy: #751f36;
  --red: #ce2434;
  --gold: #d8b35f;
  --cream: #fffaf0;
  --white: #ffffff;
  --ink: #172033;
  --muted: #65708a;
  --line: rgba(216, 179, 95, 0.35);
  --shadow: 0 28px 80px rgba(7, 21, 46, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(206, 36, 52, 0.06), transparent 28%),
    linear-gradient(180deg, #fffdf8, #f5f1e8 55%, #fffaf0);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(45deg, transparent 0 22%, rgba(216,179,95,.12) 22% 23%, transparent 23% 45%, rgba(117,31,54,.08) 45% 46%, transparent 46%),
    radial-gradient(circle at 82% 18%, rgba(16, 35, 63, 0.18), transparent 28rem);
  opacity: 0.8;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
p { color: var(--muted); line-height: 1.7; }
h1, h2, h3 { margin: 0; font-family: "Libre Baskerville", Georgia, serif; line-height: 1.08; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 72px);
  border-bottom: 1px solid rgba(255,255,255,.18);
  color: var(--white);
  background: rgba(7, 21, 46, 0.93);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: radial-gradient(circle at 30% 20%, white, var(--gold));
  box-shadow: 0 0 0 5px rgba(216,179,95,.14);
}
.brand span:last-child { display: grid; }
.brand small { color: #f5dfaa; }

.primary-nav { display: flex; justify-content: flex-end; gap: 4px; }
.nav-item { position: relative; }
.nav-item > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
}
.nav-item:hover > a { background: rgba(255,255,255,.1); }
.mega {
  position: absolute;
  right: 0;
  top: 100%;
  display: none;
  min-width: 520px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(216,179,95,.35);
  border-radius: 10px;
  background: rgba(9, 23, 48, 0.98);
  box-shadow: var(--shadow);
}
.nav-item:hover .mega { display: grid; }
.mega a { padding: 12px; border-radius: 8px; color: #fff6df; background: rgba(255,255,255,.06); }
.menu-toggle { display: none; }

.page { display: none; }
.page.active { display: block; }
.page > section, .page-title { padding: clamp(58px, 7vw, 108px) clamp(18px, 4vw, 72px); }
.page-title {
  color: var(--white);
  background:
    linear-gradient(120deg, rgba(7,21,46,.96), rgba(117,31,54,.88)),
    url("https://images.unsplash.com/photo-1514896856000-91cb6de818e0?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.page-title h1 { max-width: 1000px; font-size: clamp(2.5rem, 6vw, 5.8rem); }
.page-title p { max-width: 760px; color: #f7ead0; }

.hero {
  position: relative;
  min-height: calc(100vh - 83px);
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background: var(--navy);
}
.hero-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7,21,46,.94), rgba(7,21,46,.62), rgba(117,31,54,.72)),
    url("https://images.unsplash.com/photo-1518709268805-4e9042af2176?auto=format&fit=crop&w=1900&q=80") center/cover;
  filter: saturate(.9);
}
.hero-content { position: relative; z-index: 1; max-width: 1120px; padding: clamp(58px, 8vw, 130px) clamp(18px, 5vw, 82px); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-weight: 900; font-size: .78rem; }
.hero h1 { max-width: 1000px; font-size: clamp(3rem, 7vw, 7rem); }
.hero-subtitle { color: #fff7e5; font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--navy);
  background: var(--white);
  font-weight: 900;
  cursor: pointer;
}
.button.primary { color: var(--white); background: var(--burgundy); }
.button.gold { color: var(--navy); background: var(--gold); }

.quick-actions, .card-grid, .journey-row, .mission-band, .parish-grid, .sacrament-grid, .news-grid, .give-grid, .ministry-grid, .help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: clamp(34px, 5vw, 72px) clamp(18px, 4vw, 72px);
}
.quick-actions a, article, .sacrament-card, .help-grid button, .guide-panel, .contact-form {
  border: 1px solid rgba(16,35,63,.12);
  border-radius: 10px;
  padding: 22px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 16px 48px rgba(7,21,46,.08);
}
.quick-actions a { display: grid; gap: 8px; }
.quick-actions span, article span, .parish-card span { color: var(--burgundy); font-weight: 900; text-transform: uppercase; font-size: .76rem; }
.quick-actions strong { font-size: 1.3rem; }

.two-column, .archbishop, .parish-preview, .giving-banner, .about-layout, .featured-article, .newsletter, .contact-form {
  display: grid;
  grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr);
  gap: 34px;
  align-items: center;
  padding: clamp(58px, 7vw, 108px) clamp(18px, 4vw, 72px);
}
.section-head { padding: clamp(44px, 6vw, 84px) clamp(18px, 4vw, 72px) 0; }
.section-head h2, .two-column h2, .archbishop h2, .giving-banner h2 { font-size: clamp(2rem, 4.4vw, 4.4rem); }
.today-grid { display: grid; gap: 14px; }
.portrait { min-height: 420px; border-radius: 14px; background: linear-gradient(rgba(7,21,46,.16), rgba(117,31,54,.16)), url("https://images.unsplash.com/photo-1528357136257-0c25517acfea?auto=format&fit=crop&w=1200&q=80") center/cover; box-shadow: var(--shadow); }
.search-strip, .finder-panel { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; }
input, select, textarea { width: 100%; border: 1px solid rgba(16,35,63,.2); border-radius: 8px; padding: 13px; background: white; }

.giving-banner { color: white; background: linear-gradient(120deg, var(--navy), var(--burgundy)); }
.giving-banner p { color: #f7ead0; }
.mission-band article { color: white; background: linear-gradient(145deg, var(--navy), var(--navy-2)); }
.mission-band p { color: #dbe3f1; }

.finder-panel { grid-template-columns: 1fr; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-grid label, .filter-row button, .tag-row b, .card-actions a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,.72);
  font-weight: 800;
}
.parish-card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; }
.parish-card dt { color: var(--burgundy); font-weight: 900; }
.parish-card dd { margin: 0; color: var(--muted); }
.tag-row, .card-actions, .filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.card-actions a { color: var(--burgundy); }

.sacrament-card { text-align: left; cursor: pointer; }
.sacrament-card strong { display: block; font-size: 1.25rem; margin-bottom: 8px; }
.guide-panel { margin: 0 clamp(18px, 4vw, 72px) 72px; }
.guide-panel ol { display: grid; gap: 10px; }

.featured-article { color: white; background: linear-gradient(120deg, var(--burgundy), var(--navy)); }
.featured-article p { color: #f7ead0; }
.filter-row { padding: 24px clamp(18px, 4vw, 72px) 0; }
.filter-row button { cursor: pointer; }
.filter-row button.active { color: white; background: var(--burgundy); }
.news-grid article a { color: var(--burgundy); font-weight: 900; }
.newsletter form { display: flex; gap: 10px; }

.help-grid button { text-align: left; cursor: pointer; }
.help-grid strong { display: block; }
.contact-form { margin: 0 clamp(18px, 4vw, 72px) 90px; }
.contact-form form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.contact-form label { display: grid; gap: 7px; font-weight: 800; }
.wide, .contact-form button { grid-column: 1 / -1; }

.ask-button {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 70;
  width: 104px;
  height: 104px;
  border: 0;
  border-radius: 50%;
  color: var(--navy);
  background: radial-gradient(circle at 35% 25%, white, var(--gold));
  box-shadow: var(--shadow);
  font-weight: 950;
  cursor: pointer;
}
.ai-panel {
  position: fixed;
  right: 22px;
  bottom: 142px;
  z-index: 80;
  width: min(430px, calc(100vw - 28px));
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.ai-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.ai-head, .chat-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid rgba(16,35,63,.12); }
.ai-head button { border: 0; background: var(--burgundy); color: white; width: 36px; height: 36px; border-radius: 8px; }
.starter-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; }
.starter-list button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; background: white; }
.chat-log { display: grid; gap: 10px; padding: 14px; max-height: 250px; overflow: auto; }
.chat-log p { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f2ead9; }
.chat-log .user { justify-self: end; color: white; background: var(--burgundy); }
.chat-form { border-top: 1px solid rgba(16,35,63,.12); border-bottom: 0; }
.chat-form input { flex: 1; }
.chat-form button { border: 0; border-radius: 8px; padding: 12px 14px; color: white; background: var(--burgundy); }
.mobile-bottom { display: none; }

@media (max-width: 1080px) {
  .site-header { grid-template-columns: 1fr auto; }
  .menu-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: white; background: rgba(255,255,255,.1); }
  .primary-nav { display: none; grid-column: 1 / -1; justify-content: start; flex-wrap: wrap; }
  .primary-nav.open { display: flex; }
  .mega { position: static; min-width: 100%; box-shadow: none; }
  .nav-item:hover .mega { display: none; }
  .quick-actions, .card-grid, .journey-row, .mission-band, .parish-grid, .sacrament-grid, .news-grid, .give-grid, .ministry-grid, .help-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .archbishop, .parish-preview, .giving-banner, .about-layout, .featured-article, .newsletter, .contact-form { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .brand small { display: none; }
  .hero { min-height: auto; }
  .hero-content { padding-top: 72px; padding-bottom: 92px; }
  .hero h1 { font-size: 2.65rem; }
  .hero-actions .button { flex: 1 1 100%; }
  .quick-actions, .card-grid, .journey-row, .mission-band, .parish-grid, .sacrament-grid, .news-grid, .give-grid, .ministry-grid, .help-grid { grid-template-columns: 1fr; }
  .search-strip, .newsletter form, .contact-form form { grid-template-columns: 1fr; }
  .wide, .contact-form button { grid-column: auto; }
  .ask-button { bottom: 88px; width: 78px; height: 78px; font-size: .8rem; }
  .mobile-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(7,21,46,.96);
    border-top: 1px solid var(--line);
  }
  .mobile-bottom a, .mobile-bottom button {
    min-height: 58px;
    border: 0;
    color: white;
    background: transparent;
    font-weight: 900;
  }
}
