/* ── RESET & BASE ──────────────────────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    color: #111;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ── APP LAYOUT ────────────────────────────────────────────────────────────── */

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #fff;
}

header h1 {
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

/* ── HAMBURGER ─────────────────────────────────────────────────────────────── */

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #111;
    transition: opacity 0.2s;
}

/* ── CONTAINER ─────────────────────────────────────────────────────────────── */

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */

.sidebar {
    width: 250px;
    background: #f7f7f7;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    display: none;
}

#years-container {
    flex: 1;
    padding: 1.5rem 0;
}

.sidebar-footer {
    border-top: 1px solid #e0e0e0;
    padding: 1.25rem;
}

.sobre-link {
    cursor: pointer;
    padding: 0.7rem 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: background 0.2s;
    border-radius: 4px;
}

.sobre-link:hover { background: #ebebeb; }
.sobre-link.active { background: #e2e2e2; }

.copyright {
    margin-top: 0.75rem;
    font-size: 0.68rem;
    color: #bbb;
    text-align: center;
    line-height: 1.5;
}

.year-item { margin-bottom: 0.25rem; }

.year-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
    user-select: none;
}

.year-header:hover { background: #ebebeb; }
.year-header.active { background: #ebebeb; }

.year-chevron {
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    color: #bbb;
}

.year-header.active .year-chevron { transform: rotate(90deg); }

.blocos-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.blocos-list.expanded { max-height: 600px; }

.bloco-item {
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #777;
    text-transform: capitalize;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.bloco-item:hover { background: #ebebeb; color: #111; }
.bloco-item.active { background: #e2e2e2; color: #111; border-left: 2px solid #111; }

/* ── GALLERY CONTENT ───────────────────────────────────────────────────────── */

.gallery-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
}

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bbb;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.bloco-header { margin-bottom: 2.5rem; }

.bloco-header h2 {
    font-size: 2.2rem;
    font-weight: 200;
    margin-bottom: 0.5rem;
    line-height: 1.15;
}

.bloco-header .bloco-path {
    color: #aaa;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bloco-header .photo-count {
    margin-top: 0.5rem;
    color: #bbb;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

/* ── BLOCO DESCRIPTION ─────────────────────────────────────────────────────── */

.bloco-description {
    max-width: 640px;
    margin-bottom: 2rem;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.8;
}

.bloco-description p { margin-bottom: 0.85rem; }
.bloco-description h1, .bloco-description h2, .bloco-description h3 {
    font-weight: 400;
    color: #222;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}
.bloco-description h1 { font-size: 1.2rem; }
.bloco-description h2 { font-size: 1.05rem; }
.bloco-description h3 { font-size: 0.95rem; }
.bloco-description strong { color: #222; font-weight: 500; }
.bloco-description em { font-style: italic; }
.bloco-description a { color: #111; text-decoration: underline; text-underline-offset: 3px; }

/* ── PHOTO GRID ────────────────────────────────────────────────────────────── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.photo-item {
    cursor: pointer;
    overflow: hidden;
    background: #ebebeb;
    aspect-ratio: 16/9;
    position: relative;
    border-radius: 6px;
}

.photo-item picture {
    width: 100%;
    height: 100%;
    display: block;
}

.photo-item img,
.photo-item picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.2s ease;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
    display: block;
}

.photo-item:hover img { transform: scale(1.04); }

.photo-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── SKELETON ──────────────────────────────────────────────────────────────── */

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.photo-item.skeleton {
    background: #ebebeb;
}

.photo-item.skeleton img {
    opacity: 0;
}

.photo-item.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #e8e8e8 25%, #f2f2f2 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
}

/* ── SOBRE ─────────────────────────────────────────────────────────────────── */

.sobre-content {
    max-width: 560px;
    padding: 0 0 2rem;
}

.sobre-content h2 {
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 1.75rem;
}

.sobre-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: #555;
    font-size: 0.95rem;
    text-align: justify;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.contact-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f0f0f0;
    border-radius: 6px;
    color: #111;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.contact-links a:hover { background: #e8e8e8; }
.contact-links svg { flex-shrink: 0; }

/* ── LIGHTBOX ──────────────────────────────────────────────────────────────── */

.lightbox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.96);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* ── LIGHTBOX SPINNER ──────────────────────────────────────────────────────── */

@keyframes lb-spin {
    to { transform: rotate(360deg); }
}

.lb-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.lb-spinner.active { opacity: 1; }

.lb-spinner::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: rgba(255,255,255,0.75);
    border-radius: 50%;
    animation: lb-spin 0.7s linear infinite;
}

/* ── LIGHTBOX IMAGE & ZOOM ─────────────────────────────────────────────────── */

#lb-picture {
    display: flex;
    max-width: 95vw;
    max-height: 82vh;
    cursor: zoom-in;
}

#lb-picture.zoomed { cursor: zoom-out; }

#lb-img {
    max-width: 95vw;
    max-height: 82vh;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
    transform: scale(1);
    transition: transform 0.3s ease, opacity 0.15s ease;
}

.lightbox img {
    max-width: 95vw;
    max-height: 82vh;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.lightbox .close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0.25rem 0.5rem;
}

.lightbox .close:hover { opacity: 1; }

.lightbox .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 3.5rem;
    cursor: pointer;
    padding: 1rem 1.25rem;
    opacity: 0.35;
    transition: opacity 0.2s;
}

.lightbox .nav:hover { opacity: 1; }
.lightbox .prev { left: 0.5rem; }
.lightbox .next { right: 0.5rem; }

.lightbox-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.5rem;
    align-items: center;
    white-space: nowrap;
}

.lightbox-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.lightbox-footer .caption {
    font-size: 0.85rem;
    color: #888;
}

.lightbox .subtitle {
    font-size: 1rem;
    color: #ccc;
    font-style: italic;
    margin-top: 0.6rem;
}

.lightbox-footer .counter {
    font-size: 0.85rem;
    color: #555;
}

.lightbox-footer .fullscreen-btn,
.lightbox-footer .share-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.lightbox-footer .fullscreen-btn:hover,
.lightbox-footer .share-btn:hover { color: #fff; }

/* ── TOAST ─────────────────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: #222;
    color: #fff;
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2000;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── HIGHLIGHTS SLIDESHOW ─────────────────────────────────────────────────── */

.gallery-content.highlights-mode {
    padding: 2rem 2.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.highlights-slideshow {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    background: #000;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide img,
.slide picture {
    width: 100%;
    height: 100%;
    display: block;
}

.slide picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
}

.slide img {
    object-fit: cover;
    -webkit-user-drag: none;
}

.slide-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.slide-dots {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.slide-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.slide-dot.active {
    background: rgba(255,255,255,0.9);
    transform: scale(1.35);
}

/* ── MOBILE ────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

    body { overflow: auto; height: auto; }
    .app-layout { height: auto; min-height: 100vh; }

    .menu-toggle { display: flex; }

    header { padding: 1rem 1.25rem; }
    header h1 { font-size: 1.1rem; }

    .container { overflow: visible; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 600;
        width: 270px;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 500;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .gallery-content {
        padding: 1.25rem;
        min-height: calc(100vh - 60px);
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .lightbox .nav { font-size: 2.5rem; padding: 0.75rem; }
    .lightbox .close { font-size: 2rem; }

    .gallery-content.highlights-mode {
        padding: 1rem;
        overflow: hidden;
        min-height: 0;
    }

    .highlights-slideshow {
        height: calc(100dvh - 60px - 2rem);
        flex: none;
    }
}
