/* ==========================================================================
   Catholic Academy — Design System
   Palette drawn from the original site crest: navy shield, gold laurel.
   ========================================================================== */

:root {
  /* Brand palette */
  --navy-950: #0b1730;
  --navy-900: #0f2044;
  --navy-800: #16305f;
  --navy-700: #1d3f7a;
  --navy-600: #2a5099;
  --gold-600: #a9812f;
  --gold-500: #c9a24b;
  --gold-400: #dcbd75;
  --gold-100: #f6ecd6;
  --cream-100: #fbf8f2;
  --cream-200: #f4efe3;
  --ink-900: #1b1d22;
  --ink-700: #3d4048;
  --ink-500: #666a73;
  --line: #e4ddcc;
  --white: #ffffff;

  /* Semantic tokens */
  --bg: var(--cream-100);
  --bg-alt: var(--cream-200);
  --surface: var(--white);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --accent: var(--gold-500);
  --accent-ink: var(--navy-900);
  --brand: var(--navy-900);
  --brand-deep: var(--navy-950);
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 32, 68, 0.08);
  --shadow-md: 0 8px 28px rgba(15, 32, 68, 0.12);
  --shadow-lg: 0 20px 48px rgba(15, 32, 68, 0.18);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--navy-700); text-decoration-color: rgba(29, 63, 122, 0.35); text-underline-offset: 2px; }
a:hover { color: var(--gold-600); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--brand-deep);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
.lede { font-size: 1.18rem; color: var(--text-muted); font-family: var(--serif); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 0.75em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--gold-500);
  display: inline-block;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: 74px 0; }
.section-tight { padding: 44px 0; }
.section-alt { background: var(--bg-alt); }
.section-brand {
  background: linear-gradient(160deg, var(--navy-950), var(--navy-800) 70%);
  color: var(--gold-100);
}
.section-brand h2, .section-brand h3 { color: var(--white); }
.section-brand .eyebrow { color: var(--gold-400); }

hr.rule { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy-900); color: var(--white);
  padding: 10px 18px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 23, 48, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 162, 75, 0.25);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; height: 82px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--white); text-decoration: none;
}
.brand img { height: 48px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .name { font-family: var(--serif); font-weight: 700; font-size: 1.28rem; color: var(--white); }
.brand-text .motto { font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--gold-400); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px;
  color: var(--white); width: 42px; height: 38px; cursor: pointer; font-size: 1.1rem;
}

.main-nav { display: flex; align-items: center; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; }
.main-nav a {
  color: rgba(255,255,255,0.88); text-decoration: none;
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 10px 14px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover, .main-nav a:focus-visible { background: rgba(255,255,255,0.08); color: var(--gold-400); }
.main-nav .caret { font-size: 0.62em; opacity: 0.7; transform: translateY(1px); }

.has-dropdown .dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  min-width: 260px; padding: 12px; opacity: 0; visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  list-style: none;
  display: flex; flex-direction: column; gap: 4px;
}
.has-dropdown .dropdown.dropdown-wide {
  min-width: 320px;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown li a {
  color: var(--ink-900); padding: 12px 14px; border-radius: 6px;
  display: block; font-size: 0.9rem; font-weight: 500; line-height: 1.35;
}
.dropdown li a:hover { background: var(--cream-200); color: var(--navy-800); }
.dropdown .desc { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 400; margin-top: 3px; line-height: 1.4; }

.nav-cta {
  background: var(--gold-500); color: var(--navy-950) !important;
  padding: 9px 18px !important; border-radius: 24px !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--gold-400); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 30px; font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s, color 0.15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-400); color: var(--navy-950); box-shadow: var(--shadow-md); }
.btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-outline:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,0.08); }
.btn-navy { background: var(--navy-900); color: var(--white); }
.btn-navy:hover { background: var(--navy-800); color: var(--white); box-shadow: var(--shadow-md); }
.btn-ghost { border-color: var(--navy-900); color: var(--navy-900); }
.btn-ghost:hover { background: var(--navy-900); color: var(--white); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 84% -10%, rgba(201,162,75,0.18), transparent 60%),
    linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 45%, var(--navy-800) 100%);
  color: var(--gold-100);
  padding: 96px 0 84px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 { color: var(--white); }
