/* ═══════════════════════════════════════════════════════════
   Christ Church Cathedral — Main Stylesheet
   Colour variables (--primary, --accent, --light) are set
   dynamically by js/app.js based on the current week's entry
   in data/colors.js. Fallback values below are used until JS runs.
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --primary:      #1E3A6E;
  --accent:       #BF9B30;
  --light:        #EEF3FA;
  --text-dark:    #1a1a2e;
  --text-mid:     #4a4a6a;
  --text-light:   #888;
  --bg:           #ffffff;
  --bg-soft:      #f8f9fc;
  --border:       #e8eaf0;
  --shadow:       0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.13);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    20px;
  --nav-height:   64px;
  --max-width:    1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

/* ── Typography ── */
h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-mid); line-height: 1.75; }

.eyebrow {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
section { padding: 64px 0; }
main { flex: 1; padding-top: var(--nav-height); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header h2 {
  font-size: 1.5rem;
  position: relative;
  padding-left: 14px;
}
.section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 90%;
  background: var(--primary);
  border-radius: 2px;
  transition: background 0.5s;
}
.section-header a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}
.section-header a:hover { gap: 8px; }

/* ══════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════ */
.main-nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  height: var(--nav-height);
  transition: border-color 0.5s;
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
  transition: color 0.5s;
  z-index: 1;
}
.brand-cross { font-size: 1.3rem; }
.brand-logo {
  height: 36px;
  width: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Hamburger toggle button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 8px;
  width: 40px;
  height: 36px;
  z-index: 1;
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--primary); }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--primary);
  background: var(--light);
}
.nav-links a.active {
  color: var(--primary);
  background: var(--light);
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--light); }
.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  padding: 9px 16px;
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--primary); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }

/* ══════════════════════════════════════════════
   HERO — Landing page
══════════════════════════════════════════════ */
.hero {
  position: relative;
  background: linear-gradient(140deg, var(--light) 0%, white 55%);
  background-image: url('../assets/ccmInterior33.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 72px 0 56px;
  border-bottom: 4px solid var(--primary);
  transition: background-color 0.5s, border-color 0.5s;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.72) 55%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-text .eyebrow { margin-bottom: 18px; }
.hero-text h1 { color: var(--text-dark); margin-bottom: 14px; }
.hero-text h1 em { font-style: normal; color: var(--primary); transition: color 0.5s; }
.hero-text > p { font-size: 1.05rem; margin-bottom: 28px; max-width: 420px; color: #000; }

/* Sunday service card */
.service-card {
  background: white;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  transition: border-color 0.5s;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: background 0.5s;
}
.service-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin-bottom: 6px;
  transition: color 0.5s;
}
.service-card-header {
  position: relative;
  margin-bottom: 0;
}
.service-card-header-text { position: relative; z-index: 1; }
.service-card-cross {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 9rem;
  color: var(--primary);
  line-height: 1;
  transition: color 0.5s;
  pointer-events: none;
}
.service-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.service-card .next-date {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 16px;
}
.service-time {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  transition: color 0.5s;
}
.service-details { display: flex; flex-direction: column; gap: 8px; }
.service-detail {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-mid);
}
.service-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ══════════════════════════════════════════════
   CALENDAR
