/* ============================================
   TREE BUILDING — style.css
   Responsivo: Mobile (< 600px) | Tablet (600–1024px) | Desktop (> 1024px)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* ── TOKENS ── */
:root {
    --color-white:   #FFFFFF;
    --color-black:   #000000;
    --color-sage:    #7e8f7c;
    --color-dark:    #242424;
    --color-off:     #F5F5F2;

    --nav-height: 60px;
    --section-pad-v: 4rem;
    --section-pad-h: 20%;

    --font-main: "Montserrat", sans-serif;
}

/* ── RESET ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-white);
    font-family: var(--font-main);
    color: var(--color-dark);
    overflow-x: hidden;
}

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

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 2rem;
    height: var(--nav-height);
}

.nav-logo {
    display: none; /* aparece apenas no mobile */
    margin-right: auto;
}

.nav-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Links desktop */
.nav-links {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(126, 143, 124, 1);
    padding: 0;
}

.nav-links .item {
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 20px;
    cursor: pointer;
    z-index: 5;
    min-width: 100px;
    height: var(--nav-height);
    text-decoration: none;
    color: var(--color-white);
    white-space: nowrap;
    transition: color 0.2s;
}

.underline {
    height: 6px;
    background: var(--color-white);
    position: absolute;
    bottom: 0;
    width: 25%; /* 1/4 dos itens */
    z-index: 2;
    pointer-events: none;
    transition: translate 0.35s ease;
}

/* Hamburger button — oculto no desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 200;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   HERO
   ============================================ */
header.hero {
    position: relative;
    width: 100%;
    /* desktop: ocupa tela cheia sem cortar demais */
    height: 100vh;
    background-image: url("../assets/principal_header.jpg");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* ============================================
   SEÇÃO INTRO
   ============================================ */
.intro {
    padding: var(--section-pad-v) var(--section-pad-h);
    color: var(--color-dark);
    text-align: center;
    line-height: 1.7;
}

.intro p + p {
    margin-top: 1.5rem;
}

.main_text_green {
    color: var(--color-sage);
}

.intro_button_contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    background-color: var(--color-sage);
    color: var(--color-white);
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 0 1.4rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 240px;
    height: 45px;
    text-decoration: none;
    background-image: linear-gradient(
        -60deg,
        #ffffff00 0%, #ffffff00 40%,
        #ffffff44 40%, #ffffff44 60%,
        #ffffff00 60%, #ffffff00 100%
    );
    background-size: 200% 100%;
    background-position-x: 150%;
    transition: scale 0.5s;
}

.intro_button_contact:hover {
    animation: shimmer 1s forwards;
    scale: 1.05;
}

@keyframes shimmer {
    0%   { background-position-x: 150%; }
    100% { background-position-x: -50%; }
}

/* ============================================
   SEÇÃO INTRO_DIF (fundo verde)
   ============================================ */
.intro_dif {
    padding: var(--section-pad-v) var(--section-pad-h);
    color: var(--color-white);
    text-align: center;
    background-color: var(--color-sage);
    line-height: 1.7;
}

.main_text_white_italic {
    font-style: italic;
    margin-bottom: 1rem;
}

.main_text_white {
    padding-top: 1.5rem;
}

.treelab_soon {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.main_text_white_bold {
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.main_text_white_bold h3 {
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   PORTFÓLIO
   ============================================ */
.portfolio {
    color: var(--color-dark);
    text-align: center;
    font-style: italic;
    padding: var(--section-pad-v) 2rem;
}

.portfolio h2 {
    margin-bottom: 1.5rem;
}

.image_portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.image_portfolio img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.image_portfolio img:hover {
    transform: scale(1.02);
    filter: brightness(1.08);
}

/* ============================================
   TREE LAB — imagens
   ============================================ */
.image_treelab {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
}

.image_treelab a {
    display: flex;
    align-items: center;
    width: 200px;
    flex-shrink: 0;
}

.image_treelab_img {
    width: 200px;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s;
}

.image_treelab a:hover .image_treelab_img {
    opacity: 0.85;
}

/* ============================================
   PARCERIAS
   ============================================ */
.parcerias {
    padding: var(--section-pad-v) var(--section-pad-h);
    color: var(--color-dark);
    text-align: center;
    line-height: 1.7;
}

.parcerias p + p {
    margin-top: 1.5rem;
}

.main_text_black_italic {
    font-style: italic;
    color: var(--color-dark);
    margin-bottom: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--color-sage);
    width: 100%;
    padding: 2rem 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2.5rem;
    font-size: 12px;
}

footer a {
    color: var(--color-white);
    text-decoration: none;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.75;
}

.footer_left,
.footer_right {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 200px;
    color: var(--color-white);
}

.footer_left { text-align: left; }
.footer_right { text-align: right; }

.footer_center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-white);
    text-align: center;
}

