/* ==========================================================================
   Grace Church Keighley — Design System
   ========================================================================== */

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

:root {
  /* Brand palette — navy, teal & gold, drawn from the church's real branding */
  --primary:      #16233F;
  --primary-mid:  #24365C;
  --primary-dark: #0A1220;
  --teal:         #3C6E78;
  --teal-dark:    #2A4E56;
  --accent:       #C89B4C;
  --accent-mid:   #B4863A;
  --accent-dark:  #8C6425;

  /* Neutrals */
  --bg:        #FBF7EF;
  --surface:   #FFFFFF;
  --border:    #E6DFCE;
  --text:      #1B1F27;
  --text-soft: #565C68;
  --text-muted:#8B909A;

  /* Typography */
  --font-display: 'Fraunces', serif;
  --font-body:    'Source Sans 3', sans-serif;

  /* Spacing / layout */
  --section-pad: clamp(60px, 8vw, 120px);
  --container:   1200px;
  --radius:      12px;
  --radius-lg:   28px;

  --shadow-soft: 0 20px 50px -20px rgba(10, 18, 32, 0.35);
  --shadow-card: 0 12px 30px -14px rgba(22, 35, 63, 0.22);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--primary);
  line-height: 1.1;
  font-weight: 600;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.03; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.1; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.7rem); }
h4 { font-size: clamp(1.05rem, 1.8vw, 1.25rem); }

p { font-size: clamp(0.98rem, 1.5vw, 1.1rem); color: var(--text-soft); }

.italic-display { font-style: italic; font-family: var(--font-display); color: var(--accent-dark); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: var(--section-pad); }
.section-tight { padding-block: clamp(40px, 5vw, 72px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

.heading-rule {
  width: 64px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
  margin: 1rem 0 1.5rem;
}
.center .heading-rule { margin-inline: auto; }

.center { text-align: center; }

/* Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
}
.btn-accent:hover { background: var(--accent-mid); transform: translateY(-2px); }

.btn-outline-light {
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: #fff; transform: translateY(-2px); }

.btn-outline-dark {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-dark:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-mid); transform: translateY(-2px); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding-block: 1.1rem;
  transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
}
.site-nav.scrolled {
  background: rgba(251, 247, 239, 0.92);
  backdrop-filter: blur(10px);
  padding-block: 0.7rem;
  box-shadow: 0 8px 30px -18px rgba(10,18,32,0.4);
}
.nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: #fff;
  transition: color 0.35s ease;
}
.site-nav.scrolled .nav-brand { color: var(--primary); }
.nav-brand .brand-mark {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-links {
  display: none;
  align-items: center;
  gap: 2.1rem;
}
.nav-links a {
  font-size: 0.94rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  position: relative;
  padding-block: 0.3rem;
  transition: color 0.3s ease;
}
.site-nav.scrolled .nav-links a { color: var(--text); }
.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--accent);
  transition: right 0.25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }
.nav-links a.active { color: var(--accent) !important; }

.nav-cta { display: none; }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.14);
  cursor: pointer;
  z-index: 1100;
  position: relative;
}
.site-nav.scrolled .hamburger { background: rgba(22,35,63,0.08); }
.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: #fff;
  margin-inline: auto;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}
.site-nav.scrolled .hamburger span { background: var(--primary); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--primary-dark);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 8vw, 4rem);
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(.65,0,.35,1);
  visibility: hidden;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-menu ul { display: flex; flex-direction: column; gap: 1.4rem; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  color: #fff;
  font-weight: 600;
}
.mobile-menu a.active { color: var(--accent); }
.mobile-menu .mobile-cta { margin-top: 2rem; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .hamburger { display: none; }
}

/* ==========================================================================
   Hero (page-level, reused with modifiers)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,32,0.55) 0%, rgba(10,18,32,0.55) 40%, rgba(10,18,32,0.92) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-block: clamp(4rem, 10vw, 6rem) clamp(3rem, 8vw, 4.5rem);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.hero-eyebrow::before { content:''; width: 28px; height: 2px; background: var(--accent); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lede {
  color: rgba(255,255,255,0.86);
  max-width: 46ch;
  margin-block: 1.4rem 2.2rem;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero-charity { color: rgba(255,255,255,0.65); font-size: 0.85rem; margin-top: 1.4rem; }

.hero-page {
  min-height: 60svh;
  align-items: center;
}
.hero-page .hero-inner { padding-block: clamp(7rem, 14vw, 9rem) clamp(3rem, 8vw, 4rem); }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.scroll-cue span {
  width: 4px; height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ==========================================================================
   Cards & grids
   ========================================================================== */
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.9rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
  border-color: transparent;
}
.card-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.3rem;
}
.card-icon svg { width: 26px; height: 26px; stroke: var(--accent); }
.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: 0.98rem; margin-bottom: 0; }

