/* ============================================================
   Free Sight Association - Main Stylesheet
   ============================================================ */

/* ---------- Base ---------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}
.font-poppins { font-family: 'Poppins', sans-serif; }

/* ---------- Buttons ---------- */
.btn-primary {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.btn-primary, .btn-primary:visited, .btn-primary:hover, .btn-primary:focus { color: #ffffff; }
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #8d1a1a 100%);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.4);
}

/* ---------- Header / Nav ---------- */
header {
    transition: box-shadow 0.35s ease, backdrop-filter 0.35s ease, background 0.35s ease;
}
header.is-scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.nav-link {
    position: relative;
    padding: 8px 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.1); }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 12px; right: 12px;
    height: 2px;
    background: #ff6655;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

.mobile-menu { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a.font-medium,
.mobile-menu a.active {
    background: rgba(255,255,255,0.12);
    border-left: 3px solid #ff6655;
    padding-left: calc(1rem - 3px);
    border-radius: 0 8px 8px 0;
}

@media (max-width: 1023px) {
    .mobile-menu { transform: translateX(100%); }
    .nav-links { display: none; }
}
/* Dimmed backdrop behind the open mobile drawer */
.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 45;
}
.menu-backdrop.open { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }
.mobile-menu { z-index: 50; }

/* ---------- Cards ---------- */
.feature-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.4s ease;
}
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(211,47,47,0.15);
    border-color: rgba(211,47,47,0.2);
}

/* ---------- Badges ---------- */
.badge-ecosoc {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #4a2800;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Mission icon box ---------- */
.icon-box {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(211,47,47,0.3);
}

/* ---------- Stats counter ---------- */
.stats-counter { font-feature-settings: "tnum"; }

/* ============================================================
   HOME — Hero Slider
   ============================================================ */
.hero-slider {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    min-height: 520px;
    max-height: 780px;
    overflow: hidden;
}
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(1.05); /* force GPU layer + Ken Burns */
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.slide.active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    z-index: 2;
}
.slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18,10,10,0.55) 0%, rgba(18,10,10,0.52) 45%, rgba(92,14,14,0.8) 100%);
}
/* Hero photos from the FSA Facebook page (img/facebook/). */
.slide-1 { background-image: url('../../img/facebook/hero-1.jpg'); }
.slide-2 { background-image: url('../../img/facebook/hero-2.jpg'); }
.slide-3 { background-image: url('../../img/facebook/hero-3.jpg'); }
.slide-4 { background-image: url('../../img/facebook/hero-4.jpg'); }

/* Serve smaller variants on mobile — saves ~70% bytes on first paint. */
@media (max-width: 768px) {
    .slide-1 { background-image: url('../../img/facebook/hero-1-sm.jpg'); }
    .slide-2 { background-image: url('../../img/facebook/hero-2-sm.jpg'); }
    .slide-3 { background-image: url('../../img/facebook/hero-3-sm.jpg'); }
    .slide-4 { background-image: url('../../img/facebook/hero-4-sm.jpg'); }
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 0 1.5rem;
    max-width: 1000px;
    transform: translate3d(0, 24px, 0);
    opacity: 0;
    /* Only animate the properties that actually change — `all` triggers
       jank (e.g. transitioning layout properties like margin/padding). */
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
    will-change: opacity, transform;
}
.slide.active .slide-content {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}
.slide-content h1,
.slide-content h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.slide-content p {
    text-shadow: 0 1px 12px rgba(0,0,0,0.55);
    font-size: clamp(1rem, 2vw, 1.35rem);
    max-width: 720px;
    margin: 0 auto 2rem;
    opacity: 0.95;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}
.slider-arrow:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-50%) scale(1.1);
}
.arrow-prev { left: 20px; }
.arrow-next { right: 20px; }

@media (max-width: 1023px) {
    /* Arrows move to the bottom row beside the dots so they never cover the copy. */
    .slider-arrow { width: 38px; height: 38px; top: auto; bottom: 18px; transform: none; }
    .slider-arrow:hover { transform: scale(1.05); }
    .arrow-prev { left: 16px; }
    .arrow-next { right: 16px; }
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}
.dot.active {
    background: #ff6655;
    width: 36px;
    border-radius: 6px;
}
.dot:focus-visible {
    outline: 2px solid #ff6655;
    outline-offset: 3px;
}

/* ---------- Partner scroll ---------- */
.animate-scroll {
    animation: scroll-partners 30s linear infinite;
    will-change: transform;
}
@keyframes scroll-partners {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 768px) {
    /* Slower on mobile — the same visual speed feels faster on a narrower screen. */
    .animate-scroll { animation-duration: 45s; }
}
.partner-image {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: grayscale(30%);
    opacity: 0.85;
}
.partner-image:hover {
    transform: scale(1.1);
    filter: grayscale(0%);
    opacity: 1;
}
@media (max-width: 768px) {
    .partner-image { height: 38px; }
}

/* ============================================================
   BLOG
   ============================================================ */
.blog-hero {
    background: linear-gradient(135deg, #d32f2f, #8d1a1a);
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,102,85,0.3), transparent 60%);
}

