/* ==========================================================================
   Flock of Christ Sanctuary, Northampton - Master Stylesheet
   Ultra-modern, Light Themed, Colourful & Spirit-filled Aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --color-primary: #1e3a8a;
  --color-primary-light: #3b82f6;
  --color-gold: #d97706;
  --color-gold-light: #fbbf24;
  --color-gold-glow: rgba(245, 158, 11, 0.3);
  --color-emerald: #059669;
  --color-rose: #e11d48;
  --color-violet: #7c3aed;

  --bg-main: #faf9f6;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-elevated: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
  --shadow-glow-gold: 0 0 30px rgba(217, 119, 6, 0.25);
  --shadow-glow-blue: 0 0 30px rgba(37, 99, 235, 0.25);
}

/* -------------------------------- Base Styles -------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
  position: relative;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-x: none;
  background-image: 
    radial-gradient(at 0% 0%, rgba(254, 243, 199, 0.4) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(224, 242, 254, 0.5) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(245, 243, 255, 0.4) 0px, transparent 50%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  color: inherit;
}

.font-serif {
  font-family: var(--font-serif);
}

/* ----------------------------- Custom Utilities ---------------------------- */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03);
}

/* Enhanced Navigation Link Styling - Single line guarantee & airy spacing */
.nav-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: #1e3a8a;
  background: rgba(30, 58, 138, 0.07);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #1e3a8a;
  font-weight: 700;
  background: rgba(30, 58, 138, 0.1);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
}

.glass-card-colored {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.85) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-card);
}

.glass-card-dark {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text-gold {
  background: linear-gradient(135deg, #b45309 0%, #d97706 40%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-royal {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-light {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 60%, #fed7aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow-border-gold {
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

/* ----------------------------- Hero Section Styling ------------------------ */
.hero-wrapper {
  position: relative;
  padding-top: 1.25rem;
  padding-bottom: 3.5rem;
  overflow: hidden;
}

/* Background luminous orbs */
.orb-1 {
  position: absolute;
  top: 10%;
  left: 5%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, rgba(251, 191, 36, 0) 70%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
  animation: pulse-slow 8s ease-in-out infinite alternate;
}

.orb-2 {
  position: absolute;
  top: 25%;
  right: 5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 70%);
  filter: blur(50px);
  z-index: 0;
  pointer-events: none;
  animation: pulse-slow 10s ease-in-out infinite alternate-reverse;
}

/* The Central Hero Square Card */
.hero-square-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1 / 1;
  min-height: 480px;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 40px rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 10;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.25rem;
}

.hero-square-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.3), 0 0 50px rgba(217, 119, 6, 0.25);
}

/* Square Card Video Background (GIF-like loop) */
.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(0.92) contrast(1.08);
  pointer-events: none;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.75) 0%,
    rgba(15, 23, 42, 0.45) 45%,
    rgba(15, 23, 42, 0.88) 100%
  );
  z-index: 2;
}

.hero-card-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Flanking Portrait Video Cards (GIF-like loops) */
.hero-portrait-card {
  position: relative;
  width: 100%;
  max-width: 270px;
  aspect-ratio: 9 / 16;
  height: 500px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
}

.hero-portrait-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 25px 45px -10px rgba(30, 58, 138, 0.25);
}

.portrait-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.portrait-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.7) 0%,
    rgba(15, 23, 42, 0.2) 50%,
    rgba(15, 23, 42, 0.85) 100%
  );
  z-index: 2;
}

.portrait-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ----------------------------- Buttons ------------------------------------- */
.btn-primary-glow {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.55);
  color: #ffffff;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-weight: 600;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-full);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-royal {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-royal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45);
  color: #ffffff;
}

/* --------------------------- Animations ----------------------------------- */
@keyframes pulse-slow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.6; }
  100% { transform: scale(1.15) translate(20px, -20px); opacity: 0.9; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4)); }
  50% { opacity: 0.85; filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.8)); }
}

.animate-float {
  animation: float 5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 6s ease-in-out infinite 2s;
}

.animate-pulse-glow {
  animation: pulse-glow 3s infinite ease-in-out;
}

/* Reveal on scroll styling */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* --------------------------- Gallery Styling ------------------------------ */
.gallery-grid {
  column-count: 1;
  column-gap: 1.5rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    column-count: 3;
  }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  border-radius: 1.5rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
  cursor: pointer;
  display: block;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
}

.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  background-color: #f8fafc;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.gallery-hover-indicator {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gallery-item:hover .gallery-hover-indicator {
  opacity: 1;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.3) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem sm:padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay,
.gallery-teaser-card:hover .gallery-overlay {
  opacity: 1;
}

/* Dedicated Square Teaser Card for Home Page */
.gallery-teaser-card {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 1.5rem;
  overflow: hidden;
  background-color: #0f172a;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}

.gallery-teaser-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
}

.gallery-teaser-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-teaser-card:hover img {
  transform: scale(1.05);
}

/* --------------------------- Lightbox Modal ------------------------------- */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-img {
  transform: scale(1);
}

/* --------------------------- Interactive Tabs & Filters ------------------- */
.filter-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: all 0.25s ease;
  cursor: pointer;
}

.filter-btn:hover {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-subtle);
}

.filter-btn.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

/* --------------------------- Ministry Badges ------------------------------ */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------- Custom Scrollbar ----------------------------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --------------------------- Mobile Responsiveness ------------------------ */
@media (max-width: 1024px) {
  .hero-square-card {
    max-width: 480px;
    min-height: 440px;
    padding: 1.75rem;
  }
  .hero-portrait-card {
    height: 440px;
    max-width: 240px;
  }
}

@media (max-width: 768px) {
  .hero-wrapper {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }
  .hero-square-card {
    aspect-ratio: auto;
    min-height: 460px;
    max-width: 100%;
    border-radius: 28px;
    padding: 1.75rem 1.25rem;
  }
  .hero-portrait-card {
    height: 380px;
    max-width: 100%;
    border-radius: 24px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /* Prevent horizontal animation sway on mobile phones */
  .reveal-left,
  .reveal-right {
    transform: translateY(24px) !important;
  }
  .reveal-left.active,
  .reveal-right.active {
    transform: translateY(0) !important;
  }

  /* Safeguard against fixed or absolute orbs pushing viewport bounds */
  .orb-1, .orb-2 {
    display: none !important;
  }
}

