/* ======================================================
   GALLERY EMBED HEADER
   ====================================================== */

.pc-gallery-embed {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 2rem auto !important;
}

.pc-gallery-embed-header {
    width: 100% !important;
    max-width: 850px !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: none !important;
}

/* Individual gallery shortcode title */
.pc-gallery-embed h3.pc-gallery-embed-title {
    display: block !important;
    width: auto !important;

    margin: 0 0 10px !important;
    padding: 0 !important;

    background: none !important;
    background-color: transparent !important;
    background-image: none !important;

    color: #131313!important;

    font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;

    text-transform: none !important;

    border: 0 !important;
    box-shadow: none !important;
}

.pc-gallery-embed-description {
    width: 100% !important;
    max-width: 800px !important;

    margin: 0 0 1.5rem !important;
    padding: 0 !important;

    background: none !important;

    color: #555 !important;

    font-size: 1.05rem !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;
}

.pc-gallery-embed-description p {
    margin: 0 0 12px !important;
}

.pc-gallery-embed-description p:last-child {
    margin-bottom: 0 !important;
}

.pc-gallery-embed-description:empty {
    display: none !important;
}


/* ======================================================
   ALBUM CARDS
   ====================================================== */

.pc-gallery-albums {
    display: grid;

    grid-template-columns:
        repeat(
            var(--pc-gallery-columns, 3),
            minmax(0, 1fr)
        );

    gap: 24px;

    margin: 2rem 0;
}

.pc-gallery-album {
    overflow: hidden;

    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 10px 28px
        rgba(0, 0, 0, 0.08);
}

.pc-gallery-album-link {
    display: block;

    height: 100%;

    color: inherit;

    text-decoration: none;
}

.pc-gallery-album-image {
    position: relative;

    overflow: hidden;

    aspect-ratio: 4 / 3;

    background: #eee;
}

.pc-gallery-album-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.35s ease;
}

.pc-gallery-album-link:hover
.pc-gallery-album-image img {
    transform: scale(1.035);
}

.pc-gallery-photo-count {
    position: absolute;

    top: 14px;
    right: 14px;

    padding: 7px 11px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.68);

    color: #fff;

    font-size: 0.8rem;
}

.pc-gallery-album-content {
    padding: 18px;
}

.pc-gallery-album-content h2 {
    margin: 0 0 7px;

    font-size: 1.3rem;
    line-height: 1.25;
    font-style: normal;
}

.pc-gallery-album-content p {
    margin: 0;

    color: #68616d;

    line-height: 1.55;
    font-size: 1rem;
    font-weight: 400;
}


/* ======================================================
   GALLERY GRID
   ====================================================== */

.pc-photo-gallery {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;
}

.pc-gallery-photo-wrap {
    margin: 0;

    min-width: 0;
}

.pc-gallery-photo {
    position: relative;

    display: block;

    width: 100%;

    overflow: hidden;

    border-radius: 10px;

    background: #eee;

    aspect-ratio: 4 / 3;

    cursor: pointer;

    text-decoration: none;
}

.pc-gallery-photo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

.pc-gallery-photo:hover img {
    transform: scale(1.035);

    filter: brightness(0.9);
}

.pc-gallery-photo:focus-visible {
    outline: 4px solid #CDA177;

    outline-offset: 4px;
}

.pc-gallery-photo-wrap:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.pc-gallery-photo-wrap:first-child
.pc-gallery-photo {
    min-height: 520px;

    height: 100%;

    aspect-ratio: auto;
}

.pc-gallery-grid-caption {
    padding: 8px 2px 0;

    color: #68616d;

    font-size: 0.9rem;
    line-height: 1.45;
}


/* ======================================================
   CSS-ONLY LIGHTBOX
   ====================================================== */

.pc-gallery-css-lightbox {
    position: fixed;

    inset: 0;

    z-index: 999999;

    display: none;

    place-items: center;

    padding: 20px;
}

.pc-gallery-css-lightbox:target {
    display: grid;
}

.pc-gallery-css-backdrop {
    position: absolute;

    inset: 0;

    background: rgba(10, 7, 13, 0.95);
}

.pc-gallery-css-dialog {
    position: relative;

    z-index: 2;

    width: min(1200px, 100%);
}

.pc-gallery-css-dialog img {
    display: block;

    width: 100%;

    max-height: 82vh;

    object-fit: contain;

    background: #000;
}

.pc-gallery-css-close,
.pc-gallery-css-nav {
    position: absolute;

    z-index: 5;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background: rgba(0, 0, 0, 0.72);

    color: #fff !important;

    text-decoration: none !important;

    font-size: 24px;
    line-height: 1;
}

.pc-gallery-css-close {
    top: 12px;
    right: 12px;
}

