/* =========================================================
   GALLERY SHARED TAGS
========================================================= */

body.page-template-page-gallery-php .gallery-type-tag,
body.single-gallery_event .gallery-type-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(90, 0, 17, .10);
    border: 1px solid rgba(90, 0, 17, .18);
    color: var(--maroon2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

/* =========================================================
   GALLERY PAGE
========================================================= */

body.page-template-page-gallery-php .gallery-page {
    position: relative;
    padding: 0 0 104px;
    overflow: hidden;
}


body.page-template-page-gallery-php .gallery-page::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(980px 380px at 14% 0%, rgba(246, 199, 76, .11), rgba(246, 199, 76, 0) 62%),
        radial-gradient(900px 460px at 86% 14%, rgba(90, 0, 17, .08), rgba(90, 0, 17, 0) 66%);
}


body.page-template-page-gallery-php .gallery-page .container {
    position: relative;
    z-index: 1;
}

body.page-template-page-gallery-php .gallery-page-head h2 {
    margin: 4px 0 8px;
}

body.page-template-page-gallery-php .gallery-page-head p {
    max-width: 72ch;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

/* =========================================================
   FILTER TOOLBAR
========================================================= */

body.page-template-page-gallery-php .gallery-toolbar {
    margin: 24px 0 16px;
    padding: 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, var(--theme-card-strong), var(--theme-card));
    border: 1px solid rgba(90, 0, 17, .13);
    box-shadow:
        0 24px 52px rgba(15, 23, 42, .09),
        inset 0 1px 0 rgba(255, 255, 255, .72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.page-template-page-gallery-php .gallery-toolbar-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
    gap: 14px;
}

body.page-template-page-gallery-php .gallery-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.page-template-page-gallery-php .gallery-toolbar-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(90, 0, 17, .11);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.page-template-page-gallery-php .gallery-results-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
}

body.page-template-page-gallery-php .gallery-toolbar-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* =========================================================
   GRID / CARDS
========================================================= */

body.page-template-page-gallery-php .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 380px));
    gap: 24px;
    justify-content: center;
}

/* Keep sparse result sets visually balanced on wide canvases */
body.page-template-page-gallery-php .gallery-grid > .gallery-card:only-child {
    grid-column: 1 / -1;
    width: min(100%, 440px);
    justify-self: center;
}

body.page-template-page-gallery-php .gallery-card {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--theme-card-strong), var(--theme-card));
    border: 1px solid rgba(90, 0, 17, .10);
    box-shadow: var(--theme-shadow-md);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display: flex;
    flex-direction: column;
}

body.page-template-page-gallery-php .gallery-card.is-featured {
    border-color: rgba(242, 182, 31, .45);
}

body.page-template-page-gallery-php .gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--theme-shadow-lg);
    border-color: var(--theme-border-strong);
}

body.page-template-page-gallery-php .gallery-card-media {
    position: relative;
    display: block;
    height: 240px;
    background-size: cover;
    background-position: center;
    background-color: #d4c9cc;
    overflow: hidden;
}

body.page-template-page-gallery-php .gallery-card-media::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(31, 17, 22, .45) 100%);
}

