/* ============================================
   Gateway Bible Church — Shared Styles
   v1.0 · March 2026
   ============================================ */

/* --- Skip Navigation (accessibility) --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--dark-blue);
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  opacity: 0;
  transition: top 0.2s ease, opacity 0.2s ease;
}
.skip-nav:focus {
  top: 0;
  opacity: 1;
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
}

/* --- Google Fonts (loaded via <link> in HTML for performance) --- */

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --bright-blue: #009CFF;
  --dark-blue: #0D2038;
  --gray-blue: #506D7C;
  --tan: #BDC17E;
  --gold: #D8AA19;
  --cream: #F4F8E9;

  /* Derived Colors */
  --dark-blue-90: rgba(13, 32, 56, 0.9);
  --dark-blue-70: rgba(13, 32, 56, 0.7);
  --dark-blue-50: rgba(13, 32, 56, 0.5);
  --dark-blue-20: rgba(13, 32, 56, 0.2);
  --dark-blue-10: rgba(13, 32, 56, 0.1);
  --bright-blue-10: rgba(0, 156, 255, 0.1);
  --bright-blue-20: rgba(0, 156, 255, 0.2);
  --cream-80: rgba(244, 248, 233, 0.8);
  --white: #FFFFFF;
  --white-90: rgba(255, 255, 255, 0.9);
  --white-70: rgba(255, 255, 255, 0.7);
  --white-50: rgba(255, 255, 255, 0.6);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-primary: 'Montserrat', sans-serif;
  --font-weight-thin: 100;
  --font-weight-light: 300;
  --font-weight-book: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --max-width: 1280px;
  --nav-height: 80px;
  --nav-height-scrolled: 64px;

  /* Shadows (color-tinted, layered) */
  --shadow-sm:
    0 1px 2px rgba(13, 32, 56, 0.04),
    0 2px 4px rgba(13, 32, 56, 0.03);
  --shadow-md:
    0 2px 4px rgba(13, 32, 56, 0.04),
    0 4px 12px rgba(13, 32, 56, 0.06),
    0 8px 24px rgba(13, 32, 56, 0.04);
  --shadow-lg:
    0 4px 8px rgba(13, 32, 56, 0.04),
    0 8px 24px rgba(13, 32, 56, 0.08),
    0 16px 48px rgba(13, 32, 56, 0.06);
  --shadow-nav:
    0 1px 0 rgba(13, 32, 56, 0.06),
    0 4px 16px rgba(13, 32, 56, 0.08);

  /* Transitions (spring-style easing — no transition-all) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Extended Palette */
  --cool-gray: #EDF1F4;
  --near-black: #000a1a;
  --deep-blue: #001530;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 100px;

  /* Section Spacing */
  --section-padding: var(--space-24);
  --section-padding-mobile: var(--space-16);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  /* scroll-behavior handled by components.js with nav-height offset */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* overscroll-behavior: none removed — disrupts macOS momentum scrolling on long pages */
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-book);
  color: var(--dark-blue);
  background-color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --- Utility: Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-10);
  }
}

/* --- Utility: Screen reader only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   NAVIGATION
   ============================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--white);
  transition: background-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.site-nav.scrolled {
  height: var(--nav-height-scrolled);
  background: var(--white-90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-nav);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (min-width: 768px) {
  .nav-inner {
    padding: 0 var(--space-10);
  }
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1001;
}

.nav-logo img {
  height: 56px;
  width: auto;
  /* No height transition — animating height causes scroll jank on macOS */
}

.site-nav.scrolled .nav-logo img {
  height: 44px;
}

/* Desktop Nav Links */
.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  display: contents;
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  position: relative;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  color: var(--dark-blue);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--bright-blue);
  background: var(--bright-blue-10);
}

/* Current page indicator — bright blue text + subtle underline */
.nav-link.is-current {
  color: var(--bright-blue);
}

.nav-link.is-current::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--bright-blue);
  border-radius: 2px;
}

/* Legacy: .nav-link--cta.is-current no longer needed — "I'm New" is now a regular nav link */

.nav-link:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
}

.nav-link:active {
  transform: scale(0.97);
}

/* Legacy: .nav-link--cta capsule removed — "I'm New" uses standard nav-link styles */

