:root {
  /* SPS Brand Colors */
  --primary: #1e3a8a;       /* Royal Blue */
  --primary-dark: #1e40af;  
  --primary-light: #3b82f6; 
  --primary-bg: #eff6ff;    
  
  --navy: #0f172a;          /* Deep Navy */
  --navy-light: #1e293b;
  
  --gold: #f59e0b;          /* Gold */
  --gold-dark: #d97706;
  
  --green: #10b981;         
  
  --white: #ffffff;
  --light-grey: #f3f4f6;
  --border: #e5e7eb;
  
  --ink: #111827;
  --ink-soft: #4b5563;
  
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 12px rgba(15,23,42,.05);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: var(--white); color: var(--ink); line-height: 1.6; }
.container { width: min(92vw, 1200px); margin-inline: auto; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* --- Top Bar (Royal Blue) --- */
.top-bar { background-color: var(--primary) !important; color: rgba(255,255,255,0.8); font-size: 0.85rem; padding: 0.5rem 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.top-social a { color: rgba(255,255,255,0.8); margin-right: 1rem; transition: color 0.2s; text-decoration: none; }
.top-social a:hover { color: var(--gold) !important; }
.top-contact a { color: var(--white) !important; font-weight: 600; text-decoration: none; }
.top-contact i { color: var(--gold); margin-right: 0.5rem; }

/* --- Header & Navigation (Deep Navy) --- */
.site-header { background-color: var(--navy) !important; box-shadow: 0 2px 10px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 100; padding: 12px 0; }
.header-flex { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

/* Brand Styling */
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 55px !important; width: 55px !important; max-width: 55px !important; object-fit: contain !important; border-radius: 8px; background: var(--white); padding: 4px; }
.brand-text { color: var(--white) !important; font-weight: 800; font-size: clamp(1.1rem, 1.4vw, 1.35rem); letter-spacing: 0.5px; line-height: 1.1; white-space: nowrap; }
.brand-text span { color: var(--gold) !important; } 

/* Menu Styling */
.nav-primary { display: flex; align-items: center; flex-grow: 1; justify-content: flex-end; }
.block-menu { display: flex; list-style: none; margin: 0; padding: 0; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.block-menu li { margin: 0; }
.block-menu a { display: block; padding: 10px 14px; border-radius: 6px; background-color: transparent !important; color: var(--white) !important; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; transition: all 0.3s ease; white-space: nowrap; }
.block-menu a:hover { background-color: rgba(255,255,255,0.1) !important; color: var(--gold) !important; }
.block-menu a.donate-btn { background-color: var(--gold) !important; color: var(--navy) !important; font-weight: 800; margin-left: 8px; }
.block-menu a.donate-btn:hover { background-color: var(--gold-dark) !important; color: var(--white) !important; transform: translateY(-2px); }

/* Mega Menu Submenu */
.has-submenu { position: relative; }
.has-submenu > a { display: flex; align-items: center; }
.submenu { position: absolute; top: 100%; left: 0; background: var(--white); min-width: 220px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); border-radius: 0 0 10px 10px; padding: 0.5rem 0; list-style: none; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; z-index: 200; border-top: 3px solid var(--primary); }
.has-submenu:hover .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li { margin: 0; width: 100%; }
.submenu a { display: block; padding: 10px 20px !important; color: var(--ink) !important; background: transparent !important; font-weight: 500 !important; text-transform: none !important; font-size: 0.9rem !important; transition: all 0.2s; border-radius: 0 !important; }
.submenu a:hover { background-color: var(--primary-bg) !important; color: var(--primary) !important; padding-left: 25px !important; }

/* --- Hero Slider (FIXED) --- */
.hero-slider { position: relative; height: clamp(500px, 70vh, 700px); overflow: hidden; background: var(--navy); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide-media { position: absolute; inset: 0; }

/* Removed the transform zoom and added object-position to keep faces visible */
.slide-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

.slide-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.6) 50%, transparent 100%); }
.slide-body { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; }

