/* ============================================================
   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) + 80px);
    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;
}