:root {
    --gallery-ink: #1e2d2a;
    --gallery-soft: #f5f7f3;
    --gallery-card: #ffffff;
    --gallery-border: #dfe8e5;
    --gallery-accent: #176b55;
    --gallery-accent-dark: #114f42;
    --gallery-shadow: 0 1.25rem 2.5rem rgba(17, 63, 49, 0.08);
}

.gallery-section {
    padding: 4rem 0 5rem;
    background: linear-gradient(180deg, #f4f8f5 0%, #ffffff 78%);
}

.gallery-page-heading {
    max-width: 44rem;
    margin: 0 auto 2rem;
    text-align: center;
}

.gallery-eyebrow {
    margin: 0 0 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gallery-accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.gallery-page-heading h1 {
    margin: 0;
    font-size: clamp(2.2rem, 3vw, 3rem);
    line-height: 1.15;
    color: var(--gallery-ink);
}

.gallery-page-heading p {
    margin-top: 0.8rem;
    color: #485d58;
}

.gallery-list-heading {
    margin-bottom: 2.5rem;
}

.gallery-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.gallery-album-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gallery-border);
    background: var(--gallery-card);
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: var(--gallery-shadow);
}

.gallery-album-cover {
    display: block;
    position: relative;
    min-height: 260px;
    background: linear-gradient(135deg, #e8f1ed, #dceee5);
}

.gallery-album-cover img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

.gallery-cover-empty,
.gallery-public-empty,
.gallery-admin-placeholder {
    display: grid;
    place-items: center;
    min-height: 260px;
    text-align: center;
    color: #49615b;
    background: linear-gradient(135deg, #edf5f1, #dfece7);
    font-weight: 600;
}

.gallery-album-count {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(7, 18, 15, 0.65);
    color: white;
    padding: .45rem .8rem;
    font-size: 0.78rem;
    backdrop-filter: blur(2px);
}

.gallery-album-card-copy {
    padding: 1.2rem 1.2rem 1.4rem;
}

.gallery-album-card-copy h2 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
}

.gallery-album-card-copy h2 a {
    text-decoration: none;
    color: var(--gallery-ink);
}

.gallery-album-card-copy p {
    margin: 0.75rem 0 0.9rem;
    color: #536a66;
}

.gallery-album-open {
    color: var(--gallery-accent);
    font-weight: 700;
    text-decoration: none;
}

.gallery-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 1rem;
    color: #536a66;
    font-size: 0.94rem;
}

.gallery-breadcrumbs a {
    color: var(--gallery-accent);
    text-decoration: none;
}

.gallery-image-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--gallery-soft);
    border: 1px solid var(--gallery-border);
    color: var(--gallery-accent-dark);
    font-weight: 700;
}

.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-photo {
    position: relative;
    border: 1px solid var(--gallery-border);
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 0.65rem 1.7rem rgba(17,63,49,0.06);
}

.gallery-photo img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform .2s ease;
}

.gallery-photo:hover img,
.gallery-photo:focus-visible img {
    transform: scale(1.02);
}

.gallery-photo-caption {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    background: rgba(9, 18, 15, 0.58);
    color: #fff;
    border-radius: 0.8rem;
    padding: .6rem .8rem;
    font-size: 0.8rem;
    backdrop-filter: blur(3px);
}

.gallery-back-link {
    display: inline-flex;
    margin-top: 1.5rem;
}

.gallery-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .75rem;
    margin-top: 2rem;
    color: #4d5d58;
}

.gallery-pagination a {
    color: var(--gallery-accent);
    text-decoration: none;
    font-weight: 700;
}

.gallery-lightbox {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
}

.gallery-lightbox::backdrop {
    background: rgba(6, 15, 12, 0.78);
}

.gallery-lightbox-panel {
    position: relative;
    display: grid;
    place-items: center;
    min-width: min(92vw, 1100px);
    min-height: min(88vh, 820px);
    padding: 2.25rem 3.5rem 1.5rem;
    background: rgba(255,255,255,0.06);
}

.gallery-lightbox figure {
    margin: 0;
    display: grid;
    place-items: center;
    gap: 0.9rem;
    width: min(88vw, 980px);
}

.gallery-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 1rem;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 1.25rem 2.75rem rgba(0,0,0,0.2);
}

.gallery-lightbox-caption {
    color: #f3f8f6;
    text-align: center;
    font-size: 0.95rem;
}

.gallery-lightbox-counter {
    position: absolute;
    left: 50%;
    bottom: 0.8rem;
    transform: translateX(-50%);
    color: #eef7f1;
    background: rgba(18, 29, 25, 0.5);
    padding: .35rem .7rem;
    border-radius: 999px;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: rgba(16, 33, 29, 0.72);
    color: white;
    border-radius: 50%;
    width: 2.7rem;
    height: 2.7rem;
    font-size: 1.3rem;
    cursor: pointer;
}

.gallery-lightbox-close {
    top: 1rem;
    right: 1rem;
    transform: none;
}

.gallery-lightbox-prev { left: 1rem; }
.gallery-lightbox-next { right: 1rem; }

@media (min-width: 30rem) and (max-width: 47.99rem) {
    .gallery-photo-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-photo img { height: 180px; }
}

@media (max-width: 48rem) {
    .gallery-section { padding-top: 3rem; }
    .gallery-lightbox-panel { padding: 2.25rem 1rem 1.5rem; }
    .gallery-lightbox-close { right: 0.6rem; }
    .gallery-lightbox-prev { left: 0.6rem; }
    .gallery-lightbox-next { right: 0.6rem; }
}

@media (max-width: 29.99rem) {
    .gallery-photo-grid { grid-template-columns: 1fr; }
    .gallery-album-grid { grid-template-columns: 1fr; }
}
