/* ============================================================
   STYLE_COPILOT (versão final, limpa e otimizada)
   Look-up-Photos — Jorge Sá
   ============================================================ */

/* ------------------------------------------------------------
   0) RESET & BASE
   ------------------------------------------------------------ */
:root {
    --nav-height: 48px;
    --text-color: #111;
    --footer-bg: #3d3d3d;

    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 12px;

    --fs-base: 15px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 1.6vw, 18px);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", Arial, sans-serif;
    font-size: var(--fs-base);
    color: var(--text-color);
}

img {
    display: block;
    width: 100%;
    height: auto;
}

/* ------------------------------------------------------------
   1) NAVBAR
   ------------------------------------------------------------ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

nav {
    height: var(--nav-height);
    background: #a5a5a5;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
}

.menu-icon {
    font-size: 22px;
    cursor: pointer;
}

.logo img {
    height: calc(var(--nav-height) - 12px);
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 8px;
}

.nav-items li {
    list-style: none;
}

.nav-items>li>a {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: #000;
    text-decoration: none;
}

.nav-items>li>a:hover {
    color: darkgrey;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropbtn {
    background: transparent;
    border: none;
    cursor: pointer;
    height: var(--nav-height);
    padding: 0 14px;
    font-weight: 600;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #f1f1f1;
    min-width: 180px;
    top: 100%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.dropdown-content a {
    display: block;
    padding: 10px 14px;
    color: #000;
    text-decoration: none;
}

.dropdown-content a:hover {
    background: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Desktop */
@media (min-width: 1140px) {
    .menu-icon {
        display: none !important;
    }
}

/* Mobile menu */
@media (max-width: 1140px) {
    .nav-items {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: min(260px, 92vw);
        background: #cecece;
        padding: 8px 0;
        border-radius: 12px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    }

    .nav-items.active {
        display: flex;
    }

    .nav-items>li>a {
        color: #fff !important;
    }

    .dropdown-content {
        position: static !important;
        background: #757575 !important;
    }
}

/* ------------------------------------------------------------
   2) SCROLLMENUS
   ------------------------------------------------------------ */
.scrollmenu {
    overflow: auto;
    white-space: nowrap;
    text-align: center;
    background: linear-gradient(90deg, #a0a0a0, #fff 10%, #fff 90%, #a0a0a0);
}

.scrollmenu button {
    background: #b8b8b8;
    cursor: pointer;
}

/* ------------------------------------------------------------
   3) BANNER PRINCIPAL
   ------------------------------------------------------------ */
.mainContainer {
    margin-top: calc(var(--nav-height) + 44px);
    background: #e6e6e6;
    text-align: center;
}

#mainFigCaption {
    background: gainsboro;
    padding: 6px;
    font-size: 1.1em;
}

/* ------------------------------------------------------------
   4) GALERIA — 3 COLUNAS SEMPRE, MARGENS DINÂMICAS
   ------------------------------------------------------------ */

/* BLOCO DAS 3 COLUNAS — margens laterais responsivas */
.row {
    padding: 0 !important;
    margin-inline: clamp(4px, 6vw, 120px);
    /* margens proporcionais */
    width: auto;
    box-sizing: border-box;
}

/* 3 colunas sempre — width fixa 33.33% */
.column {
    float: left;
    width: calc(100% / 3);
    /* Moldura interna da coluna (máx 5 mm) */
    padding-left: clamp(1px, 1.2vw, 5mm);
    padding-right: clamp(1px, 1.2vw, 5mm);
    text-align: center;
    box-sizing: border-box;
}

/* Itens da grelha */
.photo-item {
    margin: 0 0 8px 0;
}

.photo-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ------------------------------------------------------------
   5) ZOOM
   ------------------------------------------------------------ */
#divModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#zoom {
    max-width: 100vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: grab;
}

.exitZoom,
.scrolLeft,
.scrolRight {
    position: fixed;
    width: 44px;
    height: 44px;
    background: rgba(235, 235, 235, 0.6);
    border-radius: 12px;
    color: #fff;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exitZoom {
    top: 16px;
    right: 16px;
}