══════════════════════════════════════════════ */
.calendar-section { background: var(--light); transition: background 0.5s; }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.calendar-nav .week-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  flex: 1;
}
.cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  transition: all 0.2s;
  white-space: nowrap;
}
.cal-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--light);
}
.cal-btn-today {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.cal-btn-today:disabled {
  border-color: var(--border);
  color: var(--text-light);
  background: white;
  cursor: default;
  opacity: 0.45;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.calendar-day {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 6px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.calendar-day:hover:not(.active) {
  border-color: var(--primary);
  background: var(--light);
}
.calendar-day.today:not(.active) { border-color: var(--accent); }
.calendar-day.today:not(.active) .day-num { color: var(--accent); font-weight: 700; }
.calendar-day.active { background: var(--primary); border-color: var(--primary); }
.calendar-day.active .day-name,
.calendar-day.active .day-num { color: white; }
.calendar-day.has-events::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.calendar-day.active.has-events::after { background: rgba(255,255,255,0.7); }
.day-name {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}
.day-num { font-size: 1.25rem; font-weight: 700; color: var(--text-dark); }

/* Events panel */
.events-panel {
  background: white;
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 80px;
  animation: fadeIn 0.2s ease;
  transition: border-color 0.5s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.events-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  transition: color 0.5s;
}
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.event-row:last-child { border-bottom: none; }
.event-time {
  background: var(--light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.5s, color 0.5s;
}
.event-row-info { flex: 1; min-width: 0; }
.event-row-title { font-size: 0.9rem; font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.event-row-desc { font-size: 0.82rem; color: var(--text-light); }
.event-type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
.no-events-msg { text-align: center; padding: 20px 0; color: var(--text-light); font-size: 0.875rem; }

/* Event type dot colours */
.type-service       { background: #1E3A6E; }
.type-sundayschool  { background: #A855F7; }
.type-youth         { background: #A855F7; }
.type-choir         { background: #EC4899; }
.type-study         { background: #F59E0B; }
.type-community     { background: #10B981; }
.type-prayer        { background: #10B981; }
.type-admin         { background: #94A3B8; }

/* ══════════════════════════════════════════════
   CARDS — shared
══════════════════════════════════════════════ */
/* ── Sunday Readings ── */
.readings-date {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}
.readings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.reading-card {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: border-color 0.5s, box-shadow 0.2s, transform 0.2s;
}
.reading-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.reading-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin-bottom: 4px;
  transition: color 0.5s;
}
.reading-ref {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.reading-excerpt {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.7;
  font-style: italic;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-mid);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s, box-shadow 0.22s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-primary { background: var(--light); color: var(--primary); transition: background 0.5s, color 0.5s; }
.badge-accent  { background: #fff3e0; color: #d97706; }
.card-date { font-size: 0.8rem; color: var(--text-light); }
.card-title { font-size: 1.05rem; font-weight: 600; color: var(--text-dark); margin-bottom: 8px; line-height: 1.4; }
.card-summary {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer-row {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

/* ══════════════════════════════════════════════
   HISTORY — TIMELINE
══════════════════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 0;
  max-width: 760px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 10px;
  bottom: 40px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary) 80%, transparent);
  transition: background 0.5s;
}
.timeline-item {
  position: relative;
  padding-left: 52px;
  padding-bottom: 44px;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: var(--radius-sm);
}
.timeline-item:hover {
  background: var(--light);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 8px;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  transition: background 0.25s, border-color 0.5s;
  box-shadow: 0 0 0 3px var(--light);
}
.timeline-item:hover .timeline-dot { background: var(--primary); }
.timeline-era {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 4px;
  transition: color 0.5s;
}
.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.35;
}
.timeline-summary {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 12px;
  max-width: 580px;
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: gap 0.2s, color 0.5s;
}
.read-more:hover { gap: 10px; }
.timeline-divider {
  position: absolute;
  left: 52px;
  bottom: 22px;
  right: 0;
  height: 1px;
  background: var(--border);
}
.timeline-item:last-child .timeline-divider { display: none; }

/* ── Coming Soon ── */
.coming-soon-wrapper { max-width: 100%; }
.coming-soon {
  text-align: center;
  padding: 80px 24px;
  max-width: 560px;
  margin: 0 auto;
}
.coming-soon-cross {
  margin-bottom: 20px;
}
.coming-soon-cross img {
  width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
}
.coming-soon-tag {
  display: inline-block;
  background: var(--light);
  color: var(--primary);
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.coming-soon h2 { font-size: 1.6rem; margin-bottom: 12px; }
.coming-soon p { font-size: 0.975rem; line-height: 1.85; color: var(--text-mid); }

/* ── History cards (kept for backward compat) ── */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}
.history-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s, box-shadow 0.22s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.history-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.history-card-img { width: 100%; height: 160px; object-fit: cover; }
.history-card-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.history-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.era-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  align-self: flex-start;
  transition: background 0.5s;
}
.history-card-body h3 { margin-bottom: 8px; }
.history-card-body p {
  font-size: 0.875rem;
  color: var(--text-mid);
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   PAGE HERO (inner pages)
══════════════════════════════════════════════ */
.page-hero {
  background: linear-gradient(140deg, var(--light) 0%, white 55%);
  padding: 52px 0 44px;
  border-bottom: 4px solid var(--primary);
  transition: background 0.5s, border-color 0.5s;
}
.page-hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  padding-left: 18px;
  border-left: 5px solid var(--primary);
  transition: border-color 0.5s;
}
.page-hero p { font-size: 0.95rem; max-width: 560px; padding-left: 23px; }

/* ══════════════════════════════════════════════
   CONTACT PAGE
══════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
@keyframes scheduleHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
  25%  { box-shadow: 0 0 0 6px var(--primary); }
  75%  { box-shadow: 0 0 0 6px var(--primary); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
.info-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: border-color 0.5s;
}
.info-card.highlight {
  animation: scheduleHighlight 2s ease forwards;
}
.info-card-icon {
  width: 48px;
  height: 48px;
  background: var(--light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
  transition: background 0.5s;
}
.info-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 8px;
}
.info-card p { font-size: 0.925rem; color: var(--text-dark); font-weight: 500; line-height: 1.65; }
.info-card a { color: var(--primary); }
.contact-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.contact-link:hover {
  color: var(--primary);
}

.priest-card {
  background: linear-gradient(135deg, var(--light) 0%, white 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: var(--shadow);
  max-width: 580px;
  transition: border-color 0.5s, background 0.5s;
}
.priest-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}
.priest-title-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 4px;
  transition: color 0.5s;
}
.priest-card h2 { font-size: 1.35rem; margin-bottom: 4px; }
.priest-subtitle { font-size: 0.875rem; color: var(--text-mid); margin: 0; }
.priest-phone { font-size: 0.875rem; color: var(--text-mid); margin: 2px 0 0; }
.priest-phone a { color: var(--primary); text-decoration: none; font-weight: 500; }
.priest-phone a:hover { text-decoration: underline; }
.service-times-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

/* 3-column aligned table layout for contact page services */
.service-times-table {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px 20px;
  align-items: center;
}
.service-times-table .service-time-row { display: contents; }
.svc-day {
  font-weight: 700;
  color: var(--primary);
  transition: color 0.5s;
}
.svc-time {
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}
.svc-name {
  color: var(--text-mid);
  font-size: 0.9rem;
}

/* ── Sister Churches tile ── */
.sister-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-top: 16px;
  transition: border-color 0.5s;
}
.sister-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sister-icon {
  font-size: 0.9rem;
  color: var(--primary);
  transition: color 0.5s;
}
.sister-card-header h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin: 0;
}
.sister-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sister-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sister-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
}
.sister-phone {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  white-space: nowrap;
  transition: color 0.5s;
}
.sister-phone:hover { text-decoration: underline; }

/* ── Services + Map row ── */
.services-map-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  align-items: stretch;
}
.services-col { min-width: 0; }
.map-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.map-col .map-container {
  flex: 1;
}
.map-col .map-frame {
  height: 100%;
  min-height: 220px;
}

/* ── Map ── */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
  transition: border-color 0.5s;
}
.map-frame {
  width: 100%;
  height: 400px;
  border: none;
  display: block;
}
.service-time-row { display: flex; align-items: flex-start; gap: 12px; font-size: 0.9rem; flex-wrap: wrap; }
.service-time-row .time { font-weight: 700; color: var(--primary); min-width: 90px; transition: color 0.5s; }
.service-time-row .name { color: var(--text-mid); }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,30,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.22s;
}
.modal-split {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: none; }

/* Scrollbar — modal body and page */
.modal-body::-webkit-scrollbar,
html::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: var(--light); border-radius: 99px; margin: 20px 0; }
html::-webkit-scrollbar-track { background: var(--light); border-radius: 99px; }
.modal-body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 99px; transition: background 0.3s; }
.modal-body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover { filter: brightness(1.2); }
.modal-cover {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
}
.modal-color-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background 0.5s;
}
/* color bar spans full width above the split row */
.modal-color-bar + .modal-split { flex: 1; min-height: 0; }

/* ── Modal image gallery ── */
.modal-gallery {
  position: relative;
  width: 100%;
  flex: 3;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background: #0a0a14;
}
.modal-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.22s ease;
}
.modal-gallery-img.fading { opacity: 0; }
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.42);
  border: none;
  color: white;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 13px 6px;
  border-radius: 8px;
  z-index: 2;
  transition: background 0.18s;
}
.gallery-btn:hover { background: rgba(0,0,0,0.7); }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-dots {
  position: absolute;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.gallery-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.42);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
  flex-shrink: 0;
}
.gallery-dot.active { background: white; transform: scale(1.3); }
.modal-cover-placeholder {
  width: 100%;
  flex: 3;
  min-height: 0;
  background: linear-gradient(135deg, var(--light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-radius: 0;
}
.modal-body { padding: 28px 32px 32px; overflow-y: auto; flex: 2; min-height: 0; -webkit-overflow-scrolling: touch; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #111;
  transition: background 0.18s;
  line-height: 1;
}
.modal-close:hover { background: #e5e5e5; }
.modal-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.modal-body h2 { font-size: 1.35rem; margin-bottom: 0; }
.modal-date { font-size: 0.8rem; color: var(--text-light); margin-bottom: 18px; }
.modal-content p { font-size: 0.9rem; line-height: 1.8; color: var(--text-mid); white-space: pre-line; }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.main-footer { background: #12121e; color: white; padding: 52px 0 24px; border-top: 4px solid var(--primary); transition: border-color 0.5s; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer-brand h3 {
  color: white;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.footer-brand h3 .cross { color: var(--primary); transition: color 0.5s; }
.footer-brand p { font-size: 0.83rem; color: rgba(255,255,255,0.45); line-height: 1.75; }
.footer-col h4 {
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 0.83rem; color: rgba(255,255,255,0.45); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.28);
}
.dev-link {
  color: rgba(255,255,255,0.28);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.dev-link:hover { color: var(--accent); }
.dev-link sup { font-size: 0.65em; vertical-align: super; line-height: 0; }

/* ══════════════════════════════════════════════
   RESPONSIVE — tablet
══════════════════════════════════════════════ */
@media (max-width: 860px) {
  h1 { font-size: 2rem; }
  .hero-content { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .service-time { font-size: 2.2rem; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — mobile  (≤ 640px)
══════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Nav — hamburger active */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px 16px;
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
  }

  /* Typography */
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.35rem; }

  /* Sections */
  section { padding: 44px 0; }
  .container { padding: 0 16px; }
  .page-hero { padding: 36px 0 28px; }
  .page-hero h1 { font-size: 1.7rem; }

  /* Hero */
  .hero { padding: 44px 0 40px; }
  .hero-text > p { font-size: 0.95rem; }
  .service-time { font-size: 2rem; }
  .service-card { padding: 20px; }
  .service-card-cross { font-size: 4rem; }

  /* Calendar */
  .calendar-nav { gap: 8px; }
  .calendar-nav .week-label { font-size: 0.78rem; order: -1; flex: 0 0 100%; text-align: center; }
  .cal-btn { flex: 1; justify-content: center; padding: 8px 10px; font-size: 0.78rem; }
  .calendar-grid { gap: 4px; }
  .calendar-day { padding: 10px 2px 16px; min-height: 64px; }
  .day-num { font-size: 0.95rem; }
  .day-name { font-size: 0.58rem; }
  .events-panel { padding: 16px; }
  .event-row { flex-wrap: wrap; gap: 8px; }

  /* Section headers */
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Cards */
  .cards-grid { grid-template-columns: 1fr; gap: 20px; }
  .readings-grid { grid-template-columns: 1fr; }
  .card-img, .card-img-placeholder { height: 160px; }
  .card-title { font-size: 0.95rem; }
  .reading-card { padding: 16px 18px; }

  /* Filter */
  .filter-btn { padding: 6px 14px; font-size: 0.8rem; }

  /* Timeline */
  .timeline::before { left: 12px; }
  .timeline-dot { left: 4px; width: 16px; height: 16px; }
  .timeline-item { padding-left: 40px; padding-bottom: 36px; }
  .timeline-divider { left: 40px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 16px; }
  .priest-card { flex-direction: column; text-align: center; gap: 16px; padding: 20px; }
  .info-card { padding: 16px 18px; display: flex; flex-direction: row; align-items: center; gap: 16px; }
  .info-card-icon { margin-bottom: 0; flex-shrink: 0; }
  .info-card-text { flex: 1; min-width: 0; }
  #weekly-schedule-card { flex-direction: column; align-items: stretch; gap: 14px; }
  .info-card-header { display: flex; flex-direction: row; align-items: center; gap: 12px; }

  /* Services / Map / Sister Churches — stack vertically */
  .services-map-row { grid-template-columns: 1fr; }
  /* Reset flex-stretch behaviour so map has a fixed height when stacked */
  .map-col { display: block; }
  .map-col .map-container { flex: none; }
  .map-col .map-frame,
  .map-frame { height: 260px; }
  /* Sister churches list — wrap phone below name on narrow screens */
  .sister-list li { flex-direction: column; align-items: flex-start; gap: 2px; }
  .sister-phone { font-size: 0.85rem; }
  /* Service times table — tighter column gap */
  .service-times-table { gap: 10px 12px; }
  .svc-day, .svc-time { font-size: 0.85rem; }
  .svc-name { font-size: 0.82rem; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 6px; }

  /* Modal */
  .modal { max-width: calc(100vw - 32px); height: 92vh; }
  .modal-gallery { flex: none; height: 200px; }
  .modal-cover-placeholder { flex: none; height: 140px; }
  .modal-body { padding: 18px 18px 24px; }
  .gallery-btn { font-size: 2rem; padding: 2px 10px 5px; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — very small (≤ 380px)
══════════════════════════════════════════════ */
@media (max-width: 380px) {
  .nav-brand { font-size: 0.82rem; }
  .brand-cross { display: none; }
  h1 { font-size: 1.4rem; }
  .service-time { font-size: 1.75rem; }
  .cal-btn { padding: 7px 8px; font-size: 0.72rem; }
}