/* Mobile Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  z-index: 1001;
  border-radius: var(--radius-md);
  transition: background-color var(--duration-fast) var(--ease-out);
}

.nav-hamburger:hover {
  background: var(--dark-blue-10);
}

.nav-hamburger:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  .nav-hamburger {
    display: none;
  }
}

.hamburger-line {
  width: 22px;
  height: 2px;
  background: var(--dark-blue);
  border-radius: 2px;
  transition: transform var(--duration-normal) var(--ease-spring),
              opacity var(--duration-fast) var(--ease-out);
}

.hamburger-line + .hamburger-line {
  margin-top: 6px;
}

/* Hamburger → X animation */
.nav-hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-slow) var(--ease-out),
              visibility var(--duration-slow) var(--ease-out);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-links li {
  display: contents;
}

.mobile-link {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--dark-blue);
  letter-spacing: -0.01em;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  opacity: 0;
  transform: translateY(20px);
  transition: color var(--duration-fast) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-spring);
}

.mobile-menu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance */
.mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 80ms; }
.mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 130ms; }
.mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 180ms; }
.mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 230ms; }
.mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 280ms; }
.mobile-menu.open .mobile-link:nth-child(6) { transition-delay: 330ms; }
.mobile-menu.open .mobile-link:nth-child(7) { transition-delay: 380ms; }

.mobile-link.is-current {
  color: var(--bright-blue);
}

.mobile-link:hover {
  color: var(--bright-blue);
}

.mobile-link:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
}

/* Legacy: .mobile-link--cta capsule removed — "I'm New" uses standard mobile-link styles */

.mobile-menu-contact {
  margin-top: var(--space-12);
  text-align: center;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  transition-delay: 420ms;
}

.mobile-menu.open .mobile-menu-contact {
  opacity: 1;
}

.mobile-menu-contact p {
  font-size: var(--text-sm);
  color: var(--gray-blue);
  line-height: 1.8;
}

.mobile-menu-contact a {
  color: var(--bright-blue);
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-fast) var(--ease-out);
}

.mobile-menu-contact a:hover {
  color: var(--dark-blue);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--dark-blue);
  color: var(--white);
  padding: var(--space-20) 0 var(--space-8);
  position: relative;
  overflow: hidden;
}

/* Subtle grain texture overlay */
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
}

/* Soft radial glow */
.site-footer::after {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 156, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
}

/* Footer top: logo + tagline */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--white-10);
}

.footer-brand img {
  height: 52px;
  width: auto;
}

.footer-tagline {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-book);
  color: var(--white-50);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Footer grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-16);
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-column h4 {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-5);
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-column a {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-book);
  color: var(--white-70);
  transition: color var(--duration-fast) var(--ease-out);
  display: inline-block;
}

.footer-column a:hover {
  color: var(--bright-blue);
}

.footer-column a:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Footer community column — 2-col list for 8 items */
.footer-community-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-6);
}

/* Footer bottom bar — address line + copyright stacked left, socials right */
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-top: var(--space-8);
  border-top: 1px solid var(--white-10);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-8);
  }
}

.footer-bottom-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-contact,
.footer-copyright {
  font-size: var(--text-xs);
  color: var(--white-50);
  font-weight: var(--font-weight-book);
  line-height: 1.5;
}

.footer-contact a {
  color: inherit;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-contact a:hover {
  color: var(--bright-blue);
}

.footer-contact-sep {
  display: none;
}

@media (min-width: 640px) {
  .footer-contact-sep {
    display: inline;
    color: var(--white-10);
    margin: 0 0.4em;
  }
}

/* Mobile: stack address bits vertically so they're not jammed together */
@media (max-width: 639px) {
  .footer-contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }
}

.footer-socials {
  display: flex;
  gap: var(--space-4);
}

.footer-social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--white-10);
  color: var(--white-70);
  transition: transform var(--duration-fast) var(--ease-spring),
              background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.footer-social-link:hover {
  background: var(--bright-blue);
  color: var(--white);
  transform: scale(1.1);
}

.footer-social-link:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
}

.footer-social-link:active {
  transform: scale(0.95);
}

.footer-social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ============================================
   PAGE BODY OFFSET (for fixed nav)
   ============================================ */

.page-content {
  padding-top: var(--nav-height);
}

/* ============================================
   SHARED BUTTON STYLES
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-xl);
  cursor: pointer;
  border: none;
  transition: transform var(--duration-fast) var(--ease-spring),
              background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.btn:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--dark-blue);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--bright-blue);
  box-shadow: 0 4px 16px rgba(0, 156, 255, 0.25);
}

.btn--secondary {
  background: transparent;
  color: var(--dark-blue);
  border: 1.5px solid var(--dark-blue-20);
}

.btn--secondary:hover {
  border-color: var(--bright-blue);
  color: var(--bright-blue);
  background: var(--bright-blue-10);
}