/* Added padding to prevent text overlapping the arrows */
.slide-body .container { 
    max-width: 850px; 
    margin-left: max(4vw, calc((100vw - 1200px) / 2)); 
    padding-left: 60px;
    padding-right: 60px; 
    color: var(--white); 
}

.slide-title { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem; color: var(--white); text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.slide-excerpt { font-size: 1.125rem; margin-bottom: 2rem; color: var(--light-grey); }

/* Moved arrows closer to the edge */
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.3); color: var(--white); border-radius: 50%; font-size: 1.2rem; cursor: pointer; z-index: 10; transition: background 0.2s; display: grid; place-items: center; }
.slider-arrow:hover { background: var(--primary); border-color: var(--primary); }
.slider-arrow.prev { left: 1rem; }
.slider-arrow.next { right: 1rem; }

.slider-nav { position: absolute; bottom: 2rem; left: 0; right: 0; display: flex; justify-content: center; z-index: 10; }
.slider-dots { display: flex; gap: 0.5rem; background: rgba(0,0,0,0.4); padding: 0.5rem 0.75rem; border-radius: 999px; }
.slider-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; cursor: pointer; transition: 0.2s; }
.slider-dot.is-active { background: var(--gold); width: 24px; border-radius: 999px; }

/* --- Ticker --- */
.ticker-wrap { width: 100%; overflow: hidden; background: var(--primary) !important; padding: 1rem 0; }
.ticker { display: flex; white-space: nowrap; animation: ticker 20s linear infinite; }
.ticker__item { display: inline-block; padding: 0 2rem; font-size: 1.25rem; font-weight: 700; color: var(--white); text-transform: uppercase; }
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-50%, 0, 0); } }

/* --- Sections & Stats --- */
.section { padding: 6rem 0; }
.section-head { text-align: center; margin-bottom: 3rem; }
.eyebrow { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary) !important; background: var(--primary-bg); padding: 0.4rem 0.8rem; border-radius: 999px; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.stat { display: flex; flex-direction: column; padding: 2rem; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); position: relative; overflow: hidden; height: 100%; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary) !important; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--primary); line-height: 1.2; margin-bottom: 0.5rem; min-height: 2.2rem; }
.stat-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem; display: block; }
.stat-desc { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Story Cards --- */
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; padding: 0; margin: 0; list-style: none; }
.story-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s, box-shadow 0.3s; }
.story-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.story-card-img { position: relative; height: 240px; overflow: hidden; }
.story-card-img img { width: 100%; height: 100%; object-fit: cover; }
.story-card-badge { position: absolute; top: 1rem; left: 1rem; background: var(--primary) !important; color: var(--white); padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.story-card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.story-title a { color: var(--ink); font-weight: 700; }
.story-title a:hover { color: var(--primary) !important; }
.story-excerpt { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.5rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.story-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.story-link { font-weight: 600; color: var(--primary) !important; }
.story-share a { margin-left: 10px; color: var(--ink-soft); }
.story-share a:hover { color: var(--gold) !important; }

/* --- Layout Pages --- */
.page-hero { padding: 8rem 0 6rem; background-size: cover; background-position: center; text-align: center; position: relative; }
.page-layout-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: start; }
@media (min-width: 900px) { .page-layout-grid { grid-template-columns: 2.5fr 1fr; } }
.page-content { font-size: 1.1rem; line-height: 1.8; color: var(--ink-soft); }
.page-sidebar { background: var(--light-grey); padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.sidebar-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 1.5rem; border-bottom: 2px solid var(--primary) !important; padding-bottom: 0.75rem; }
.sidebar-card { display: flex; gap: 1rem; margin-bottom: 1.25rem; align-items: center; text-decoration: none; }
.sidebar-img { width: 85px !important; height: 85px !important; flex-shrink: 0 !important; border-radius: 8px; overflow: hidden; background-color: var(--border); }
.sidebar-img img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
.sidebar-text h4 { font-size: 0.95rem; font-weight: 700; margin: 0; color: var(--ink); }

/* --- Buttons --- */
.btn, .btn-primary { background-color: var(--primary) !important; color: var(--white) !important; border: none !important; padding: 0.875rem 1.5rem; border-radius: 8px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: background 0.2s; display: inline-block; text-decoration: none !important; text-align: center; }
.btn:hover, .btn-primary:hover { background-color: var(--primary-dark) !important; }
.hero-slider .btn { background-color: var(--gold) !important; color: var(--navy) !important; font-weight: 800; }
.hero-slider .btn:hover { background-color: var(--gold-dark) !important; color: var(--white) !important; }

/* --- About Page Cards --- */
.about-intro { max-width: 800px; margin: 0 auto 4rem auto; text-align: center; font-size: 1.1rem; line-height: 1.8; color: var(--ink-soft); }
.about-cards-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important; gap: 2rem !important; margin-top: 3rem; }
.about-card { background: var(--white) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-lg) !important; padding: 2.5rem !important; box-shadow: var(--shadow) !important; transition: transform 0.3s ease !important; display: flex !important; flex-direction: column !important; }
.about-card:hover { transform: translateY(-8px) !important; border-color: var(--primary) !important; }
.about-card.full-width { grid-column: 1 / -1 !important; }
.about-card-icon { width: 50px; height: 50px; background: var(--primary-bg) !important; color: var(--primary) !important; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1.5rem; }
.about-card-title { font-size: 1.5rem !important; font-weight: 800 !important; color: var(--primary) !important; margin-bottom: 1rem !important; }
.about-card-text { font-size: 1rem !important; line-height: 1.7 !important; color: var(--ink-soft) !important; flex-grow: 1; }
.about-card-list { list-style: none !important; padding: 0 !important; margin: 0 !important; font-size: 0.95rem !important; line-height: 1.6 !important; color: var(--ink-soft) !important; }
.about-card-list li { margin-bottom: 0.75rem !important; padding-left: 1.5rem !important; position: relative !important; }
.about-card-list li::before { content: '✓' !important; position: absolute !important; left: 0 !important; top: 0 !important; color: var(--primary) !important; font-weight: 900 !important; }

