/* === Custom Properties === */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-primary-light: #3b82f6;
    --color-secondary: #0ea5e9;
    --color-secondary-light: #38bdf8;
    --color-accent: #f59e0b;
    --color-bg: #f8fafc;
    --color-bg-alt: #f1f5f9;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-border: #e2e8f0;
    --color-white: #fff;
    --nav-bg: rgba(30, 64, 175, 0.85);
    --nav-blur: 12px;
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.06);
    --shadow-md: 0 4px 12px rgba(37, 99, 235, 0.1);
    --shadow-lg: 0 8px 24px rgba(37, 99, 235, 0.15);
    --radius: 8px;
    --max-width: 1200px;
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Base === */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.menu-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

main.container {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* === Navbar === */
.site-header {
    background: var(--nav-bg);
    backdrop-filter: blur(var(--nav-blur));
    -webkit-backdrop-filter: blur(var(--nav-blur));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.625rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.navbar-brand {
    color: var(--color-white);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.navbar-brand:hover {
    color: var(--color-bg-alt);
}

.navbar-logo {
    height: var(--logo-height, 44px);
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
}

.mobile-menu-logo {
    display: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 300;
    position: relative;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    transition: transform var(--transition), opacity var(--transition);
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
}

.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }

/* Hamburger to X animation */
.menu-toggle.open .menu-icon {
    background: transparent;
}

.menu-toggle.open .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.open .menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* === Back Link === */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--color-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-primary-dark);
}

/* === Page Header === */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary-dark);
}

/* === Card Grid === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}

a.card-link {
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card-image-wrapper {
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition);
}

.card:hover .card-image {
    transform: scale(1.03);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.card-title a {
    color: inherit;
}

.card-title a:hover {
    color: var(--color-primary);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* === Image Grid (Gallery / Members Photos) === */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.image-grid-item {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
}

.image-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.image-grid-item:hover img {
    transform: scale(1.05);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--color-white);
    padding: 2rem 0.75rem 0.75rem;
    font-size: 0.85rem;
}

/* === News Article === */
.news-list .card {
    display: flex;
    flex-direction: column;
}

.article-detail {
    max-width: 800px;
}

.article-detail .article-image {
    border-radius: 12px;
    margin-bottom: 1.5rem;
    width: 100%;
    max-height: 450px;
    object-fit: cover;
}

.article-detail .article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-detail .article-content p {
    margin-bottom: 1rem;
}

.gallery-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 10px;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.gallery-link:hover {
    background: var(--color-primary-light);
    color: var(--color-white);
}

/* === About Page === */
.about-content {
    max-width: 800px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.about-content h2 {
    color: var(--color-primary-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.about-content h3 {
    color: var(--color-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.about-content p {
    margin-bottom: 1rem;
}

.about-content ul, .about-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* === Board Members === */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.board-card {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-align: center;
    padding: 1.5rem;
}

.board-card-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--color-primary);
}

.board-card-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.board-card-role {
    color: var(--color-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.board-card-link {
    position: relative;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.board-card-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.board-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.board-card-email {
    position: relative;
    z-index: 1;
}

.board-card-email {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* === Events === */
.events-section {
    margin-bottom: 3rem;
}

.events-section h2 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.event-detail {
    max-width: 800px;
}

.event-detail .event-image {
    border-radius: 12px;
    margin-bottom: 1.5rem;
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.event-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.event-description {
    line-height: 1.8;
    font-size: 1.05rem;
}

.event-description p {
    margin-bottom: 1rem;
}

.event-contact {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
}

.event-contact h2 {
    font-size: 1.15rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
}

.event-contact p {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

/* === Member Detail === */
.member-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.member-header-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-primary);
    flex-shrink: 0;
}

.member-header-info h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    border: none;
    padding: 0;
}

.member-header-info p {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.page-link:hover {
    background: var(--color-primary-light);
    color: var(--color-white);
}

.page-link.current {
    background: var(--color-primary);
    color: var(--color-white);
}

/* === Lightbox === */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-caption {
    text-align: center;
    color: var(--color-white);
    padding: 0.75rem;
    font-size: 0.95rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition);
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 0.5rem;
    right: 1rem;
    font-size: 2.5rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* === Placeholder Image === */
.placeholder-image {
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 3rem;
}

/* === Legal Page === */
.legal-content {
    max-width: 800px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.legal-content h2 {
    color: var(--color-primary-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-content h3 {
    color: var(--color-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    margin-bottom: 1rem;
}

.legal-content ul, .legal-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* === Footer === */
.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-legal {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--color-white);
}

/* === Hero === */
.hero {
    background-color: var(--color-primary-dark);
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.8), rgba(14, 165, 233, 0.6));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}

.hero-title {
    color: var(--color-white);
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 600px;
    line-height: 1.6;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* === Homepage Sections === */
.home-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.home-section:last-child {
    margin-bottom: 0;
}

.home-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.home-section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary-dark);
}

.section-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
}

.section-link:hover {
    color: var(--color-primary-dark);
}

.home-gallery-title {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.home-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.home-gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
}

.home-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.home-gallery-item:hover img {
    transform: scale(1.05);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-light);
}

.empty-state p {
    font-size: 1.1rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero {
        min-height: 280px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-text {
        font-size: 1rem;
    }

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

    .navbar-logo {
        height: calc(var(--logo-height, 44px) * 0.75);
    }

    .menu-toggle {
        display: block;
    }

    .mobile-menu-logo {
        display: block;
        margin-bottom: 1rem;
    }

    .mobile-menu-logo img {
        height: 72px;
        width: auto;
    }

    /* Remove backdrop-filter when menu is open so that
       position:fixed on .nav-links references the viewport,
       not the header (backdrop-filter creates a containing block). */
    body.menu-open .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--color-primary-dark);
    }

    .nav-links {
        position: fixed;
        inset: 0;
        z-index: 200;
        background: rgba(30, 64, 175, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity var(--transition), visibility var(--transition);
    }

    .nav-links.open {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .nav-links a {
        font-size: 1.5rem;
        padding: 0.75rem 1.5rem;
        border-radius: var(--radius);
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .member-header {
        flex-direction: column;
        text-align: center;
    }

    .member-header-photo {
        width: 150px;
        height: 150px;
    }
}

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

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}
