:root {
    --dark-green: #1a4d2e;
    --gold: #d4a373;
    --black: #1a1a1a;
    --white: #ffffff;
    --light-green: #e8f5e9;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 15px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --page-pad-x: clamp(1rem, 4vw, 3rem);
    --page-pad-y: 2rem;
}

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

/* Dark background behind the page so overscroll/bounce never shows a white gap */
html {
    background: var(--dark-green);
}

/* Full-height layout: content grows so the footer always sits at the bottom of the screen */
body {
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--black);
    background: var(--white);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

.hidden {
    display: none !important;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, rgba(26, 77, 46, 0.95), rgba(26, 26, 26, 0.95));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 163, 115, 0.2);
    color: var(--white);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-container {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 calc(var(--page-pad-x) - 1rem);
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--gold);
    text-decoration: none;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    transition: var(--transition);
}

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

.nav-link:hover:after {
    width: 100%;
}

.admin-btn {
    background: linear-gradient(135deg, var(--gold), #c49060);
    color: var(--black);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.3);
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 163, 115, 0.4);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 101;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: var(--dark-green);
    margin-bottom: 1rem;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--dark-green);
    border-radius: 4px;
    box-sizing: border-box;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
}

.modal-buttons button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.modal-buttons button:first-child {
    background: #ddd;
}

.btn-primary {
    background: var(--dark-green);
    color: var(--white);
}

.btn-danger {
    background: #d32f2f;
    color: var(--white);
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* Admin Panel */
.admin-panel {
    background: var(--white);
    padding: var(--page-pad-y) var(--page-pad-x);
    width: 100%;
}

.admin-panel.hidden {
    display: none;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #ddd;
    flex-wrap: wrap;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--dark-green);
    border: none;
    cursor: pointer;
    font-weight: 400;
}

.admin-tab.active {
    background: var(--dark-green);
    color: var(--white);
    font-weight: 600;
}

.btn-save {
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    background: var(--gold);
    color: var(--black);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
}

/* Content */
.content {
    flex: 1;
    width: 100%;
    padding: var(--page-pad-y) var(--page-pad-x);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Hero: full-width slideshow */
.hero {
    position: relative;
    height: clamp(360px, 72vh, 860px);
    height: clamp(360px, 72svh, 860px);
    margin: calc(-1 * var(--page-pad-y)) calc(-1 * var(--page-pad-x)) 3rem;
    background: linear-gradient(135deg, var(--dark-green), var(--black));
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slides {
    position: absolute;
    inset: 0;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.slide.active {
    opacity: 1;
}

/* The whole photo is always shown (no cropping)... */
.slide-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ...and a blurred copy fills any space around it instead of empty bars */
.slide-bg {
    position: absolute;
    inset: -40px;
    width: calc(100% + 80px);
    height: calc(100% + 80px);
    object-fit: cover;
    filter: blur(30px) brightness(0.55);
}

/* Darkens photos so the title stays readable */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 163, 115, 0.1), rgba(26, 26, 26, 0.3));
    z-index: 1;
}

.hero.has-slides::before {
    background: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.8) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--white);
    padding: 0 4rem;
}

.hero-content h1 {
    color: var(--gold);
    font-size: clamp(26px, 5vw, 52px);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-content h2 {
    font-size: clamp(18px, 3vw, 30px);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
    font-style: italic;
    font-size: clamp(14px, 2vw, 20px);
}

/* With photos, the title sits at the bottom so the photo stays clear */
.hero.has-slides .hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4.5rem;
    padding: 0 1rem;
}

.hero.has-slides .hero-content h1 {
    font-size: clamp(20px, 3.2vw, 38px);
    margin-bottom: 0.25rem;
}

.hero.has-slides .hero-content h2 {
    font-size: clamp(15px, 2vw, 22px);
    margin-bottom: 0.25rem;
}

.hero.has-slides .hero-tagline {
    font-size: clamp(13px, 1.4vw, 16px);
}

.slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2.75rem;
    padding: 0 1rem;
    text-align: center;
    color: var(--white);
    font-size: 15px;
    z-index: 10;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.hero:not(.has-slides) .slide-caption {
    display: none;
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    font-size: 24px;
}

.hero:not(.multi) .slide-btn {
    display: none;
}

.slide-btn.left {
    left: 1rem;
}

.slide-btn.right {
    right: 1rem;
}

.slide-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
    gap: 0.5rem;
    z-index: 20;
}

.slide-indicators button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.slide-indicators button.active {
    background: var(--gold);
}