.scrolLeft {
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
}

.scrolRight {
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
}

.zoomCaption {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 12px;
    border-radius: 12px;
    max-width: 90vw;
    z-index: 2200;
}

/* ------------------------------------------------------------
   6) FOOTER
   ------------------------------------------------------------ */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--footer-bg);
    color: #fff;
    text-align: center;
    padding: 6px;
}

/* ------------------------------------------------------------
   7) MODAIS (Password / Advertising)
   ------------------------------------------------------------ */
.modal-content {
    background: #fff;
    width: 300px;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid #304710;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
}

.modalAdvice {
    display: none;
    position: fixed;
    background: #c9c9c9;
    width: 60%;
    height: 70%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: auto;
}

/* ------------------------------------------------------------
   8) UTILITÁRIOS
   ------------------------------------------------------------ */
.active {
    color: darkgreen;
    font-weight: bold;
}

.block {
    display: block;
    width: 100%;
    background: #55b355;
    color: #fff;
    padding: 14px;
    border: none;
    cursor: pointer;
}

.block:hover {
    background: #ddd;
    color: #000;
}

/* ============================================================
   RESTAURAÇÃO DO SEARCH: LUPA DENTRO DO CAMPO + CAMPO À DIREITA
   ============================================================ */

/* Garante que o search alinha sempre à direita */
#searchForm {
    margin-left: auto !important;
    position: relative;
    display: flex;
    align-items: center;
}

/* Input com espaço interno para a lupa */
#searchForm .search-input,
#searchForm .search-data {
    padding-right: 36px !important;
    /* espaço para a lupa */
    height: 32px;
    line-height: 32px;
    border-radius: 18px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
    outline: none;
}

/* Lupa dentro do input, encostada à direita */
#searchForm .search-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 24px;
    width: 24px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ícone menor e alinhado */
#searchForm .search-btn .fa {
    font-size: 15px !important;
    color: #666;
}

/* <figure> sem legendas: remove margens default do user-agent */
.photo-item {
    margin: 0 0 8px 0;
    /* só espaço vertical entre itens */
}

/* imagens ocupam a largura da coluna e não causam CLS */
.photo-item .photo-img {
    display: block;
    width: 100%;
    height: auto;
}

#gallery {
    column-count: 3;
    column-gap: 12px;
    padding: 0 12px;
}

.photo-item {
    break-inside: avoid;
    margin-bottom: 12px;
}

.photo-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

@media (max-width: 1000px) {
    #gallery {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    #gallery {
        column-count: 1;
    }
}

/* Acrescenta a 23/02/2026 */

/* --- Sticky filters --- */
:root {
    /* altura aproximada da navbar; ajuste conforme o seu layout */
    --navbar-h: 48px;
    /* espaço entre as duas barras quando coladas */
    --filters-gap: -10px;
    /* z-index acima do conteúdo, mas abaixo de modais */
    --filters-z: 20;
}

/* Container (opcional) caso queira agrupar as duas barras */
.filters-wrapper {
    position: relative;
    z-index: var(--filters-z);
}

/* Cada barra individual torna-se sticky */
#btnYear {
    position: sticky;
    top: var(--navbar-h);
    /* cola sob a navbar */
    z-index: var(--filters-z);
    background: #fff;
    /* importante para não ver conteúdo por baixo */
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

#btnPlace {
    position: sticky;
    top: calc(var(--navbar-h) + 42px + var(--filters-gap));
    /* 42px ≈ altura da #btnYear */
    z-index: var(--filters-z);
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

/* Garantir que botões não “saltam” quando ficam sticky */
#btnYear .btn,
#btnPlace .btn {
    will-change: transform;
}

/* Se usar modo escuro, ajuste o fundo das barras */
@media (prefers-color-scheme: dark) {

    #btnYear,
    #btnPlace {
        background: #111;
    }
}