.blog-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(211,47,47,0.15);
}
.blog-img {
    height: 200px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}
.cat-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    color: #d32f2f;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 999px;
    background: white;
    color: #333;
    font-weight: 500;
    border: 1px solid #e5e5e5;
    transition: all 0.3s;
    cursor: pointer;
}
.filter-btn:hover { border-color: #d32f2f; color: #d32f2f; }
.filter-btn.active {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(211,47,47,0.3);
}

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
    background: white;
    border-radius: 1rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.modal-hero {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 2;
    font-size: 1.25rem;
}
.modal-body { padding: 2rem; }
.modal-body h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.modal-body h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: #d32f2f;
    margin: 1.75rem 0 0.75rem;
}
.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.75;
    color: #444;
}
.modal-body ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #444;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-hero {
    background: linear-gradient(135deg, #8d1a1a, #4a0d0d);
    position: relative;
    overflow: hidden;
}
.projects-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 40%, rgba(255,102,85,0.25), transparent 60%);
}

.project-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(211,47,47,0.15);
}
.project-banner {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
}
.status-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.95);
    font-weight: 700;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.programme-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #003399; /* EU blue */
    color: #ffcc00;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.programme-pill i { font-size: 0.6rem; }

/* ---------- Home: Youth & Erasmus+ spotlight ---------- */
.youth-feature {
    display: block;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.youth-feature:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(211,47,47,0.15); }