.hero .lede { color: var(--gold-100); opacity: 0.92; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-emblem {
  display: flex; align-items: center; justify-content: center;
}
.hero-emblem img { width: min(320px, 100%); filter: drop-shadow(0 18px 40px rgba(0,0,0,0.45)); }

.hero-stats { display: flex; gap: 36px; margin-top: 46px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-family: var(--serif); font-size: 1.9rem; color: var(--gold-400); }
.hero-stats div span { font-size: 0.82rem; color: rgba(255,255,255,0.7); }

/* ---------- Page header (interior pages) ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--navy-950), var(--navy-800));
  color: var(--white);
  padding: 62px 0 56px;
  position: relative;
}
.page-hero .eyebrow { color: var(--gold-400); }
.page-hero h1 { color: var(--white); margin-bottom: 0.35em; }
.page-hero .lede { color: rgba(246,236,214,0.88); max-width: 66ch; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-bottom: 14px; }
.breadcrumb a { color: rgba(255,255,255,0.75); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm); transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card h3 { margin-bottom: 0.4em; }
.card .icon {
  width: 46px; height: 46px; border-radius: 10px;
  background: var(--gold-100); color: var(--gold-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.card p:last-child { margin-bottom: 0; }
.card a.more { font-size: 0.86rem; font-weight: 700; }

.link-card {
  display: block; text-decoration: none; color: inherit;
}
.link-card:hover h3 { color: var(--gold-600); }

/* ---------- Pull quote / scripture ---------- */
.scripture {
  border-left: 3px solid var(--gold-500);
  padding: 4px 0 4px 26px; margin: 2em 0;
  font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--navy-900);
}
.scripture cite { display: block; margin-top: 10px; font-family: var(--sans); font-style: normal; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.section-brand .scripture { color: var(--gold-100); border-left-color: var(--gold-400); }
.section-brand .scripture cite { color: rgba(255,255,255,0.65); }

/* ---------- Accordion (sacraments etc.) ---------- */
.accordion { display: flex; flex-direction: column; gap: 14px; }
.acc-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.acc-header {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--brand-deep);
}
.acc-header .num {
  color: var(--gold-600); font-family: var(--sans); font-weight: 800; font-size: 0.85rem;
  margin-right: 10px;
}
.acc-header .plus {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--navy-700); transition: transform 0.2s ease, background .2s;
}
.acc-item[open] .acc-header .plus { transform: rotate(45deg); background: var(--gold-100); }
.acc-header::-webkit-details-marker { display: none; }
.acc-body { padding: 0 24px 26px; color: var(--text); }
.acc-body h4 { margin-top: 1.1em; }
.acc-body .tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.tag {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--cream-200); color: var(--navy-800); padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--line);
}

/* ---------- Table of contents ---------- */
.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; box-shadow: var(--shadow-sm);
}
.toc h4 { margin-bottom: 12px; }
.toc ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.toc a { font-size: 0.92rem; font-weight: 600; }

/* ---------- Two column layout ---------- */
.layout-side {
  display: grid; grid-template-columns: 250px 1fr; gap: 44px; align-items: start;
}
.layout-side .toc { position: sticky; top: 104px; }

/* ---------- Prose ---------- */
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  border-radius: 18px; padding: 52px; color: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-banner h2 { color: var(--white); margin-bottom: 6px; }
.cta-banner p { color: rgba(246,236,214,0.85); margin: 0; }

/* ---------- Table ---------- */
table.styled { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
table.styled th, table.styled td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.styled th { font-family: var(--serif); font-size: 1rem; color: var(--brand-deep); background: var(--cream-200); }
table.styled tr:last-child td { border-bottom: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: rgba(255,255,255,0.75); padding: 64px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.footer-brand img { height: 42px; }
.footer-brand .name { font-family: var(--serif); font-size: 1.15rem; color: var(--white); font-weight: 700; }
.site-footer h4 { color: var(--white); font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: rgba(255,255,255,0.72); text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--gold-400); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 46px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
}
.footer-bottom a { color: rgba(255,255,255,0.55); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.small { font-size: 0.86rem; color: var(--text-muted); }
.center-col { max-width: 780px; margin: 0 auto; }
.badge {
  display: inline-block; background: var(--gold-100); color: var(--gold-600);
  border-radius: 20px; padding: 5px 14px; font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* ---------- Resource directory ---------- */
.resource-group { margin-bottom: 12px; }
.resource-group h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; margin-bottom: 14px;
}
.resource-group h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.resource-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 40px; padding: 0; list-style: none; }
.resource-list li {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.resource-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.94rem;
  border-radius: 8px; transition: background .15s, color .15s;
}
.resource-list a:hover { background: var(--cream-200); color: var(--navy-800); }
.resource-list a .go { color: var(--gold-600); font-weight: 700; flex-shrink: 0; }
.resource-list .note { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Course track ---------- */
.track { display: flex; flex-direction: column; gap: 0; }
.track-step { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding-bottom: 34px; position: relative; }
.track-step::before {
  content: ""; position: absolute; left: 27px; top: 56px; bottom: 0; width: 2px; background: var(--line);
}
.track-step:last-child::before { display: none; }
.track-num {
  width: 56px; height: 56px; border-radius: 50%; background: var(--navy-900); color: var(--gold-400);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 1.4rem; font-weight: 700;
  flex-shrink: 0; z-index: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-emblem { order: -1; }
  .hero-emblem img { width: 160px; }
  .layout-side { grid-template-columns: 1fr; }
  .layout-side .toc { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .resource-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav {
    position: fixed; inset: 82px 0 0 0; background: var(--navy-950);
    flex-direction: column; padding: 18px; display: none; overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; width: 100%; gap: 2px; }
  .main-nav > ul > li { width: 100%; }
  .has-dropdown .dropdown {
    position: static; box-shadow: none; opacity: 1; visibility: visible; transform: none;
    display: none; margin: 4px 0 8px 10px; border: none; background: rgba(255,255,255,0.04);
  }
  .has-dropdown.open .dropdown { display: block; }
  .has-dropdown .dropdown.dropdown-wide { columns: 1; min-width: 0; }
  .dropdown li a { color: rgba(255,255,255,0.85); }
  .dropdown li a:hover { background: rgba(255,255,255,0.08); color: var(--gold-400); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .track-step { grid-template-columns: 44px 1fr; gap: 14px; }
  .track-num { width: 44px; height: 44px; font-size: 1.1rem; }
  .track-step::before { left: 21px; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 70px 0 56px; }
  .section { padding: 54px 0; }
}
