@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600&display=swap');

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

body {
    font-family: 'Fredoka', Arial, sans-serif;
    background: #eef4fb;
    color: #222;
    min-height: 100vh;
}

header {
    padding: 50px 20px;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #2563eb, #9333ea, #ec4899);
    box-shadow: 0 12px 35px rgba(0,0,0,.22);
}

header h1 {
    font-size: 46px;
    margin-bottom: 10px;
}

header p {
    font-size: 20px;
}

footer {
    margin-top: 50px;
    padding: 30px;
    text-align: center;
    background: #111827;
    color: white;
}

/* PUBLIC MONTH GALLERY */

.gallery {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
}

.card img,
.card video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #000;
}

.card h2 {
    font-size: 16px;
    color: #2563eb;
    text-align: center;
    padding: 12px 10px 4px;
}

.card p {
    font-size: 14px;
    color: #555;
    text-align: center;
    padding: 0 10px 14px;
}

/* TIMELINE HOME */

.timeline {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.year-section {
    margin-bottom: 50px;
}

.year-section h2 {
    font-size: 38px;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

.month-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: #222;
    box-shadow: 0 10px 26px rgba(0,0,0,.12);
    transition: .25s;
}

.month-card:hover {
    transform: translateY(-5px);
}

.empty-cover {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    background: #f3f6fb;
}

.month-card img,
.month-card video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.month-card h3 {
    text-align: center;
    padding: 16px 10px 4px;
    font-size: 22px;
    color: #2563eb;
}

.month-card p {
    text-align: center;
    color: #666;
    padding-bottom: 18px;
}

/* BUTTONS */

.button,
.big-buttons a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 22px;
    padding: 24px;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(37,99,235,.25);
    transition: .25s;
}

.button:hover,
.big-buttons a:hover {
    transform: translateY(-5px);
}

.big-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}

/* ADMIN LAYOUT */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1e3a8a;
    color: white;
    padding: 30px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 26px;
}

.sidebar a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 14px;
    font-weight: 700;
}

.sidebar a:hover {
    background: rgba(255,255,255,.16);
}

.main-content {
    flex: 1;
    padding: 40px;
}

/* DASHBOARD */

.dashboard {
    max-width: 1200px;
    margin: auto;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 20px;
}

.hero h1 {
    color: #1e3a8a;
    font-size: 44px;
}

.hero p {
    color: #666;
    font-size: 20px;
}

.hero-stat {
    background: white;
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
    text-align: center;
}

.hero-stat span {
    display: block;
    font-size: 22px;
    font-weight: 800;
}

.hero-stat small {
    color: #777;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    border-radius: 22px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
}

.stat-card h3 {
    color: #2563eb;
    font-size: 22px;
}

.stat-card span {
    display: block;
    margin-top: 15px;
    font-size: 52px;
    font-weight: 900;
    color: #2563eb;
}

/* UPLOAD */

.upload-box {
    max-width: 560px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(0,0,0,.14);
}

.upload-box h2 {
    color: #1e3a8a;
    margin-bottom: 20px;
}

.upload-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-box label {
    font-weight: 800;
    color: #2563eb;
}

.upload-box input,
.upload-box select,
.upload-box textarea {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.upload-box textarea {
    min-height: 100px;
}

.upload-box button {
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #9333ea);
    color: white;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

/* ADMIN GALLERY MANAGER */

.admin-gallery {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-gallery h2 {
    color: #1e3a8a;
    font-size: 36px;
    margin-bottom: 25px;
}

.gallery-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px;
}

.memory-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0,0,0,.13);
    display: flex;
    flex-direction: column;
}

.memory-card img,
.memory-card video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #000;
}

.memory-info {
    padding: 14px;
    text-align: center;
}

.memory-info h3 {
    font-size: 17px;
    color: #2563eb;
    margin-bottom: 5px;
    word-break: break-word;
}

.memory-info p {
    color: #666;
    font-size: 14px;
}

.memory-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #eee;
}

.memory-actions a {
    text-align: center;
    padding: 12px 4px;
    text-decoration: none;
    color: #2563eb;
    font-weight: 800;
    font-size: 14px;
}

/* MOBILE */

@media (max-width: 800px) {
    header {
        padding: 35px 16px;
    }

    header h1 {
        font-size: 32px;
    }

    header p {
        font-size: 16px;
    }

    .admin-layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 18px;
    }

    .sidebar h2 {
        grid-column: 1 / -1;
        font-size: 22px;
        margin-bottom: 8px;
    }

    .sidebar a {
        margin: 0;
        text-align: center;
        padding: 12px 8px;
        font-size: 14px;
    }

    .main-content {
        padding: 16px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 12px;
    }

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

    .memory-actions a {
        font-size: 12px;
        padding: 10px 2px;
    }

    .upload-box {
        margin: 16px auto;
        padding: 20px;
    }

    .big-buttons {
        grid-template-columns: 1fr;
    }
}
.preview-img {
    cursor: zoom-in;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.show {
    display: flex;
    flex-direction: column;
}

.lightbox img {
    max-width: 95vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 14px;
    background: white;
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: white;
    color: #111;
    border: 0;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-size: 32px;
    line-height: 38px;
    cursor: pointer;
    font-weight: bold;
}

#lightbox-title {
    color: white;
    margin-top: 14px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}
.card img.preview-img {
    pointer-events: auto !important;
    cursor: zoom-in !important;
    position: relative;
    z-index: 2;
}