.card-dark {
  background: var(--primary);
  border: none;
}
.card-dark h3, .card-dark .card-icon { color: #fff; }
.card-dark p { color: rgba(255,255,255,0.75); }
.card-dark .card-icon { background: rgba(255,255,255,0.1); }
.card-dark .card-icon svg { stroke: var(--accent); }

/* Section band (dark) */
.band-dark {
  background: var(--primary);
  color: #fff;
  position: relative;
}
.band-dark h2, .band-dark h3, .band-dark h4 { color: #fff; }
.band-dark p { color: rgba(255,255,255,0.78); }
.band-dark .eyebrow { color: var(--accent); }

/* About-style split */
.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .split.reverse .split-media { order: 2; }
}
.split-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.split-media::before {
  content: '';
  position: absolute; inset: 0;
  border: 10px solid var(--surface);
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow: var(--shadow-soft);
}
.split-badge {
  position: absolute;
  bottom: -1.5rem; right: -1.2rem;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  text-align: center;
  line-height: 1.1;
}
.split-badge strong { display: block; font-size: 1.6rem; }
.split-badge span { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }

/* Ministry / project row */
.project-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-block: 2.2rem;
  border-bottom: 1px solid var(--border);
}
.project-row:last-child { border-bottom: none; }
@media (min-width: 768px) {
  .project-row { grid-template-columns: 90px 1fr; gap: 2rem; }
}
.project-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent);
  font-weight: 600;
}
.project-row h3 { margin-bottom: 0.5rem; }

/* Events */
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
}
.event-card h3 { margin-bottom: 0.4rem; }
.event-time {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* Testimonial */
.testimonial-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.4rem;
  border: 1px solid var(--border);
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.4;
  position: absolute;
  top: 0.4rem; left: 1.4rem;
  line-height: 1;
}
.stars { color: var(--accent); letter-spacing: 0.15em; margin-bottom: 1rem; font-size: 1rem; }
.testimonial-name { font-weight: 700; color: var(--primary); margin-top: 1rem; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10,18,32,0.55));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover::after { opacity: 1; }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,18,32,0.94);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; }
@media (min-width: 640px) { .form-grid.two-col { grid-template-columns: 1fr 1fr; } }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200,155,76,0.18);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-success {
  display: none;
  background: var(--primary);
  color: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
}
.form-success.show { display: block; }
.form-success h3 { color: #fff; }

/* Contact info list */
.contact-info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-block: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.contact-info-item:last-child { border-bottom: none; }
.contact-info-item .icon-badge {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-info-item .icon-badge svg { width: 20px; height: 20px; stroke: var(--accent); }

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding-block: 4rem 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.6rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.footer-brand span { font-family: var(--font-display); font-size: 1.15rem; color: #fff; font-weight: 700; }
.footer-col h4 { color: #fff; font-size: 0.95rem; letter-spacing: 0.04em; margin-bottom: 1.1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a, .footer-col address { font-size: 0.92rem; color: rgba(255,255,255,0.68); font-style: normal; }
.footer-col a:hover { color: var(--accent); }
.footer-socials { display: flex; gap: 0.7rem; margin-top: 1.3rem; }
.footer-socials a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.footer-socials svg { width: 17px; height: 17px; stroke: #fff; }
.footer-socials a:hover { background: var(--accent); }
.footer-socials a:hover svg { stroke: var(--primary-dark); }
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: center;
  text-align: center;
  padding-top: 2rem;
  font-size: 0.85rem;
}
@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer-bottom a { color: rgba(255,255,255,0.7); }
.footer-bottom a:hover { color: var(--accent); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 1rem 1.5rem;
  z-index: 3000;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0; top: 0;
}

/* Utility */
.text-accent { color: var(--accent-dark); }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.max-prose { max-width: 62ch; }
