/* =================================================
   TIPOGRAFIA – SD EDITORIAL GALLERY
   ================================================= */

.sd-eg-grid,
.sd-eg-lightbox-content {
    font-family: 'Montserrat', sans-serif;
}

/* =================================================
   RESET LOCAL
   ================================================= */

.sd-eg-grid,
.sd-eg-item,
.sd-eg-image,
.sd-eg-lightbox,
.sd-eg-lightbox-content {
    box-sizing: border-box;
}

/* =================================================
   GRID / MASONRY – MOBILE FIRST
   ================================================= */

/* MOBILE – 1 COLUNA REAL */
.sd-eg-grid {
    display: block;
    column-count: 1;
    column-gap: 0;
    padding-left: 16px;
    padding-right: 16px;
}

/* ITEM */
.sd-eg-item {
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 32px;
    cursor: pointer;
    transition: transform .2s ease;
}

.sd-eg-item:hover {
    transform: translateY(-2px);
}

/* CONTAINER DA IMAGEM */
.sd-eg-image {
    width: 100%;
    overflow: hidden;
}

/* IMAGEM – SEM CORTE */
.sd-eg-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* TEXTO */
.sd-eg-title {
    font-weight: 600;
    font-size: 16px;
    margin: 12px 0 6px;
}

.sd-eg-excerpt {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
}

/* =================================================
   DESKTOP – ATIVA MASONRY
   ================================================= */

@media (min-width: 769px) {
    .sd-eg-grid {
        column-count: var(--sd-eg-columns);
        column-gap: 32px;
    }
}

/* =================================================
   LIGHTBOX – BASE
   ================================================= */

#sd-eg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: none;
    z-index: 9999;
    padding: 16px;
}

#sd-eg-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CONTEÚDO DO LIGHTBOX */
.sd-eg-lightbox-content {
    background: #fff;
    width: 100%;
    max-width: 1000px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 24px 96px; /* espaço para botão fechar */
    position: relative;
}

/* IMAGEM DESTACADA */
.sd-eg-lightbox-featured img {
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 24px;
}

/* ===============================
   LIGHTBOX – MIOLO EDITORIAL
   =============================== */

.sd-eg-lightbox-body {
    padding: 32px;
}


/* MOBILE – AJUSTES FINOS */
@media (max-width: 600px) {
    .sd-eg-lightbox-content {
        padding: 16px 16px 96px;
    }

    .sd-eg-lightbox-featured img {
        max-height: 60vh;
    }
}

/* =================================================
   BOTÃO FECHAR – DEFINITIVO
   ================================================= */

#sd-eg-lightbox .sd-eg-close {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 36px;
    height: 36px;

    background: rgba(0,0,0,.6);
    color: #fff;

    border-radius: 50%;
    font-size: 32px;
    line-height: 1;

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

    z-index: 10001;
    cursor: pointer;

    /* 🔑 REMOVE ESTILO NATIVO */
    border: none;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;

    transition: opacity .2s ease, transform .2s ease;
}


#sd-eg-lightbox .sd-eg-close:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* =================================================
   BOTÕES DE NAVEGAÇÃO
   ================================================= */

.sd-eg-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);

    width: 36px;
    height: 36px;

    background: rgba(0,0,0,.7);
    color: #fff;

    font-size: 22px;
    line-height: 1;              /* remove interferência */
    padding: 0;                  /* remove padding nativo */

    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10001;

    display: flex;               /* 🔑 chave */
    align-items: center;         /* centraliza vertical */
    justify-content: center;     /* centraliza horizontal */
}


.sd-eg-prev {
    left: 24px;
}

.sd-eg-next {
    right: 24px;
}

/* =================================================
   SCROLLBAR – LIGHTBOX
   ================================================= */

/* Webkit */
#sd-eg-lightbox .sd-eg-lightbox-content::-webkit-scrollbar {
    width: 8px;
}

#sd-eg-lightbox .sd-eg-lightbox-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

#sd-eg-lightbox .sd-eg-lightbox-content::-webkit-scrollbar-thumb {
    background-color: #999;
    border-radius: 8px;
    border: 2px solid #f1f1f1;
}

#sd-eg-lightbox .sd-eg-lightbox-content::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

/* Firefox */
#sd-eg-lightbox .sd-eg-lightbox-content {
    scrollbar-width: thin;
    scrollbar-color: #999 #f1f1f1;
}
@media (max-width: 600px) {
    .sd-eg-nav {
        opacity: 0.5;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}
.sd-eg-lightbox::after {
    content: "Arraste para navegar";
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #fff;
    opacity: 0.7;
}