/**
 * APSPA – Asia Pacific School Psychology Association
 * Enhanced styles with Premium Aesthetic
 */

:root {
    --apspa-primary: #002D62;
    /* Deep Academic Navy */
    --apspa-primary-dark: #001f44;
    --apspa-secondary: #C8102E;
    /* Rich Academic Red */
    --apspa-accent: #D4AF37;
    /* Gold accent */
    --apspa-text: #1e293b;
    --apspa-text-muted: #475569;
    --apspa-border: #e2e8f0;
    --apspa-bg: #ffffff;
    --apspa-bg-alt: #f8fafc;
    --apspa-header-glass: rgba(255, 255, 255, 0.9);
    --apspa-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --apspa-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --apspa-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body.apspa-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--apspa-text);
    background: var(--apspa-bg);
}

h1,
h2,
h3,
h4,
.apspa-nav-link {
    font-family: 'Montserrat', sans-serif;
}

/* Header & Navigation */
.apspa-header {
    background: var(--apspa-header-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.apspa-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.apspa-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.apspa-logo:hover {
    transform: scale(1.02);
}

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

.apspa-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.apspa-nav-link {
    padding: 0.6rem 1rem;
    color: var(--apspa-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.apspa-nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--apspa-secondary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.apspa-nav-link:hover {
    color: var(--apspa-secondary);
}

.apspa-nav-link:hover::after,
.apspa-nav-link.active::after {
    transform: scaleX(1);
}

.apspa-nav-link.active {
    color: var(--apspa-secondary);
}

/* Dropdown */
.apspa-nav-dropdown {
    position: relative;
}

.apspa-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--apspa-border);
    border-radius: 8px;
    padding: 0.75rem 0;
    box-shadow: var(--apspa-shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    list-style: none;
}

.apspa-nav-dropdown:hover .apspa-nav-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.apspa-nav-dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: var(--apspa-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.apspa-nav-dropdown-menu li a:hover {
    background: var(--apspa-bg-alt);
    color: var(--apspa-secondary);
    padding-left: 1.5rem;
}

/* ─── Inner Page Hero (sub-pages like Office Bearers, Journal, etc.) ─── */
.apspa-inner-hero {
    position: relative;
    width: 100%;
    min-height: 380px;
    background: linear-gradient(135deg, var(--apspa-primary) 0%, #1a4a8a 60%, var(--apspa-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 5rem 2rem 8rem;
}

.apspa-inner-hero-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.apspa-inner-hero-icon {
    position: absolute;
    right: 6%;
    bottom: 18%;
    width: 220px;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

.apspa-inner-hero-content {
    position: relative;
    z-index: 2;
}

.apspa-inner-hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.apspa-inner-hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.apspa-inner-hero-sub {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ─── Team/Advisors Grid ─── */
.apspa-team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.apspa-team-card {
    text-align: center;
}

.apspa-team-photo-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border: 3px solid #fff;
    outline: 2px solid var(--apspa-border);
    transition: all 0.4s ease;
}

.apspa-team-card:hover .apspa-team-photo-wrap {
    outline-color: var(--apspa-secondary);
    transform: translateY(-5px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.15);
}

.apspa-team-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.apspa-team-card:hover .apspa-team-photo {
    transform: scale(1.08);
}

.apspa-team-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--apspa-primary);
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.apspa-team-inst {
    font-size: 0.85rem;
    color: var(--apspa-text-muted);
    margin: 0;
}

@media (max-width: 768px) {
    .apspa-team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .apspa-inner-hero-icon {
        display: none;
    }
}

@media (max-width: 480px) {
    .apspa-team-grid {
        grid-template-columns: 1fr;
    }
}

/* Hero Section */
.apspa-hero {

    position: relative;
    width: 100%;
    min-height: 580px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    color: #fff;
    margin-bottom: 0;
    /* Shape divider handles spacing */
    padding: 5rem 2rem 8rem;
}

/* Ken Burns: the background image animates on a pseudo-element */
.apspa-hero-bg {
    position: absolute;
    inset: -10%;
    /* Extra space so zoom doesn't show edges */
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: kenBurns 22s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes kenBurns {
    0% {
        transform: scale(1) translate(0, 0);
    }

    33% {
        transform: scale(1.08) translate(-2%, 1%);
    }

    66% {
        transform: scale(1.05) translate(2%, -1%);
    }

    100% {
        transform: scale(1.1) translate(0, 2%);
    }
}

/* Dark gradient overlay */
.apspa-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 45, 98, 0.72), rgba(0, 45, 98, 0.38));
    z-index: 1;
}

.apspa-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

.apspa-hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #fff;
}

.apspa-hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.3s;
}

/* Shape Divider (wave at the bottom of the hero) */
.apspa-hero-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 3;
}

.apspa-hero-divider svg {
    display: block;
    width: 100%;
    height: 80px;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Layout */
.apspa-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.apspa-content-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    padding: 2rem 0 5rem;
}