.youth-feature-img {
    position: relative;
    height: 220px;
    background-size: cover;
    background-position: center;
}
.youth-mini {
    display: block;
    background: #f9fafb;
    border: 1px solid #f0f0f0;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.youth-mini:hover { border-color: #f3c4c4; background: white; }
.status-ongoing { color: #0a7c2e; }
.status-completed { color: #1e40af; }
.status-upcoming { color: #b45309; }

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.75rem;
    color: #666;
}
.project-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    background: white;
    border: 2px dashed #e5e5e5;
    border-radius: 1rem;
}

/* ============================================================
   DETAIL PAGES (blog-detail, project-detail)
   ============================================================ */
.article-hero {
    position: relative;
    background-color: #8d1a1a;
    background-size: cover;
    background-position: center;
}

.article-body {
    color: #2d3748;
    font-size: 1.0625rem;
    line-height: 1.8;
}
.article-body .lead {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #1a202c;
    font-weight: 500;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 4px solid #d32f2f;
}
.article-body h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    color: #1a202c;
    margin: 2.5rem 0 1rem;
    line-height: 1.25;
}
.article-body h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #1a202c;
    margin: 1.75rem 0 0.75rem;
}
.article-body p {
    margin-bottom: 1.25rem;
    color: #2d3748;
}
.article-body ul, .article-body ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}
.article-body li {
    margin-bottom: 0.6rem;
    color: #2d3748;
}
.article-body strong { color: #1a202c; font-weight: 700; }
.article-body blockquote {
    border-left: 4px solid #d32f2f;
    background: #fef5f5;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.125rem;
    color: #4a0d0d;
    border-radius: 0 0.5rem 0.5rem 0;
}
/* Inline links in body text only — scoped narrowly so buttons/cards
   inside .article-body keep their own colors. */
.article-body p a,
.article-body li a,
.article-body blockquote a {
    color: #d32f2f;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article-body p a:hover,
.article-body li a:hover,
.article-body blockquote a:hover { color: #8d1a1a; }

/* Defensive: any button inside article body keeps its button styling. */
.article-body .btn-primary,
.article-body .btn-primary:hover,
.article-body .btn-primary:focus,
.article-body .btn-primary:visited {
    color: #ffffff;
    text-decoration: none;
}
.article-body .share-btn { text-decoration: none; }

/* Global objective callout */
.article-body .global-objective {
    background: linear-gradient(135deg, #fff4f4, #ffe8e8);
    border-left: 4px solid #d32f2f;
    padding: 1.1rem 1.35rem;
    border-radius: 0 0.6rem 0.6rem 0;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #1a202c;
    margin: 0 0 2rem;
    font-weight: 500;
}

/* Objective & outcome lists */
.article-body .objective-list,
.article-body .outcome-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}
.article-body .objective-list li,
.article-body .outcome-list li {
    position: relative;
    padding: 0.6rem 0 0.6rem 2rem;
    border-bottom: 1px dashed #eee;
    color: #2d3748;
    line-height: 1.6;
}
.article-body .objective-list li:last-child,
.article-body .outcome-list li:last-child { border-bottom: none; }
.article-body .objective-list li::before,
.article-body .outcome-list li::before {
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
}
.article-body .objective-list li::before {
    content: '\f00c'; /* fa-check */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    background: linear-gradient(135deg, #d32f2f, #8d1a1a);
}
.article-body .outcome-list li::before {
    content: '\f091'; /* fa-trophy */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    background: linear-gradient(135deg, #16a34a, #15803d);
}
.article-body .outcome-list li a {
    color: #d32f2f;
    text-decoration: underline;
    font-weight: 500;
}

/* Sidebar box on project detail */
.sidebar-box {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
@media (min-width: 1024px) {
    .sidebar-box {
        position: sticky;
        top: 100px;
    }
}

/* Share buttons */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}
.share-btn:hover {
    background: #d32f2f;
    color: white;
    transform: translateY(-2px);
}

/* ============================================================
   MODERN FOOTER
   ============================================================ */
.site-footer {
    background: linear-gradient(180deg, #111 0%, #000 100%);
    color: #e5e7eb;
    padding-top: 4rem;
    position: relative;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d32f2f, #ff6655, #d32f2f);
}
.footer-col h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-col h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 2px;
    background: #ff6655;
}
.footer-col a,
.footer-col li {
    color: #b0b3b8;
    font-size: 0.9rem;
    line-height: 1.9;
    transition: all 0.25s ease;
    display: inline-block;
}
.footer-col a:hover {
    color: #ff6655;
    transform: translateX(3px);
}
.footer-col ul li {
    display: block;
}
.footer-contact p {
    color: #b0b3b8;
    font-size: 0.875rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}
.footer-contact a,
.footer-contact span { min-width: 0; overflow-wrap: anywhere; }
.footer-contact a:hover { transform: none; }
.footer-contact i {
    color: #ff6655;
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 16px;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    transition: all 0.3s ease;
}
.footer-social a:hover {
    background: #d32f2f;
    border-color: #d32f2f;
    color: white;
    transform: translateY(-3px);
}

.footer-newsletter input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.footer-newsletter input::placeholder { color: #6b7280; }
.footer-newsletter input:focus {
    outline: none;
    border-color: #ff6655;
    background: rgba(255,255,255,0.08);
}
.footer-newsletter button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.footer-newsletter button:hover {
    background: linear-gradient(135deg, #b71c1c, #8d1a1a);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 3rem;
    padding: 1.5rem 0;
    font-size: 0.8125rem;
    color: #9ca3af;
}
.footer-bottom a { color: #9ca3af; transition: color 0.25s ease; }
.footer-bottom a:hover { color: #ff6655; }

.footer-brand-tagline {
    color: #9ca3af;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 1rem;
    max-width: 320px;
}

.badge-inline-ecosoc {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    background: rgba(255,215,0,0.12);
    color: #ffd700;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   ABOUT — HERO + CORE BLOCKS
   ============================================================ */
.about-hero {
    background: linear-gradient(135deg, #8d1a1a 0%, #4a0d0d 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
.about-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 500px at 85% 0%, rgba(255,102,85,0.25), transparent 60%),
        radial-gradient(700px 400px at 10% 100%, rgba(255,255,255,0.08), transparent 60%);
    pointer-events: none;
}

/* About stat stack (hero-adjacent) */
.about-stat-stack {
    display: grid;
    gap: 0.85rem;
}
.about-stat {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border-radius: 0.85rem;
    border: 1px solid #f1f1f1;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}
.about-stat:hover {
    border-color: rgba(211,47,47,0.2);
    box-shadow: 0 10px 28px rgba(211,47,47,0.12);
    transform: translateX(4px);
}
.about-stat-num {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: #d32f2f;
    min-width: 64px;
}
.about-stat-label { color: #4a5568; font-size: 0.95rem; }

/* Mission / Vision / Values pillar cards */
.pillar-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid #ececec;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.pillar-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, #d32f2f, #ff6655);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.pillar-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(211,47,47,0.15);
    border-color: rgba(211,47,47,0.15);
}
.pillar-card:hover::before { transform: scaleX(1); }
.pillar-icon {
    width: 56px; height: 56px;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #fff4f4, #ffe0e0);
    color: #d32f2f;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

/* Approach steps */
.approach-step {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    border: 1px solid #ececec;
    transition: all 0.3s ease;
    position: relative;
}
.approach-step:hover {
    transform: translateY(-4px);
    border-color: rgba(211,47,47,0.25);
    box-shadow: 0 12px 30px rgba(211,47,47,0.12);
}
.approach-num {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #d32f2f, #ff6655);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.75rem;
    display: block;
}

/* Focus area tiles */
.focus-tile {
    background: white;
    border: 1px solid #ececec;
    border-radius: 0.85rem;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}
.focus-tile i {
    width: 48px; height: 48px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #fff4f4, #ffe0e0);
    color: #d32f2f;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.focus-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(211,47,47,0.3);
    box-shadow: 0 10px 28px rgba(211,47,47,0.15);
    color: #d32f2f;
}
.focus-tile:hover i {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    transform: scale(1.05);
}

/* Recognition list */
.recognition-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f1f1;
}
.recognition-item:last-child { border-bottom: none; }
.recognition-icon {
    width: 44px; height: 44px;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #fff4f4, #ffe0e0);
    color: #d32f2f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ECOSOC hero card (right column of recognition) */
.ecosoc-hero {
    background: linear-gradient(135deg, #d32f2f 0%, #8d1a1a 100%);
    border-radius: 1.25rem;
    padding: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(141,26,26,0.35);
}
.ecosoc-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 55%);
    pointer-events: none;
}
.ecosoc-hero-inner { position: relative; z-index: 1; }
.ecosoc-hero-badge {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #4a2800;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 22px rgba(255,176,0,0.4);
}

/* ============================================================
   ABOUT — TIMELINE
   ============================================================ */
.timeline-rail {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 0;
}
.timeline-line {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 3px;
    background: linear-gradient(180deg, transparent, #d32f2f 10%, #d32f2f 90%, transparent);
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0.25;
}
.timeline-items { position: relative; z-index: 1; }

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1rem 2.5rem;
    opacity: 0.55;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.timeline-item.is-active { opacity: 1; transform: translateY(0); }
.timeline-left  { left: 0;  padding-right: 3rem; }
.timeline-right { left: 50%; padding-left: 3rem; }

.timeline-dot {
    position: absolute;
    top: 1.75rem;
    width: 54px; height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d32f2f, #8d1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    border: 4px solid #f9fafb;
    box-shadow: 0 8px 20px rgba(211,47,47,0.35);
    z-index: 2;
}
.timeline-left  .timeline-dot { right: -27px; }
.timeline-right .timeline-dot { left: -27px; }

.timeline-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 28px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.35s ease;
}
.timeline-item.is-active .timeline-card {
    box-shadow: 0 16px 40px rgba(211,47,47,0.18);
    border-color: rgba(211,47,47,0.2);
}
.timeline-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #eee;
}
.timeline-count {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a51c1c;
    background: rgba(211,47,47,0.08);
    padding: 4px 10px;
    border-radius: 999px;
}
.timeline-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.timeline-project {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.6rem;
    color: #2d3748;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    border: 1px solid transparent;
}
.timeline-project:hover {
    background: rgba(211,47,47,0.05);
    border-color: rgba(211,47,47,0.15);
    transform: translateX(2px);
}
.timeline-icon {
    width: 30px; height: 30px;
    border-radius: 0.45rem;
    background: linear-gradient(135deg, #fff4f4, #ffe5e5);
    color: #d32f2f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}
.timeline-project-title {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.875rem;
    line-height: 1.3;
    flex: 1;
    /* Keep to a single line — full title shown as tooltip on hover. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.timeline-arrow {
    color: #d32f2f;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.timeline-project:hover .timeline-arrow {
    opacity: 1;
    transform: translateX(0);
}
/* Tighter gap inside timeline cards now that rows are smaller */
.timeline-list { gap: 0.3rem !important; }

/* Mobile — stack timeline on the right of the line */
@media (max-width: 768px) {
    .timeline-line { left: 24px; }
    .timeline-item,
    .timeline-left,
    .timeline-right {
        width: 100%;
        left: 0;
        padding-left: 3.5rem;
        padding-right: 0.5rem;
    }
    .timeline-left  .timeline-dot,
    .timeline-right .timeline-dot {
        left: -3px;
        right: auto;
        width: 44px; height: 44px;
        font-size: 0.75rem;
    }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-hero {
    background: linear-gradient(135deg, #8d1a1a 0%, #4a0d0d 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
.contact-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 500px at 90% 10%, rgba(255,102,85,0.25), transparent 60%),
        radial-gradient(600px 400px at 0% 100%, rgba(255,255,255,0.08), transparent 60%);
    pointer-events: none;
}

.contact-channel {
    background: white;
    border: 1px solid #eee;
    border-radius: 1rem;
    padding: 1.75rem;
    text-decoration: none;
    color: #1a202c;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.contact-channel::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #d32f2f, #ff6655);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.contact-channel:hover {
    transform: translateY(-4px);
    border-color: rgba(211,47,47,0.25);
    box-shadow: 0 18px 40px rgba(211,47,47,0.12);
}
.contact-channel:hover::before { transform: scaleY(1); }
.contact-channel-icon {
    width: 46px; height: 46px;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, #fff4f4, #ffe0e0);
    color: #d32f2f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.contact-channel:hover .contact-channel-icon { transform: scale(1.08); }

/* Brand-coloured icon tiles */
.contact-channel-icon-fb {
    background: linear-gradient(135deg, #e7f0fd, #dbe8fb);
    color: #1877f2;
}
.contact-channel-icon-yt {
    background: linear-gradient(135deg, #ffe6e6, #ffd0d0);
    color: #ff0000;
}
.contact-channel-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
}
.contact-channel-value {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a202c;
    word-break: break-word;
}
.contact-channel-note { font-size: 0.8rem; color: #6b7280; }

/* Form card */
.contact-form-card {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}
@media (min-width: 768px) { .contact-form-card { padding: 2.5rem; } }

.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}
.form-field .required { color: #d32f2f; }
.form-field .optional { color: #6b7280; font-weight: 400; font-size: 0.75rem; }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.75rem 0.95rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-family: inherit;
    color: #1a202c;
    background: #fafafa;
    transition: all 0.25s ease;
}
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: #cbd5e0;
    background: white;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #d32f2f;
    background: white;
    box-shadow: 0 0 0 4px rgba(211,47,47,0.12);
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field input:user-invalid,
.form-field select:user-invalid,
.form-field textarea:user-invalid {
    border-color: #ef4444;
    background: #fff5f5;
}
.form-counter {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
}
.form-counter .near-limit { color: #d32f2f; font-weight: 600; }

.form-checkbox {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
    width: 18px; height: 18px;
    margin-top: 2px;
    accent-color: #d32f2f;
    cursor: pointer;
    flex-shrink: 0;
}

.form-status {
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    line-height: 1.4;
}
.form-status.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.form-status.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Submit disabled state */
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Info sidebar */
.info-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}
.info-card:hover {
    border-color: rgba(211,47,47,0.2);
    box-shadow: 0 10px 30px rgba(211,47,47,0.08);
    transform: translateY(-2px);
}
.info-card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a202c;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
}
.info-card-link {
    color: #d32f2f;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}
.info-card-link:hover { text-decoration: underline; }

.info-card-dark {
    background: linear-gradient(135deg, #d32f2f, #8d1a1a);
    border-color: transparent;
    color: white;
    box-shadow: 0 20px 40px rgba(141,26,26,0.25);
}
.info-card-dark:hover {
    box-shadow: 0 25px 50px rgba(141,26,26,0.35);
}
.info-card-title-dark {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: white;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
}

/* Map */
.map-embed {
    width: 100%;
    height: 420px;
    background: #e5e7eb;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
}
.map-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    filter: contrast(1.02);
}

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 0.85rem;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}
.faq-item[open] {
    border-color: rgba(211,47,47,0.25);
    box-shadow: 0 10px 28px rgba(211,47,47,0.08);
}
.faq-item summary {
    cursor: pointer;
    padding: 1.1rem 1.25rem;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '\002B'; /* + */
    font-size: 1.5rem;
    color: #d32f2f;
    margin-left: 1rem;
    font-weight: 400;
    transition: transform 0.25s ease;
    line-height: 1;
}
.faq-item[open] summary::after {
    content: '\2212'; /* − */
    transform: rotate(0);
}
.faq-item p {
    padding: 0 1.25rem 1.25rem;
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
}
.faq-item p a { color: #d32f2f; text-decoration: underline; }

/* ============================================================
   BACK-TO-TOP FLOATING BUTTON
   ============================================================ */
#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d32f2f, #8d1a1a);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(211,47,47,0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    z-index: 40;
    font-size: 1rem;
}
#back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
#back-to-top:hover {
    box-shadow: 0 12px 30px rgba(211,47,47,0.55);
    transform: translateY(-3px) scale(1.05);
}
#back-to-top:active { transform: translateY(-1px) scale(0.98); }
#back-to-top:focus-visible { outline: 3px solid rgba(255,102,85,0.6); outline-offset: 3px; }
@media (max-width: 640px) {
    #back-to-top { bottom: 16px; right: 16px; width: 42px; height: 42px; }
}

/* ============================================================
   FOOTER CREDIT (MSAI Systems)
   ============================================================ */
.footer-credit {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.msai-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #e5e7eb;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 8px;
    border-radius: 6px;
}
.msai-mark:hover {
    color: white;
    background: rgba(255,255,255,0.04);
}


/* ============================================================
   SMOOTH REVEAL ANIMATIONS
   (only applied when <html class="js-enabled"> so no-JS users
    still see content.)
   ============================================================ */
html { scroll-behavior: smooth; }

.js-enabled .reveal,
.js-enabled .feature-card,
.js-enabled .blog-card,
.js-enabled .project-card,
.js-enabled .card-hover,
.js-enabled .timeline-item,
.js-enabled section > .container > h2,
.js-enabled .stats-card {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-enabled .reveal.is-in-view,
.js-enabled .feature-card.is-in-view,
.js-enabled .blog-card.is-in-view,
.js-enabled .project-card.is-in-view,
.js-enabled .card-hover.is-in-view,
.js-enabled .timeline-item.is-in-view,
.js-enabled section > .container > h2.is-in-view,
.js-enabled .stats-card.is-in-view {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
/* Snappier on mobile */
@media (max-width: 640px) {
    .js-enabled .reveal,
    .js-enabled .feature-card,
    .js-enabled .blog-card,
    .js-enabled .project-card,
    .js-enabled .card-hover,
    .js-enabled .timeline-item,
    .js-enabled section > .container > h2,
    .js-enabled .stats-card {
        transform: translate3d(0, 16px, 0);
        transition-duration: 0.5s;
    }
}

/* Stagger by index (data-reveal-index) inside a group */
.js-enabled [data-reveal-index="0"] { transition-delay: 0.00s; }
.js-enabled [data-reveal-index="1"] { transition-delay: 0.07s; }
.js-enabled [data-reveal-index="2"] { transition-delay: 0.14s; }
.js-enabled [data-reveal-index="3"] { transition-delay: 0.21s; }
.js-enabled [data-reveal-index="4"] { transition-delay: 0.28s; }
.js-enabled [data-reveal-index="5"] { transition-delay: 0.35s; }
.js-enabled [data-reveal-index="6"] { transition-delay: 0.42s; }
.js-enabled [data-reveal-index="7"] { transition-delay: 0.49s; }
/* On mobile, cut the stagger nearly in half — waiting for card 7 before it
   fades in feels sluggish on small screens where you're scrolling fast. */
@media (max-width: 640px) {
    .js-enabled [data-reveal-index="1"] { transition-delay: 0.04s; }
    .js-enabled [data-reveal-index="2"] { transition-delay: 0.08s; }
    .js-enabled [data-reveal-index="3"] { transition-delay: 0.12s; }
    .js-enabled [data-reveal-index="4"] { transition-delay: 0.16s; }
    .js-enabled [data-reveal-index="5"] { transition-delay: 0.20s; }
    .js-enabled [data-reveal-index="6"] { transition-delay: 0.24s; }
    .js-enabled [data-reveal-index="7"] { transition-delay: 0.28s; }
}

/* Subtle nav-link fade-in */
.js-enabled header .nav-link,
.js-enabled header a {
    animation: navFade 0.5s ease backwards;
}
.js-enabled header .nav-links > li:nth-child(1) a { animation-delay: 0.05s; }
.js-enabled header .nav-links > li:nth-child(2) a { animation-delay: 0.10s; }
.js-enabled header .nav-links > li:nth-child(3) a { animation-delay: 0.15s; }
.js-enabled header .nav-links > li:nth-child(4) a { animation-delay: 0.20s; }
.js-enabled header .nav-links > li:nth-child(5) a { animation-delay: 0.25s; }
.js-enabled header .nav-links > li:nth-child(6) a { animation-delay: 0.30s; }
@keyframes navFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Page load shell */
.js-enabled main { animation: pageFade 0.6s ease; }
@keyframes pageFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Button press micro-interaction */
.btn-primary:active { transform: translateY(-1px) scale(0.98); }
.share-btn:active,
.filter-btn:active { transform: translateY(0); }

/* Card lift smoothing */
.feature-card, .blog-card, .project-card {
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Partner loop — pause on hover for accessibility.
   Watched at the parent wrapper so hovering text/whitespace also pauses. */
.animate-scroll:hover,
.animate-scroll:focus-within { animation-play-state: paused; }

/* Slider arrows — pulse on focus */
.slider-arrow:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.45);
}

/* Timeline-item entry refinement */
.js-enabled .timeline-item {
    transform: translateY(30px) scale(0.98);
}
.js-enabled .timeline-item.is-in-view {
    transform: translateY(0) scale(1);
}

/* Photo gallery inside articles */
.article-body .post-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.75rem 0;
}
.article-body .post-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.75rem;
    margin: 0;
}

/* ============================================================
   MOTION LAYER
   ============================================================ */

/* Hero slider: badge, title, copy, and buttons arrive one after another */
.slide .slide-content > * {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide.active .slide-content > * { opacity: 1; transform: none; }
.slide.active .slide-content > *:nth-child(1) { transition-delay: 0.25s; }
.slide.active .slide-content > *:nth-child(2) { transition-delay: 0.38s; }
.slide.active .slide-content > *:nth-child(3) { transition-delay: 0.51s; }
.slide.active .slide-content > *:nth-child(4) { transition-delay: 0.64s; }

/* Inner-page heroes: staggered entrance on load */
@keyframes heroUp {
    from { opacity: 0; transform: translate3d(0, 20px, 0); }
    to   { opacity: 1; transform: none; }
}
.projects-hero .container > *,
.blog-hero .container > *,
.article-hero .container > *,
.about-hero .container > div > *,
.contact-hero .container > div > * {
    animation: heroUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
:is(.projects-hero, .blog-hero, .article-hero) .container > *:nth-child(2),
:is(.about-hero, .contact-hero) .container > div > *:nth-child(2) { animation-delay: 0.1s; }
:is(.projects-hero, .blog-hero, .article-hero) .container > *:nth-child(3),
:is(.about-hero, .contact-hero) .container > div > *:nth-child(3) { animation-delay: 0.2s; }
:is(.projects-hero, .blog-hero, .article-hero) .container > *:nth-child(n+4),
:is(.about-hero, .contact-hero) .container > div > *:nth-child(n+4) { animation-delay: 0.3s; }

/* Card imagery: slow zoom on hover */
.project-banner, .youth-feature-img { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.project-card { overflow: hidden; }
.project-card:hover .project-banner,
.youth-feature:hover .youth-feature-img { transform: scale(1.04); }
.project-banner i, .blog-img i { transition: transform 0.4s ease; }
.project-card:hover .project-banner i,
.blog-card:hover .blog-img i { transform: scale(1.12); }
.youth-feature { overflow: hidden; }

/* Icon boxes lift slightly with their card */
.feature-card .icon-box { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.feature-card:hover .icon-box { transform: translateY(-3px) rotate(-4deg); }

/* Header condenses after scrolling */
/* Header is exactly as tall as the 80px (pt-20) every page reserves for it */
header nav { height: 80px; padding-top: 0 !important; padding-bottom: 0 !important; transition: height 0.3s ease; }
header.is-scrolled nav { height: 64px; }
header img { transition: width 0.3s ease, height 0.3s ease; }
@media (min-width: 1024px) {
    header.is-scrolled nav img { width: 2.75rem; height: 2.75rem; }
}

/* Partner logos: pause the marquee while the visitor looks */
.animate-scroll:hover { animation-play-state: paused; }

/* Filter buttons: smooth state change */
.filter-btn { transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease; }

/* Reading progress (blog and project detail pages) */
#read-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #ffcc00, #ff6655);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 60;
    pointer-events: none;
}

/* ============================================================
   UX POLISH — touch targets, drawer, swipeable filters
   ============================================================ */

/* Hamburger: 44px target with a visible keyboard focus ring */
#menu-toggle {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    margin-right: -10px;
}
#menu-toggle:focus-visible,
#close-menu:focus-visible { outline: 3px solid #ffcc00; outline-offset: 2px; }
#close-menu { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* Closed drawer: no shadow bleeding into the page, not reachable by Tab */
.mobile-menu { visibility: hidden; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s; }
.mobile-menu.open { visibility: visible; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s; }

/* Slider: bigger hit areas without changing the look */
.dot { position: relative; }
.dot::after { content: ''; position: absolute; inset: -16px -5px; }
@media (max-width: 1023px) {
    .slider-arrow { width: 44px; height: 44px; }
}

/* Footer: comfortable tap rows on touch screens */
.footer-social a { width: 44px; height: 44px; }
@media (pointer: coarse) {
    .footer-col ul li a { display: inline-block; padding: 0.55rem 0; }
    .footer-col ul li { margin-bottom: 0; }
    .footer-bottom a { display: inline-block; padding: 0.75rem 0.25rem; }
    .footer-contact p { margin-bottom: 0; align-items: center; }
    .footer-contact p i { margin-top: 0; }
    .footer-contact a { display: inline-block; padding: 0.6rem 0; }
    .footer-contact p:has(span) { padding: 0.4rem 0; align-items: flex-start; }
    .footer-contact p:has(span) i { margin-top: 0.25rem; }
    main a.inline-flex, .info-card-link, .share-btn,
    .youth-feature + .grid a, .text-\[\#d32f2f\].font-semibold.text-sm { min-height: 44px; align-items: center; }
    #library-grid a.btn-primary, #lib-grid a.btn-primary { min-height: 44px; }
}

/* Header subtitle was 9px on phones */
@media (max-width: 640px) {
    header a .leading-tight > div:last-child { font-size: 10.5px; }
}

/* Featured home cards keep their photo edge-to-edge on phones */
.feature-card.youth-feature { padding: 0 !important; }

/* Filter bars: one swipeable row on phones instead of 3-5 stacked rows */
@media (max-width: 640px) {
    div.filter-scroll {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        margin-left: -1rem; margin-right: -1rem;
        padding: 2px 1rem 6px;
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
                mask-image: linear-gradient(90deg, #000 85%, transparent);
    }
    div.filter-scroll::-webkit-scrollbar { display: none; }
    div.filter-scroll > * { flex-shrink: 0; scroll-snap-align: start; white-space: nowrap; }
    #library-filters { gap: 0.5rem; }
    #library-filters .filter-btn { padding: 0.55rem 1rem; font-size: 0.85rem; }
}

/* Reduced motion: show every partner logo in a wrapped grid instead of a frozen strip */
@media (prefers-reduced-motion: reduce) {
    .animate-scroll { animation: none !important; transform: none !important; flex-wrap: wrap; justify-content: center; }
    .animate-scroll > div { flex-wrap: wrap; justify-content: center; flex-shrink: 1; }
    .animate-scroll > div[aria-hidden="true"] { display: none; }
}

/* Reduced-motion guard — respect users who opt out */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        animation-delay: 0s !important;
        scroll-behavior: auto !important;
    }
    .js-enabled .reveal,
    .js-enabled .feature-card,
    .js-enabled .blog-card,
    .js-enabled .project-card,
    .js-enabled .card-hover,
    .js-enabled .timeline-item,
    .js-enabled section > .container > h2,
    .js-enabled .stats-card {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */

/* ---------- Tablet + mid-mobile ---------- */
@media (max-width: 768px) {

    /* Hero slider: don't lock tall min-height on small viewports */
    .hero-slider { height: auto; min-height: 480px; max-height: none; }
    .slide { padding: 2rem 0; }
    .slide-content { padding: 0 1rem; }
    /* Sticky filter bars: sit tighter under the fixed header */
    section.sticky { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    /* Reduce partner-scroll gap — too much breathing room on narrow screens */
    .animate-scroll { gap: 2rem !important; }
    .animate-scroll > div { gap: 2rem !important; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
    /* Article body */
    .article-body { font-size: 1rem; }
    .article-body .lead { font-size: 1.0625rem; padding-left: 0.75rem; }
    .sidebar-box { position: static; margin-top: 2rem; }

    /* Hero slider compact */
    .hero-slider { min-height: 600px; }
    .slide { padding: 2rem 0 5rem; }
    .slide-content h1 { line-height: 1.15; }
    .slide-content p { margin-bottom: 1.5rem; }
    .slider-dots { bottom: 31px; }

    /* Header: keep compact but readable */
    header a .leading-tight > div:first-child { font-size: 0.9rem; line-height: 1.15; }
    header a .leading-tight > div:last-child { font-size: 9px; line-height: 1.1; }

    /* Filter bars: minimum tap target 44px, comfortable spacing */
    .filter-btn {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }

    /* Nav links in mobile drawer — bigger tap target */
    .mobile-menu a { min-height: 48px; padding-top: 0.6rem; padding-bottom: 0.6rem; }

    /* Feature / blog / project / pillar / info cards — tighten */
    .feature-card, .pillar-card, .approach-step, .info-card, .contact-form-card {
        padding: 1.5rem !important;
    }
    .pillar-icon { width: 48px; height: 48px; font-size: 1.2rem; }
    .approach-num { font-size: 2rem; }

    /* Stats on home — keep readable */
    .stats-counter { font-size: clamp(1.6rem, 6vw, 2rem); }

    /* Timeline: tighter side padding, smaller dots */
    .timeline-rail { padding: 0; }
    .timeline-line { left: 18px; width: 2px; }
    .timeline-item,
    .timeline-left,
    .timeline-right {
        padding-left: 3rem !important;
        padding-right: 0 !important;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    .timeline-left  .timeline-dot,
    .timeline-right .timeline-dot {
        left: -2px;
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
        top: 1.5rem;
        border-width: 3px;
    }
    .timeline-card { padding: 1.25rem; border-radius: 0.85rem; }
    .timeline-card-head { flex-wrap: wrap; gap: 0.5rem; }
    .timeline-project { padding: 0.6rem; }
    .timeline-project-title { font-size: 0.9rem; }
    .timeline-project-meta { font-size: 0.7rem; }

    /* Contact form */
    .contact-form-card { padding: 1.25rem !important; }
    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 0.85rem 0.9rem;
        font-size: 16px; /* prevents iOS auto-zoom on focus */
    }
    .form-checkbox { font-size: 0.875rem; }
    .form-checkbox input[type="checkbox"] { width: 22px; height: 22px; }

    /* Info-card tighter */
    .info-card, .info-card-dark { padding: 1.25rem; }

    /* Focus tiles */
    .focus-tile { padding: 1rem 0.5rem; font-size: 0.8rem; }
    .focus-tile i { width: 42px; height: 42px; font-size: 1rem; }

    /* About stats stack */
    .about-stat { padding: 1rem 1.1rem; gap: 0.75rem; }
    .about-stat-num { font-size: 1.35rem; min-width: 48px; }
    .about-stat-label { font-size: 0.85rem; }

    /* Map height — don't eat the whole screen */
    .map-embed { height: 300px; }

    /* FAQ tighter */
    .faq-item summary { padding: 0.9rem 1rem; font-size: 0.95rem; }
    .faq-item p { padding: 0 1rem 1rem; font-size: 0.9rem; }

    /* Blog detail article hero — tame the big padding */
    .article-hero .container { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
    .article-body h2 { margin-top: 1.75rem; }

    /* Share buttons wrap nicely */
    .share-btn { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

    /* Recognition card (ecosoc-hero) tighter */
    .ecosoc-hero { padding: 1.75rem; }

    /* Contact channels card stack */
    .contact-channel { padding: 1.25rem; }
    .contact-channel-value { font-size: 0.95rem; }

    /* Back-to-top: avoid covering page content */
    #back-to-top { bottom: 14px; right: 14px; width: 40px; height: 40px; font-size: 0.9rem; }

    /* Modal card */
    .modal { border-radius: 0.85rem; max-height: 94vh; }
    .modal-hero { height: 160px; font-size: 3rem; }
    .modal-body { padding: 1.25rem; }
    .modal-body h1 { font-size: 1.35rem; }
    .modal-body h2 { font-size: 1.1rem; }

    /* Project banner height */
    .project-banner, .blog-img { height: 170px; font-size: 2.25rem; }

    /* Partner loop tighter */
    .animate-scroll { gap: 1.5rem !important; }
    .animate-scroll > div { gap: 1.5rem !important; }
    .partner-image { height: 32px; }
}

/* ---------- Very small phones (< 380px) ---------- */
@media (max-width: 380px) {
    /* Mobile drawer: don't eat the whole screen */
    .mobile-menu { width: 84vw !important; }
    /* Logo subtitle can disappear — header feels less cluttered */
    header a .leading-tight > div:last-child { display: none; }
    header a .leading-tight > div:first-child { font-size: 0.85rem; }
    /* Timeline even tighter */
    .timeline-item,
    .timeline-left,
    .timeline-right { padding-left: 2.75rem !important; }
    .timeline-line { left: 14px; }
    .timeline-left  .timeline-dot,
    .timeline-right .timeline-dot { width: 34px; height: 34px; font-size: 0.65rem; }
}

/* ---------- Prevent any horizontal overflow ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; } /* height left to per-iframe rules */


/* Project sidebar partner list: even spacing, not article list styles */
.article-body .sidebar-box ul.partner-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.article-body .sidebar-box ul.partner-list li { margin: 0 0 0.35rem; padding: 0; line-height: 1.45; }