body.page-template-page-gallery-php .gallery-pill {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.page-template-page-gallery-php .gallery-pill-year {
    top: 14px;
    left: 14px;
    background: var(--theme-card-strong);
    color: var(--maroon);
    border: 1px solid var(--theme-border);
    box-shadow:
        0 10px 22px rgba(15, 23, 42, .10),
        inset 0 1px 0 rgba(255, 255, 255, .70);
    font-size: 11px;
    letter-spacing: .08em;
}

body.page-template-page-gallery-php .gallery-pill-count {
    right: 14px;
    bottom: 14px;
    background: rgba(255, 255, 255, .85);
    color: var(--maroon2);
    border: 1px solid rgba(255, 255, 255, .65);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

body.page-template-page-gallery-php .gallery-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.page-template-page-gallery-php .gallery-card-tags {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.page-template-page-gallery-php .gallery-card h3 {
    margin: 0 0 10px;
    font-size: clamp(1.2rem, 1.35vw, 1.42rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

body.page-template-page-gallery-php .gallery-card h3 a {
    color: var(--text);
    text-decoration: none;
}

body.page-template-page-gallery-php .gallery-card h3 a:hover,
body.page-template-page-gallery-php .gallery-card h3 a:focus-visible {
    color: var(--maroon);
}

body.page-template-page-gallery-php .gallery-meta {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 14.5px;
    color: #68545a;
}

body.page-template-page-gallery-php .gallery-meta-key {
    color: var(--maroon2);
    font-weight: 800;
}

body.page-template-page-gallery-php .gallery-summary {
    margin: 0;
    color: #4d3b40;
    line-height: 1.62;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.page-template-page-gallery-php .gallery-card-actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
}

body.page-template-page-gallery-php .gallery-card-actions .btn {
    width: 100%;
    justify-content: center;
}

body.page-template-page-gallery-php .gallery-pagination {
    margin-top: 34px;
    display: flex;
    justify-content: center;
}

body.page-template-page-gallery-php .gallery-pagination .page-numbers {
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    margin: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid var(--theme-border);
    background: var(--theme-card-strong);
    color: var(--text);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

body.page-template-page-gallery-php .gallery-pagination .page-numbers.current {
    background: var(--maroon);
    border-color: var(--maroon);
    color: #fff;
    box-shadow: 0 12px 24px rgba(90, 0, 17, .22);
}

body.page-template-page-gallery-php .gallery-pagination .page-numbers:hover,
body.page-template-page-gallery-php .gallery-pagination .page-numbers:focus-visible {
    transform: translateY(-1px);
    border-color: var(--theme-border-strong);
    box-shadow: var(--theme-shadow-sm);
}

body.page-template-page-gallery-php .gallery-empty,
body.single-gallery_event .gallery-empty {
    padding: 36px;
    border-radius: 24px;
    text-align: center;
    border: 1px dashed rgba(90, 0, 17, .18);
}

body.page-template-page-gallery-php .gallery-empty h3,
body.single-gallery_event .gallery-empty h3 {
    margin: 0 0 10px;
}

body.page-template-page-gallery-php .gallery-empty p,
body.single-gallery_event .gallery-empty p {
    margin: 0 0 18px;
    color: var(--muted);
}

/* =========================================================
   SINGLE GALLERY EVENT
========================================================= */

body.single-gallery_event .gallery-single {
    padding: 80px 0 84px;
}

body.single-gallery_event .gallery-meta-panel,
body.single-gallery_event .gallery-single-intro {
    background: linear-gradient(180deg, var(--theme-card-strong), var(--theme-card));
    border: 1px solid var(--theme-border);
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 26px;
    box-shadow: var(--theme-shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.single-gallery_event .gallery-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.single-gallery_event .gallery-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 244, 245, .92));
    border: 1px solid rgba(90, 0, 17, .24);
    color: var(--maroon-strong);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .01em;
    box-shadow:
        0 8px 18px rgba(15, 23, 42, .08),
        inset 0 1px 0 rgba(255, 255, 255, .72);
}

/* Match taxonomy chips to the same richer chip language on single gallery */
body.single-gallery_event .gallery-type-tag {
    background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(248, 244, 245, .9));
    border-color: rgba(90, 0, 17, .24);
    color: var(--maroon-strong);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, .07),
        inset 0 1px 0 rgba(255, 255, 255, .7);
}

body.single-gallery_event .gallery-single-prose {
    max-width: 74ch;
    color: #24151a;
    line-height: 1.7;
}

body.single-gallery_event .gallery-single-prose > :first-child {
    margin-top: 0;
}

body.single-gallery_event .gallery-single-prose > :last-child {
    margin-bottom: 0;
}

body.single-gallery_event .gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

body.single-gallery_event .gallery-photo-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--theme-shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease;
    background: #d4c9cc;
}

body.single-gallery_event .gallery-photo-card:hover,
body.single-gallery_event .gallery-photo-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--theme-shadow-lg);
}