/* --- Testimonials --- */
.testimonial-static-grid { margin-top: 2rem; }
.testimonial-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 992px) { .testimonial-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .testimonial-row { grid-template-columns: 1fr; } }
.testimonial-card { display: flex; flex-direction: column; margin-bottom: 1rem; }
.testimonial-quote { background: var(--navy) !important; color: var(--white); padding: 2rem 2rem 2.5rem 2rem; border-radius: var(--radius-lg); position: relative; margin-bottom: 2rem; box-shadow: 0 8px 20px rgba(15,23,42,0.15); height: 240px; display: flex; flex-direction: column; overflow: hidden; }
.testimonial-quote::after { content: ''; position: absolute; bottom: -15px; left: 30px; border-width: 15px 15px 0; border-style: solid; border-color: var(--navy) transparent transparent transparent; }
.testimonial-text { font-size: 0.95rem; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.testimonial-profile { display: flex; flex-direction: column; align-items: flex-start; padding-left: 15px; }
.testimonial-img { width: 85px; height: 85px; border-radius: 50%; object-fit: cover; border: 4px solid var(--white); box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin-bottom: 0.75rem; margin-top: -50px; position: relative; z-index: 2; }
.testimonial-name { font-size: 1rem; font-weight: 800; color: var(--primary) !important; text-transform: uppercase; margin-bottom: 0.2rem; }
.testimonial-role { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; }

/* --- CKEditor Content Styles --- */
.story-body img, .page-content img { max-width: 100% !important; height: auto !important; border-radius: var(--radius); margin: 1.5rem 0; display: block; }
.story-body figure, .page-content figure { margin: 2rem 0; max-width: 100%; display: table; }
.story-body figure.image-style-align-center { margin-left: auto; margin-right: auto; }
.story-body figure.image-style-align-left { float: left; margin-right: 1.5rem; }
.story-body figure.image-style-align-right { float: right; margin-left: 1.5rem; }
.story-body figcaption { display: table-caption; caption-side: bottom; font-size: 0.85rem; color: var(--ink-soft); text-align: center; padding-top: 0.5rem; }
.story-body::after { content: ''; display: table; clear: both; }

/* --- Footer (Deep Navy) --- */
.site-footer { background-color: var(--navy) !important; color: rgba(255,255,255,0.7); padding: 3rem 0 2rem !important; border-top: 4px solid var(--primary); margin-top: 0; }
.site-footer a:hover { color: var(--gold) !important; }
.site-footer img { margin-bottom: 0.5rem !important; background: var(--white); padding: 5px; border-radius: 8px; }
.site-footer p { margin-bottom: 0.5rem !important; }
.text-center { text-align: center; }

/* --- Back to Top --- */
#backToTop { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background-color: var(--primary) !important; color: var(--white) !important; border: none; border-radius: 8px; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 9999; transition: all 0.3s ease; opacity: 0; visibility: hidden; transform: translateY(20px); display: flex; align-items: center; justify-content: center; }
#backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { background-color: var(--gold) !important; color: var(--navy) !important; transform: translateY(-5px); }

/* --- Responsive Navigation --- */
.mobile-nav-toggle { display: none; background: transparent; border: none; font-size: 1.5rem; color: var(--white); cursor: pointer; padding: 0.5rem; }

@media (max-width: 1150px) {
    .header-flex { flex-direction: column; align-items: flex-start; }
    .nav-primary { width: 100%; justify-content: flex-start; margin-top: 0.5rem; }
    .block-menu { justify-content: flex-start; }
}

@media (max-width: 991px) {
    .mobile-nav-toggle { display: block; position: absolute; top: 20px; right: 4vw; }
    .header-flex { position: relative; flex-direction: row; align-items: center; }
    .nav-primary { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); padding: 1rem; box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-top: 1px solid rgba(255,255,255,0.1); z-index: 999; flex-direction: column; margin-top: 0; }
    .nav-primary.open { display: flex; }
    .block-menu { flex-direction: column; gap: 0.5rem; width: 100%; }
    .block-menu li { width: 100%; }
    .block-menu a { width: 100%; text-align: center; padding: 12px; }
    .submenu { position: static; box-shadow: none; border: none; background: rgba(255,255,255,0.05); padding-left: 1rem; display: none; width: 100%; }
    .has-submenu.active .submenu { display: block; }
}

