/* --- [2025 PERFORMANCE STANDARDS] Modern Font Loading Strategy --- */
/* Evidence-based implementation for optimal font loading performance */

/* Critical font declarations - optimized for 2025 standards */
@font-face {
  font-family: 'Roboto';
  src: url('https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  src: url('https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Advanced fallback font stack with size-adjust for layout stability */
@font-face {
  font-family: 'Roboto-fallback';
  src: local('Arial'), local('Helvetica Neue'), local('system-ui');
  font-display: swap;
  size-adjust: 107%; /* Matches Roboto's metrics */
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* Optimized font stacks with CSS custom properties */
:root {
  --font-primary: 'Roboto', 'Roboto-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Georgia', 'Times New Roman', Times, serif;
}

/* Strategic font-display implementation based on content importance */
body {
  font-family: var(--font-primary);
  font-size-adjust: 0.5;
  line-height: 1.6;
}
body.modal-open {
  overflow: hidden;
}

/* For hero/branding text - use swap for guaranteed custom font display */
.hero-content-bridge h1,
.logo,
.main-nav {
}

/* For body text - use optional for better performance on slow connections */
.card p,
.about-text p,
.news-content p {
}

/* For decorative elements - use fallback as compromise */
.tier-card h3,
.partner h3 {
}

/* Font loading states with enhanced fallback strategy */
.fonts-loaded {
  font-family: var(--font-primary);
}

.fonts-fallback {
  font-family: 'Roboto-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Optimize heading fonts to prevent layout shifts */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-size-adjust: 0.5;
}

/* Font loading animation (subtle) */
@keyframes font-loading {
  0% { opacity: 0.95; }
  100% { opacity: 1; }
}

.fonts-loaded * {
  animation: font-loading 0.2s ease-in-out;
}


/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility: visually-hidden (for accessible labels) */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Performance Optimization: CSS-based smooth scrolling */
html {
    scroll-behavior: smooth;
    color-scheme: light;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* --- Palette Variables --- */
/* --- [ACCESSIBILITY FIX] Updated Palette Variables --- */
:root {
    --primary-red: #D91D25; /* Slightly darker red for AA compliance */;
    --dark-red: #B2181F; /* A darker shade for hover states */;
    --deep-crimson: #8B1318;
    --black: #000000;
    --light-neutral: #F3F3F3;
    --warm-ivory: #F9F7F4;
    --sand-accent: #8A7A50; /* This shade is AA compliant with black text */;
    --rich-gold: #B59A4C;
    --focus-ring: #005fcc; /* High-contrast focus indicator */
    --sticky-offset: 80px; /* Approx header height for anchor scroll offsets */
    accent-color: var(--primary-red);
}

body {
    font-family: var(--font-primary);
    margin: 0;
    color: var(--black);
    background-color: var(--warm-ivory);
    padding: 0 10px; /* Adds a small buffer on the sides */;
    accent-color: var(--primary-red);
}

/* Provide room for anchored sections under sticky header */
:where(main > section, [id]) { scroll-margin-top: var(--sticky-offset); }

/* --- Skip Link for Accessibility --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-red);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 4vw + 1rem, 3rem);
    color: #FFFFFF;
}

h2 {
    font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
    text-align: center;
    margin-bottom: 50px; /* Increased for better rhythm */;
}

/* --- Typography Rhythm Refinement --- */
h2, .h2 { /* using a class for flexibility */
    margin-bottom: 50px;
}
h3, .h3 {
    margin-bottom: 20px;
}
.card h3, .tier-card h3 {
    margin-top: 1.5rem; /* Ensure space above card titles */;
}

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Navigation */
/* Ensure the CTA button looks right on desktop, even in a list */
.main-nav ul li:last-child {
    list-style: none; /* Removes bullet point if any */;
}

.logo img {
    height: 50px;
    width: auto;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease, font-weight 0.3s ease; /* Smooth color and weight transitions */
    position: relative; /* For potential underline effects */
}

.main-nav a:hover {
    color: var(--primary-red);
}

/* Enhanced active navigation link styling */
.main-nav a.active-nav-link {
    color: var(--primary-red);
    font-weight: bold;
    position: relative;
}

/* Optional: Add subtle underline effect for active links */
.main-nav a.active-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-red);
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-red);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

/* --- Buttons and CTAs --- */
.cta-button {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- [ACCESSIBILITY FIX] Refined Button Styles --- */
.primary-button {
    background-color: var(--primary-red);
    color: #FFFFFF;
    border: none;
    transition: background-color 0.3s ease; /* Simplified transition */;
}
.primary-button:hover {
    background-color: var(--dark-red); /* Use the new darker hover shade */;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(178, 24, 31, 0.3);
}

.secondary-button {
    background-color: var(--sand-accent);
    color: var(--black);
    transition: background-color 0.3s ease; /* Simplified transition */;
}

.secondary-button:hover {
    background-color: var(--rich-gold); /* Use rich gold for a brighter hover */;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(181, 154, 76, 0.3);
}

/* --- Diptych Hero Section Styling --- */
/* ========================================================= */
/*  3.1  Fluid column ratio (clamps between 35/65 and 50/50)  */
/* ========================================================= */
.hero-diptych {
    display: grid;
    --split: clamp(35%, 45vw, 50%);   /* 45% at 1000 px, 50% at 1600 px */
    grid-template-columns: var(--split) calc(100% - var(--split));
    position: relative;
    background-color: #e0e0e0; /* Fallback for image loading */;
    overflow: hidden;
}

/* ========================================================= */
/*  3.2  Safer height on mobile address-bar browsers          */
/*       Uses the small-viewport-height (svh) unit (2023-+)   */
/* ========================================================= */
.hero-diptych { height: 90svh; }               /* iOS/Android fix */
@supports not (height: 90svh) {                /* graceful fallback */
  .hero-diptych { height: 90vh; }
}

.hero-panel {
    position: relative;
    overflow: hidden;
}

.hero-panel-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mimics background-size: cover */
    object-position: center; /* Mimics background-position: center */
    /* The subtle Ken Burns animation effect */
    animation: ken-burns 20s infinite;
    /* GPU optimization: hoist to compositor layer once */
    will-change: transform;
    /* Ensure proper positioning */
    position: absolute;
    top: 0;
    left: 0;
}

/* ========================================================= */
/*  3.3  Constrain Ken-Burns to panel bounds                  */
/*       Sets transform-origin per panel so zoom stays inside */
/* ========================================================= */
.left-panel  .hero-panel-image { transform-origin: 70% 30%; }
.right-panel .hero-panel-image { transform-origin: 30% 70%; }

.image-uk {
    /* Add overlay effect to match original gradient */
    filter: brightness(0.7) contrast(1.1); /* Simulates the rgba(0,0,0,0.3) overlay */;
    animation-direction: alternate-reverse; /* Pan in a different direction */;
}

.image-oman {
    /* Add overlay effect to match original gradient */
    filter: brightness(0.8) contrast(1.05); /* Simulates the rgba(0,0,0,0.2) overlay */;
    animation-direction: alternate;
}

/* Removed DPR background trick; rely on <picture>/<source> for formats/resolution */

/* Keyframe animation for the subtle pan/zoom */
@keyframes ken-burns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.1) translate(-2%, 2%);
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-panel-image {
        animation: none;
    }
    
    .card {
        transition: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .tier-card {
        transition: none;
    }
    
    .tier-card:hover {
        transform: none;
    }
    
    .event-item {
        animation: none;
    }
    
    .sticky-button {
        transition: none;
    }
    
    .sticky-button:hover {
        transform: none;
    }
    
    .cta-button {
        transition: none;
    }
    
    .cta-button:hover {
        transform: none;
    }
    
    .modal-close-button:hover {
        transform: none;
    }
}