.image_footer {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.footer_text {
    font-size: 11px;
    opacity: 0.8;
}

/* ============================================
   RESPONSIVO — TABLET  (max 1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --section-pad-h: 10%;
    }

    .image_portfolio {
        grid-template-columns: repeat(2, 1fr);
    }

    .image_portfolio img {
        height: 220px;
    }

    .footer_left,
    .footer_right {
        width: 170px;
        font-size: 11px;
    }
}

/* ============================================
   RESPONSIVO — MOBILE  (max 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --section-pad-v: 3rem;
        --section-pad-h: 6%;
        --nav-height: 56px;
    }

    /* --- NAV MOBILE --- */
    .nav-logo {
        display: block;
    }

    .hamburger {
        display: flex;
    }

    /* Nav links viram menu dropdown fechado */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: rgba(126, 143, 124, 0.97);
        padding-top: calc(var(--nav-height) + 1.5rem);
        gap: 0;
        align-items: stretch;
        transition: right 0.35s ease;
        z-index: 150;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links .item {
        width: 100%;
        min-width: unset;
        height: 56px;
        justify-content: flex-start;
        padding: 0 2rem;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    .underline {
        display: none; /* desativa underline no mobile */
    }

    /* Overlay escuro ao abrir menu */
    .nav-links.open::before {
        content: '';
        position: fixed;
        inset: 0;
        right: unset;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.4);
        z-index: -1;
    }

    /* --- HERO MOBILE --- */
    /* Imagem completa visível, proporcional à tela */
    header.hero {
        height: auto;
        aspect-ratio: 16 / 9;
        background-size: contain;
        background-position: center;
        background-color: #000;
    }

    /* Navbar retorna como hamburguer flutuante sobre o hero */
    .navbar {
        position: absolute;
    }

    /* --- INTRO MOBILE --- */
    .intro {
        font-size: 0.9rem;
    }

    /* --- PORTFÓLIO MOBILE --- */
    .image_portfolio {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .image_portfolio img {
        height: 220px;
        width: 100%;
    }

    /* --- TREE LAB MOBILE --- */
    .image_treelab {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .image_treelab_img,
    .image_treelab a {
        width: clamp(200px, 70%, 320px);
    }

    /* --- FOOTER MOBILE --- */
    footer {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 2.5rem 1.5rem;
    }

    .footer_left,
    .footer_right {
        width: 100%;
        text-align: center;
    }

    .footer_center {
        order: -1; /* logo no topo no mobile */
    }
}

/* ============================================
   RESPONSIVO — MOBILE PEQUENO  (max 420px)
   ============================================ */
@media (max-width: 420px) {
    .intro p,
    .intro_dif p,
    .parcerias p {
        font-size: 0.85rem;
    }

    .intro_dif h2,
    .portfolio h2,
    .parcerias h2 {
        font-size: 1.1rem;
    }

    .image_portfolio img {
        height: 190px;
    }

    footer {
        font-size: 11px;
    }
}

/* ============================================
   ACESSIBILIDADE — reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.portfolio-img {
    cursor: zoom-in;
}

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#lightbox.active {
    display: flex;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    display: block;
}

#lightbox-close {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 0.3rem 0.6rem;
}

#lightbox-close:hover { opacity: 1; }

#lightbox-prev,
#lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    opacity: 0.75;
    transition: opacity 0.2s, background 0.2s;
}

#lightbox-prev { left: 1rem; }
#lightbox-next { right: 1rem; }

#lightbox-prev:hover,
#lightbox-next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}