/* Stats */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    background: transparent;
    padding: 2.5rem 1.5rem;
    margin-bottom: 3rem;
    border-radius: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(26, 77, 46, 0.2);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(26, 77, 46, 0.08);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(26, 77, 46, 0.15);
    border-color: rgba(26, 77, 46, 0.4);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 12px;
    color: var(--dark-green);
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.quick-link {
    display: block;
    width: 100%;
    font: inherit;
    background: linear-gradient(135deg, rgba(232, 245, 233, 0.9), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(10px);
    border: 2px solid var(--dark-green);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(26, 77, 46, 0.1);
}

.quick-link:hover,
.quick-link:focus-visible {
    transform: translateY(-10px);
    border-color: var(--gold);
    box-shadow: 0 15px 40px rgba(26, 77, 46, 0.2);
    background: linear-gradient(135deg, rgba(212, 163, 115, 0.1), rgba(232, 245, 233, 0.95));
}

.quick-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.quick-link-icon {
    display: block;
    font-size: 32px;
    margin-bottom: 0.5rem;
}

.quick-link-label {
    display: block;
    font-weight: 600;
    color: var(--dark-green);
}

/* Grids */
.alumni-grid,
.memories-grid,
.events-grid,
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.alumni-card,
.memory-card,
.event-card,
.achievement-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(232, 245, 233, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(26, 77, 46, 0.15);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(26, 77, 46, 0.08);
}

.alumni-card:hover,
.memory-card:hover,
.event-card:hover,
.achievement-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(26, 77, 46, 0.15);
    border-color: var(--gold);
}

.alumni-card h3,
.memory-card h3,
.event-card h3,
.achievement-card h3 {
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}

.alumni-card p,
.memory-card p,
.event-card p,
.achievement-card p {
    color: #666;
    font-size: 13px;
    margin: 0.25rem 0;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.photo-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

/* Timeline */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    margin-top: 2rem;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -2.5rem;
    width: 24px;
    height: 24px;
    background: var(--gold);
    border: 3px solid var(--dark-green);
    border-radius: 50%;
    top: 0;
}

.timeline-content {
    background: var(--white);
    border: 2px solid var(--dark-green);
    border-radius: 8px;
    padding: 1.5rem;
}

.timeline-year {
    color: var(--gold);
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.timeline-event {
    color: var(--dark-green);
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--dark-green);
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
    font-size: 12px;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: linear-gradient(135deg, rgba(26, 77, 46, 0.98), rgba(26, 26, 26, 0.98));
        padding: 0.5rem 0;
        margin: 0;
        gap: 0;
        border-bottom: 1px solid rgba(212, 163, 115, 0.2);
        max-height: calc(100vh - 58px);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 99;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(212, 163, 115, 0.1);
        width: 100%;
        font-size: 13px;
        text-align: left;
    }

    .nav-link:after {
        display: none;
    }

    .hamburger {
        display: flex;
    }
    
    .nav-logo {
        font-size: 16px;
    }
    
    .admin-btn {
        padding: 0.5rem 0.8rem;
        font-size: 11px;
    }

    .welcome-section {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }
    
    .welcome-section h2 {
        font-size: 22px;
    }
    
    .welcome-section p {
        font-size: 14px;
    }

    .alumni-grid,
    .memories-grid,
    .events-grid,
    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .slide-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .slide-btn.left {
        left: 0.5rem;
    }

    .slide-btn.right {
        right: 0.5rem;
    }

    .hero-content {
        padding: 0 3rem;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-tab {
        padding: 0.5rem 1rem;
        font-size: 12px;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0;
        gap: 1rem;
    }

    .admin-btn {
        padding: 0.5rem 1rem;
        font-size: 11px;
    }
}

h1 {
    color: var(--dark-green);
    margin-bottom: 1.5rem;
}

.search-bar {
    margin-bottom: 2rem;
}

.search-bar input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

input, textarea, select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0.5rem 0;
    width: 100%;
}

button {
    cursor: pointer;
}

.btn-edit, .btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin: 0.5rem;
}

.btn-edit {
    background: var(--gold);
    color: var(--black);
}

.btn-delete {
    background: #d32f2f;
    color: var(--white);
}

.voting-card {
    background: var(--light-green);
    border: 2px solid var(--dark-green);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, rgba(232, 245, 233, 0.9), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(15px);
    border: 2px solid var(--dark-green);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 15px 40px rgba(26, 77, 46, 0.1);
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-section h2 {
    color: var(--dark-green);
    font-size: 32px;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--dark-green), #0d3220);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section p {
    color: #333;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: center;
}

.welcome-section ul {
    list-style: none;
    padding: 0;
    margin: 1rem auto;
    text-align: left;
    display: inline-block;
    color: var(--dark-green);
    font-weight: 500;
}