@media (max-width: 1024px) {
    .apspa-content-wrap {
        grid-template-columns: 1fr;
    }
}

/* Sidebar & Widgets */
.apspa-sidebar {
    position: sticky;
    top: 100px;
}

.apspa-widget {
    background: var(--apspa-bg-alt);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--apspa-border);
    margin-bottom: 2rem;
    box-shadow: var(--apspa-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.apspa-widget:hover {
    box-shadow: var(--apspa-shadow);
    transform: translateY(-2px);
}

.apspa-widget-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--apspa-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    position: relative;
    display: block;
}

.apspa-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--apspa-secondary);
}

.apspa-widget-list {
    list-style: none;
}

.apspa-widget-list li {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
    position: relative;
    transition: all 0.3s ease;
}

.apspa-widget-list li:hover {
    padding-left: 0.5rem;
}

.apspa-widget-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.apspa-widget-list a {
    color: var(--apspa-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    display: block;
    transition: color 0.2s ease;
}

.apspa-widget-list a::before {
    content: '◈';
    margin-right: 0.5rem;
    color: var(--apspa-secondary);
    font-size: 0.8rem;
    vertical-align: middle;
}

.apspa-widget-list a:hover {
    color: var(--apspa-secondary);
}

/* Cards & Content */
.apspa-block-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--apspa-primary);
    margin-bottom: 2rem;
    position: relative;
}

.apspa-block-card {
    background: #fff;
    border: 1px solid var(--apspa-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    box-shadow: var(--apspa-shadow-sm);
}

.apspa-block-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--apspa-shadow-lg);
}

.apspa-card-image-top img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.apspa-card-body {
    padding: 2rem;
}

.apspa-btn-learn {
    display: inline-block;
    background: var(--apspa-secondary);
    color: #fff !important;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.apspa-btn-learn:hover {
    background: var(--apspa-primary-dark);
    transform: scale(1.05);
}

/* Welcome Section */
.apspa-intro h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--apspa-primary);
    margin-bottom: 1.5rem;
}

.apspa-intro p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--apspa-text-muted);
}

/* Grids */
.apspa-block-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.apspa-block-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {

    .apspa-block-grid-3,
    .apspa-block-grid-2 {
        grid-template-columns: 1fr;
    }

    .apspa-hero-title {
        font-size: 2rem;
    }
}

/* Footer */
.apspa-footer {
    background: var(--apspa-primary);
    color: #fff;
    padding: 3rem 0;
    margin-top: 5rem;
}

.apspa-footer-copy {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Gallery Slider Section */
.apspa-gallery-marquee {
    width: 100%;
    margin: 5rem 0;
    overflow: hidden;
    padding: 2rem 0;
    position: relative;
    border-top: 1px solid var(--apspa-border);
    border-bottom: 1px solid var(--apspa-border);
}

.apspa-marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 45s linear infinite;
    gap: 30px;
}

.apspa-marquee-track:hover {
    animation-play-state: paused;
}

.apspa-gallery-item {
    width: 320px;
    height: 220px;
    flex-shrink: 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: var(--apspa-primary);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.apspa-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(20%) contrast(1.1) brightness(0.85) grayscale(20%);
    transition: all 0.6s ease;
}

.apspa-gallery-item:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.apspa-gallery-item:hover img {
    filter: sepia(0%) contrast(1) brightness(1) grayscale(0%);
    transform: scale(1.1);
}

.apspa-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 45, 98, 0.5), transparent 60%);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.4s ease;
}

.apspa-gallery-item:hover .apspa-gallery-overlay {
    opacity: 0.3;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .apspa-gallery-item {
        width: 260px;
        height: 180px;
    }
}

/* Partner Logos Strip */
.apspa-partner-logo {
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.4s ease;
    overflow: hidden;
}

.apspa-partner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.5);
    transition: all 0.4s ease;
}

.apspa-partner-logo:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border-color: var(--apspa-secondary);
}

.apspa-partner-logo:hover img {
    filter: grayscale(0%) opacity(1);
}

/* Video Card & Modal Styles */
.apspa-video-card {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--apspa-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.apspa-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.apspa-video-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.apspa-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.apspa-play-btn {
    width: 50px;
    height: 50px;
    background: var(--apspa-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 1.2rem;
    position: absolute;
    z-index: 2;
    box-shadow: 0 0 20px rgba(234, 30, 99, 0.4);
}

/* Video Modal */
.apspa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Standard transparent dark */
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.apspa-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.apspa-modal-content {
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.apspa-modal-overlay.active .apspa-modal-content {
    transform: scale(1);
}

.apspa-modal-close {
    position: fixed;
    top: 30px;
    left: 30px;
    /* Moved to Top-Left to avoid overlap with YT Share button */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
}

.apspa-modal-close:hover {
    background: var(--apspa-secondary);
    transform: rotate(90deg);
}