/*
 * ============================================================
 *  JPGM FAMILY CITY CHURCH — RESPONSIVE SYSTEM
 *  Covers: 320px → 480px → 576px → 768px → 992px → 1200px → 1920px+
 *  Mobile-first progressive enhancement
 *  File loads AFTER style.css and cutting-edge.css
 * ============================================================
 */

/* ── GLOBAL OVERFLOW GUARD ──────────────────────────── */
html, body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── IMPROVED CONTAINER ─────────────────────────────── */
.container {
  width: min(100% - 2rem, 1280px);
  margin-inline: auto;
  padding-left: clamp(16px, 4vw, 24px);
  padding-right: clamp(16px, 4vw, 24px);
}

/* ── RESPONSIVE IMAGES ──────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
}

/* ── RESPONSIVE VIDEO EMBEDS ────────────────────────── */
.video-responsive,
.live-player,
.featured-sermon-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-responsive iframe,
.live-player iframe,
.featured-sermon-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── TOUCH TARGETS ──────────────────────────────────── */
button, a, input, select, textarea, .filter-pill, .filter-btn, .tab-btn {
  touch-action: manipulation;
}

/* ── REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   LARGE SCREENS: 1920px+
   ============================================================ */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  body #home.hero h1 {
    font-size: clamp(72px, 5.5vw, 96px);
  }

  body #home.hero .hero-desc {
    font-size: clamp(20px, 1.5vw, 26px);
  }

  .footer-grid {
    grid-template-columns: 2.2fr 1fr 1fr 1fr 1.6fr;
    gap: 56px;
  }
}

/* ============================================================
   DESKTOP: 1280px – 1920px (fine-tuning)
   ============================================================ */
@media (max-width: 1440px) {
  .container {
    max-width: 1240px;
  }
}

@media (max-width: 1366px) {
  .container {
    max-width: 1180px;
  }

  body #home.hero h1 {
    font-size: clamp(46px, 5vw, 72px);
  }
}

@media (max-width: 1280px) {
  .container {
    max-width: 1100px;
  }

  .footer-grid {
    gap: 28px;
  }

  .min-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* ============================================================
   TABLET-LARGE / LAPTOP: 1024px – 1200px
   ============================================================ */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
  }

  .triple-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
    gap: 24px;
  }

  .footer-grid > *:last-child {
    grid-column: 1 / -1;
  }

  .giving-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pw-grid {
    gap: 40px;
  }

  .wm-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   TABLET: 992px – 1024px
   ============================================================ */
@media (max-width: 1024px) {
  /* Header */
  .header {
    width: 94% !important;
    height: 62px !important;
    top: 12px !important;
  }

  .mobile-toggle {
    display: flex !important;
  }

  .nav-main {
    position: fixed !important;
    top: 82px !important;
    left: 5% !important;
    right: 5% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(138, 43, 226, 0.3) !important;
    border-radius: 20px !important;
    padding: 20px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-14px) scale(0.97) !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 9999 !important;
    margin: 0 !important;
    max-height: calc(100vh - 100px) !important;
    overflow-y: auto !important;
  }

  .nav-main.mobile-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
  }

  .nav-main a,
  .nav-main > .nav-dropdown > a {
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    color: rgba(255,255,255,0.88) !important;
    width: 100% !important;
    display: block !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    transition: background 0.2s !important;
  }

  .nav-main a:hover,
  .nav-main a.active {
    background: rgba(138, 43, 226, 0.18) !important;
    color: #fff !important;
  }

  /* Mobile nav: inline dropdown */
  .dropdown-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    padding: 6px 12px !important;
    margin-top: 4px !important;
    min-width: unset !important;
  }

  .dropdown-menu::before { display: none !important; }

  .dropdown-menu a {
    font-size: 14px !important;
    padding: 10px 14px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Hero */
  body #home.hero {
    min-height: 0 !important;
    height: auto !important;
    padding-top: calc(100px + var(--announcement-height, 0px)) !important;
    padding-bottom: 90px !important;
  }

  body #home.hero .hero-container {
    grid-template-columns: 0.55fr 1fr !important;
  }

  body #home.hero .hero-portrait-wrapper {
    width: clamp(160px, 20vw, 240px) !important;
  }

  /* Layout fixes */
  .featured-sermon {
    grid-template-columns: 1fr !important;
  }

  .featured-sermon-video {
    min-height: 260px !important;
    aspect-ratio: 16 / 9 !important;
  }

  .featured-sermon-info {
    padding: 28px !important;
  }

  .leader-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Quick links */
  body .ql-bar {
    flex-wrap: wrap !important;
    gap: 16px !important;
    padding: 20px !important;
  }

  body .ql-item {
    min-width: 40% !important;
    flex: none !important;
  }

  body .ql-divider {
    display: none !important;
  }

  /* forms */
  .visit-form-box,
  .giving-form-box {
    padding: 28px !important;
  }

  .visit-steps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ============================================================
   TABLET: 768px – 992px
   ============================================================ */