@media (max-width: 768px) {
    .top-bar .container { flex-direction: column !important; justify-content: center !important; text-align: center; }
    .top-social { margin-bottom: 8px; }
    .top-social a { margin: 0 5px !important; }
    
    /* --- Slider Mobile Adjustments --- */
    .hero-slider {
        height: 450px;
    }
    .slide-body .container {
        margin-left: auto;
        margin-right: auto;
        padding: 0 5%;
        text-align: center;
    }
    .slide-media::after {
        background: rgba(15,23,42,0.7);
    }
}

/* --- Partners Grid (Homepage) --- */
.partner-grid { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 1.5rem; 
    margin-top: 2rem; 
}
.partner-card { 
    background: var(--white); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    padding: 1.5rem; 
    width: 180px; 
    height: 120px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 4px 12px rgba(15,23,42,0.03); 
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; 
    text-decoration: none; 
}
.partner-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); 
    border-color: var(--primary-light); 
}
.partner-card img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}
@media (max-width: 576px) {
    .partner-card { width: calc(50% - 1rem); height: 100px; padding: 1rem; }
}

/* --- SPS Leadership Page --- */
.leadership-section {
    background-color: var(--light-grey);
    padding: 5rem 0;
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.leader-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    padding-top: 3rem; 
}

.leader-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.1);
    border-color: var(--primary);
}

.leader-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 0 auto 1.5rem auto;
    background-color: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 800;
}

.leader-body {
    padding: 0 1.5rem 2rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.leader-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.leader-role {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
    min-height: 40px;
}

.leader-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--ink-soft);
    text-decoration: none;
    background: var(--light-grey);
    padding: 8px 16px;
    border-radius: 999px;
    transition: all 0.2s;
    margin-top: auto;
}

.leader-email:hover {
    background: var(--primary);
    color: var(--white);
}

.leader-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gold);
}

@media (max-width: 768px) {
    .leadership-grid {
        grid-template-columns: 1fr;
    }
}