/* Central Content Styling */
.hero-content-bridge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    width: 90%;
    max-width: 700px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
@media (prefers-contrast: more) {
  .hero-content-bridge { background: rgba(0, 0, 0, 0.5); }
}

/* Update hero H1 to look good on the new background */
/* ========================================================= */
/*  3.4  Fluid type + safe min                                */
/* ========================================================= */
.hero-content-bridge h1 {
    font-size: clamp(1.8rem, 4.5vw + .5rem, 3rem);
    color: #FFFFFF;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
}
.hero-content-bridge h1::after {
     border-bottom-color: var(--rich-gold);
}
.hero-content-bridge .typed-words {
    color: #FFFFFF;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

/* Decorative Divider */
.hero-divider {
    position: absolute;
    top: 0;
    left: var(--split); /* Use the same split variable as the grid */;
    width: 2px;
    height: 100%;
    background: linear-gradient(transparent, rgba(255, 204, 102, 0.7), transparent); /* Faded gold line */;
    z-index: 2;
}

/* Responsive adjustments for the hero */
@media (max-width: 768px) {
    .hero-diptych {
        --split: 100%; /* Full width on mobile */
        grid-template-columns: 1fr;
        height: 70svh; /* Use svh for mobile browsers */
        min-height: 70vh; /* Fallback */
    }
    .hero-divider {
        display: none; /* Hide divider on mobile */;
    }
    .hero-content-bridge {
        width: 90%;
        padding: 20px;
    }
    /* Remove the fixed font-size override since we now use clamp */
}

/* --- Podcast Hub Section Styling --- */
.podcast-section {
    padding: 60px 20px;
    background-color: var(--light-neutral);
}
.podcast-container {
    max-width: 800px;
    margin: 0 auto;
}
.podcast-intro {
    text-align: center;
    margin-bottom: 40px;
}
.podcast-intro h2 {
    margin-bottom: 15px;
}
.podcast-intro p {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

.podcast-player-hub {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.podcast-tabs {
    display: flex;
    background-color: #f0f0f0;
}
.podcast-tab {
    flex: 1; /* Make tabs share space equally */;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s, color 0.3s;
    border-bottom: 3px solid transparent;
}
.podcast-tab:hover {
    background-color: #e9e9e9;
}
.podcast-tab.active {
    color: var(--primary-red);
    background: white;
    border-bottom: 3px solid var(--primary-red);
}
.podcast-tab svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.podcast-player-panel {
    display: none; /* Hide panels by default */;
    padding: 20px;
    animation: fade-in 0.5s;
}
.podcast-player-panel.active {
    display: block; /* Show the active panel */;
}

/* Reusable fade-in animation */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Membership Details Modal Styling --- */
.membership-modal-body {
    padding: 20px 40px 40px 40px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* Tab navigation within the modal */
.membership-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}
.membership-modal-tab {
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}
.membership-modal-tab:hover {
    color: #333;
}
.membership-modal-tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

/* Content panes for each tab */
.membership-pane {
    display: none;
    animation: fade-in 0.5s;
}
.membership-pane.active {
    display: block;
}

.membership-pane h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--black);
}
.membership-pane h4 {
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--black);
    border-left: 4px solid var(--sand-accent);
    padding-left: 15px;
}
.membership-pane p {
    line-height: 1.8;
}
.membership-pane .benefits-list {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}
.membership-pane .benefits-list li {
    padding-inline-start: 30px;
    position: relative;
    margin-bottom: 12px;
}
.membership-pane .benefits-list li::before {
    content: '✔';
    color: var(--primary-red);
    font-weight: bold;
    position: absolute;
    inset-inline-start: 0;
    top: 2px;
}

.guarantee-note {
    background-color: var(--warm-ivory);
    padding: 20px;
    border-radius: 8px;
    border-inline-start: 5px solid var(--rich-gold);
    margin-top: 30px;
}
.guarantee-note p {
    margin: 0;
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
}

