/* ================================================================
   LAYOUT.CSS — FOOTER NATURAL (VERSÃO FINAL LIMPA)
================================================================ */

/* RESET */
.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
html,
body {
    height: auto;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2d3d;
    line-height: 1.4;
}

/* NAVBAR */
.navbar {
    width: 100%;
    height: 58px;
    background: #4C7DA6;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    position: sticky;
    top: 0;
    z-index: 20;
}

.navbar .left,
.navbar .right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo img {
    height: 40px;
    object-fit: contain;
}

.hamburger {
    display: none;
}

/* SEARCH */
.search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .25);
    border-radius: 6px;
    padding: 3px 6px;
}

.search input {
    border: none;
    outline: none;
    background: transparent;
    color: white;
    width: 160px;
}

.search button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

/* BUTTONS */
.toggle-btn,
.unlock-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .18);
    color: white;
    cursor: pointer;
    transition: .2s;
}

.toggle-btn:hover,
.unlock-btn:hover {
    background: rgba(255, 255, 255, .35);
}

/* FILTER BAR */
.filter-bar {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #c6d3e1;
    background: #e9f1f7;
    position: sticky;
    top: 58px;
    z-index: 2000;
}

.filter-label {
    font-weight: 600;
    color: #2f4154;
}

.dd {
    position: relative;
}

/* DROPDOWNS */
.dropBtn {
    background: #4C7DA6;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.dropBtn:hover {
    background: #6FA3C5;
}

.dropdown {
    position: absolute;
    top: 38px;
    left: 0;
    width: 180px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 0;
    display: none;
    z-index: 25000;
}

.dropdown:not(.hidden) {
    display: block;
}

.dropdown .dropdown-item {
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown .dropdown-item:hover {
    background: #e3e8ef;
}

/* FILTER BLOCKS */
.filters-sticky {
    width: 100%;
    background: #f7f9fc;
    padding: 8px 12px;
    border-bottom: 1px solid #d0d4dc;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filters.hidden {
    display: none;
}

.filter-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-title {
    font-weight: 600;
    color: #2f4154;
}

.chip-btn {
    padding: 6px 10px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    cursor: pointer;
}

.chip-btn:hover {
    background: #cdd6df;
}

.chip-btn.active {
    background: #4C7DA6;
    color: white;
    border-color: #4C7DA6;
}

/* BANNER */
#banner {
    width: 100%;
    overflow: visible !important;
    position: relative;
}

#banner img {
    width: 100%;
    height: auto !important;
    object-fit: contain !important;
    display: block;
}

#banner figcaption {
    margin-top: 6px;
    font-size: 14px;
    color: #4b5563;
}

.column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.thumb {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .18);
}

/* LOAD MORE — largura estreita, PC + Mobile */
.load-btn {
    display: block;
    padding: 10px 20px;
    background: #4C7DA6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.load-btn:hover {
    background: #6FA3C5;
}

#loadMore {
    position: static;
    display: block;
    width: min(92vw, 420px);
    margin: 24px auto;
    z-index: auto;
}

/* ZOOM */
#zoomModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#zoomModal.hidden {
    display: none !important;
}

#zoomImg {
    display: block;
    max-width: 88vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(255, 255, 255, .3);
}

.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 48px;
    cursor: pointer;
    padding: 8px;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 36px;
    cursor: pointer;
    color: white;
}

#zoomCaption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    color: #e5e7eb;
    text-align: center;
    font-size: 14px;
}

/* MODAIS */
#loginModal,
.modalAdvice {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

#loginModal.hidden,
.modalAdvice.hidden {
    display: none !important;
}

#loginModal .modal-box {
    width: min(92vw, 420px);
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

#loginModal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

#loginError {
    color: #b91c1c;
    font-size: 14px;
}

/* SKELETON / LOADER */
.loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .6);
    z-index: 3000;
}

.loading .loader {
    display: flex;
}

.thumb-wrap {
    position: relative;
}

/* FOOTER — NATURAL */
footer {
    position: static;
    width: 100%;
    padding: 12px;
    margin-top: 24px;
    /* Espaço entre botão e footer */
    background: #e9eff5;
    color: #334155;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-top: 1px solid #d0d4dc;
}

@media (max-width: 700px) {
    #loginModal .btns {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}

/* =============================================
   FIX DEFINITIVO MOBILE – Remover faixa lateral
   ============================================= */
@media (max-width: 900px) {

    html,
    body {
        width: 100%;
        overflow-x: hidden !important;
        /* corta qualquer overflow horizontal */
    }

    /* Anula as margens de 20% do desktop quando estiver em mobile */
    #gallery {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 8px;
        /* opcional: um pouco de respiro lateral */
    }

    .column {
        width: 100% !important;
    }

    /* Defesa global: nada ultrapassa a largura do ecrã */
    img,
    video,
    iframe,
    canvas {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }
}


/* ================================================
   LAYOUT DA MASONRY — MOBILE-FIRST (sem conflitos)
   ================================================ */

/* Base: mobile muito pequeno (1 coluna) */
.masonry {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 coluna */
    gap: 12px;
    width: 100%;
    padding: 12px;
}

/* Telefone normal e phablet: 2 colunas, sem overflow */
@media (min-width: 400px) and (max-width: 900px) {
    .masonry {
        grid-template-columns: repeat(2, 1fr);
        /* 2 colunas */
        gap: 12px;
    }
}

/* Tablet/Desktop: 3 colunas (ajusta à tua preferência) */
@media (min-width: 901px) {
    .masonry {
        grid-template-columns: repeat(3, 1fr);
        /* 3 colunas */
        gap: 16px;
        padding: 12px;
    }
}

/* Itens da grelha (garantia de que ocupam a célula toda) */
.column {
    width: 100%;
}

/* Imagens: nunca ultrapassar a célula */
img.thumb {
    width: 100%;
    height: auto;
    display: block;
}

/* Defesa contra faixa lateral (mantém) */
html,
body {
    width: 100%;
    overflow-x: hidden;
}