/* =========================================================
   STUDIO EPÍFITA — PÁGINA ARCHICAD
   Folha de estilos organizada
   ========================================================= */


/* =========================================================
   1. HERO / APRESENTAÇÃO DA FERRAMENTA
   ========================================================= */

.tool-hero {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    min-height: 390px;
    background: #e9e5dc;
    border-bottom: 1px solid var(--line);
}

.tool-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 42px 8% 48px 10%;
}

.back-link {
    margin-bottom: 38px;
    color: var(--muted);
    font-size: 12px;
}

.back-link:hover {
    color: var(--olive);
}

.tool-hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 4.3vw, 58px);
    line-height: 1.05;
}

.tool-hero-copy h1 em {
    color: var(--olive);
    font-style: normal;
}

.tool-hero-copy>p:not(.eyebrow) {
    max-width: 500px;
    margin-bottom: 24px;
    color: #55564f;
    line-height: 1.65;
}

.tool-hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 30px 5%;
    background: #dedbd1;
}

.blueprint-label {
    display: flex;
    justify-content: space-between;
    width: min(100%, 600px);
    margin: 0 auto 12px;
    color: #6c6d61;
    font-size: 9px;
    letter-spacing: .2em;
}

.blueprint-art {
    width: min(100%, 600px);
    margin: auto;
    padding: 15px;
    background: #f4f1e9;
    box-shadow: 0 12px 35px #34362212;
}

.blueprint-art svg {
    display: block;
    width: 100%;
}

.visual-note {
    width: min(100%, 600px);
    margin: 10px auto 0;
    color: #77776c;
    font-size: 8px;
    letter-spacing: .13em;
    text-align: right;
}


/* =========================================================
   2. INTRODUÇÃO
   ========================================================= */

.tool-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
    border-bottom: 1px solid var(--line);
}

.tool-intro h2 {
    margin: 0;
    font-size: clamp(30px, 3.2vw, 43px);
    line-height: 1.1;
}

.tool-intro>p {
    max-width: 570px;
    margin: 0;
    color: #55564f;
    line-height: 1.75;
}


/* =========================================================
   3. LISTA E APRESENTAÇÃO DO PROJETO
   ========================================================= */

.project-list {
    padding: 48px 5% 70px;
}

.project-entry {
    max-width: 1440px;
    margin: auto;
}

.project-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 25px;
}

.project-heading h2 {
    margin: 0;
    font-size: clamp(32px, 3vw, 42px);
}

.project-number {
    padding-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .15em;
}

.project-overview {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    align-items: stretch;
    gap: 38px;
}

.project-cover {
    position: relative;
    min-height: 350px;
    background: #ddd8cc;
}

.project-cover img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 350px;
    object-fit: cover;
    filter: saturate(.68);
}

.image-caption {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 7px 10px;
    background: #f3f0e9e8;
    color: #55564f;
    font-size: 9px;
}

.project-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 2% 12px 0;
}

.meta-line {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}

.meta-line span {
    color: var(--muted);
}

.meta-line strong {
    font-weight: 600;
    text-align: right;
}

.project-meta>p {
    margin: 22px 0;
    color: #55564f;
    font-size: 14px;
    line-height: 1.65;
}

.project-meta .button {
    align-self: flex-start;
}


/* =========================================================
   4. DOCUMENTAÇÃO / TÍTULO DA GALERIA
   ========================================================= */

.deliverables {
    padding-top: 58px;
}

.deliverables-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 22px;
}

.deliverables-heading h3 {
    margin: 0;
    font: 500 26px "Manrope", sans-serif;
}

.deliverables-heading>p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
}


/* =========================================================
   5. GALERIA DE PRANCHAS
   Ajuste da miniatura A3 vertical:
   - aspect-ratio define a proporção da área;
   - padding controla o espaço entre a imagem e o card;
   - --sheet-frame-inset controla a posição da moldura.
   ========================================================= */

:root {
    --sheet-preview-padding: 4px;
    --sheet-frame-inset: 4px;
    --sheet-frame-color: #b9b6ab;
}

/* Largura Moldura da folha */
.sheet-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
}

.sheet-card {
    appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #f8f6f0;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.sheet-card:hover,
.sheet-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px #24241912;
}

.sheet-card:focus-visible {
    outline: 2px solid var(--olive);
    outline-offset: 3px;
}

/* Altura Moldura da folha */
.sheet-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    aspect-ratio: auto;
    min-width: 0;
    padding: var(--sheet-preview-padding);
    box-sizing: border-box;
    overflow: hidden;
    background: #eeece5;
}

/* Moldura fina ao redor da folha */
.sheet-preview::before {
    content: "";
    position: absolute;
    inset: var(--sheet-frame-inset);
    z-index: 2;
    border: 1px solid var(--sheet-frame-color);
    pointer-events: none;
}

/* Imagem A3: mantém a proporção e não corta o desenho */
.sheet-preview img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.sheet-stamp {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 3;
    padding: 2px 4px;
    background: #f8f6f0d9;
    color: #77776c;
    font-size: 9px;
    pointer-events: none;
}

.sheet-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 68px;
    padding: 13px 14px 15px;
}

.sheet-info strong {
    font-size: 13px;
}

.sheet-info small {
    color: var(--muted);
    font-size: 10px;
}

.sheet-disclaimer {
    margin: 15px 0 0;
    color: #77766d;
    font-size: 10px;
    line-height: 1.5;
}

/* Elementos gráficos de prévia, caso ainda sejam usados no HTML */
.plan-lines,
.elevation-lines,
.detail-lines,
.iso-lines {
    position: relative;
    width: 75%;
    height: 65%;
    opacity: .85;
}