.welcome-section ul li {
    padding: 0.5rem 0;
    font-size: 14px;
}

.welcome-section strong {
    color: var(--dark-green);
    font-weight: 600;
}

@media (max-width: 768px) {
    .welcome-section {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }
    
    .welcome-section h2 {
        font-size: 22px;
    }
    
    .welcome-section p {
        font-size: 14px;
    }
}

/* Modern Button Styling */
.btn-primary {
    background: linear-gradient(135deg, var(--dark-green), #0d3220) !important;
    color: var(--white) !important;
    box-shadow: 0 4px 15px rgba(26, 77, 46, 0.3) !important;
    border-radius: 8px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(26, 77, 46, 0.4) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #d32f2f, #b71c1c) !important;
    color: var(--white) !important;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3) !important;
    border-radius: 8px !important;
}

.btn-danger:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4) !important;
}

.btn-edit {
    background: linear-gradient(135deg, var(--gold), #c49060) !important;
    color: var(--black) !important;
    box-shadow: 0 4px 12px rgba(212, 163, 115, 0.3) !important;
    border-radius: 8px !important;
}

.btn-edit:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(212, 163, 115, 0.4) !important;
}

.btn-delete {
    background: linear-gradient(135deg, #d32f2f, #b71c1c) !important;
    color: var(--white) !important;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3) !important;
    border-radius: 8px !important;
}

.btn-delete:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4) !important;
}

.btn-save {
    background: linear-gradient(135deg, var(--gold), #c49060) !important;
    color: var(--black) !important;
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.3) !important;
    border-radius: 8px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
}

.btn-save:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(212, 163, 115, 0.4) !important;
}

/* Page Transitions */
.page {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modern Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
    border: 1px solid rgba(26, 77, 46, 0.2) !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    transition: var(--transition) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: var(--dark-green) !important;
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1) !important;
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Photos on cards */
.avatar-frame {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.avatar {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    border: 3px solid var(--gold);
}

.event-card.past {
    opacity: 0.75;
}

/* Admin photo picker */
.photo-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.photo-thumb {
    position: relative;
    width: 96px;
    height: 96px;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.photo-thumb button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #d32f2f;
    color: var(--white);
    font-size: 16px;
    line-height: 1;
}

.upload-btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    border: 2px dashed var(--dark-green);
    border-radius: 8px;
    color: var(--dark-green);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.upload-btn:hover {
    background: var(--light-green);
}

.admin-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Photo gallery */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img,
.lightbox video {
    max-width: 92vw;
    max-height: 82vh;
    max-height: 82dvh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-caption {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--white);
    font-size: 14px;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 28px;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-nav.left {
    left: 1rem;
}

.lightbox-nav.right {
    right: 1rem;
}

/* Save notifications */
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translate(-50%, 200%);
    background: var(--dark-green);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    z-index: 400;
    max-width: calc(100% - 2rem);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translate(-50%, 0);
}

.toast.error {
    background: #b71c1c;
}

/* Home: welcome note beside the birthday frame */
.home-intro {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}

.home-intro .welcome-section {
    max-width: none;
    margin: 0;
    text-align: left;
}

.home-intro .welcome-section p {
    text-align: left;
}

.home-intro .welcome-section ul {
    margin: 1rem 0;
}

/* Birthday frame: today's celebrants */
.birthday-panel {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: linear-gradient(160deg, var(--dark-green), #0d3220);
    color: var(--white);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 15px 40px rgba(26, 77, 46, 0.2);
}

.birthday-panel.celebrating {
    box-shadow: 0 0 0 6px rgba(212, 163, 115, 0.3), 0 20px 50px rgba(26, 77, 46, 0.3);
}

.birthday-panel h2 {
    color: var(--gold);
    font-size: clamp(24px, 2.4vw, 32px);
    margin-bottom: 0.25rem;
}

.birthday-date-today {
    font-size: 16px;
    opacity: 0.85;
    margin-bottom: 1.5rem;
}

.celebrants {
    display: grid;
    gap: 1.5rem;
}

.celebrants.multiple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
    align-items: end; /* names line up even when photos are different shapes */
}

/* The whole photo is shown at its own shape (no cropping), within a size limit */
.celebrant-photo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 420px;
    margin: 0 auto;
    border-radius: 16px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.celebrants.multiple .celebrant-photo {
    max-height: 240px;
}

.celebrant-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    font-size: 96px;
}

.celebrants.multiple .celebrant-photo.placeholder {
    font-size: 56px;
}

