:root {
    --brand-primary: #009a44;
    --brand-primary-dark: #006633;
    --ink: #173f2c;
    --muted: rgba(23, 63, 44, 0.74);
    --line: rgba(0, 154, 68, 0.14);
    --surface: #f7fbf8;
    --font-heading: "Roboto", "Segoe UI", Arial, sans-serif;
    --font-ui: "Roboto", "Segoe UI", Arial, sans-serif;
}

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

body {
    min-height: 100vh;
    background: #fff;
    color: var(--ink);
    font-family: var(--font-ui);
}

.container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
}

.gallery-page {
    padding-top: 86px;
}

.gallery-hero {
    padding: 4.6rem 0 3rem;
    background:
        radial-gradient(circle at top right, rgba(0, 154, 68, 0.16), transparent 32%),
        linear-gradient(180deg, #f7fbf8 0%, #fff 100%);
}

.gallery-hero-copy {
    max-width: 48rem;
}

.gallery-kicker,
.event-label {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 154, 68, 0.1);
    color: #11673c;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    margin: 0 0 0.85rem;
    color: var(--ink);
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.gallery-hero p {
    max-width: 38rem;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.gallery-section {
    padding: 2.6rem 0 4.8rem;
    background: #fff;
}

.gallery-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
}

.gallery-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: #11673c;
    font-size: 0.9rem;
    font-weight: 800;
}

.event-list {
    display: grid;
    gap: 1.35rem;
}

.event-card,
.gallery-empty {
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(0, 154, 68, 0.08), transparent 26%),
        #fff;
    box-shadow: 0 18px 36px rgba(20, 62, 37, 0.08);
}

.event-card {
    padding: 1.25rem;
}

.event-header {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 1rem;
    align-items: start;
}

.event-header-tools {
    display: grid;
    justify-items: end;
    gap: 0.7rem;
}

.event-header h2 {
    color: var(--ink);
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2.6vw, 2rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.event-meta span {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 154, 68, 0.08);
    color: #11673c;
    font-size: 0.82rem;
    font-weight: 800;
}

.album-share {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
}

.album-share-label {
    color: rgba(23, 63, 44, 0.72);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.album-share-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.album-share-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.48rem 0.72rem;
    border: 1px solid rgba(0, 154, 68, 0.16);
    border-radius: 999px;
    background: rgba(0, 154, 68, 0.06);
    color: #0b6b3b;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.album-share-links a:hover {
    background: #0b6b3b;
    border-color: #0b6b3b;
    color: #fff;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.photo-card {
    overflow: hidden;
    border: 1px solid rgba(0, 154, 68, 0.12);
    border-radius: 18px;
    background: #fff;
}

.event-card:not(.is-expanded) .photo-card.is-extra-photo {
    display: none;
}

.photo-link {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 0;
    padding: 0;
    background: var(--surface);
    cursor: pointer;
}

.photo-link img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.photo-card:hover .photo-link img {
    transform: scale(1.04);
}

.photo-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(0, 154, 68, 0.12);
}

.photo-actions a,
.photo-actions button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
    border: 0;
    background: #fff;
    color: #0b6b3b;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.photo-actions a + a,
.photo-actions button + a {
    border-left: 1px solid rgba(0, 154, 68, 0.12);
}

.photo-actions a:hover,
.photo-actions button:hover {
    background: rgba(0, 154, 68, 0.08);
}

.album-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.1rem;
}

.album-toggle {
    min-height: 46px;
    padding: 0.72rem 1.15rem;
    border: 1px solid rgba(0, 154, 68, 0.2);
    border-radius: 999px;
    background: #0b6b3b;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.album-toggle:hover {
    background: #084f2d;
    border-color: #084f2d;
    transform: translateY(-1px);
}

.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: rgba(10, 22, 16, 0.66);
    backdrop-filter: blur(8px);
}

.photo-modal.is-open {
    display: flex;
}

.photo-modal-panel {
    width: min(980px, 100%);
    max-height: min(90vh, 860px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(0, 154, 68, 0.18);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(5, 28, 15, 0.28);
}

.photo-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem 0.85rem;
    border-bottom: 1px solid rgba(0, 154, 68, 0.12);
}

.photo-modal-tag {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 0.35rem;
    padding: 0.25rem 0.62rem;
    border-radius: 999px;
    background: rgba(0, 154, 68, 0.1);
    color: #11673c;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.photo-modal-header h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    line-height: 1.15;
}

.photo-modal-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 154, 68, 0.1);
    color: #0b6b3b;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.photo-modal-stage {
    min-height: 0;
    padding: 1rem;
    background: #f7fbf8;
}

.photo-modal-stage img {
    width: 100%;
    max-height: calc(90vh - 190px);
    display: block;
    object-fit: contain;
}

.photo-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(0, 154, 68, 0.12);
}

.photo-modal-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.68rem 1rem;
    border-radius: 999px;
    background: #0b6b3b;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

body.photo-modal-open {
    overflow: hidden;
}

.gallery-empty,
.event-empty {
    color: var(--muted);
    line-height: 1.65;
}

.gallery-empty {
    display: grid;
    gap: 0.75rem;
    padding: 1.6rem;
}

.gallery-empty h2 {
    color: var(--ink);
    font-size: 1.45rem;
}

.event-empty {
    padding: 1rem;
    border-radius: 16px;
    background: var(--surface);
}

@media (max-width: 960px) {
    .photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-page {
        padding-top: 82px;
    }

    .gallery-hero {
        padding: 3.4rem 0 2.3rem;
    }

    .gallery-section {
        padding: 2rem 0 3.5rem;
    }

    .event-header {
        display: grid;
    }

    .event-header-tools,
    .event-meta {
        justify-items: start;
        justify-content: flex-start;
    }

    .album-share {
        justify-content: flex-start;
    }

    .album-share-links {
        justify-content: flex-start;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 1rem, 1200px);
    }

    .event-card {
        padding: 0.85rem;
        border-radius: 20px;
    }

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

    .photo-modal {
        padding: 0.7rem;
    }

    .photo-modal-panel {
        border-radius: 20px;
    }

    .photo-modal-stage {
        padding: 0.7rem;
    }
}