@media (max-width: 992px) {
  /* Sections */
  .page-header {
    padding: 140px 0 60px !important;
  }

  .page-header h1 {
    font-size: clamp(28px, 6vw, 44px) !important;
  }

  /* Hero responsive */
  body #home.hero {
    padding: calc(96px + var(--announcement-height, 0px)) 0 80px 0 !important;
    min-height: 0 !important;
    height: auto !important;
    align-items: flex-start !important;
  }

  body #home.hero .hero-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px !important;
    padding-bottom: 0 !important;
  }

  body #home.hero .hero-portrait-wrapper {
    display: none !important;
  }

  /* Hide glow pseudo-element that causes vertical line artifact */
  body #home.hero .hero-portrait-wrapper::before {
    display: none !important;
  }

  body #home.hero .hero-content {
    order: 2 !important;
    width: 100% !important;
    max-width: 620px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    text-align: center !important;
    grid-column: auto !important;
  }

  body #home.hero .hero-eyebrow,
  body #home.hero .hero-signature,
  body #home.hero .hero-btns {
    justify-content: center !important;
  }

  body #home.hero h1 {
    font-size: clamp(36px, 7.5vw, 54px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body #home.hero .hero-desc {
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: clamp(15px, 2vw, 19px) !important;
  }

  body #home.hero .badge {
    display: none !important;
  }

  /* Grids */
  .pw-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .nh-box {
    grid-template-columns: 1fr !important;
    padding: 28px !important;
  }

  .prayer-box {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .triple-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .min-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }

  .beliefs-grid {
    grid-template-columns: 1fr !important;
  }

  .prayer-wall-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .wm-highlights {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .event-item,
  .event-item-featured {
    grid-template-columns: 80px 1fr !important;
    gap: 16px !important;
  }

  .event-item-featured {
    grid-template-columns: 80px 1fr !important;
  }

  .event-feature-img {
    display: none !important;
  }

  .visit-steps-grid {
    grid-template-columns: 1fr !important;
  }

  .nl-box {
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
    padding: 24px !important;
  }

  .nl-form {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 400px !important;
    margin: 0 auto !important;
  }

  .nl-form input {
    width: 100% !important;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 32px !important;
  }

  .footer-brand {
    grid-column: 1 / -1 !important;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Sermon */
  .sermon-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .gallery-large {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
  }

  .gallery-large img {
    min-height: 200px !important;
  }

  /* Quick links on mobile */
  .quick-links-wrapper {
    margin-top: -30px !important;
    position: relative !important;
    z-index: 20 !important;
  }

  .ministries-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
}

/* ============================================================
   TABLET: 768px (iPad portrait)
   ============================================================ */
@media (max-width: 768px) {
  /* Section padding reduction */
  .ministries,
  .triple,
  .pastor-welcome,
  .testimonials,
  .gallery,
  .new-here,
  .prayer-section,
  .newsletter,
  .content-section {
    padding-top: clamp(40px, 6vw, 70px) !important;
    padding-bottom: clamp(40px, 6vw, 70px) !important;
  }

  .page-header {
    padding: 130px 0 56px !important;
  }

  /* Hero */
  body #home.hero {
    padding: calc(90px + var(--announcement-height, 0px)) 0 76px !important;
  }

  body #home.hero h1 {
    font-size: clamp(32px, 8vw, 48px) !important;
  }

  /* Footer */
  .footer {
    padding-top: 60px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }

  .footer-brand {
    grid-column: 1 / -1 !important;
  }

  /* Countdown */
  .countdown-units {
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: center !important;
  }

  .countdown-unit {
    min-width: 70px !important;
    padding: 14px 16px !important;
  }

  .countdown-unit .number {
    font-size: 26px !important;
  }

  /* Lightbox mobile */
  .lightbox-img {
    max-width: 95vw !important;
    max-height: 85vh !important;
  }

  .lightbox-prev {
    left: 8px !important;
    width: 42px !important;
    height: 42px !important;
  }

  .lightbox-next {
    right: 8px !important;
    width: 42px !important;
    height: 42px !important;
  }

  /* Content cards */
  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* Giving */
  .giving-options {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .giving-form-box {
    padding: 24px !important;
  }

  .giving-amounts {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Event item */
  .event-item,
  .event-item-featured {
    grid-template-columns: 70px 1fr !important;
    padding: 18px !important;
    gap: 14px !important;
  }

  /* Devotional */
  .devotional-box {
    padding: 28px 20px !important;
  }

  /* Visit form */
  .visit-form-box {
    padding: 24px 16px !important;
  }

  /* Sermon filter */
  .sermon-filter,
  .events-filter {
    width: 100% !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }

  .filter-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* PWelcome image */
  .pw-image img {
    height: 280px !important;
  }
}

/* ============================================================
   MOBILE: 576px – 768px
   ============================================================ */
@media (max-width: 600px) {
  /* Container */
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Header: optimized for touch */
  .header {
    width: 96% !important;
    height: 64px !important;
    top: 10px !important;
  }

  .icon-btn, .mobile-toggle {
    width: 44px !important;
    height: 44px !important;
  }
  
  .logo-img {
    max-height: 40px !important;
    width: 40px !important;
    aspect-ratio: 1 / 1 !important;
  }

  .logo-text {
    font-size: 11px !important;
  }

  /* Hero */
  body #home.hero {
    padding: calc(86px + var(--announcement-height, 0px)) 0 76px !important;
  }

  body #home.hero h1 {
    font-size: clamp(30px, 9vw, 42px) !important;
    line-height: 1.1 !important;
  }

  body #home.hero .hero-desc {
    font-size: 15px !important;
  }

  body #home.hero .hero-btns {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  body #home.hero .btn-solid-white,
  body #home.hero .btn-outline-white {
    width: 100% !important;
    justify-content: center !important;
    min-height: 50px !important;
    font-size: 15px !important;
  }

  /* Quick links stacked */
  body .ql-bar {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    border-radius: 16px !important;
  }

  body .ql-item {
    min-width: 100% !important;
    padding: 18px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    text-align: left !important;
  }

  body .ql-item:last-child {
    border-bottom: none !important;
  }

  body .ql-item svg {
    margin-bottom: 0 !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }

  body .ql-item h4 {
    font-size: 13px !important;
  }

  body .ql-item p {
    font-size: 11px !important;
  }

  /* Grids */
  .min-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .triple-grid {
    grid-template-columns: 1fr !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .leader-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  .sermon-grid {
    grid-template-columns: 1fr !important;
  }

  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  .beliefs-grid {
    grid-template-columns: 1fr !important;
  }

  .prayer-wall-grid {
    grid-template-columns: 1fr !important;
  }

  .wm-highlights {
    grid-template-columns: 1fr !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .gallery-large {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
  }

  .gallery-large img {
    min-height: 180px !important;
    height: 180px !important;
  }

  .gallery-item img {
    height: 150px !important;
  }

  /* Giving */
  .giving-options {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .giving-amounts {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .prayer-form-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* page header */
  .page-header {
    padding: 120px 0 44px !important;
  }

  .page-header h1 {
    font-size: clamp(26px, 8.5vw, 38px) !important;
    letter-spacing: -0.5px !important;
  }

  .page-header p {
    font-size: 14px !important;
  }

  /* Breadcrumb */
  .breadcrumb {
    flex-wrap: wrap !important;
    font-size: 12px !important;
    justify-content: center !important;
  }

  /* Featured sermon */
  .featured-sermon {
    grid-template-columns: 1fr !important;
  }

  .featured-sermon-info {
    padding: 20px !important;
  }

  /* Event items */
  .event-item,
  .event-item-featured {
    grid-template-columns: 60px 1fr !important;
    padding: 14px !important;
    gap: 12px !important;
  }

  .event-date-box {
    width: 60px !important;
    padding: 10px 8px !important;
  }

  .event-date-box .event-day {
    font-size: 22px !important;
  }

  .event-meta {
    flex-direction: column !important;
    gap: 4px !important;
  }

  /* Newsletter footer */
  .footer-newsletter {
    padding: 20px 16px !important;
  }

  .footer-newsletter-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }

  .footer-newsletter-fields {
    flex-direction: column !important;
  }

  .footer-nl-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Floating buttons */
  .whatsapp-float-btn {
    bottom: 20px !important;
    left: 14px !important;
    right: auto !important;
    width: 44px !important;
    height: 44px !important;
  }

  #aiAssistantWidget {
    bottom: 14px !important;
    right: 14px !important;
  }

  .back-to-top {
    bottom: 74px !important;
    right: 14px !important;
    width: 42px !important;
    height: 42px !important;
  }

  /* Min card padding */
  .min-card {
    padding: 28px 20px !important;
  }

  /* New here box */
  .nh-box {
    padding: 20px !important;
  }

  .nh-image img {
    height: 260px !important;
  }

  /* Section gaps */
  .ministries,
  .triple,
  .pastor-welcome,
  .testimonials,
  .gallery,
  .new-here,
  .prayer-section,
  .newsletter,
  .content-section {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }
}

/* ============================================================
   MOBILE: 480px
   ============================================================ */
@media (max-width: 480px) {
  /* Container edge */
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Leader cards: 2 cols still ok */
  .leader-card {
    padding: 20px 14px !important;
  }

  .leader-avatar {
    width: 60px !important;
    height: 60px !important;
    font-size: 18px !important;
  }

  /* Giving option */
  .giving-option {
    padding: 20px 14px !important;
  }

  .giving-form-box {
    padding: 20px 14px !important;
  }

  /* Prayer wall */
  .prayer-wall-card {
    padding: 18px !important;
  }

  /* Sermon card */
  .sermon-card-body {
    padding: 16px !important;
  }

  /* Visit */
  .visit-step-card {
    padding: 22px !important;
  }

  /* Countdown */
  .countdown-unit {
    min-width: 62px !important;
    padding: 10px 12px !important;
  }

  .countdown-unit .number {
    font-size: 22px !important;
  }

  /* Card event/sermon min-height */
  .card-event,
  .card-sermon,
  .card-times {
    min-height: 260px !important;
  }

  /* nl form  */
  .nl-box {
    padding: 18px !important;
  }

  /* content section */
  .content-section h2 {
    font-size: clamp(20px, 6.5vw, 28px) !important;
  }

  /* testimonial */
  .testimonial-card {
    padding: 20px !important;
  }

  /* Tab btn */
  .tab-btn {
    font-size: 10px !important;
    padding: 8px 4px !important;
  }
}

/* Desktop homepage: use the supplied JPGM hero artwork exactly as designed.
   It already contains the matching header, portrait, copy, stage, and actions. */
@media (min-width: 761px) {
  body:has(#home) .top-announcement-banner,
  body:has(#home) .skip-to-content,
  body:has(#home) .header,
  body:has(#home) .quick-links-wrapper {
    display: none !important;
  }

  body:has(#home) #home.hero {
    height: min(52.5vw, 900px) !important;
    min-height: 0 !important;
    max-height: none !important;
    background: #08021e !important;
  }

  body:has(#home) #home.hero .hero-reference-art {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
  }

  body:has(#home) #home.hero::before {
    display: none !important;
  }

  body:has(#home) #home.hero::after {
    content: '';
    position: absolute;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    height: 12%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(5, 2, 19, 0.96) 78%, #08021e);
  }

  body:has(#home) #home.hero .hero-bg,
  body:has(#home) #home.hero #heroParticles,
  body:has(#home) #home.hero .hero-grid-layout {
    display: none !important;
  }
}

@media (max-width: 760px) {
  body:has(#home) #home.hero .hero-reference-art {
    display: none;
  }
}

/* Professional homepage composition: keep the real, accessible header and
   navigation on top of the hero.  The supplied artwork is used only as the
   worship-stage background, never as a screenshot replacement for the UI. */
@media (min-width: 761px) {
  body:has(#home) .top-announcement-banner {
    display: flex !important;
  }

  body:has(#home) .skip-to-content,
  body:has(#home) .header {
    display: block !important;
  }

  body:has(#home) .quick-links-wrapper {
    display: block !important;
  }

  body:has(#home) #home.hero {
    height: auto !important;
    min-height: min(780px, 100vh) !important;
    background: #08031d !important;
  }

  body:has(#home) #home.hero::after {
    content: none;
  }

  body:has(#home) #home.hero .hero-reference-art {
    display: none !important;
  }

  body:has(#home) #home.hero .hero-bg {
    display: block !important;
    background-color: #08031d !important;
    background-image: url('/Regina%20Church1/Regina-Church/public/assets/uploads/hero-reference.png') !important;
    background-position: center -96px !important;
    background-size: 100% auto !important;
    background-repeat: no-repeat !important;
  }

  body:has(#home) #home.hero .hero-bg::before {
    display: none;
  }

  body:has(#home) #home.hero .hero-bg-split {
    display: block !important;
    background: linear-gradient(135deg, rgba(13, 3, 35, 0.96), rgba(7, 3, 28, 0.91)) !important;
    clip-path: polygon(0 0, 59% 0, 47% 100%, 0 100%);
    box-shadow: 12px 0 22px rgba(223, 98, 255, 0.58);
  }

  body:has(#home) #home.hero .hero-bg-split::after {
    display: block !important;
  }

  body:has(#home) #home.hero #heroParticles {
    display: none !important;
  }

  body:has(#home) #home.hero .hero-grid-layout {
    display: grid !important;
    min-height: min(780px, 100vh);
    grid-template-columns: minmax(250px, 24%) minmax(420px, 38%) 1fr;
    padding: clamp(120px, 13vh, 150px) clamp(20px, 3vw, 60px) 30px 0;
  }

  body:has(#home) #home.hero .hero-col-portrait {
    display: flex;
  }

  body:has(#home) #home.hero .hero-col-content {
    display: block;
  }
}

/* Exact uploaded hero replacement.  The image contains the complete approved
   design, so it is rendered as one unaltered canvas rather than reconstructed
   with CSS.  Invisible links retain the two pictured calls to action. */
body:has(#home) .top-announcement-banner,
body:has(#home) .skip-to-content,
body:has(#home) .header,
body:has(#home) .quick-links-wrapper {
  display: none !important;
}

body:has(#home) #home.hero {
  display: block !important;
  width: 100%;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  line-height: 0;
  background: #08021e !important;
}

body:has(#home) #home.hero::before,
body:has(#home) #home.hero::after,
body:has(#home) #home.hero .hero-bg,
body:has(#home) #home.hero #heroParticles,
body:has(#home) #home.hero .hero-grid-layout {
  display: none !important;
}

body:has(#home) #home.hero .hero-ui-replacement {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  height: auto;
}

body:has(#home) #home.hero .hero-ui-action {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 10px;
  outline: none;
}

body:has(#home) #home.hero .hero-ui-action:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

body:has(#home) #home.hero .hero-ui-visit {
  top: 69.8%;
  left: 58.4%;
  width: 27.4%;
  height: 10.9%;
}

body:has(#home) #home.hero .hero-ui-live {
  top: 82.7%;
  left: 58.4%;
  width: 27.4%;
  height: 10.9%;
}

/* Keep the real site navigation available above the approved hero artwork. */
body:has(#home) .header {
  display: block !important;
  top: 16px !important;
  z-index: 1000 !important;
  background: rgba(7, 3, 24, 0.68) !important;
  border-color: rgba(255, 201, 36, 0.35) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ============================================================
   MOBILE: 430px (iPhone 14 Plus, Galaxy A54)
   ============================================================ */
@media (max-width: 430px) {
  body #home.hero h1 {
    font-size: clamp(28px, 9.5vw, 38px) !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .giving-options {
    grid-template-columns: 1fr !important;
  }

  .stat-box {
    padding: 18px !important;
  }

  .stat-box .stat-number {
    font-size: 26px !important;
  }

  /* Event card horizontal layout */
  .event-item,
  .event-item-featured {
    grid-template-columns: 56px 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .event-info h3 {
    font-size: 15px !important;
  }
}

/* ============================================================
   MOBILE: 390px (iPhone 14, 15)
   ============================================================ */
@media (max-width: 390px) {
  body #home.hero h1 {
    font-size: clamp(26px, 9.5vw, 36px) !important;
    line-height: 1.08 !important;
  }

  body #home.hero .hero-desc {
    font-size: 14px !important;
  }

  .leader-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .filter-btn {
    padding: 8px 14px !important;
    font-size: 12px !important;
  }

  .btn-header-cta {
    padding: 7px 10px !important;
    font-size: 11px !important;
  }

  .testimonial-card {
    padding: 16px !important;
  }

  .testimonial-card p {
    font-size: 13px !important;
  }

  /* forms */
  .prayer-input,
  .prayer-textarea,
  .form-input,
  .form-textarea,
  .giving-input,
  .form-select {
    padding: 12px 14px !important;
    font-size: 14px !important;
  }

  /* gallery compact */
  .gallery-item img {
    height: 120px !important;
  }

  .gallery-large img {
    min-height: 150px !important;
    height: 150px !important;
  }
}

/* ============================================================
   MOBILE: 375px (iPhone SE, older iPhones)
   ============================================================ */
@media (max-width: 375px) {
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body #home.hero h1 {
    font-size: clamp(24px, 9.8vw, 32px) !important;
  }

  body #home.hero .sig-with {
    font-size: 22px !important;
  }

  /* footer links readable */
  .footer-col ul a {
    font-size: 13px !important;
    padding: 7px 0 !important;
  }

  .min-card h3 {
    font-size: 20px !important;
  }

  .min-icon {
    width: 52px !important;
    height: 52px !important;
  }

  .min-icon svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* ============================================================
   MOBILE: 360px (Galaxy S series)
   ============================================================ */
@media (max-width: 360px) {
  body #home.hero h1 {
    font-size: clamp(22px, 10vw, 30px) !important;
  }

  .leader-grid {
    grid-template-columns: 1fr !important;
  }

  .giving-amounts {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .page-header h1 {
    font-size: clamp(22px, 9vw, 30px) !important;
  }

  .section-tag {
    font-size: 10px !important;
    letter-spacing: 2px !important;
  }

  .breadcrumb {
    font-size: 11px !important;
    padding: 6px 14px !important;
  }
}

/* ============================================================
   PHONE LAYOUT — final, component-scoped safeguards
   ============================================================ */
@media (max-width: 1024px) {
  html, body {
    max-width: 100%;
    overflow-x: clip;
  }

  .header .nav-main {
    top: calc(var(--announcement-height, 0px) + 86px) !important;
    max-height: calc(100dvh - var(--announcement-height, 0px) - 100px) !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
  }

  .mobile-toggle .menu-open-icon,
  .mobile-toggle .menu-close-icon {
    width: 22px !important;
    height: 22px !important;
    visibility: visible !important;
  }

  .mobile-toggle.is-open .menu-open-icon { display: none !important; }
  .mobile-toggle.is-open .menu-close-icon { display: block !important; }

  .schedule-tabs {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }

  .schedule-tabs .tab-btn { flex: 0 0 auto; }
  .tab-content, .tab-pane, .time-left { min-width: 0; }
  .time-left > div { min-width: 0; }
  .service-title, .service-subtitle { overflow-wrap: anywhere; }
}

@media (max-width: 600px) {
  .header { width: calc(100% - 20px) !important; }

  .header .container {
    min-width: 0 !important;
    width: 100% !important;
  }

  .header-left, .header-right { min-width: 0; }
  .header-right { flex-shrink: 0; }

  .quick-links-wrapper .container { padding-left: 12px !important; padding-right: 12px !important; }
  .ql-bar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ql-divider { display: none !important; }
}

/* ============================================================
   MOBILE: 320px (smallest supported)
   ============================================================ */
@media (max-width: 320px) {
  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body #home.hero h1 {
    font-size: 22px !important;
    letter-spacing: -0.3px !important;
  }

  body #home.hero .hero-desc {
    font-size: 13px !important;
  }

  .btn-header-cta {
    display: none !important;
  }

  .logo-text {
    display: none !important;
  }

  .nav-main {
    left: 2% !important;
    right: 2% !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr !important;
  }

  .gallery-item img,
  .gallery-large img {
    height: 160px !important;
    min-height: unset !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .countdown-unit {
    min-width: 56px !important;
    padding: 8px !important;
  }

  .countdown-unit .number {
    font-size: 20px !important;
  }

  /* Touch-friendly buttons */
  .btn-primary,
  .btn-outline,
  .btn-orange,
  .btn-ghost,
  .btn-purple-outline,
  .btn-sub,
  .btn-header-cta {
    min-height: 44px !important;
  }
}

/* ============================================================
   LANDSCAPE PHONE FIXES
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  body #home.hero {
    min-height: 100vh !important;
    padding: 80px 0 40px !important;
  }

  body #home.hero .hero-portrait-wrapper {
    width: clamp(100px, 18vw, 150px) !important;
  }

  body #home.hero h1 {
    font-size: clamp(24px, 5vw, 36px) !important;
  }

  .nav-main {
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
  }

  .page-header {
    padding: 110px 0 40px !important;
  }
}

/* ============================================================
   ADMIN PANEL RESPONSIVE
   ============================================================ */

/* Admin sidebar toggle (already in admin.css for ≤1024px) */
@media (max-width: 1024px) {
  /* Admin dashboard cards */
  .dashboard-stats,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  .admin-topbar {
    padding: 0 16px !important;
  }

  .admin-main {
    padding: 20px 16px !important;
  }

  /* Admin tables: horizontal scroll */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .admin-table {
    min-width: 600px !important;
  }
}

@media (max-width: 768px) {
  .dashboard-stats,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Admin forms */
  .admin-form .form-row,
  .admin-form-row {
    grid-template-columns: 1fr !important;
  }

  /* Tables retain their semantic headings on phones.  The previous card
     conversion hid headings even though the page markup has no data-label
     attributes, leaving table values without context. */
  .table-responsive,
  .admin-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .admin-table {
    min-width: 600px !important;
  }

  .admin-main {
    padding: 16px 12px !important;
  }
}

@media (max-width: 600px) {
  .dashboard-stats,
  .stats-row {
    grid-template-columns: 1fr !important;
  }

  /* Admin topbar */
  .admin-topbar-title {
    font-size: 14px !important;
  }

  .admin-topbar-actions {
    gap: 6px !important;
  }

  /* Content cards in admin */
  .admin-card {
    padding: 16px !important;
  }
}

/* ============================================================
   FOOTER RESPONSIVE EXTRAS
   ============================================================ */
@media (max-width: 768px) {
  .footer {
    padding-top: 56px !important;
  }

  .socials a {
    width: 38px !important;
    height: 38px !important;
  }

  .footer-bottom {
    font-size: 11.5px !important;
    padding-top: 20px !important;
  }

  /* Cookie banner */
  .cookie-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* Toast */
  .toast-container {
    bottom: 14px !important;
    right: 14px !important;
    left: 14px !important;
    max-width: 100% !important;
  }

  .toast {
    font-size: 13.5px !important;
    padding: 12px 16px !important;
  }
}

/* ============================================================
   DOCS PAGE RESPONSIVE EXTRAS
   ============================================================ */
@media (max-width: 900px) {
  .docs-detail-layout {
    grid-template-columns: 1fr !important;
  }

  .docs-toc-sidebar {
    display: none !important;
  }

  .docs-article {
    padding: 28px 20px !important;
  }
}

@media (max-width: 600px) {
  .docs-grid {
    grid-template-columns: 1fr !important;
  }

  .docs-hero-grid {
    grid-template-columns: 1fr !important;
  }

  .docs-hero-visual {
    display: none !important;
  }

  .docs-hero {
    padding: 120px 0 40px !important;
  }

  .docs-hero h1 {
    font-size: clamp(24px, 7.5vw, 36px) !important;
  }
}

/* ============================================================
   ACCESSIBILITY — minimum touch targets
   ============================================================ */
@media (max-width: 1024px) {
  .nav-main a,
  .filter-btn,
  .tab-btn,
  .btn-primary,
  .btn-outline,
  .btn-orange,
  .btn-ghost,
  .btn-purple-outline,
  .btn-sub,
  .btn-header-cta,
  .pray-btn,
  .faq-question,
  .socials a,
  .icon-btn,
  .mobile-toggle,
  .whatsapp-float-btn,
  .back-to-top {
    min-height: 44px !important;
  }
}

/* ============================================================
   UTILITY — safe-area insets (notched phones)
   ============================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(30px + env(safe-area-inset-bottom)) !important;
  }

  .cookie-banner {
    padding-bottom: calc(15px + env(safe-area-inset-bottom)) !important;
  }

  body #home.hero .hero-btns {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   FINAL RESPONSIVE SAFEGUARDS
   These rules address the few layout edges shared across pages.
   ============================================================ */
:root {
  --announcement-height: 0px;
}

main,
section,
.container,
.header .container,
.footer-grid,
.admin-main,
.admin-card {
  min-width: 0;
}

#main-content,
[id] {
  scroll-margin-top: calc(112px + var(--announcement-height));
}

.header.has-announcement {
  top: calc(var(--announcement-height) + 10px) !important;
}

.header.has-announcement.scrolled {
  top: 10px !important;
}

.top-announcement-banner {
  overflow-wrap: anywhere;
}

pre,
code,
.search-results-wrapper,
.ai-message-bubble {
  overflow-wrap: anywhere;
}

.lightbox-close,
.lightbox-nav {
  min-width: 44px;
  min-height: 44px;
}

.back-to-top {
  bottom: 150px !important;
}

@media (max-width: 1024px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(4, 2, 18, 0.72);
  }

  .nav-main .dropdown-menu {
    display: none !important;
  }

  .nav-main .nav-dropdown.is-expanded .dropdown-menu {
    display: block !important;
  }

  .nav-main .nav-dropdown.is-expanded .has-dropdown svg {
    transform: rotate(180deg);
  }

  .admin-wrapper.mobile-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(4, 2, 18, 0.56);
  }

  .admin-wrapper.mobile-open .admin-sidebar {
    z-index: 100;
  }
}

/* A persistent header is essential on touch screens.  This also overrides
   any inline transform left behind by the desktop smart-scroll behaviour. */
@media (max-width: 768px) {
  .header,
  .header.scrolled {
    transform: translateY(0) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
}

@media (max-width: 600px) {
  .top-announcement-banner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    line-height: 1.4;
  }
  
  .top-announcement-banner > a {
    margin-left: 0 !important;
    margin-top: 2px !important;
    display: inline-flex;
    align-items: center;
  }

  .header .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
    gap: 6px !important;
  }

  .header-right {
    gap: 6px !important;
  }

  .header-right .icon-btn,
  .header-right .mobile-toggle {
    width: 44px !important;
    height: 44px !important;
  }

  .ai-chat-window {
    width: min(calc(100vw - 24px), 380px) !important;
    height: min(480px, calc(100dvh - 104px)) !important;
    max-height: calc(100dvh - 104px) !important;
    right: 0 !important;
  }

  .back-to-top {
    right: 14px !important;
    bottom: 138px !important;
  }
}

@media (max-width: 430px) {
  .header-right #userProfileBtn {
    display: none !important;
  }

  .btn-header-cta {
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  .btn-header-cta svg {
    width: 17px !important;
    height: 17px !important;
  }

  .ai-chat-window {
    bottom: 62px !important;
  }
}

@media (max-width: 360px) {
  .header-right .btn-header-cta {
    display: none !important;
  }

  .top-announcement-banner {
    font-size: 11px !important;
  }
}

/* Keep the footer fully on-brand on phones.  Some mobile browsers exposed a
   pale underlying page layer through the transparent footer surface. */
.footer {
  background: rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #fff;
  isolation: isolate;
  position: relative;
  z-index: 1001;
}

.footer-newsletter {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.22), rgba(255, 51, 102, 0.14)) !important;
  border-color: rgba(192, 132, 252, 0.38) !important;
  position: relative;
  z-index: 1002;
}

@media (max-width: 768px) {
  .footer {
    background-color: #0c041d !important;
    background-image: linear-gradient(160deg, #170831 0%, #0c041d 55%, #070112 100%) !important;
  }
}

/* Mobile footer colour guard: prevents transparent sections from exposing a
   white browser/page background below the contact details. */
@media (max-width: 768px) {
  footer.footer {
    background: transparent !important;
  }

  footer.footer .container,
  footer.footer .footer-grid,
  footer.footer .footer-bottom {
    background-color: transparent !important;
  }

  footer.footer .footer-newsletter {
    background: #251044 linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(255, 51, 102, 0.2)) !important;
  }
}

/* ============================================================
   MOBILE OVERFLOW REPAIR
   Keep page content inside the viewport.  This must remain at the end of
   the responsive stylesheet so component-specific desktop rules cannot
   reintroduce horizontal clipping on phones.
   ============================================================ */
@media (max-width: 768px) {
  /* A full-width, padded container gives every page one predictable gutter. */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 16px !important;
  }

  /* Grid and flex children otherwise use their intrinsic width as a minimum. */
  .triple-grid,
  .min-grid,
  .min-grid-6,
  .pw-grid,
  .nh-box,
  .prayer-box,
  .contact-grid,
  .stats-grid,
  .sermon-grid,
  .cards-grid,
  .beliefs-grid,
  .prayer-wall-grid,
  .wm-highlights,
  .leader-grid,
  .giving-options,
  .giving-amounts,
  .form-row,
  .visit-steps-grid,
  .values-grid,
  .gallery-grid,
  .footer-grid,
  .featured-sermon,
  .docs-hero-grid,
  .docs-detail-layout,
  .event-item,
  .event-item-featured {
    min-width: 0;
    max-width: 100%;
  }

  .triple-grid > *,
  .min-grid > *,
  .min-grid-6 > *,
  .pw-grid > *,
  .nh-box > *,
  .prayer-box > *,
  .contact-grid > *,
  .stats-grid > *,
  .sermon-grid > *,
  .cards-grid > *,
  .beliefs-grid > *,
  .prayer-wall-grid > *,
  .wm-highlights > *,
  .leader-grid > *,
  .giving-options > *,
  .giving-amounts > *,
  .form-row > *,
  .visit-steps-grid > *,
  .values-grid > *,
  .gallery-grid > *,
  .footer-grid > *,
  .featured-sermon > *,
  .docs-hero-grid > *,
  .docs-detail-layout > * {
    min-width: 0;
    max-width: 100%;
  }

  /* Homepage highlights shown in the report: keep card content and actions fluid. */
  .card-event,
  .card-sermon,
  .card-times {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 24px 20px !important;
  }

  .card-title,
  .card-desc,
  .sermon-meta-text,
  .event-info,
  .event-info h3,
  .event-info p,
  .event-meta,
  .event-meta span,
  .service-title,
  .service-subtitle {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .card-meta {
    align-items: flex-start;
    min-width: 0;
    margin-bottom: 14px;
  }

  .card-meta span {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    min-width: 0;
    line-height: 1.45;
  }

  .card-meta svg {
    width: 18px;
    height: 18px;
    margin-top: 1px;
  }

  .btn-primary,
  .btn-orange,
  .btn-outline,
  .btn-ghost,
  .btn-purple-outline,
  .btn-sub,
  .event-item .btn,
  .event-item-featured .btn {
    max-width: 100%;
    white-space: normal;
  }

  input,
  select,
  textarea,
  iframe,
  video,
  canvas {
    max-width: 100%;
  }

  .table-responsive,
  .admin-table-wrapper {
    max-width: 100%;
    overscroll-behavior-x: contain;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: 14px !important;
  }

  .card-event,
  .card-sermon,
  .card-times {
    padding: 22px 18px !important;
  }
}

/* ============================================================
   NAVIGATION POLISH
   High-contrast, clearly interactive navigation on every page and viewport.
   ============================================================ */
.header {
  background: rgba(8, 4, 24, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(18px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(130%) !important;
}

.header .nav-main > a,
.header .nav-main > .nav-dropdown > a {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600 !important;
}

.header .nav-main > a:hover,
.header .nav-main > a:focus-visible,
.header .nav-main > .nav-dropdown:hover > a,
.header .nav-main > .nav-dropdown:focus-within > a {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

.header .nav-main > a.active,
.header .nav-main > .nav-dropdown.active > a {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.34), rgba(236, 72, 153, 0.25)) !important;
  border: 1px solid rgba(216, 180, 254, 0.32) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 14px rgba(94, 36, 164, 0.2) !important;
}

.header .nav-main > a.active::after,
.header .nav-main > .nav-dropdown.active > a::after {
  bottom: 3px !important;
  background: #fff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8) !important;
}

.header .dropdown-menu {
  background: rgba(10, 5, 28, 0.98) !important;
  border-color: rgba(216, 180, 254, 0.3) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
}

.header .nav-dropdown:focus-within .dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important;
}

.header .dropdown-menu a {
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 550 !important;
}

.header .dropdown-menu a:hover,
.header .dropdown-menu a:focus-visible {
  background: rgba(168, 85, 247, 0.22) !important;
  color: #fff !important;
}

.header .btn-header-cta {
  min-height: 42px !important;
  background: linear-gradient(135deg, #ff6a32 0%, #e94118 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  box-shadow: 0 8px 20px rgba(220, 62, 21, 0.35) !important;
}

.header .btn-header-cta svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.header-right .icon-btn,
.header .mobile-toggle {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.26) !important;
  color: #fff !important;
}

.header .btn-header-cta:hover,
.header .btn-header-cta:focus-visible,
.header-right .icon-btn:hover,
.header-right .icon-btn:focus-visible,
.header .mobile-toggle:hover,
.header .mobile-toggle:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 0 0 3px rgba(216, 180, 254, 0.28), 0 8px 20px rgba(0, 0, 0, 0.28) !important;
}

.header a:focus-visible,
.header button:focus-visible {
  outline: 3px solid #facc15 !important;
  outline-offset: 3px !important;
}

@media (max-width: 1024px) {
  .header .nav-main {
    background: rgba(10, 5, 28, 0.98) !important;
    border-color: rgba(216, 180, 254, 0.42) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  }

  .header .nav-main > a,
  .header .nav-main > .nav-dropdown > a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid transparent !important;
    margin: 2px 0 !important;
  }

  .header .nav-main > a:hover,
  .header .nav-main > a:focus-visible,
  .header .nav-main > .nav-dropdown:hover > a,
  .header .nav-main > .nav-dropdown:focus-within > a,
  .header .nav-main > a.active,
  .header .nav-main > .nav-dropdown.active > a {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.34), rgba(236, 72, 153, 0.24)) !important;
    border-color: rgba(216, 180, 254, 0.34) !important;
  }

  .header .nav-main > a.active::after,
  .header .nav-main > .nav-dropdown.active > a::after {
    display: none !important;
  }

  .header .nav-main .dropdown-menu {
    background: rgba(255, 255, 255, 0.055) !important;
    border-color: rgba(216, 180, 254, 0.22) !important;
  }
}

/* ============================================================
   HOMEPAGE HEADER — reference-layout correction only
   The scope deliberately stops at the home header; no hero, footer,
   background, or downstream section styles are changed here.
   ============================================================ */
@media (min-width: 1025px) {
  body:has(#home) .header {
    top: 18px !important;
    width: min(calc(100% - 48px), 1720px) !important;
    max-width: none !important;
    height: 76px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* An active announcement remains visible above the homepage header. */
  body:has(#home) .header.has-announcement {
    top: calc(18px + var(--announcement-height, 0px)) !important;
  }

  body:has(#home) .header::after {
    display: none !important;
  }

  body:has(#home) .header .container {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 12px !important;
    gap: 18px !important;
  }

  body:has(#home) .header .logo-link {
    gap: 12px !important;
  }

  body:has(#home) .header .logo-img {
    width: 58px !important;
    height: 58px !important;
  }

  body:has(#home) .header .logo-text {
    font-size: 15px !important;
    line-height: 1.12 !important;
    letter-spacing: 0.7px !important;
  }

  /* Let the link group use the available middle space instead of pushing
     the header actions outside the viewport. */
  body:has(#home) .header .nav-main {
    flex: 1 1 auto !important;
    justify-content: center !important;
    gap: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body:has(#home) .header .nav-main > a,
  body:has(#home) .header .nav-main > .nav-dropdown > a {
    padding: 10px clamp(7px, 0.72vw, 13px) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: clamp(11px, 0.78vw, 13px) !important;
    font-weight: 600 !important;
  }

  body:has(#home) .header .nav-main > a:hover,
  body:has(#home) .header .nav-main > a:focus-visible,
  body:has(#home) .header .nav-main > .nav-dropdown:hover > a,
  body:has(#home) .header .nav-main > .nav-dropdown:focus-within > a,
  body:has(#home) .header .nav-main > a.active,
  body:has(#home) .header .nav-main > .nav-dropdown.active > a {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
  }

  body:has(#home) .header .nav-main > a.active::after,
  body:has(#home) .header .nav-main > .nav-dropdown.active > a::after {
    display: block !important;
    bottom: 2px !important;
    width: 28px !important;
    height: 2px !important;
    background: #fff !important;
    border-radius: 999px !important;
    box-shadow: none !important;
  }

  body:has(#home) .header .header-right {
    gap: 10px !important;
  }

  body:has(#home) .header-right .icon-btn {
    width: 38px !important;
    height: 38px !important;
    background: rgba(8, 4, 24, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.36) !important;
    box-shadow: none !important;
  }

  body:has(#home) .header .btn-header-cta {
    min-height: 38px !important;
    padding: 0 15px !important;
    background: #fff !important;
    color: #15072e !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2) !important;
  }

  body:has(#home) .header .btn-header-cta svg {
    color: #15072e !important;
    stroke: #15072e !important;
  }
}

/* Keep the complete navigation inside the header on smaller laptops, without
   removing any links or changing the mobile menu. */
@media (min-width: 1025px) and (max-width: 1280px) {
  body:has(#home) .header {
    width: calc(100% - 32px) !important;
  }

  body:has(#home) .header .container {
    gap: 10px !important;
    padding-inline: 4px !important;
  }

  body:has(#home) .header .logo-img {
    width: 48px !important;
    height: 48px !important;
  }

  body:has(#home) .header .logo-text {
    font-size: 12px !important;
  }

  body:has(#home) .header .nav-main > a,
  body:has(#home) .header .nav-main > .nav-dropdown > a {
    padding-inline: 6px !important;
    font-size: 11px !important;
  }

  body:has(#home) .header .btn-header-cta {
    padding-inline: 10px !important;
    font-size: 11px !important;
  }
}

/* Homepage hero composition: use the existing artwork and colours, while
   aligning the pastor, copy, badges, and actions to the supplied reference. */
@media (min-width: 1025px) {
  body:has(#home) #home.hero {
    min-height: 680px !important;
    padding-top: clamp(116px, 11vh, 148px) !important;
    padding-bottom: 104px !important;
  }

  body:has(#home) #home.hero .hero-portrait-wrapper {
    left: clamp(18px, 2.4vw, 52px) !important;
    width: clamp(220px, 23vw, 390px) !important;
    max-height: 82% !important;
  }

  body:has(#home) #home.hero .hero-portrait-wrapper .hero-portrait {
    max-height: min(650px, 82vh) !important;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 9%, #000 100%) !important;
    mask-image: linear-gradient(to top, transparent 0%, #000 9%, #000 100%) !important;
  }

  body:has(#home) #home.hero .hero-container {
    display: block !important;
    padding-bottom: 0 !important;
  }

  body:has(#home) #home.hero .hero-content {
    display: block !important;
    width: min(54%, 680px) !important;
    max-width: 680px !important;
    margin: 0 0 0 clamp(250px, 24vw, 450px) !important;
    padding: 0 !important;
    text-align: left !important;
  }

  body:has(#home) #home.hero h1 {
    max-width: 660px !important;
    font-size: clamp(42px, 4.15vw, 68px) !important;
    line-height: 1.04 !important;
    margin-bottom: 18px !important;
  }

  body:has(#home) #home.hero .hero-desc {
    max-width: 520px !important;
    font-size: clamp(16px, 1.2vw, 19px) !important;
    line-height: 1.6 !important;
    margin-bottom: 24px !important;
  }

  body:has(#home) #home.hero .hero-signature {
    margin-bottom: 28px !important;
  }

  body:has(#home) #home.hero .btn-solid-white,
  body:has(#home) #home.hero .btn-outline-white {
    min-height: 50px !important;
    padding-inline: 22px !important;
    font-size: 14px !important;
  }

  body:has(#home) #home.hero .badge-belong {
    top: auto !important;
    bottom: 132px !important;
    left: clamp(340px, 29vw, 560px) !important;
  }

  body:has(#home) #home.hero .badge-loved {
    right: clamp(28px, 5vw, 92px) !important;
    bottom: 92px !important;
  }
}

/* Keep the initial paint on the existing site artwork while the page loads.
   This prevents a white flash without introducing a new dark background. */
html {
  background: #8a2be2 url('../images/background.png') center / cover fixed no-repeat;
}

.preloader {
  background: #8a2be2 url('../images/background.png') center / cover no-repeat !important;
}

/* Use the existing JPGM worship-team photograph in the homepage hero.  The
   overlay values are intentionally unchanged, so the current colour design
   remains intact while the team is visible on the right of the hero. */
@media (min-width: 1025px) {
  body:has(#home) #home.hero .hero-bg {
    background:
      radial-gradient(circle at 72% 22%, rgba(139, 92, 246, 0.38), transparent 34%),
      radial-gradient(circle at 14% 72%, rgba(0, 51, 255, 0.25), transparent 30%),
      linear-gradient(90deg, rgba(15, 5, 41, 0.96) 0%, rgba(15, 5, 41, 0.88) 31%, rgba(16, 8, 56, 0.72) 56%, rgba(12, 5, 34, 0.86) 100%),
      url('../images/worship-7.jpg') center right / cover no-repeat !important;
  }
}

/* Final media guards: images and embeds must never make a page wider than
   the viewport.  They do not change any image colours or section styling. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
picture,
video,
iframe,
canvas {
  max-width: 100%;
}

picture {
  display: block;
}

/* ============================================================
   HOMEPAGE HERO — REFERENCE-INSPIRED COMPOSITION
   This final rule set deliberately targets the current hero markup so it
   takes precedence over the older experimental hero layouts above.
   ============================================================ */
body:has(#home) #home.hero {
  min-height: min(760px, 100vh) !important;
  margin-top: 0 !important;
  padding: 0 !important;
  isolation: isolate;
  background: #09031c !important;
}

body:has(#home) #home.hero .hero-bg {
  background:
    radial-gradient(ellipse at 76% 36%, rgba(31, 20, 120, 0.92), transparent 35%),
    radial-gradient(ellipse at 98% 16%, rgba(132, 0, 25, 0.64), transparent 34%),
    linear-gradient(105deg, #08031e 0%, #08031e 40%, #0a0427 100%) !important;
}

body:has(#home) #home.hero .hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 86%, rgba(30, 45, 255, 0.50), transparent 31%),
    radial-gradient(circle at 4% 10%, rgba(192, 0, 24, 0.62), transparent 34%),
    linear-gradient(135deg, rgba(118, 0, 20, 0.28), transparent 45%);
}

body:has(#home) #home.hero .hero-bg-split {
  background:
    linear-gradient(135deg, rgba(17, 2, 40, 0.98), rgba(7, 3, 31, 0.95) 64%, rgba(5, 2, 28, 0.80)) !important;
  clip-path: polygon(0 0, 60.5% 0, 48.5% 100%, 0 100%);
  box-shadow: 12px 0 24px rgba(201, 77, 255, 0.50);
}

body:has(#home) #home.hero .hero-bg-split::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(60% 0, 60.45% 0, 48.45% 100%, 48% 100%);
  background: linear-gradient(#ff8bf8, #a855f7 46%, #4f46e5);
  filter: drop-shadow(0 0 8px #f472ff);
}

/* The right half is an in-page stage illustration.  It replaces the unrelated
   congregation photo while preserving crisp text, links, and buttons. */
body:has(#home) #home.hero .hero-stage-art {
  position: absolute;
  z-index: 1;
  top: 118px;
  right: 0;
  bottom: 0;
  width: 55%;
  overflow: hidden;
  clip-path: polygon(17% 0, 100% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(ellipse at 52% 23%, rgba(21, 26, 158, 0.88), transparent 31%),
    radial-gradient(ellipse at 6% 44%, rgba(191, 10, 66, 0.70), transparent 29%),
    linear-gradient(180deg, #080622 0%, #13083c 55%, #060510 100%);
}

body:has(#home) #home.hero .stage-rig {
  position: absolute;
  top: 7%;
  left: 8%;
  width: 100%;
  height: 9%;
  border-top: 3px solid rgba(255, 57, 125, 0.42);
  border-bottom: 2px solid rgba(118, 80, 255, 0.35);
  border-radius: 50%;
  transform: rotate(-3deg);
  box-shadow: 0 12px 25px rgba(255, 0, 106, 0.20);
}

body:has(#home) #home.hero .stage-lights {
  position: absolute;
  inset: 5% 0 18%;
  opacity: 0.94;
  background:
    linear-gradient(108deg, transparent 0 7%, rgba(255, 25, 82, 0.78) 7.2%, transparent 7.7%),
    linear-gradient(81deg, transparent 0 19%, rgba(63, 73, 255, 0.92) 19.3%, transparent 19.8%),
    linear-gradient(102deg, transparent 0 32%, rgba(255, 39, 94, 0.86) 32.3%, transparent 32.8%),
    linear-gradient(78deg, transparent 0 47%, rgba(72, 77, 255, 0.96) 47.3%, transparent 47.8%),
    linear-gradient(100deg, transparent 0 62%, rgba(237, 52, 151, 0.84) 62.3%, transparent 62.8%),
    linear-gradient(80deg, transparent 0 78%, rgba(70, 102, 255, 0.92) 78.3%, transparent 78.8%),
    linear-gradient(104deg, transparent 0 91%, rgba(255, 29, 79, 0.82) 91.3%, transparent 91.8%);
  filter: blur(1px) drop-shadow(0 0 10px rgba(139, 92, 246, 0.85));
}

body:has(#home) #home.hero .stage-screen {
  position: absolute;
  top: 38%;
  z-index: 1;
  padding: 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  background: linear-gradient(135deg, rgba(39, 14, 93, 0.92), rgba(8, 7, 48, 0.82));
  color: rgba(255, 255, 255, 0.92);
  font: 700 clamp(13px, 1.25vw, 21px)/1.33 'Outfit', sans-serif;
  letter-spacing: 0.015em;
  text-align: center;
  box-shadow: 0 0 35px rgba(68, 69, 255, 0.38);
}

body:has(#home) #home.hero .stage-screen-left { left: 9%; }
body:has(#home) #home.hero .stage-screen-right { right: 3%; }

body:has(#home) #home.hero .stage-cross {
  position: absolute;
  top: 22%;
  left: 58%;
  z-index: 2;
  width: clamp(56px, 5vw, 92px);
  height: clamp(140px, 16vw, 260px);
  transform: translateX(-50%);
  filter: drop-shadow(0 0 14px rgba(210, 224, 255, 0.98)) drop-shadow(0 0 36px rgba(91, 105, 255, 0.86));
}

body:has(#home) #home.hero .stage-cross::before,
body:has(#home) #home.hero .stage-cross span {
  content: '';
  position: absolute;
  background: linear-gradient(90deg, #d9e6ff, #fff, #dbe5ff);
  border-radius: 2px;
}

body:has(#home) #home.hero .stage-cross::before {
  top: 0;
  left: 44%;
  width: 14%;
  height: 100%;
}

body:has(#home) #home.hero .stage-cross span {
  top: 27%;
  left: 0;
  width: 100%;
  height: 10%;
}

body:has(#home) #home.hero .stage-people {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: 18%;
  left: 11%;
  display: flex;
  align-items: end;
  justify-content: space-around;
  height: 18%;
}

body:has(#home) #home.hero .stage-people i {
  position: relative;
  display: block;
  width: clamp(10px, 1.2vw, 20px);
  height: 70%;
  border-radius: 45% 45% 14% 14%;
  background: linear-gradient(#1e133b, #03030a);
  box-shadow: 0 -8px 0 -2px #15102b, 0 0 14px rgba(237, 66, 182, 0.48);
}

body:has(#home) #home.hero .stage-people i:nth-child(2n) { height: 88%; }
body:has(#home) #home.hero .stage-people i:nth-child(3n) { height: 61%; }

body:has(#home) #home.hero .stage-audience {
  position: absolute;
  right: -4%;
  bottom: -5%;
  left: 0;
  height: 26%;
  opacity: 0.92;
  background:
    radial-gradient(ellipse at 4% 55%, #05040e 0 4%, transparent 4.5%),
    radial-gradient(ellipse at 14% 42%, #070410 0 5%, transparent 5.5%),
    radial-gradient(ellipse at 26% 59%, #020208 0 6%, transparent 6.5%),
    radial-gradient(ellipse at 39% 38%, #06030e 0 6%, transparent 6.5%),
    radial-gradient(ellipse at 54% 60%, #020208 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 70% 42%, #070410 0 6%, transparent 6.5%),
    radial-gradient(ellipse at 84% 59%, #020208 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 98% 42%, #06030e 0 8%, transparent 8.5%),
    linear-gradient(180deg, transparent, #020207 38%);
}

body:has(#home) #home.hero .hero-grid-layout {
  min-height: min(760px, 100vh);
  max-width: 1720px;
  grid-template-columns: minmax(250px, 24%) minmax(420px, 38%) 1fr;
  align-items: stretch;
  padding: clamp(105px, 11vh, 132px) clamp(20px, 3vw, 60px) 30px 0;
}

body:has(#home) #home.hero .hero-col-portrait {
  position: relative;
  z-index: 1;
  min-width: 0;
  align-items: flex-end;
}

body:has(#home) #home.hero .hero-portrait {
  width: clamp(260px, 21vw, 360px);
  max-width: none;
  max-height: none;
  margin-left: max(0px, 1.5vw);
  object-fit: contain;
  object-position: bottom left;
  filter: drop-shadow(16px 8px 22px rgba(0, 0, 0, 0.46));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 87%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 87%, transparent 100%);
}

body:has(#home) #home.hero .hero-col-content {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 10px clamp(16px, 2.3vw, 42px) 48px 0;
}

body:has(#home) #home.hero h1 {
  max-width: 670px;
  margin: 0 0 20px !important;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(38px, 4.05vw, 68px) !important;
  font-weight: 800;
  line-height: 1.06 !important;
  letter-spacing: -0.045em;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.24);
}

body:has(#home) #home.hero .hero-desc {
  max-width: 480px;
  margin: 0 0 26px !important;
  font-size: clamp(15px, 1.15vw, 18px) !important;
  line-height: 1.65 !important;
  color: rgba(255, 255, 255, 0.90) !important;
}

body:has(#home) #home.hero .hero-signature {
  margin: 0 0 30px !important;
  gap: 10px;
}

body:has(#home) #home.hero .sig-with {
  font-size: clamp(28px, 2.5vw, 40px);
  line-height: 1;
}

body:has(#home) #home.hero .sig-name {
  font-size: clamp(10px, 0.86vw, 13px);
  letter-spacing: 0.13em;
}

body:has(#home) #home.hero .hero-btns {
  gap: 16px;
}

body:has(#home) #home.hero .btn-solid-white,
body:has(#home) #home.hero .btn-outline-white {
  min-height: 56px !important;
  padding: 14px 26px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 700;
}

body:has(#home) #home.hero .btn-outline-white {
  background: rgba(9, 3, 40, 0.42);
  border-color: rgba(255, 255, 255, 0.55);
}

body:has(#home) #home.hero .hero-col-badges {
  display: none;
}

body:has(#home) #home.hero .badge {
  padding: 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  background: rgba(16, 3, 53, 0.62);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(6px);
}

body:has(#home) #home.hero .badge-belong {
  align-self: flex-start;
  margin-left: clamp(8px, 2vw, 42px);
  transform: none;
}

body:has(#home) #home.hero .badge-loved {
  margin-right: clamp(0px, 2vw, 40px);
  transform: none;
}

@media (max-width: 1100px) {
  body:has(#home) #home.hero .hero-grid-layout {
    grid-template-columns: minmax(205px, 27%) minmax(370px, 48%) 1fr;
    padding-right: 20px;
  }

  body:has(#home) #home.hero .hero-col-badges {
    display: none;
  }

  body:has(#home) #home.hero .hero-bg-split {
    clip-path: polygon(0 0, 69% 0, 54% 100%, 0 100%);
  }
}

@media (max-width: 760px) {
  body:has(#home) #home.hero {
    min-height: auto !important;
  }

  body:has(#home) #home.hero .hero-bg {
    background:
      radial-gradient(circle at 75% 10%, rgba(80, 39, 201, 0.48), transparent 38%),
      linear-gradient(180deg, rgba(8, 3, 31, 0.81), rgba(8, 3, 31, 0.95)) !important;
  }

  body:has(#home) #home.hero .hero-bg-split,
  body:has(#home) #home.hero .hero-bg-split::after,
  body:has(#home) #home.hero .hero-stage-art {
    display: none;
  }

  body:has(#home) #home.hero .hero-grid-layout {
    display: flex;
    flex-direction: column-reverse;
    min-height: 0;
    padding: calc(92px + var(--announcement-height, 0px)) 24px 48px;
  }

  body:has(#home) #home.hero .hero-col-portrait {
    display: none;
  }

  body:has(#home) #home.hero .hero-col-content {
    width: 100%;
    max-width: 620px;
    align-self: center;
    padding: 20px 0 0;
    text-align: center;
  }

  body:has(#home) #home.hero h1,
  body:has(#home) #home.hero .hero-desc {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body:has(#home) #home.hero h1 {
    font-size: clamp(34px, 9.4vw, 52px) !important;
  }

  body:has(#home) #home.hero .hero-signature,
  body:has(#home) #home.hero .hero-btns {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body:has(#home) #home.hero .hero-grid-layout {
    padding-inline: 18px;
  }

  body:has(#home) #home.hero .hero-btns {
    flex-direction: column;
    align-items: stretch;
  }

  body:has(#home) #home.hero .btn-solid-white,
  body:has(#home) #home.hero .btn-outline-white {
    justify-content: center;
    width: 100%;
  }
}

/* ============================================================
   HOMEPAGE HIGHLIGHTS — PREMIUM EDITORIAL REFRESH
   ============================================================ */
body:has(#home) .triple {
  position: relative;
  isolation: isolate;
  padding: clamp(68px, 7vw, 108px) 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 7% 42%, rgba(68, 80, 255, 0.25), transparent 31%),
    radial-gradient(circle at 88% 8%, rgba(238, 44, 121, 0.2), transparent 28%),
    linear-gradient(115deg, rgba(7, 10, 30, 0.94), rgba(18, 11, 46, 0.9));
}

body:has(#home) .triple::before,
body:has(#home) .triple::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

body:has(#home) .triple::before {
  width: 38rem;
  height: 38rem;
  right: -15rem;
  bottom: -24rem;
  border: 1px solid rgba(214, 177, 255, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(214, 177, 255, 0.025), 0 0 0 112px rgba(214, 177, 255, 0.018);
}

body:has(#home) .triple::after {
  inset: 0;
  opacity: 0.22;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 0.65px, transparent 0.65px);
  background-size: 20px 20px;
  mask-image: linear-gradient(90deg, #000, transparent 85%);
}

body:has(#home) .triple .container { position: relative; }

body:has(#home) .triple-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 22px;
}

body:has(#home) .triple-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f0c9ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

body:has(#home) .triple-kicker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, #ff8f4e, #e7b8ff);
}

body:has(#home) .triple-intro p {
  max-width: 37rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.95rem;
  text-align: right;
}

body:has(#home) .triple-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.06fr);
  gap: 22px;
}

body:has(#home) .card-event,
body:has(#home) .card-sermon,
body:has(#home) .card-times {
  min-height: 480px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.27), inset 0 1px rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

body:has(#home) .card-event,
body:has(#home) .card-sermon { isolation: isolate; }

body:has(#home) .card-event {
  background: linear-gradient(180deg, rgba(20, 19, 56, 0.15) 0%, rgba(8, 10, 30, 0.96) 82%);
}

body:has(#home) .card-event .event-card-image {
  opacity: 0.5;
  filter: saturate(0.76) contrast(1.06) brightness(0.72);
  transform: scale(1.02);
  transition: transform 0.7s var(--ease-out-expo), filter 0.7s ease;
}

body:has(#home) .card-event::after,
body:has(#home) .card-sermon::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(12, 9, 34, 0.02) 20%, rgba(7, 8, 26, 0.24) 49%, rgba(6, 8, 25, 0.94) 100%);
}

body:has(#home) .card-sermon::after {
  background: linear-gradient(180deg, rgba(11, 8, 32, 0.12), rgba(9, 8, 28, 0.88));
}

body:has(#home) .card-sermon > * { position: relative; z-index: 1; }

body:has(#home) .card-times {
  background: linear-gradient(145deg, rgba(39, 18, 70, 0.9), rgba(17, 17, 52, 0.94));
}

body:has(#home) .card-event:hover,
body:has(#home) .card-sermon:hover,
body:has(#home) .card-times:hover {
  transform: translateY(-7px);
  border-color: rgba(225, 174, 255, 0.48);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36), 0 0 34px rgba(156, 81, 255, 0.16), inset 0 1px rgba(255, 255, 255, 0.15);
}

body:has(#home) .card-event:hover .event-card-image {
  transform: scale(1.08);
  filter: saturate(0.92) contrast(1.08) brightness(0.8);
}

body:has(#home) .card-tag {
  margin-bottom: 12px;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
}

body:has(#home) .card-title {
  max-width: 15ch;
  margin-bottom: 13px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: clamp(1.75rem, 2.1vw, 2.15rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

body:has(#home) .card-times .card-title { max-width: none; }

body:has(#home) .card-meta {
  margin-bottom: 13px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  line-height: 1.45;
}

body:has(#home) .card-meta svg { color: #e6b3ff; }
body:has(#home) .sermon-meta-text { color: rgba(255, 255, 255, 0.74); }

body:has(#home) .card-event .btn-orange,
body:has(#home) .card-sermon .btn-primary {
  width: 100%;
  min-height: 50px;
  margin-top: auto;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.21);
}

body:has(#home) .schedule-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 2px 0 17px;
  padding: 5px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(3, 5, 25, 0.27);
}

body:has(#home) .tab-btn {
  min-height: 35px;
  padding: 7px 3px;
  border-radius: 8px;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
}

body:has(#home) .tab-btn.active {
  background: linear-gradient(135deg, #ff8b57, #e55ab9);
  box-shadow: 0 5px 14px rgba(229, 90, 185, 0.28);
  transform: none;
}

body:has(#home) .tab-content { min-height: 176px; }

body:has(#home) .time-row {
  min-height: 62px;
  margin-bottom: 7px;
  padding: 11px 13px;
  border-color: rgba(255, 255, 255, 0.075);
  border-radius: 11px;
  background: rgba(4, 5, 24, 0.27);
}

body:has(#home) .time-row:hover { transform: translateX(3px); }
body:has(#home) .time-left { gap: 11px; }
body:has(#home) .time-left svg { width: 19px; height: 19px; color: #f3b2db; }
body:has(#home) .service-title { font-size: 0.82rem; }
body:has(#home) .service-subtitle { color: rgba(255, 255, 255, 0.64); font-size: 0.73rem; }

body:has(#home) .browse-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 14px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

body:has(#home) .browse-link svg { width: 17px; height: 17px; }

@media (max-width: 1200px) {
  body:has(#home) .triple-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:has(#home) .card-times { grid-column: 1 / -1; min-height: 395px; }
}

@media (max-width: 768px) {
  body:has(#home) .triple { padding: 54px 0; }
  body:has(#home) .triple-intro { display: block; margin-bottom: 18px; }
  body:has(#home) .triple-intro p { margin-top: 8px; text-align: left; }
  body:has(#home) .triple-grid { grid-template-columns: 1fr !important; }
  body:has(#home) .card-times { grid-column: auto; }
  body:has(#home) .card-event,
  body:has(#home) .card-sermon,
  body:has(#home) .card-times { min-height: 390px !important; padding: 25px 22px !important; }
  body:has(#home) .card-times { min-height: 420px !important; }
}

@media (max-width: 480px) {
  body:has(#home) .schedule-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:has(#home) .tab-btn { font-size: 0.62rem !important; }
  body:has(#home) .card-title { font-size: 1.7rem; }
}

/* Keep the homepage's original vibrant page background visible behind the cards. */
body:has(#home) .triple {
  background: transparent;
}

body:has(#home) .triple::before,
body:has(#home) .triple::after {
  display: none;
}

body:has(#home) .card-event {
  background: linear-gradient(160deg, rgba(45, 24, 113, 0.54), rgba(10, 24, 91, 0.78));
}

body:has(#home) .card-times {
  background: linear-gradient(145deg, rgba(194, 12, 78, 0.7), rgba(102, 13, 90, 0.82));
}

/* ============================================================
   SITE HEADER — REFINED GLASS NAVIGATION
   ============================================================ */
.header {
  top: 18px;
  width: min(calc(100% - 40px), 1480px);
  max-width: 1480px;
  height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(14, 7, 42, 0.91), rgba(48, 8, 62, 0.82));
  box-shadow: 0 18px 48px rgba(8, 3, 32, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.header::after {
  right: 34%;
  left: 34%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff9a68, #e7a1ff, transparent);
  opacity: 0.72;
}

.header.scrolled {
  top: 12px;
  width: min(calc(100% - 32px), 1440px);
  max-width: 1440px;
  height: 68px;
  background: rgba(16, 7, 44, 0.94);
  border-color: rgba(233, 186, 255, 0.27);
  box-shadow: 0 16px 44px rgba(8, 3, 32, 0.36), inset 0 1px rgba(255, 255, 255, 0.12);
}

body:has(#home) .header {
  top: 18px !important;
  background: linear-gradient(110deg, rgba(14, 7, 42, 0.91), rgba(48, 8, 62, 0.82)) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

body:has(#home) .header.scrolled {
  top: 12px !important;
  background: rgba(16, 7, 44, 0.94) !important;
  border-color: rgba(233, 186, 255, 0.27) !important;
}

.header .container { max-width: none; padding: 0 20px; gap: 18px; }
.logo-link { gap: 11px; }
.logo-img {
  width: 46px;
  height: 46px;
  padding: 3px;
  border: 1px solid rgba(255, 205, 99, 0.45);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 18px rgba(255, 157, 81, 0.18);
}
.logo-text { font-size: 12px; letter-spacing: 0.07em; line-height: 1.17; }

.nav-main { gap: clamp(12px, 1.25vw, 21px); }
.nav-main a,
.nav-main > .nav-dropdown > a {
  padding: 9px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px;
  font-weight: 650;
}
.nav-main a.active,
.nav-dropdown.active > a { color: #fff; }
.nav-main a.active::after,
.nav-dropdown.active > a::after {
  bottom: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff9c5c, #ed71cd);
  box-shadow: 0 0 12px rgba(240, 110, 210, 0.7);
}
.nav-main a:not(.active):not(.has-dropdown)::after { bottom: 0; }

.dropdown-menu {
  top: calc(100% + 15px);
  min-width: 232px;
  padding: 9px;
  border-color: rgba(239, 193, 255, 0.22);
  background: rgba(20, 9, 52, 0.97);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}
.dropdown-menu::before { background: rgba(20, 9, 52, 0.97); }
.dropdown-menu a { padding: 9px 12px; border-radius: 8px; }
.dropdown-menu a:hover { padding-left: 16px; background: rgba(255, 133, 208, 0.12); }

.header-right { gap: 8px; }
.header-right .icon-btn {
  width: 38px;
  height: 38px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}
.header-right .icon-btn:hover { border-color: rgba(255, 196, 225, 0.7); background: rgba(255, 255, 255, 0.11); }
.header-right .icon-btn svg { width: 17px; height: 17px; }
.btn-header-cta {
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff8255, #ed2a75);
  box-shadow: 0 10px 24px rgba(237, 42, 117, 0.24);
}

.header-notifications { position: relative; }
.notification-toggle { overflow: visible !important; }
.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid #24103e;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a59, #ee377f);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(255, 65, 132, 0.45);
}
.notification-panel {
  position: absolute;
  top: calc(100% + 16px);
  right: -56px;
  width: min(340px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(238, 194, 255, 0.24);
  border-radius: 15px;
  background: rgba(21, 9, 53, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.notification-panel[hidden] { display: none; }
.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 7px 10px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.notification-status {
  padding: 3px 7px;
  border-radius: 100px;
  background: rgba(255, 124, 177, 0.15);
  color: #ffc5e1;
  font-size: 0.65rem;
}
.notification-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 10px;
  color: #fff;
}
.notification-item:hover { background: rgba(255, 255, 255, 0.075); }
.notification-item strong,
.notification-item small { display: block; }
.notification-item strong { font-size: 0.78rem; }
.notification-item small { margin-top: 2px; color: rgba(255, 255, 255, 0.62); font-size: 0.7rem; }
.notification-icon {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
}
.notification-icon svg { width: 16px; height: 16px; }
.notification-icon-event { background: rgba(251, 142, 76, 0.16); color: #ffb071; }
.notification-icon-visit { background: rgba(222, 118, 255, 0.15); color: #ecb2ff; }

.homepage-event-value { display: inline !important; }

@media (max-width: 1200px) {
  .header { width: calc(100% - 28px); }
  .nav-main { gap: 12px; }
  .nav-main a,
  .nav-main > .nav-dropdown > a { font-size: 11.5px; }
  .logo-text { display: none; }
}

@media (max-width: 768px) {
  .header { top: 10px; width: calc(100% - 20px); height: 64px; border-radius: 15px; }
  .header .container { padding: 0 13px; gap: 9px; }
  .logo-img { width: 40px; height: 40px; }
  .header-right { gap: 6px; }
  .header-right .icon-btn { width: 35px; height: 35px; }
  .header-right #userProfileBtn { display: none; }
  .btn-header-cta { min-height: 35px; padding: 8px 10px; font-size: 0.7rem; }
  .btn-header-cta svg { display: none; }
  .notification-panel { right: -88px; }
  body:has(#home) .header { top: 10px !important; }
}

@media (max-width: 430px) {
  .btn-header-cta { display: none; }
  .notification-panel { right: -52px; }
}

/* ============================================================
   HOMEPAGE MOBILE RESTORATION
   The hero artwork remains intact while the interactive actions and quick
   links stay available as real, touch-friendly page content.
   ============================================================ */
body:has(#home) .quick-links-wrapper {
  display: block !important;
  margin-top: 0 !important;
  padding: 26px 0 4px;
}

.mobile-hero-actions { display: none; }

@media (max-width: 760px) {
  body:has(#home) #home.hero .hero-ui-visit,
  body:has(#home) #home.hero .hero-ui-live {
    display: none !important;
  }

  .mobile-hero-actions {
    display: grid;
    gap: 12px;
    width: min(calc(100% - 36px), 460px);
    margin: -8px auto 6px;
    position: relative;
    z-index: 4;
  }

  .mobile-hero-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    gap: 11px;
    border-radius: 13px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
  }

  .mobile-hero-actions svg { width: 20px; height: 20px; }

  .mobile-hero-visit {
    color: #160d2e;
    background: linear-gradient(135deg, #fff, #e8e5f2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  }

  .mobile-hero-live {
    border: 1px solid rgba(255, 255, 255, 0.37);
    color: #fff;
    background: rgba(21, 10, 51, 0.72);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  }

  body:has(#home) .quick-links-wrapper {
    padding: 30px 0 14px;
  }

  body:has(#home) .quick-links-wrapper .container {
    padding-inline: 18px !important;
  }

  body:has(#home) .ql-bar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 12px !important;
    border-radius: 22px !important;
    background: rgba(31, 18, 58, 0.78) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 20px 40px rgba(5, 2, 24, 0.3) !important;
  }

  body:has(#home) .ql-item {
    min-width: 0 !important;
    min-height: 142px;
    justify-content: center !important;
    padding: 18px 10px !important;
    border-radius: 14px;
  }

  body:has(#home) .ql-item:nth-of-type(1),
  body:has(#home) .ql-item:nth-of-type(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  body:has(#home) .ql-item:nth-of-type(1),
  body:has(#home) .ql-item:nth-of-type(3) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  body:has(#home) .ql-item svg { width: 31px !important; height: 31px !important; margin-bottom: 10px !important; }
  body:has(#home) .ql-item h4 { margin-bottom: 7px !important; font-size: 0.82rem !important; }
  body:has(#home) .ql-item p { font-size: 0.76rem !important; line-height: 1.45 !important; }
  body:has(#home) .ql-divider { display: none !important; }

  body:has(#home) .triple { padding-top: 42px; }
  body:has(#home) .card-event,
  body:has(#home) .card-sermon,
  body:has(#home) .card-times { border-radius: 20px; }
}

@media (max-width: 380px) {
  .mobile-hero-actions { width: calc(100% - 28px); }
  body:has(#home) .quick-links-wrapper .container { padding-inline: 14px !important; }
  body:has(#home) .ql-item { min-height: 132px; padding: 15px 7px !important; }
  body:has(#home) .ql-item p { font-size: 0.71rem !important; }
}

/* ============================================================
   HEADER FIT & MODERN NAVIGATION
   ============================================================ */
.header,
.header .container,
.header-right,
.nav-main { min-width: 0; }

.header { overflow: visible; }
.header .container { justify-content: space-between; }
.nav-main {
  flex: 1 1 auto;
  justify-content: center;
  margin: 0;
  gap: clamp(13px, 1.35vw, 24px);
}
.nav-main a,
.nav-main > .nav-dropdown > a {
  font-size: 0.78rem;
  font-weight: 700;
}
.header-right { margin-left: 0; }
.header-notifications { order: -1; z-index: 20; }
.notification-toggle { isolation: isolate; }
.notification-panel { z-index: 1100; }

@media (max-width: 1120px) {
  .header { width: calc(100% - 24px); }
  .header .container { padding-inline: 14px; }
  .nav-main { display: none !important; }
  .header .mobile-toggle { display: inline-flex !important; }

  .header .nav-main.mobile-open {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 4px;
    max-height: min(70dvh, 520px);
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid rgba(237, 194, 255, 0.24);
    border-radius: 16px;
    background: rgba(18, 8, 47, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .header .nav-main.mobile-open > a,
  .header .nav-main.mobile-open > .nav-dropdown > a {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
    font-size: 0.82rem;
  }

  .header .nav-main.mobile-open > .nav-dropdown { grid-column: 1 / -1; }
  .header .nav-main.mobile-open .nav-dropdown .dropdown-menu {
    display: none;
    position: static;
    min-width: 0;
    margin: 4px 0 0;
    padding: 4px;
    transform: none;
    border-radius: 10px;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
  }

  .header .nav-main.mobile-open .nav-dropdown.is-expanded .dropdown-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header .nav-main.mobile-open .nav-dropdown .dropdown-menu::before { display: none; }
  .header .nav-main.mobile-open .nav-dropdown .dropdown-menu a { padding: 10px; font-size: 0.78rem; }
}

@media (max-width: 760px) {
  .header,
  body:has(#home) .header { top: 8px !important; width: calc(100% - 16px); height: 64px; }
  .header .container { padding-inline: 10px; gap: 7px; }
  .logo-img { width: 41px; height: 41px; }
  .header-right { gap: 5px; }
  .header-right .icon-btn,
  .header .mobile-toggle { width: 38px !important; height: 38px !important; }
  .header-right #userProfileBtn,
  .header-right .btn-header-cta { display: none; }
  .notification-panel { right: 0; width: min(340px, calc(100vw - 22px)); }
  .header .nav-main.mobile-open { top: calc(100% + 9px); grid-template-columns: 1fr; border-radius: 14px; }
  .header .nav-main.mobile-open .nav-dropdown.is-expanded .dropdown-menu { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .header .container { padding-inline: 8px; }
  .header-right .icon-btn,
  .header .mobile-toggle { width: 36px !important; height: 36px !important; }
  .logo-img { width: 39px; height: 39px; }
}

/* ============================================================
   FULL-WIDTH NAVIGATION + NOTIFICATION STRIP
   ============================================================ */
.site-notification-tray {
  /* This is an entry-page notice, not a persistent overlay. Keeping it in
     document flow prevents it from covering footer and page content. */
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(calc(100% - 48px), 980px);
  min-height: 30px;
  padding: 5px 13px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 208, 236, 0.28);
  border-radius: 999px;
  background: rgba(28, 7, 54, 0.92);
  box-shadow: 0 8px 28px rgba(7, 0, 28, 0.28);
  color: rgba(255, 255, 255, 0.83);
  font-size: 0.72rem;
  line-height: 1.2;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tray-count {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff995c, #f02c81);
  color: #fff;
  font-size: 0.63rem;
  font-weight: 900;
}
.tray-label { color: #fff; font-weight: 800; }
.tray-message { color: rgba(255, 255, 255, 0.68); }
.tray-link { color: #ffd1e7; font-weight: 800; white-space: nowrap; }
.tray-link:hover { color: #fff; }

.header,
body:has(#home) .header {
  top: 48px !important;
  width: calc(100% - 48px);
  max-width: none;
  border-radius: 15px;
}
.header.scrolled,
body:has(#home) .header.scrolled { top: 44px !important; }
.header.has-announcement { top: calc(var(--announcement-height, 0px) + 48px) !important; }

.header .container { width: 100%; max-width: none; padding-inline: 22px; }
.header-left { flex: 0 0 255px; }
.header-right { flex: 0 0 auto; }
.nav-main {
  display: flex;
  flex: 1 1 auto;
  justify-content: space-between;
  gap: 0;
  margin: 0 28px;
}
.nav-main a,
.nav-main > .nav-dropdown > a {
  padding: 12px 5px;
  font-size: clamp(0.67rem, 0.72vw, 0.81rem);
  letter-spacing: 0;
  text-align: center;
}
.nav-main a.active::after,
.nav-dropdown.active > a::after { bottom: 2px; }

@media (max-width: 1450px) {
  .header-left { flex-basis: 212px; }
  .header .container { padding-inline: 16px; }
  .nav-main { margin-inline: 15px; }
  .nav-main a,
  .nav-main > .nav-dropdown > a { font-size: 0.69rem; }
  .btn-header-cta { padding-inline: 12px; }
}

@media (max-width: 1120px) {
  .header .nav-main.mobile-open { margin: 0; }
}

@media (max-width: 760px) {
  .site-notification-tray {
    top: 5px;
    justify-content: flex-start;
    width: calc(100% - 16px);
    min-height: 27px;
    padding: 4px 10px;
    font-size: 0.66rem;
  }
  .tray-message { display: none; }
  .tray-link { margin-left: auto; }
  .header,
  body:has(#home) .header { top: 41px !important; width: calc(100% - 16px); }
  .header.scrolled,
  body:has(#home) .header.scrolled { top: 38px !important; }
  .header.has-announcement { top: calc(var(--announcement-height, 0px) + 41px) !important; }
}

/* ============================================================
   MOBILE HOMEPAGE — APPROVED FULL HERO ARTWORK
   Keep the approved JPGM hero as one complete image on phones. The real
   navigation, notification tray and support controls remain separate,
   functional interface elements above it.
   ============================================================ */
@media (max-width: 760px) {
  body:has(#home) .site-notification-tray {
    display: flex !important;
  }

  body:has(#home) .header,
  body:has(#home) .header.scrolled {
    top: calc(max(5px, env(safe-area-inset-top)) + 36px) !important;
    height: 60px;
    background: rgba(14, 6, 39, 0.88) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 12px 30px rgba(5, 1, 22, 0.28);
  }

  body:has(#home) .header.has-announcement {
    top: calc(var(--announcement-height, 0px) + max(5px, env(safe-area-inset-top)) + 36px) !important;
  }

  body:has(#home) #home.hero {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    /* The header is fixed. Reserve its complete mobile stack so the image
       begins below it instead of being covered or visually cut in half. */
    margin-top: calc(max(5px, env(safe-area-inset-top)) + 108px) !important;
    padding: 0 !important;
    line-height: 0;
    background: #08021e !important;
  }

  body:has(#home) #home.hero .hero-ui-replacement {
    display: block !important;
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
  }

  body:has(#home) #home.hero .hero-ui-action {
    display: block !important;
  }

  body:has(#home) .mobile-hero-actions {
    display: none !important;
  }

  body:has(#home) #home.hero .hero-bg {
    display: none !important;
  }

  body:has(#home) #home.hero .hero-bg-split,
  body:has(#home) #home.hero .hero-bg-split::after,
  body:has(#home) #home.hero #heroParticles {
    display: none !important;
  }

  body:has(#home) #home.hero .hero-grid-layout {
    display: none !important;
  }

  body:has(#home) #home.hero .hero-col-portrait,
  body:has(#home) #home.hero .hero-col-badges,
  body:has(#home) #home.hero .hero-col-content {
    display: none !important;
  }

  body:has(#home) .quick-links-wrapper {
    display: block !important;
    padding: 24px 0 12px !important;
  }

  /* Restore real floating support controls that a previous hero-only rule hid. */
  body:has(#home) .ai-assistant-widget,
  body:has(#home) .whatsapp-float-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body:has(#home) .ai-assistant-widget {
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    transform: none !important;
    z-index: 10010;
  }

  body:has(#home) .whatsapp-float-btn {
    left: max(14px, env(safe-area-inset-left)) !important;
    right: auto !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    width: 54px !important;
    height: 54px !important;
    padding: 0 !important;
    justify-content: center;
    transform: none !important;
    z-index: 10009;
  }

  body:has(#home) .whatsapp-float-btn .whatsapp-badge,
  body:has(#home) .ai-assistant-toggle .ai-toggle-text {
    display: none !important;
  }

  body:has(#home) .ai-assistant-toggle {
    width: 54px;
    height: 54px;
    padding: 0;
    justify-content: center;
  }

  body:has(#home) .ai-toggle-icon { width: 38px; height: 38px; }
  body:has(#home) .whatsapp-float-btn svg { width: 27px; height: 27px; }

  body:has(#home) .ai-chat-window {
    right: 0;
    bottom: 66px;
    width: min(380px, calc(100vw - 28px));
    height: min(500px, calc(100dvh - 96px));
    max-height: calc(100dvh - 96px);
  }

  body:has(#home) .back-to-top {
    right: max(17px, env(safe-area-inset-right)) !important;
    bottom: 82px !important;
  }
}

@media (max-width: 380px) {
  body:has(#home) .site-notification-tray { font-size: 0.62rem; }
}

/* ============================================================
   MOBILE OVERFLOW GUARDRAILS + LIFE AT JPGM GALLERY
   Keep every page inside the viewport and give the gallery a deliberate,
   breathable feature-image layout instead of crowded competing grid rules.
   ============================================================ */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  main,
  section,
  .container,
  .content-section,
  .gallery,
  .footer {
    min-width: 0;
    max-width: 100%;
  }

  img,
  video,
  iframe {
    max-width: 100%;
  }

  .card-title,
  .gallery-overlay span,
  .notification-item strong,
  .notification-item small,
  .footer a,
  .event-item,
  .sermon-card-title {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body:has(#home) .gallery {
    padding: 48px 0 !important;
    overflow: clip;
  }

  body:has(#home) .gallery .container {
    padding-inline: 16px !important;
  }

  body:has(#home) .gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row;
    gap: 10px !important;
  }

  body:has(#home) .gallery-item {
    min-width: 0;
    border-radius: 14px !important;
    aspect-ratio: 1 / 0.84;
    transform: none !important;
  }

  body:has(#home) .gallery-large {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    aspect-ratio: 16 / 9;
  }

  body:has(#home) .gallery-item img,
  body:has(#home) .gallery-large img {
    display: block;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    object-fit: cover;
  }

  /* Touch devices do not have hover, so captions stay readable without
     expanding or covering the images unexpectedly. */
  body:has(#home) .gallery-overlay,
  body:has(#home) .gallery-item:hover .gallery-overlay {
    display: flex;
    align-items: flex-end;
    min-height: 44%;
    padding: 22px 10px 9px;
    opacity: 1;
    transform: none;
    background: linear-gradient(transparent, rgba(5, 2, 22, 0.86));
  }

  body:has(#home) .gallery-overlay span {
    font-size: 0.68rem !important;
    line-height: 1.25;
    text-wrap: balance;
  }

  body:has(#home) .gallery-large .gallery-overlay span {
    font-size: 0.86rem !important;
  }
}

@media (max-width: 380px) {
  body:has(#home) .gallery .container { padding-inline: 14px !important; }
  body:has(#home) .gallery-grid { gap: 8px !important; }
  body:has(#home) .gallery-item { border-radius: 12px !important; }
  body:has(#home) .gallery-overlay { padding: 18px 8px 8px; }
  body:has(#home) .gallery-overlay span { font-size: 0.62rem !important; }
}

/* ============================================================
   HOMEPAGE SUPPORT ACTIONS — ALWAYS AVAILABLE
   These controls must never inherit a hidden state from a hero treatment.
   They remain fixed above page content at every scroll position.
   ============================================================ */
body:has(#home) .ai-assistant-widget {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10010 !important;
}

body:has(#home) .whatsapp-float-btn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10009 !important;
}

@media (min-width: 761px) {
  body:has(#home) .ai-assistant-widget {
    right: 24px !important;
    bottom: 24px !important;
  }

  body:has(#home) .whatsapp-float-btn {
    right: auto !important;
    bottom: 24px !important;
    left: 24px !important;
  }
}

/* ============================================================
   HOMEPAGE LATEST EVENT — IMAGE VISIBILITY
   Preserve text contrast at the bottom while allowing the event artwork to
   remain the visual focus instead of being buried under dark overlays.
   ============================================================ */
body:has(#home) .card-event .event-card-image {
  opacity: 0.88 !important;
  filter: saturate(1.04) contrast(1.03) brightness(0.94) !important;
  background-position: center !important;
}

body:has(#home) .card-event::after {
  background: linear-gradient(
    180deg,
    rgba(8, 8, 28, 0.04) 0%,
    rgba(8, 8, 28, 0.16) 43%,
    rgba(8, 8, 28, 0.78) 100%
  ) !important;
}

body:has(#home) .card-event:hover .event-card-image {
  filter: saturate(1.1) contrast(1.04) brightness(1) !important;
}