body.single-gallery_event .gallery-photo-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, .54) 100%);
}

body.single-gallery_event .gallery-photo-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

body.single-gallery_event .gallery-photo-caption {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 2;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1080px) {
    body.page-template-page-gallery-php .gallery-toolbar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-template-page-gallery-php .gallery-control--search {
        grid-column: 1 / -1;
    }

    body.page-template-page-gallery-php .gallery-grid,
    body.single-gallery_event .gallery-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    body.page-template-page-gallery-php .gallery-page,
    body.single-gallery_event .gallery-single {
        padding: 54px 0 74px;
    }

    body.page-template-page-gallery-php .gallery-toolbar,
    body.single-gallery_event .gallery-meta-panel,
    body.single-gallery_event .gallery-single-intro {
        padding: 20px;
        border-radius: 22px;
    }

    body.page-template-page-gallery-php .gallery-toolbar-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    body.page-template-page-gallery-php .gallery-toolbar-buttons {
        width: 100%;
    }

    body.page-template-page-gallery-php .gallery-toolbar-buttons .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    body.page-template-page-gallery-php .gallery-toolbar-grid,
    body.page-template-page-gallery-php .gallery-grid,
    body.single-gallery_event .gallery-photo-grid {
        grid-template-columns: 1fr;
    }

    body.page-template-page-gallery-php .gallery-card-media,
    body.single-gallery_event .gallery-photo-card img {
        height: 250px;
    }

    body.page-template-page-gallery-php .gallery-card-body {
        padding: 18px;
    }
}

/* =========================================================
   GALLERY LIGHTBOX POLISH
========================================================= */

:is(body.page-template-page-gallery-php, body.single-gallery_event) .goverlay {
    background: radial-gradient(1200px 700px at 50% 20%, rgba(20, 10, 14, .72), rgba(8, 8, 10, .94));
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .ginner-container {
    border-radius: 14px;
    overflow: hidden;
    margin: 0 auto !important;
    background: rgba(10, 10, 12, .96);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .42);
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-inner-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: auto !important;
    max-width: min(92vw, 1400px) !important;
    margin: 0 auto !important;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-media {
    border-radius: 0;
    overflow: hidden;
    width: auto !important;
    max-width: min(92vw, 1400px) !important;
    box-shadow: none;
    margin: 0 auto !important;
    padding: 0 !important;
    flex: 0 0 auto;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-image,
:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-image img,
:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-media img {
    border-radius: 0 !important;
    margin: 0 !important;
    display: block;
    max-width: 100%;
    height: auto;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-description {
    background: linear-gradient(180deg, rgba(18, 10, 14, .86), rgba(10, 10, 12, .92));
    border-top: 1px solid rgba(246, 199, 76, .22);
    width: 100% !important;
    max-width: min(92vw, 1400px) !important;
    border-radius: 0;
    margin-top: 0 !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex: 0 0 auto;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gdesc-inner {
    font-family: inherit;
    padding: 14px 18px;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-title {
    color: #fff;
    font-weight: 800;
    letter-spacing: .01em;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gslide-desc {
    color: rgba(255, 255, 255, .86);
    line-height: 1.55;
}

:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gnext,
:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gprev,
:is(body.page-template-page-gallery-php, body.single-gallery_event) .glightbox-clean .gclose {
    background: rgba(18, 10, 14, .62);
    border: 1px solid rgba(246, 199, 76, .28);
    border-radius: 999px;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, .28),
        inset 0 1px 0 rgba(255, 255, 255, .12);
}

body.page-template-page-gallery-php .gallery-page {
    padding-top: 0;
}

body.page-template-page-gallery-php .gallery-intro.page-intro {
    margin-bottom: 24px;
}

body.page-template-page-gallery-php .gallery-intro.page-intro .page-intro-head,
body.page-template-page-gallery-php .gallery-intro.page-intro .intro-panel {
    max-width: 100%;
}

body.page-template-page-gallery-php .gallery-intro .page-intro-sub {
    max-width: var(--max);
}

body.page-template-page-gallery-php .gallery-toolbar {
    margin-top: 0;
}