.celebrant-name {
    margin-top: 0.75rem;
    font-size: clamp(20px, 2vw, 26px);
    font-weight: 700;
}

.celebrants.multiple .celebrant-name {
    font-size: 16px;
}

.birthday-none {
    padding: 1rem 0;
}

.birthday-none-icon {
    font-size: 72px;
    margin-bottom: 0.5rem;
}

.birthday-none p {
    font-size: 18px;
}

/* Upcoming birthdays list below today's celebrants */
.upcoming-birthdays {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(212, 163, 115, 0.35);
    text-align: left;
}

.upcoming-birthdays h3 {
    color: var(--gold);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.upcoming-list {
    max-height: 360px;
    overflow-y: auto;
}

.upcoming-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
}

.upcoming-person + .upcoming-person {
    border-top: 1px solid rgba(212, 163, 115, 0.15);
}

.upcoming-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    flex-shrink: 0;
}

.upcoming-avatar.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    font-size: 22px;
}

.upcoming-info {
    flex: 1;
    min-width: 0;
}

.upcoming-name {
    font-weight: 600;
    font-size: 15px;
}

.upcoming-date {
    font-size: 13px;
    color: var(--gold);
}

.upcoming-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--gold);
    color: var(--gold);
    white-space: nowrap;
}

.upcoming-empty {
    font-size: 14px;
    opacity: 0.7;
    font-style: italic;
}

@media (max-width: 900px) {
    .home-intro {
        grid-template-columns: 1fr;
    }

    /* On phones the birthday frame comes first so it isn't buried under the welcome note */
    .birthday-panel {
        position: static;
        max-height: none;
        order: -1;
    }
}

/* Video previews */
.photo-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    background: var(--black);
}

.photo-thumb video {
    border-radius: 6px;
}

.play-icon,
.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    pointer-events: none;
}

.play-icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
    padding-left: 4px;
}

.video-badge {
    width: 32px;
    height: 32px;
    font-size: 13px;
    padding-left: 2px;
}

.media-field {
    margin-top: 1rem;
}

/* Memories: every photo and video is its own tile, shown whole (no cropping) */
.memories-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.memory-tile {
    margin: 0;
}

.memory-tile-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: #0d3220;
    box-shadow: 0 8px 24px rgba(26, 77, 46, 0.12);
    transition: var(--transition);
}

.memory-tile-frame.video {
    background: var(--black);
}

.memory-tile-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(26, 77, 46, 0.2);
}

.memory-tile-bg {
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    filter: blur(18px) brightness(0.6);
}

.memory-tile-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.memory-tile figcaption {
    margin-top: 0.5rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-green);
    text-align: center;
}

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

    .memory-tile figcaption {
        font-size: 12px;
    }
}

/* Admin: picking slideshow photos from Memories and Events */
.picker-heading {
    color: var(--dark-green);
    font-size: 14px;
    margin: 1.25rem 0 0.5rem;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}

.picker-item {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #0d3220;
    cursor: pointer;
}

.picker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.picker-item.picked {
    border-color: var(--gold);
}

.picker-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: transparent;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-item.picked .picker-check {
    background: var(--gold);
    color: var(--black);
}

.picker-item.in-slideshow {
    cursor: default;
    opacity: 0.5;
}

.picker-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    color: var(--white);
    font-size: 11px;
    padding: 0.2rem;
    text-align: center;
}

/* Events: one full-width card per event, with each photo and video as its own tile */
.events-grid {
    grid-template-columns: minmax(0, 1fr);
}

.event-card:hover {
    transform: none;
}

.event-media {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

/* Home: current executives */
.excos-section {
    margin-bottom: 3rem;
    text-align: center;
}

.excos-section h2 {
    color: var(--dark-green);
    margin-bottom: 1.5rem;
}

.excos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
    justify-content: center;
    gap: 1.5rem;
}

.exco-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(232, 245, 233, 0.8));
    border: 1px solid rgba(26, 77, 46, 0.15);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    box-shadow: 0 8px 32px rgba(26, 77, 46, 0.08);
    min-width: 0;
}

.exco-photo {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
}

.exco-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--light-green);
}

.exco-position {
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.exco-card h3 {
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}

.exco-contact {
    display: block;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    overflow-wrap: anywhere;
    margin-top: 0.25rem;
}

.exco-contact:hover {
    color: var(--dark-green);
    text-decoration: underline;
}

.exco-move {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.exco-move button {
    padding: 0.2rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
}

.exco-move button:disabled {
    opacity: 0.4;
    cursor: default;
}

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

    .excos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .exco-photo {
        width: 88px;
        height: 88px;
    }
}
