/* SGM editorial gallery — responsive refinement v2.1
   Preserves the approved editorial look while correcting page-builder width
   constraints, desktop album columns and mobile gutters. */
.sgm-public-gallery{
    box-sizing:border-box;
    --sgm-paper:#f7f4ed;
    --sgm-ink:#34251d;
    --sgm-muted:#76695e;
    --sgm-gold:#9b6d27;
    background:var(--sgm-paper);
    color:var(--sgm-ink);
    font-family:inherit;
    /* Stay inside the page-builder column: 100vw breakout caused mobile edge clipping. */
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:0 auto;
    padding:76px clamp(20px, 4vw, 48px) 100px;
    overflow:clip;
}
.sgm-public-gallery *{box-sizing:border-box}
.sgm-public-inner{display:block;width:100%;max-width:1176px;min-width:0;margin:0 auto}
.sgm-public-heading{margin:0 0 43px}
.sgm-public-eyebrow{display:block;color:var(--sgm-gold);font-size:10px;font-weight:700;letter-spacing:.2em;margin:0 0 20px;text-transform:uppercase}
.sgm-public-eyebrow span{color:#b6a182;margin-right:8px}
.sgm-public-heading h1{font-family:Georgia,'Times New Roman',serif;font-size:clamp(42px,5vw,58px);font-weight:700;font-style:italic;line-height:1.04;letter-spacing:-.035em;color:var(--sgm-ink);margin:0 0 13px}
.sgm-public-heading>p,.sgm-public-intro{font-size:14px;line-height:1.7;color:var(--sgm-muted);margin:0;max-width:720px}

/* Two-column album layout on desktop */
.sgm-editorial-albums{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:34px;row-gap:48px}
.sgm-editorial-row{display:flex;flex-direction:column;align-items:stretch;min-width:0;gap:0}
.sgm-editorial-image{display:block;width:100%;aspect-ratio:1.65/1;overflow:hidden;background:#e8e4dc;color:#76695e;text-decoration:none;position:relative;isolation:isolate}
.sgm-editorial-image:after{content:"";position:absolute;inset:0;border:1px solid rgba(52,37,29,.07);pointer-events:none}
.sgm-editorial-image img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.2,.65,.3,1)}
.sgm-editorial-image:hover img{transform:scale(1.035)}
.sgm-editorial-image>span{position:absolute;inset:0;display:grid;place-items:center;font-size:13px}
.sgm-editorial-copy{padding:20px 2px 0}
.sgm-editorial-count{display:block;color:var(--sgm-gold);font-size:9px;font-weight:700;letter-spacing:.16em;margin-bottom:11px}
.sgm-editorial-copy h2{font-family:Georgia,'Times New Roman',serif;font-size:clamp(23px,2vw,28px);font-style:italic;font-weight:700;line-height:1.2;color:var(--sgm-ink);margin:0 0 13px}
.sgm-editorial-description{font-size:12px;line-height:1.8;color:var(--sgm-muted);max-width:470px;margin:0 0 18px}
.sgm-editorial-description p{margin:0}
.sgm-editorial-link{display:inline-flex;align-items:center;gap:11px;color:#80571f;text-decoration:none;font-size:13px;font-weight:700;transition:gap .2s ease}
.sgm-editorial-link:hover{color:#4f3821;gap:16px}
.sgm-editorial-link span{font-size:18px;line-height:1}
.sgm-public-empty{padding:35px 0;color:var(--sgm-muted);font-size:14px}
.sgm-album-back{display:inline-block;color:#80571f;text-decoration:none;font-size:12px;font-weight:700;margin:0 0 30px}
.sgm-album-public-heading{margin-bottom:35px}
.sgm-album-public-heading h1{font-size:clamp(36px,4vw,48px)}
.sgm-album-public-heading>p{font-size:12px;color:var(--sgm-gold);margin-top:12px}
.sgm-public-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.sgm-public-photo{display:block;border:0;padding:0;aspect-ratio:4/3;overflow:hidden;background:#e8e4dc;cursor:zoom-in}
.sgm-public-photo img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .45s ease}
.sgm-public-photo:hover img{transform:scale(1.04)}
.sgm-photo-lightbox{display:none;position:fixed;inset:0;z-index:999999;background:rgba(22,17,13,.96);align-items:center;justify-content:center;padding:60px 75px}
.sgm-photo-lightbox.is-open{display:flex}
.sgm-photo-lightbox button{position:absolute;border:0;background:transparent;color:#fff;cursor:pointer;font-family:Arial,sans-serif;font-weight:300}
.sgm-lb-close{top:18px;right:25px;font-size:38px}
.sgm-lb-prev,.sgm-lb-next{top:50%;transform:translateY(-50%);font-size:55px}
.sgm-lb-prev{left:18px}.sgm-lb-next{right:18px}
.sgm-lb-content{height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.sgm-lb-content img{max-width:100%;max-height:calc(100% - 28px);object-fit:contain}
.sgm-lb-count{align-self:flex-start;color:#eee;font-size:11px;letter-spacing:.1em}
body.sgm-photo-view-open{overflow:hidden}

/* Tablet: retain two columns where each card remains comfortable */
@media(max-width:900px){
    .sgm-public-gallery{padding-left:clamp(22px,4vw,32px);padding-right:clamp(22px,4vw,32px)}
    .sgm-editorial-albums{column-gap:24px;row-gap:40px}
    .sgm-editorial-copy{padding-top:17px}
    .sgm-public-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Mobile: single column with a deliberate, consistent 20px gutter */
@media(max-width:600px){
    .sgm-public-gallery{
        width:100%;
        max-width:100%;
        margin:0 auto;
        padding:48px 22px 64px;
        overflow:clip;
    }
    .sgm-public-inner{width:100%;max-width:100%;min-width:0}
    .sgm-public-heading{margin-bottom:30px}
    .sgm-public-eyebrow{font-size:9px;letter-spacing:.18em;margin-bottom:16px}
    .sgm-public-heading h1{font-size:clamp(37px,10vw,46px);line-height:1.06;margin-bottom:12px}
    .sgm-public-heading>p{font-size:13px;line-height:1.7}
    .sgm-editorial-albums{grid-template-columns:minmax(0,1fr);gap:38px}
    .sgm-editorial-row{width:100%;min-width:0}
    .sgm-editorial-image{width:100%;aspect-ratio:1.55/1}
    .sgm-editorial-copy{padding:15px 1px 0}
    .sgm-editorial-count{font-size:9px;margin-bottom:9px}
    .sgm-editorial-copy h2{font-size:25px;margin-bottom:10px}
    .sgm-editorial-description{font-size:12px;line-height:1.7;margin-bottom:13px}
    .sgm-editorial-link{font-size:12px}
    .sgm-public-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .sgm-photo-lightbox{padding:55px 42px}
    .sgm-lb-prev{left:2px}.sgm-lb-next{right:2px}
    .sgm-lb-prev,.sgm-lb-next{font-size:40px}
}
@media(prefers-reduced-motion:reduce){.sgm-public-gallery *{transition:none!important}}

/* Mobile edge protection: prevent long text, images or theme defaults causing horizontal overflow. */
.sgm-public-gallery, .sgm-public-gallery .sgm-public-inner, .sgm-public-gallery .sgm-editorial-row, .sgm-public-gallery .sgm-editorial-copy {min-width:0;max-width:100%;}
.sgm-public-gallery img {max-width:100%;}
.sgm-public-gallery .sgm-public-heading h1, .sgm-public-gallery .sgm-editorial-copy h2 {overflow-wrap:anywhere;}
@media(max-width:600px){.sgm-public-gallery{padding-left:22px!important;padding-right:22px!important}.sgm-public-gallery .sgm-editorial-image{width:100%;max-width:100%}.sgm-public-gallery .sgm-editorial-description,.sgm-public-gallery .sgm-public-heading>p{overflow-wrap:break-word}}


/* v2.3: centred editorial canvas — preserve the approved two-column UX. */
@media (min-width: 901px) {
    .sgm-public-gallery {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }
    .sgm-public-inner {
        max-width: 1060px !important;
    }
    .sgm-editorial-albums {
        column-gap: 30px;
        row-gap: 44px;
    }
}

/* v2.3: robust, theme-independent lightbox controls and an opaque backdrop.
   This prevents page-builder button styles and background content bleeding through. */
.sgm-photo-lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 56px 82px !important;
    background: rgba(15, 12, 10, .985) !important;
    isolation: isolate;
}
.sgm-photo-lightbox.is-open {
    display: flex !important;
}
.sgm-photo-lightbox .sgm-lb-content {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.sgm-photo-lightbox .sgm-lb-content img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: min(100%, 1120px) !important;
    max-height: 78vh !important;
    object-fit: contain !important;
    box-shadow: 0 18px 65px rgba(0,0,0,.28);
}
.sgm-photo-lightbox .sgm-lb-count {
    width: min(100%, 1120px);
    color: rgba(255,255,255,.78) !important;
    font-size: 11px !important;
    letter-spacing: .12em;
}
.sgm-photo-lightbox button.sgm-lb-close,
.sgm-photo-lightbox button.sgm-lb-prev,
.sgm-photo-lightbox button.sgm-lb-next {
    position: fixed !important;
    z-index: 3 !important;
    display: grid !important;
    place-items: center !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(214,177,112,.48) !important;
    border-radius: 50% !important;
    background: rgba(28, 25, 21, .72) !important;
    color: #f7f1e8 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font-family: Arial, sans-serif !important;
    font-size: 27px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-transform: none !important;
    transform: none !important;
    opacity: 1 !important;
    cursor: pointer !important;
}
.sgm-photo-lightbox button.sgm-lb-close:hover,
.sgm-photo-lightbox button.sgm-lb-prev:hover,
.sgm-photo-lightbox button.sgm-lb-next:hover {
    background: #b78b45 !important;
    border-color: #b78b45 !important;
    color: #fff !important;
}
.sgm-photo-lightbox button.sgm-lb-close {
    top: 24px !important;
    right: 28px !important;
    font-size: 25px !important;
}
.sgm-photo-lightbox button.sgm-lb-prev {
    top: 50% !important;
    left: 24px !important;
    transform: translateY(-50%) !important;
}
.sgm-photo-lightbox button.sgm-lb-next {
    top: 50% !important;
    right: 24px !important;
    transform: translateY(-50%) !important;
}
@media (max-width: 700px) {
    .sgm-photo-lightbox {
        padding: 64px 18px 72px !important;
    }
    .sgm-photo-lightbox .sgm-lb-content img {
        max-width: 100% !important;
        max-height: 76vh !important;
    }
    .sgm-photo-lightbox button.sgm-lb-close {
        top: 12px !important;
        right: 12px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
    .sgm-photo-lightbox button.sgm-lb-prev {
        left: 10px !important;
    }
    .sgm-photo-lightbox button.sgm-lb-next {
        right: 10px !important;
    }
    .sgm-photo-lightbox button.sgm-lb-close,
    .sgm-photo-lightbox button.sgm-lb-prev,
    .sgm-photo-lightbox button.sgm-lb-next {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        font-size: 22px !important;
    }
}

/* Hide unrelated plugin notices only on this custom Gallery Manager screen.
   The Gallery Manager's own save confirmation remains visible. */
body.toplevel_page_sgm-gallery-manager #wpbody-content .notice:not(.sgm-gm-notice),
body.toplevel_page_sgm-gallery-manager #wpbody-content .updated:not(.sgm-gm-notice),
body.toplevel_page_sgm-gallery-manager #wpbody-content .error:not(.sgm-gm-notice),
body.toplevel_page_sgm-gallery-manager #wpbody-content .update-nag,
body.toplevel_page_sgm-gallery-manager #wpbody-content .e-notice,
body.toplevel_page_sgm-gallery-manager #wpbody-content .givewp-notice {
    display: none !important;
}