.pc-gallery-css-nav {
    top: 50%;

    transform: translateY(-50%);
}

.pc-gallery-css-prev {
    left: 12px;
}

.pc-gallery-css-next {
    right: 12px;
}

.pc-gallery-css-close:hover,
.pc-gallery-css-nav:hover,
.pc-gallery-css-close:focus-visible,
.pc-gallery-css-nav:focus-visible {
    background: #4E008E;
}

.pc-gallery-css-footer {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding-top: 12px;

    color: #fff;
}

.pc-gallery-css-caption {
    font-size: 0.95rem;
    line-height: 1.5;
}

.pc-gallery-css-counter {
    flex: 0 0 auto;

    color: rgba(255, 255, 255, 0.72);

    font-size: 0.9rem;
}


/* ======================================================
   SINGLE GALLERY / ARCHIVE PAGE
   ====================================================== */

.pc-single-gallery,
.pc-gallery-archive {
    width: min(1180px, calc(100% - 40px)) !important;

    max-width: 1180px !important;

    margin: 48px auto 80px !important;

    padding: 0 !important;
}


/* Single gallery page header */
.pc-single-gallery .pc-gallery-header,
.pc-gallery-archive .pc-gallery-archive-header {
    width: 100% !important;

    max-width: 850px !important;

    margin: 0 0 32px !important;

    padding: 0 !important;

    background: none !important;

    box-shadow: none !important;
}


/* Individual gallery page title — H3 */
.pc-single-gallery
.pc-gallery-header
h3 {
    display: block !important;

    width: auto !important;
    max-width: none !important;

    margin: 0 0 12px !important;

    padding: 0 !important;

    background: none !important;
    background-color: transparent !important;
    background-image: none !important;

    color: #131313 !important;

    font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;

    text-transform: none !important;

    border: 0 !important;

    box-shadow: none !important;
}


/* Archive page H1 stays an H1 */
.pc-gallery-archive
.pc-gallery-archive-header
h1 {
    display: block !important;

    width: auto !important;

    margin: 0 0 12px !important;

    padding: 0 !important;

    background: none !important;
    background-color: transparent !important;
    background-image: none !important;

    color: #311662 !important;

    font-size: clamp(2.2rem, 4vw, 3.4rem) !important;
    font-weight: 700 !important;
    line-height: 1.08 !important;

    text-transform: none !important;

    border: 0 !important;

    box-shadow: none !important;
}


/* Gallery descriptions */
.pc-gallery-description,
.pc-gallery-archive-header p {
    width: 100% !important;

    max-width: 800px !important;

    margin: 0 !important;

    padding: 0 !important;

    background: none !important;

    color: #555 !important;

    font-size: 1.05rem !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;
}

.pc-gallery-description p {
    margin: 0 0 12px !important;
}

.pc-gallery-description p:last-child {
    margin-bottom: 0 !important;
}

.pc-gallery-description:empty {
    display: none !important;
}


/* ======================================================
   TABLET
   ====================================================== */

@media (max-width: 900px) {

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

    .pc-gallery-photo-wrap:first-child {
        grid-column: span 2;
    }

    .pc-gallery-photo-wrap:first-child
    .pc-gallery-photo {
        min-height: 420px;
    }
}


/* ======================================================
   MOBILE
   ====================================================== */

@media (max-width: 600px) {

    .pc-single-gallery,
    .pc-gallery-archive {
        width: calc(100% - 24px) !important;

        margin-top: 30px !important;
        margin-bottom: 50px !important;
    }

    .pc-gallery-embed
    h3.pc-gallery-embed-title,
    .pc-single-gallery
    .pc-gallery-header
    h3 {
        font-size: 1.6rem !important;
    }

    .pc-gallery-archive
    .pc-gallery-archive-header
    h1 {
        font-size: 2.25rem !important;
    }
}


@media (max-width: 580px) {

    .pc-gallery-albums,
    .pc-photo-gallery {
        grid-template-columns: 1fr;
    }

    .pc-gallery-photo-wrap:first-child {
        grid-column: auto;
        grid-row: auto;
    }

    .pc-gallery-photo,
    .pc-gallery-photo-wrap:first-child
    .pc-gallery-photo {
        min-height: 0;

        aspect-ratio: 16 / 10;
    }

    .pc-gallery-css-lightbox {
        padding: 10px;
    }

    .pc-gallery-css-close,
    .pc-gallery-css-nav {
        width: 44px;
        height: 44px;
    }

    .pc-gallery-css-footer {
        display: block;
    }

    .pc-gallery-css-counter {
        margin-top: 5px;
    }
}


/* ======================================================
   REDUCED MOTION
   ====================================================== */

@media (prefers-reduced-motion: reduce) {

    .pc-gallery-photo img,
    .pc-gallery-album-image img {
        transition: none;
    }
}