/* =========================================
   DLD — Desenha, Lain, desenha!
   ========================================= */

:root {
    --bg: #e9e5dc;
    --paper: #f4f0e7;
    --paper-dark: #ddd7ca;
    --ink: #272522;
    --muted: #777168;
    --line: #b9b1a3;
    --accent: #6d765f;
    --accent-dark: #4f5845;
    --shadow: rgba(30, 27, 23, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;

    font-size: 18px;
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.site {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
}

/* HEADER */

header {
    padding: 55px 0 35px;
    border-bottom: 1px solid var(--line);
}

.site-title {
    margin: 0;
    font-size: clamp(2.3rem, 7vw, 4.5rem);
    font-weight: normal;
    letter-spacing: -0.05em;
    line-height: 0.95;
}

.site-subtitle {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

nav {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.95rem;
}

nav a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

nav a:hover {
    border-bottom-color: var(--ink);
}

/* INTRO */

.intro {
    padding: 45px 0 25px;
    max-width: 680px;
}

.intro h2 {
    font-size: 1.2rem;
    font-weight: normal;
    margin: 0 0 10px;
}

.intro p {
    margin: 0 0 10px;
}

.small-note {
    color: var(--muted);
    font-size: 0.9rem;
}

/* TIMELINE */

.timeline {
    position: relative;
    padding: 30px 0 60px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 94px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.entry {
    position: relative;
    display: grid;
    grid-template-columns: 75px 1fr;
    gap: 40px;
    margin-bottom: 65px;
}

.date {
    position: relative;
    text-align: right;
    color: var(--muted);
    font-size: 0.82rem;
    padding-top: 4px;
}

.date::after {
    content: "";
    position: absolute;
    right: -24px;
    top: 9px;
    width: 9px;
    height: 9px;
    border: 1px solid var(--ink);
    background: var(--bg);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

.entry:hover .date::after {
    transform: scale(1.5);
    background: var(--accent);
}

.entry-content {
    min-width: 0;
}

.entry h2 {
    margin: 0 0 10px;
    font-size: 1.45rem;
    font-weight: normal;
}

.entry p {
    margin: 0 0 12px;
}

.entry-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

/* ARTWORK */

.artwork {
    margin: 22px 0 18px;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
    background: var(--paper-dark);
}

.artwork img {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.97);
    animation: appear 0.7s ease forwards;
    transition:
        transform 0.5s cubic-bezier(.2,.8,.2,1),
        filter 0.5s ease;
}

@keyframes appear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.artwork:hover img {
    transform: scale(1.025);
    filter: contrast(1.03);
}

.artwork::after {
    content: "clique para ampliar";
    position: absolute;
    right: 10px;
    bottom: 8px;
    padding: 2px 6px;
    background: rgba(244, 240, 231, 0.85);
    color: var(--muted);
    font-size: 0.72rem;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.artwork:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.caption {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* DESAFIO */

.challenge {
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 22px 24px;
    margin-top: 20px;
    position: relative;
}

.challenge::before {
    content: "DESAFIO";
    position: absolute;
    top: -10px;
    left: 14px;
    padding: 0 7px;
    background: var(--bg);
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}

.challenge-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: normal;
}

.challenge label,
.challenge-items label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
}

.challenge input,
.challenge-items input {
    margin-top: 6px;
    accent-color: var(--accent-dark);
}

.challenge input:checked + span {
    text-decoration: none;
}

.challenge-note {
    margin-top: 20px !important;
}

/* LISTA DE DESAFIOS */

.challenge-list {
    margin: 40px 0 80px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.challenge-list h2 {
    font-weight: normal;
    font-size: 1.5rem;
    margin: 0 0 5px;
}

.challenge-list p {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.progress {
    text-align: right;
    white-space: nowrap;
    color: var(--accent-dark);
}

#challenge-count {
    font-size: 1.2rem;
}

.progress-label {
    display: block;
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.challenge-group {
    margin-top: 35px;
}

.challenge-group h3 {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.challenge-items {
    list-style: none;
    margin: 15px 0 0;
    padding: 0;
}

.challenge-items li {
    padding: 10px 0;
    border-bottom: 1px dotted var(--line);
    transition: opacity 0.2s ease;
}

.challenge-items li.done {
    color: inherit;
}

.challenge-items li.done span {
    text-decoration: none;
}

/* LIGHTBOX */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(20, 18, 15, 0.88);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: zoom-out;
}



.lightbox img {
    max-width: min(95vw, 1200px);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: scale(0.92);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 50px rgba(0,0,0,0.35);
    cursor: default;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: fixed;
    top: 15px;
    right: 20px;
    color: white;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

/* FOOTER */

footer {
    border-top: 1px solid var(--line);
    padding: 35px 0 50px;
    margin-top: 30px;
    text-align: center;
}

.guestbook {
    display: inline-block;
    border: 1px solid var(--ink);
    padding: 10px 20px;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.guestbook:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-2px);
}

footer p {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 18px;
}

/* RESPONSIVO */

@media (max-width: 650px) {
    .site {
        width: min(100% - 24px, 900px);
    }

    header {
        padding-top: 35px;
    }

    .timeline::before {
        left: 9px;
    }

    .entry {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-left: 28px;
        margin-bottom: 50px;
    }

    .date {
        text-align: left;
        padding: 0;
    }

    .date::after {
        left: -32px;
        right: auto;
        top: 6px;
    }

    .entry h2 {
        font-size: 1.3rem;
    }

    .challenge {
        padding: 18px;
    }

    .artwork::after {
        display: none;
    }

    .section-heading {
        align-items: flex-start;
    }

    .progress {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}



/* MARCADOR DE DESAFIO */
.challenge-items .challenge-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.challenge-items .feito-marker {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    display: none;
}

.challenge-items .challenge-done .feito-marker {
    display: block;
}

/* CARROSSEL */
.carousel {
    position: relative;
    margin: 22px 0 18px;
}

.carousel-track {
    position: relative;
    overflow: hidden;
    background: var(--paper-dark);
}

.carousel-slide {
    display: none;
    margin: 0;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: rgba(244, 240, 231, 0.88);
    color: var(--ink);
    font-family: inherit;
    font-size: 1.25rem;
    cursor: pointer;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--paper);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 10px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 1px solid var(--muted);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.carousel-dot.active {
    background: var(--accent);
}

@media (max-width: 650px) {
    .carousel-prev,
    .carousel-next {
        width: 34px;
        height: 34px;
    }
}


/* Navegação entre imagens enquanto o desenho está ampliado */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.45);
    background: rgba(0,0,0,.35);
    color: white;
    font-family: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,0,0,.6);
}

@media (max-width: 650px) {
    .lightbox-prev,
    .lightbox-next {
        width: 38px;
        height: 38px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}


.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(0, 0, 0, .88);
}



.lightbox > img {
    display: block;
    max-width: min(90vw, 1100px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-prev,
.lightbox-next,
.lightbox-close {
    z-index: 1001;
}


/* Correção do zoom: o lightbox usa a classe .active */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(0, 0, 0, .88);
}

.lightbox.active {
    display: flex;
}

.lightbox #lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 88vw;
    max-height: 88vh;
    object-fit: contain;
}

body.no-scroll,
body.lightbox-open {
    overflow: hidden;
}


/* FIX FINAL DO LIGHTBOX
   A camada precisa ficar visível quando .active é aplicada.
*/
.lightbox.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.lightbox.active #lightbox-image {
    opacity: 1 !important;
    visibility: visible !important;
}

.challenge-title span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.challenge-title span img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}