/* --- Membership Modal Refinements --- */
.membership-pane .sub-section {
    padding: 20px;
    background-color: var(--warm-ivory);
    border-radius: 8px;
    margin-top: 25px;
    border-left: 4px solid var(--sand-accent);
}

.membership-pane h4 {
    border-left: none; /* We moved the border to the sub-section */;
    padding-left: 0;
}

.modal-cta-bar {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.modal-cta-bar p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

/* --- Membership Section Narrative Refinements --- */
.membership-section .tier-container {
    /* Updated to handle two cards gracefully */
    display: flex;
    justify-content: center;
    align-items: stretch; /* Make cards equal height */;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */;
    gap: 30px;
    margin-bottom: 60px; /* Space before the "Our Aims" section */;
}

.membership-section .tier-card {
    width: 320px; /* A fixed width can work well for fewer cards */;
    display: flex;
    flex-direction: column; /* Allows footer button alignment */;
}

.membership-section .tier-card ul {
    flex-grow: 1; /* Pushes the button to the bottom */;
}

/* Specific styling for the corporate card to show it builds on individual */
.tier-corporate {
    border-color: var(--sand-accent);
}
.tier-corporate .price .gold-text {
    color: var(--sand-accent);
}

.membership-aims {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0; /* Visually separates it as the foundation */;
}

@media (max-width: 768px) {
    .membership-aims {
        grid-template-columns: 1fr;
    }
}

.membership-aims ul {
    list-style: none;
    padding: 0;
}

.membership-aims li {
    position: relative;
    padding-inline-start: 28px;
    margin-bottom: 14px;
    font-size: 1rem;
}

/* red BOS tick - re-uses brand palette */
.membership-aims li::before {
    content: '✔';
    color: var(--primary-red);
    font-weight: 700;
    position: absolute;
    inset-inline-start: 0;
    top: 0;
}

/* --- Programme Card Status Indicator --- */
.card-status-closed {
    margin: 15px 1.5rem; /* Matches button margin */;
    padding: 8px 12px;
    background-color: var(--warm-ivory);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
    border: 1px solid #e0e0e0;
}

/* Adjust the card button margin to accommodate the status */
.card .cta-button {
    margin: 0 1.5rem 1.5rem;
}

/* --- Membership Modal Refinements --- */
.membership-pane .sub-section {
    padding: 20px;
    background-color: var(--warm-ivory);
    border-radius: 8px;
    margin-top: 25px;
    border-left: 4px solid var(--sand-accent);
}

.membership-pane h4 {
    border-left: none; /* We moved the border to the sub-section */;
    padding-left: 0;
}

.modal-cta-bar {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.modal-cta-bar p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

/* --- Typed.js Animation --- */
.hero-content-bridge p span.typed-cursor { 
    font-weight: 600; 
    color: var(--rich-gold);
}

.typed-words {
    font-size: clamp(.9rem, 2vw + .3rem, 1.3rem);
    color: #FFFFFF;
    font-weight: 500;
}

/* --- Card Grid for Events --- */
.grid-section { 
    padding: 60px 20px; 
    background-color: var(--light-neutral);
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: #FFFFFF;
    border-top: 5px solid var(--primary-red);
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.card:hover {
    border-top-color: var(--dark-red);
    transform: translateY(-5px); /* Slightly lift the card */;
    box-shadow: 0 12px 35px rgba(180, 29, 37, 0.15); /* Softer, more spread out shadow */;
}

/* --- [CLS FIX] Card Image Aspect Ratio --- */
.card img {
    width: 100%;
    height: auto; /* It's important height is auto */;
    object-fit: cover;
    border-radius: 4px;
    /* The key fix: reserves a 16:9 space for the image */
    aspect-ratio: 16 / 9;
    /* Add a subtle background color to the placeholder */
    background-color: #f0f0f0;
}

.card video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Responsive Video Container --- */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */;
    height: 0;
    overflow: hidden;
    border-radius: 4px; /* Match card image radius */;
    margin-bottom: 1rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px; /* Ensure iframe corners match the card's rounded corners */;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Give the video a subtle shadow to lift it */;
}



.card h3 {
    padding: 1.5rem 1.5rem 0.5rem;
    color: var(--black);
    margin-top: 1.5rem; /* Ensure consistent spacing above card titles */;
}

.card p {
    padding: 0 1.5rem 1.5rem;
    color: #666;
}

.card .cta-button {
    margin: 0 1.5rem 1.5rem;
}

/* --- Membership Section --- */
.membership-section {
    padding: 60px 20px;
    background-color: var(--warm-ivory);
}

/* --- Membership ▸ Our Aims  -------------------------------------------- */
.membership-aims{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap:40px;
    margin-bottom:60px;        /* keeps spacing above "Why Join?" */;
}

.membership-aims ul{
    list-style:none;
    padding:0;
}
.membership-aims li{
    position:relative;
    padding-left:28px;
    margin-bottom:14px;
    font-size:1rem;
}

/* red BOS tick - re-uses brand palette */
.membership-aims li::before{
    content:'✔';
    color:var(--primary-red);
    font-weight:700;
    position:absolute;
    left:0;top:0;
}

.why-join {
    max-width: 800px;
    /* Increased vertical margin for more breathing room */
    margin: 0 auto 80px;
    text-align: center;
    /* Increased internal padding */
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.why-join p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--black);
    margin: 0;
    font-weight: 500;
}

/* --- Progress Bar --- */
.progress { 
    background: #e5e5e5; 
    height: 8px; 
    border-radius: 4px; 
    margin: 20px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.progress-bar { 
    background: var(--primary-red); 
    height: 100%; 
    border-radius: 4px; 
    transition: width 0.4s ease;
}


.tier-card {
    border: 2px solid var(--primary-red);
    /* Increased padding for more internal whitespace */
    padding: 50px;
    width: 300px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: white;
}
.tier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(180, 29, 37, 0.12);
    border-color: var(--dark-red);
}

/* --- Membership Section Refinements --- */
.tier-card ul {
    text-align: left;
    margin: 25px 0;
    list-style: none; /* We will use custom checkmarks */;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.tier-card li {
    font-size: 1rem;
    padding-left: 30px; /* Space for the custom checkmark */;
    position: relative;
}

/* Custom checkmark for a more branded feel */
.tier-card li::before {
    content: '✔';
    color: var(--primary-red);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

.gold-text {
    color: var(--rich-gold);
    font-weight: bold;
}

/* --- About Section --- */
.about-section {
    padding: 60px 20px;
    background-color: white;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--black);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat {
    text-align: center;
    padding: 20px;
    background-color: var(--warm-ivory);
    border-radius: 8px;
    transition: all 0.3s ease;
}
.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat h3 {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--black);
    font-weight: 500;
}

/* --- News Section --- */
.news-section {
    padding: 60px 20px;
    background-color: var(--light-neutral);
}

/* Performance: avoid rendering work before visible */
.news-section,
.partners-section,
.events-section-reimagined {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Smaller min for mobiles */
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    transition: all 0.3s ease;
    container: card / inline-size;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

/* --- [CLS FIX] News Card Image Aspect Ratio --- */
.news-card img {
    width: 100%;
    height: 100%; /* In grid, height: 100% is often better */;
    object-fit: cover;
    aspect-ratio: 16 / 9; /* Auto-resizes while maintaining proportions */;
    background-color: #f0f0f0;
}

.news-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-content h3 {
    color: var(--black);
    font-size: 1.4rem;
}

.news-content p {
    color: #666;
    line-height: 1.6;
}

/* --- Partners Section --- */
.partners-section {
    padding: 60px 20px;
    background-color: white;
}

.partners-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.partner {
    text-align: center;
    padding: 30px;
    border: 2px solid var(--light-neutral);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.partner:hover {
    border-color: var(--primary-red);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.partner img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.partner h3 {
    color: var(--black);
}

.partner p {
    color: #666;
    font-size: 0.9rem;
}

/* --- Contact Section --- */
.contact-section {
    padding: 60px 20px;
    background-color: var(--warm-ivory);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-info h3 {
    color: var(--black);
}

.contact-info p {
    color: var(--black);
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 12px;
    border: 2px solid var(--light-neutral);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    /* Add a soft glow for better focus indication */
    box-shadow: 0 0 0 4px rgba(222, 31, 38, 0.1);
}

.contact-form button {
    align-self: flex-start;
}

/* --- Mobile Navigation Toggle (CSS-based) --- */
.nav-toggle-checkbox {
    display: none; /* Hide the checkbox */
}

.nav-toggle {
    display: none; /* Hidden on desktop */;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.nav-toggle span {
    width: 30px;
    height: 3px;
    background-color: var(--black);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Hamburger menu animation using CSS :has() */
.nav-toggle-checkbox:checked + .nav-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle-checkbox:checked + .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.nav-toggle-checkbox:checked + .nav-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* --- Mobile Responsive Navigation --- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav ul {
        display: none; /* Hide the nav links by default */;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transition: opacity 0.3s ease, transform 0.3s ease;
        opacity: 0;
        transform: translateY(-10px);
    }

    /* CSS-based mobile menu toggle */
    .nav-toggle-checkbox:checked ~ ul {
        display: flex; /* Show the nav links when checkbox is checked */;
        opacity: 1;
        transform: translateY(0);
    }

    /* Accessibility: Update aria-expanded based on checkbox state */
    .nav-toggle-checkbox:checked ~ .nav-toggle {
        --aria-expanded: "true";
    }
    
    .nav-toggle-checkbox:not(:checked) ~ .nav-toggle {
        --aria-expanded: "false";
    }

    .main-nav ul li {
        text-align: center;
        padding: 1rem 0;
    }
}

/* --- Footer --- */
footer {
    background: #0B0B0B;
    color: white;
    padding: 2rem;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    /* Use grid for better alignment */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 40px 20px;
}
.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-section h3 {
    color: white;
}
.footer-section p {
    color: #ccc;
    line-height: 1.6;
}
.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.footer-section ul li {
}
.footer-section ul li a {
    color: #ccc;
    transition: color 0.3s ease;
    position: relative;
    text-decoration: none;
}
.footer-section ul li a:hover {
    color: white;
}

/* --- Footer Link Refinements --- */
/* Add an underline effect on hover */
.footer-section ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -3px;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}
.footer-section ul li a:hover::after {
    width: 100%;
}

/* --- Accessible focus indicators (WCAG 2.2 2.4.7) --- */
:where(a, button, [role="button"], .cta-button, .sticky-button, .modal-close-button, .secondary-action-button, .podcast-tab, .main-nav a):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 6px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 1rem;
}
.social-links a {
    display: inline-block;
    transition: transform 0.3s ease;
}
.social-links a:hover {
    transform: translateY(-3px);
}
.social-links img {
    width: 35px;
    height: 35px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-links a:hover img {
    opacity: 1;
    transform: scale(1.1); /* Make social icons pop on hover */;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    margin-top: 20px;
    text-align: center;
}
.footer-bottom p {
    color: #ccc;
    margin: 0;
}
.legal-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #444; /* Use a different color to separate it visually */;
}
.legal-info p {
    color: #999;
    font-size: 0.8rem;
    margin: 5px 0;
}

/* --- Sticky Button --- */
.sticky-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(180deg, var(--primary-red) 0%, #C81E25 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    border: none;
}

.sticky-button:hover {
    background: linear-gradient(180deg, #C81E25 0%, var(--dark-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.sticky-button.scrolled {
    background: linear-gradient(180deg, var(--deep-crimson) 0%, var(--dark-red) 100%);
}

/* --- Reimagined Events Section --- */
.events-section-reimagined {
    background-color: var(--light-neutral);
    padding: 60px 20px;
    overflow: hidden; /* Contains animations */;
}

.events-container {
    max-width: 1200px;
    margin: 0 auto;
}

.events-title { /* Overrides h2 styling for this section */
    font-size: 2.8rem;
    color: var(--black);
    text-align: center;
    margin-bottom: 50px;
    opacity: 0; /* Animation start state */;
    transform: translateY(20px); /* Animation start state */;
    animation: fade-in-up 0.8s 0.2s forwards;
}

.event__tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
}
.event__tag--gala { background-color: var(--rich-gold); color: white; }
.event__tag--corporate { background-color: var(--sand-accent); color: var(--black); }

/* === Upcoming List Styling === */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid transparent;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0; /* Animation start state */;
    transform: translateX(-30px); /* Animation start state */;
}

.event-item:hover {
    border-left-color: var(--primary-red);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateX(0);
}

.event-item__date { 
    text-align: center; 
    color: var(--primary-red); 
}
.event-item__date .day { 
    font-size: 1.8rem; 
    font-weight: bold; 
    display: block; 
}
.event-item__date .month { 
    font-size: 0.9rem; 
    text-transform: uppercase; 
}

.event-item__title { 
    font-size: 1.2rem; 
    margin: 5px 0 3px; 
    color: var(--black); 
}
.event-item__venue { 
    color: #666; 
    font-size: 0.9rem; 
    margin: 0; 
}

/* --- Event Item Refinements & Modal --- */
.event-item {
    grid-template-columns: auto 1fr auto;
    border-left: 5px solid #e0e0e0; /* Start with a neutral border */;
    transition: all 0.4s ease;
}

.event-item:hover {
    border-left-color: var(--primary-red);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px) scale(1.01); /* A more subtle lift */;
}

.event-item__venue {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between icon and text */;
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0 0 0;
}

.event-item__venue svg {
    width: 16px;
    height: 16px;
    fill: #888;
}

/* --- Event Details Modal Styling --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw; /* Viewport width for auto-resizing */
    height: 100vh; /* Viewport height for auto-resizing */
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content-event {
    background-color: #fefefe;
    margin: 5vh auto; /* Vertical centering with viewport height */
    padding: 40px;
    border-radius: 16px;
    width: 90vw; /* Viewport width for auto-resizing */
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    animation: slide-in 0.5s ease-out;
    display: flex;
    flex-direction: column; /* Stack content on mobile */
}

.modal-close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close-button:hover {
    color: var(--primary-red);
}

.event-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 20px; /* For scrollbar */;
}

.event-modal-body h2 { 
    text-align: left; 
    font-size: 2rem; 
    color: var(--primary-red); 
    margin-bottom: 1.5rem;
}

.event-modal-body p { 
    font-size: 1.1rem; 
    line-height: 1.8; 
    margin-bottom: 1rem;
}

.event-modal-body ul { 
    list-style-position: inside; 
    padding-left: 10px; 
    margin-bottom: 1.5rem; 
}

.event-modal-body li { 
    margin-bottom: 0.5rem; 
    line-height: 1.6;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
    .modal-content-event {
        width: 95vw; /* Viewport width for auto-resizing */
        padding: 20px;
        max-height: 90vh; /* Prevent overflow on small screens */
        overflow-y: auto;
        margin: 5vh auto; /* Reduced margin for mobile */
    }
    
    .event-modal-body h2 {
        font-size: 1.6rem;
    }
    
    .event-modal-body p {
        font-size: 1rem;
    }
}

/* Staggered animation for list items */
.event-item:nth-child(1) { animation: slide-in-left 0.7s 0.6s forwards; }
.event-item:nth-child(2) { animation: slide-in-left 0.7s 0.8s forwards; }
/* Add more if needed */

/* --- Keyframe Animations --- */
@keyframes fade-in-up {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
    to { opacity: 1; transform: scale(1); }
}
@keyframes slide-in-left {
    to { opacity: 1; transform: translateX(0); }
}

/* --- Responsive Adjustments --- */
@media (min-width: 768px) {
    .event-featured {
        grid-template-columns: 250px 1fr; /* Further reduced from 300px */;
        text-align: left;
    }
    .event-featured__image-wrapper { 
        border-radius: 12px 0 0 12px; /* Reduced from 16px */;
    }
    .event-featured__content {
        display: flex;
        flex-direction: row;
        gap: 16px; /* Further reduced from 20px */;
        align-items: flex-start;
    }
    .event-featured__details { 
        flex: 1; 
    }
}

@media (max-width: 480px) {
    .event-featured__content {
        padding: 16px; /* Further reduced for mobile */;
    }
    .event-featured__info {
        flex-direction: column;
        gap: 8px; /* Reduced from 10px */;
    }
    .event-featured__title {
        font-size: 1.4rem; /* Further reduced on mobile */;
    }
    .event-featured__hook {
        font-size: 0.9rem; /* Further reduced on mobile */;
    }
    .event-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .event-item__date {
        order: -1;
        margin-bottom: 15px;
    }
}

/* ====================================================== */
/* START: COMPREHENSIVE RESPONSIVE FIXES                  */
/* ====================================================== */

/* --- [DESKTOP FIX] Navigation Alignment --- */
.main-nav {
    display: flex;
    justify-content: space-between; /* This remains */;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95); /* Semi-transparent for better visibility */
    backdrop-filter: blur(10px);
    position: sticky; /* Modern sticky positioning for 2025 browsers */
    top: 0;
    z-index: 1000; /* Ensure it layers above other content */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow when stuck */
    transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

/* Enhanced sticky state for better visual feedback */
.main-nav.stuck {
    background-color: rgba(255, 255, 255, 0.98); /* More opaque when stuck */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
    backdrop-filter: blur(15px);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    /* This ensures the list itself is centered in the available space */
    justify-content: center;
    /* Allow the list to grow and occupy the space between logo and button */
    flex-grow: 1;
}

/* --- [DESKTOP FIX] Membership Card Alignment --- */
.tier-container {
    display: flex;
    /* This is the key fix */
    justify-content: center;
    gap: 30px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-nav ul {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* --- Mobile Header Fixes --- */
    /* This ensures the logo is on the left and the toggle is on the right */
    .main-nav {
        justify-content: space-between;
        flex-direction: row; /* Explicitly set direction for mobile */;
        padding: 1rem 2rem;
        /* Enhanced mobile sticky behavior */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
    }
    
    /* Mobile sticky state */
    .main-nav.stuck {
        background: rgba(255, 255, 255, 0.99);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    .nav-toggle {
        display: flex;
    }
    .main-nav ul {
        display: none;
        position: absolute;
        top: 80px; /* Adjust based on your header height */;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 1rem;
        /* Enhanced mobile menu transitions */
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    .main-nav ul.active {
        display: flex;
    }
    .main-nav ul .cta-button {
        display: block;
        margin: 1rem auto;
        text-align: center;
        width: fit-content;
    }
    
    /* Mobile navigation link enhancements */
    .main-nav a {
        padding: 0.75rem 1rem;
        border-radius: 4px;
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    
    .main-nav a:hover {
        background-color: rgba(222, 31, 38, 0.1);
    }
    
    .main-nav a.active-nav-link {
        background-color: rgba(222, 31, 38, 0.15);
        color: var(--primary-red);
    }
    
    /* Remove underline effects on mobile for better touch experience */
    .main-nav a::after,
    .main-nav a.active-nav-link::after {
        display: none;
    }
    
    /* --- Mobile Hero Fixes --- */
    .hero-diptych {
        height: 70vh; /* Reduced from 90vh for a better mobile experience */;
    }
    /* Remove fixed font-size override since we now use clamp for fluid typography */
    .hero-content-bridge p {
        font-size: 1.1rem;
    }
    /* Remove fixed font-size override since we now use clamp for fluid typography */
    
    /* --- Grid sections now use auto-fit for automatic responsive behavior --- */
    
    .tier-container {
        flex-direction: column;
        align-items: center; /* Center cards vertically in the column */;
    }
    
    .tier-card {
        width: 100%;
        max-width: 350px; /* Prevent cards from becoming too wide on tablets */;
    }
    
    /* News cards automatically stack on mobile due to auto-fit grid */

    /* --- General Typography & Spacing for Mobile --- */
    h2 {
        font-size: 2rem;
        margin-bottom: 40px; /* Slightly reduced for mobile */;
    }
    
    h3 {
        margin-bottom: 15px; /* Reduced for mobile */;
    }
    
    .about-content {
        gap: 30px;
    }
    
    .news-container {
        gap: 20px;
    }
    
    /* Tablet layout for news cards */
    .news-card {
        grid-template-columns: 1fr; /* Single column on tablets */
        gap: 25px;
    }
    
    .news-content {
        padding: 25px; /* Adjusted padding for tablets */
    }
    
    .contact-container {
        gap: 30px;
    }
    
    /* Footer content automatically stacks on mobile due to auto-fit grid */
    
    .why-join {
        padding: 30px;
        margin-bottom: 50px; /* Increased for mobile breathing room */;
    }
    
    .why-join p {
        font-size: 1.1rem;
    }
    
    .tier-card {
        padding: 40px; /* Increased for mobile but still generous */;
    }
    
    .tier-card li {
        margin-bottom: 12px; /* Slightly reduced for mobile */;
        font-size: 0.95rem;
    }
    
    .sticky-button {
        bottom: 1rem;
        right: 1rem;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}
/* ====================================================== */
/* END: COMPREHENSIVE RESPONSIVE FIXES                    */
/* ====================================================== */

/* --- [MOBILE FRIENDLY FIX] Smaller Screen Adjustments --- */
@media (max-width: 480px) {
    /* Remove fixed font-size overrides since we now use clamp for fluid typography */
    
    .grid-section,
    .membership-section,
    .podcast-section,
    .events-section-reimagined {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card h3,
    .card p,
    .card .cta-button {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .contact-form {
        padding: 20px;
    }
    
    .tier-card {
        padding: 40px;
    }
    
    .sticky-button {
        bottom: 15px;
        right: 15px;
    }
    
    /* Stack news cards on very small screens */
    .news-container {
        grid-template-columns: 1fr; /* Stack on very small screens */
        gap: 20px;
    }
    
    /* Mobile layout for individual news cards */
    .news-card {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
    }
    
    .news-content {
        padding: 20px; /* Reduced padding for mobile */
    }
}

/* === Featured Event Styling === */
.event-featured {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px; /* Reduced from 50px */;
    position: relative;
    overflow: hidden;
    opacity: 0; /* Animation start state */;
    transform: scale(0.95); /* Animation start state */;
    animation: scale-in 0.8s 0.4s forwards;
    container: featured / inline-size;
}

.event-featured__image-wrapper {
    position: relative;
    min-height: 150px; /* Further reduced from 180px */;
    max-height: 200px; /* Add max-height constraint */;
    overflow: hidden; /* Ensure content stays within bounds */;
}

/* --- [CLS FIX] Event Image Aspect Ratio --- */
.event-featured__image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px; /* Reduced from 8px */;
    /* Reserve space for event images - typically landscape */
    aspect-ratio: 16 / 9;
    background-color: #f0f0f0;
}

.event-featured__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.event-featured__content {
    display: flex;
    flex-direction: column;
    padding: 20px; /* Further reduced from 25px */;
}

.event-featured__date {
    background: var(--primary-red);
    color: white;
    border-radius: 12px;
    width: 60px; /* Further reduced from 70px */;
    height: 60px; /* Further reduced from 70px */;
    text-align: center;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
    margin-bottom: 15px; /* Reduced from 20px */;
    flex-shrink: 0;
}
.event-featured__date .day { font-size: 1.8rem; } /* Further reduced from 2rem */;
.event-featured__date .month { font-size: 0.8rem; text-transform: uppercase; } /* Further reduced from 0.9rem */;
.event-featured__date .year { display: none; } /* Hidden for brevity */;

.event-featured__title {
    font-size: 1.6rem; /* Further reduced from 1.8rem */;
    margin-bottom: 8px; /* Reduced from 10px */;
    color: var(--black);
}

.event-featured__hook {
    font-size: 0.95rem; /* Further reduced from 1rem */;
    color: #555;
    line-height: 1.5; /* Further reduced from 1.6 */;
    margin-bottom: 18px; /* Further reduced from 20px */;
}

.event-featured__info { 
    display: flex; 
    gap: 12px; /* Further reduced from 15px */;
    color: #555; 
    font-weight: 500; 
    margin-bottom: 18px; /* Further reduced from 20px */;
}
.event-featured__info svg { 
    width: 16px; /* Reduced from 18px */;
    height: 16px; /* Reduced from 18px */;
    fill: var(--primary-red); 
    vertical-align: middle; 
    margin-right: 6px; /* Reduced from 8px */;
} 

/* --- Annual Review Modal (Digital Digest) --- */
/* De-duplicated: use the primary .modal styles defined earlier (z-index 10000) */
.modal-content-large {
    background-color: var(--light-neutral);
    margin: 3vh auto; /* Viewport height for vertical centering */
    width: 90vw; /* Viewport width for auto-resizing */
    max-width: 1100px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    position: relative;
    animation: slide-in-large 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@keyframes slide-in-large {
    from { transform: translateY(-40px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close-button {
    color: #888;
    position: absolute;
    top: 20px; right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    z-index: 10;
}
.modal-close-button:hover { color: var(--primary-red); transform: rotate(90deg); }

.review-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 70vh;
    height: 100%;
    flex: 1;
    min-height: 0;
}
.review-tabs {
    background: #fff;
    padding: 30px;
    border-right: 1px solid #e0e0e0;
    border-radius: 16px 0 0 16px;
    min-height: 0;
}
.review-modal-title {
    font-size: 1.5rem;
    color: var(--black);
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-red);
}
#reviewTabsContainer {
    list-style: none;
    padding: 0;
    margin: 0;
}
#reviewTabsContainer li {
    padding: 12px 15px;
    margin-bottom: 8px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}
#reviewTabsContainer li:hover {
    background-color: var(--warm-ivory);
    border-left-color: var(--sand-accent);
}
#reviewTabsContainer li.active {
    background-color: var(--warm-ivory);
    color: var(--primary-red);
    font-weight: bold;
    border-left-color: var(--primary-red);
}

.review-content {
    padding: 40px;
    overflow-y: auto;
    max-height: none;
    min-height: 0;
}
.review-content-pane { display: none; }
.review-content-pane.active { display: block; animation: fade-in 0.5s; }

.review-content-pane h2 {
    font-size: 2.2rem;
    text-align: left;
    margin-bottom: 20px;
}
.review-content-pane img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.review-content-pane p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1.5rem;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- [MOBILE OPTIMIZATION] Annual Review Modal --- */
@media (max-width: 768px) {
    .review-layout {
        /* On mobile, switch from a grid to a stacked layout */
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    .review-tabs {
        /* Remove the side border and add one at the bottom */
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        /* Make the tabs take up the full width */
        border-radius: 16px 16px 0 0;
        padding: 20px;
    }

    #reviewTabsContainer {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    #reviewTabsContainer::-webkit-scrollbar {
        display: none;
    }

    #reviewTabsContainer li {
        margin-bottom: 0;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    #reviewTabsContainer li:hover {
        border-left-color: transparent;
    }

    #reviewTabsContainer li.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-red);
    }

    .review-content {
        /* Adjust padding for a mobile view */
        padding: 30px 20px;
        max-height: none;
        flex: 1;
    }

    .review-content-pane h2 {
        font-size: 1.8rem; /* Slightly smaller headings for mobile */;
    }

    .review-content-pane p {
        font-size: 1rem; /* Adjust paragraph font size for readability */;
    }

    .modal-content-large {
        /* Allow the modal to be closer to the screen edges */
        width: 95vw; /* Viewport width for auto-resizing */
        margin: 5vh auto; /* Viewport height for vertical centering */
        max-height: 90vh; /* Prevent overflow on small screens */
        overflow-y: hidden;
    }
}

/* --- Reimagined Partners Section Styling --- */
.partners-section h2 {
    margin-bottom: 50px;
}
.partners-logo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}
.partner-logo-item {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important for the overlay effect */;
    transition: box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.partner-logo-item:hover {
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}
/* --- [CLS FIX] Partner Logo Aspect Ratio --- */
.partner-logo-item img {
    width: 100%;
    height: auto;
    object-fit: contain; /* Use contain for logos to preserve aspect ratio */;
    transition: transform 0.3s ease;
    /* Reserve space for logos - most logos are roughly square or 4:3 */
    aspect-ratio: 4 / 3;
    background-color: #ffffff;
    border-radius: 8px;
}
.partner-logo-item:hover img {
    filter: grayscale(0%);
    transform: scale(0.9); /* Subtly shrink the logo to make room for overlay */;
}

/* The Interactive Overlay */
.partner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(222, 31, 38, 0.9); /* Primary red with opacity */;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0; /* Hidden by default */;
    transform: translateY(20px); /* Start slightly below */;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.partner-logo-item:hover .partner-overlay {
    opacity: 1;
    transform: translateY(0);
}
.partner-overlay h3 {
    font-size: 1.2rem;
    color: white;
    margin-bottom: 15px;
}
.partner-overlay .cta-button {
    background: white;
    color: var(--primary-red);
    padding: 8px 18px;
    font-size: 0.9rem;
}

/* Responsive adjustments for partners logo wall */
@media (max-width: 768px) {
    .partners-logo-wall {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
    .partner-logo-item {
        height: 120px;
        padding: 20px;
    }
    .partner-overlay h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    .partner-overlay .cta-button {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
}

/* --- [FIX] Refined Membership Modal Action Bars --- */

/* 1. The Primary Call-to-Action Bar */
.modal-cta-bar {
    margin-top: 40px;
    padding: 25px 0; /* Add more vertical padding */;
    border-top: 1px solid #e0e0e0; /* Crucial visual separator */;
    text-align: center;
}

.modal-cta-bar p {
    font-size: 1.2rem; /* Slightly larger, more confident text */;
    font-weight: 500;
    color: var(--black);
    margin-bottom: 15px;
}

/* 2. The Secondary Option "Footer Prompt" */
.membership-modal-footer-prompt {
    margin-top: 30px;
    background-color: var(--warm-ivory); /* Different background to de-emphasize */;
    padding: 20px 30px;
    border-radius: 0 0 12px 12px; /* Match the modal's bottom corners */;
    margin: 40px -40px -40px -40px; /* Use negative margins to span the full width */;
    text-align: center;
}

.membership-modal-footer-prompt p {
    margin-bottom: 12px;
    color: #555;
    font-style: italic;
}

/* Style the secondary button to be less prominent than the primary CTA */
.membership-modal-footer-prompt .secondary-action-button {
    background: transparent;
    border: 1px solid #aaa;
    color: #333;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.membership-modal-footer-prompt .secondary-action-button:hover {
    background-color: #e0e0e0;
    border-color: #888;
}

/* --- About Us Modal Styling --- */
.about-modal-body {
    padding: 20px 0 40px 0; /* Adjusted padding */;
}

.about-modal-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 60vh;
}

.about-modal-tabs {
    background: #fff;
    padding: 30px 20px;
    border-right: 1px solid #e0e0e0;
    border-radius: 16px 0 0 16px;
}

.about-modal-tabs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: sticky; /* Makes the tabs stick on scroll */;
    top: 20px;
}

.about-modal-tabs li {
    padding: 12px 15px;
    margin-bottom: 8px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.about-modal-tabs li:hover {
    background-color: var(--warm-ivory);
    border-left-color: var(--sand-accent);
}

.about-modal-tabs li.active {
    background-color: var(--warm-ivory);
    color: var(--primary-red);
    font-weight: bold;
    border-left-color: var(--primary-red);
}

.about-modal-content {
    padding: 30px 40px;
    overflow-y: auto;
    max-height: 80vh;
}

.about-pane {
    display: none;
    animation: fade-in 0.5s;
}
.about-pane.active {
    display: block;
}

.mission-quote {
    background: var(--warm-ivory);
    border-left: 5px solid var(--primary-red);
    padding: 25px;
    margin: 1rem 0 2rem 0;
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.7;
}

.charitable-objects-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
}
.charitable-objects-list li::before {
    content: '✔';
    color: var(--primary-red);
    position: absolute;
    left: 0;
}

/* Mobile Optimizations for About Us Modal */
@media (max-width: 768px) {
    .about-modal-layout {
        display: block;
    }
    .about-modal-tabs {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 16px 16px 0 0;
        padding: 20px;
    }
    .about-modal-tabs ul {
        display: flex;
        overflow-x: auto; /* Allow horizontal scrolling for tabs */;
        padding-bottom: 10px;
        position: static;
    }
     .about-modal-tabs li {
        white-space: nowrap; /* Prevent tabs from wrapping */;
    }
    .about-modal-content {
        padding: 30px 20px;
    }
}
/* --- FONT FALLBACK STRATEGY --- */
/* This ensures text is always visible and readable */

/* Primary font stack with optimal fallbacks */
/* Removed duplicate font vars; use tokens declared at the top of file */

/* Body text with fallback */
body {
  font-family: var(--font-primary);
  /* Ensure text is always visible */
  font-synthesis: none; /* Prevent browser from synthesizing bold/italic */;
}

/* Headings with fallback */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* Font loading states */
.fonts-loaded {
  /* Custom fonts are loaded */
}

.fonts-fallback {
  /* Using system fonts due to slow connection */
}

/* Prevent FOUT (Flash of Unstyled Text) */
.fonts-fallback body {
  font-family: 'Helvetica Neue', Arial, system-ui, sans-serif;
}

.fonts-fallback h1,
.fonts-fallback h2,
.fonts-fallback h3,
.fonts-fallback h4,
.fonts-fallback h5,
.fonts-fallback h6 {
  font-family: 'Times New Roman', Georgia, serif;
}

/* Font loading performance hints */
@supports (font-display: swap) {
  /* Modern browsers - use font-display: swap */
  @font-face {
    font-family: 'Roboto';
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/roboto/v48/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBHMdazQ.woff2') format('woff2');
  }
}

/* Fallback for older browsers */
@supports not (font-display: swap) {
  /* Older browsers - use traditional loading */
  @font-face {
    font-family: 'Roboto';
    src: url('https://fonts.gstatic.com/s/roboto/v48/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBHMdazQ.woff2') format('woff2');
  }
}

.inline-style-0 {
  background-color: #f9f7f4
}

.inline-style-1 {
  display: none
}

.inline-style-2 {
  display: none
}

.inline-style-3 {
   width: 100%; max-width: 100%; overflow: hidden; border-radius: 10px; 
}

.inline-style-4 {
  border-radius: 12px
}

.inline-style-5 {
  background-color: #0b0b0b
}

.inline-style-6 {
  display: none
}