.plan-lines {
    border: 2px solid #62645a;
    background:
        linear-gradient(90deg, transparent 31%, #77786e 31.5%, #77786e 32%, transparent 32.5%, transparent 68%, #77786e 68.5%, #77786e 69%, transparent 69.5%),
        linear-gradient(0deg, transparent 48%, #77786e 48.5%, #77786e 49%, transparent 49.5%);
}

.plan-lines::before,
.plan-lines::after {
    content: "";
    position: absolute;
    border: 1px solid #77786e;
}

.plan-lines::before {
    top: 8%;
    left: 8%;
    width: 28%;
    height: 34%;
}

.plan-lines::after {
    right: 8%;
    bottom: 8%;
    width: 26%;
    height: 30%;
}

.elevation-lines {
    border: 1px solid #77786e;
    background: repeating-linear-gradient(0deg, transparent 0 20px, #77786e 21px 22px);
}

.elevation-lines::before {
    content: "";
    position: absolute;
    inset: 0 12%;
    border-right: 1px solid #77786e;
    border-left: 1px solid #77786e;
    background: repeating-linear-gradient(90deg, transparent 0 28px, #77786e 29px 30px);
}

.detail-lines {
    border: 1px solid #77786e;
    background: linear-gradient(45deg, transparent 48%, #77786e 49%, #77786e 50%, transparent 51%);
}

.detail-lines::before {
    content: "";
    position: absolute;
    top: -12px;
    right: -15px;
    width: 50px;
    height: 50px;
    border: 1px solid #77786e;
    border-radius: 50%;
    background: #eeece5;
}

.iso-lines {
    transform: rotate(-25deg) skew(25deg);
    border: 2px solid #77786e;
    background: repeating-linear-gradient(0deg, transparent 0 22px, #77786e 23px 24px);
}

.iso-lines::after {
    content: "";
    position: absolute;
    inset: 0 20%;
    border-right: 1px solid #77786e;
    border-left: 1px solid #77786e;
}


/* =========================================================
   6. PRÓXIMO PASSO / CHAMADA FINAL
   ========================================================= */

.next-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 45px 5%;
    background: #e7e3d9;
}

.next-step h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 39px);
    line-height: 1.1;
}


/* =========================================================
   7. VISUALIZADOR DE PRANCHAS / LIGHTBOX
   Primeiro clique: abre a prancha ajustada à tela.
   Clique na imagem: amplia.
   Arraste com o mouse: percorre a prancha ampliada.
   ESC ou clique fora: fecha.
   ========================================================= */

.lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: rgba(10, 10, 10, .96) !important;
}

.lightbox.open {
    display: flex !important;
}

.lightbox-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 45px 10px 15px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    color: #fff !important;
    text-align: center;
}

.lightbox-content h2 {
    position: absolute !important;
    top: 12px !important;
    left: 50% !important;
    width: 90% !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 500;
    text-align: center !important;
}

.lightbox-sheet {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: auto !important;
    border: none !important;
    background: transparent !important;
}

/* Remove a antiga grade ilustrativa do visualizador */
.lightbox-sheet::before {
    display: none !important;
    content: none !important;
}

/* Prancha no enquadramento inicial */
.lightbox-sheet img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 98vw !important;
    max-height: 90vh !important;
    flex: 0 0 auto !important;
    object-fit: contain !important;
    cursor: zoom-in !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    transition: none !important;
}

/* Estado ampliado: imagem maior que a área visível */
.lightbox-sheet.is-zoomed {
    display: block !important;
    overflow: auto !important;
    cursor: grab !important;
    user-select: none !important;
}

.lightbox-sheet.is-zoomed img {
    width: 145vw !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 auto !important;
    cursor: grab !important;
}

/* Mão fechada enquanto o usuário arrasta */
.lightbox-sheet.is-dragging,
.lightbox-sheet.is-dragging img {
    cursor: grabbing !important;
}

.lightbox-content p {
    position: absolute !important;
    bottom: 8px !important;
    margin: 0 !important;
    color: #ccc !important;
    font-size: 11px !important;
    text-align: center !important;
}

.lightbox-close {
    position: fixed !important;
    top: 8px !important;
    right: 20px !important;
    z-index: 100001 !important;
    width: 48px;
    height: 48px;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 42px !important;
    line-height: 1;
    cursor: pointer !important;
}


/* =========================================================
   8. RESPONSIVIDADE
   ========================================================= */

/* Tablets */
@media (max-width: 900px) {
    .tool-hero {
        grid-template-columns: 1fr;
    }

    .tool-hero-copy {
        padding: 35px 7%;
    }

    .back-link {
        margin-bottom: 25px;
    }

    .tool-hero-visual {
        min-height: 280px;
    }

    .project-overview {
        grid-template-columns: 1fr;
    }

    .project-meta {
        padding: 0;
    }

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

/* Celulares */
@media (max-width: 600px) {
    .tool-intro {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .project-list {
        padding: 35px 7% 50px;
    }

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

    .project-number {
        display: none;
    }

    .project-cover,
    .project-cover img {
        min-height: 240px;
    }

    .deliverables-heading {
        display: block;
    }

    .deliverables-heading>p {
        margin-top: 8px;
    }

    .sheet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .sheet-info {
        padding: 10px;
    }

    .next-step {
        flex-direction: column;
        align-items: flex-start;
        padding: 35px 7%;
    }

    .lightbox-content {
        padding: 55px 5px 15px !important;
    }

    .lightbox-sheet img {
        max-width: 96vw !important;
        max-height: 85vh !important;
    }

    .lightbox-sheet.is-zoomed img {
        width: 180vw !important;
    }

    .lightbox-close {
        top: 6px !important;
        right: 10px !important;
    }
}