/* ==========================================================
   Costa Group — paleta sobre o tema do modelo.
   Redefine os tokens HSL do site.css; nada do modelo e editado.
   Referencia: cores medidas nas PDFs do mockup (pdftoppm).
     #e2d7ce bege de fundo | #3a1d16 marrom escuro
     #957a65 marrom medio (rodape da primeira pagina)
   ========================================================== */
:root {
    --costa-bege:         #e2d7ce;
    --costa-marrom:       #3a1d16;
    --costa-marrom-medio: #957a65;

    --white-hsl:                  27, 25.64%, 84.71%;
    --black-hsl:                  11.67, 45%, 15.69%;
    --lightAccent-hsl:            27, 25.64%, 84.71%;
    --darkAccent-hsl:             11.67, 45%, 15.69%;
    --accent-hsl:                 11.67, 45%, 15.69%;

    --safeLightAccent-hsl:        27, 25.64%, 84.71%;
    --safeDarkAccent-hsl:         11.67, 45%, 15.69%;
    --safeInverseAccent-hsl:      27, 25.64%, 84.71%;
    --safeInverseLightAccent-hsl: 11.67, 45%, 15.69%;
    --safeInverseDarkAccent-hsl:  27, 25.64%, 84.71%;
}

/* DIN nos titulos, no menu e nos botoes. A DIN Alternate (so existe em
   negrito) vem instalada no Mac/iPhone e nao pode ser distribuida; quem nao
   tem recebe a D-DIN Bold (Datto, SIL OFL 1.1, licenca em fonts/D-DIN-OFL.txt).
   O !important vence o h1,h2 {font-family: LargeHeading !important} do custom.css. */
@font-face {
    font-family: 'Costa DIN';
    src: local('DIN Alternate Bold'), local('DINAlternate-Bold'),
         url('../fonts/D-DIN-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
.costa-sec__titulo,
.header-nav-item > a,
.header-menu-nav-item-content,
.header-actions-action--cta .btn,
.header-menu-cta .btn {
    font-family: 'Costa DIN', sans-serif !important;
    font-weight: 700 !important;
}

/* o header traz o fundo branco inline no markup do modelo */
#header { --solidHeaderBackgroundColor: var(--costa-bege) !important; }

/* header fixo acompanhando a rolagem. A altura real vem do costa-efeitos.js
   (--costa-header-h); os valores abaixo valem ate o script medir.
   Ancoras usam so o scroll-padding do html, sem scroll-margin nas secoes
   (os dois se somariam). */
:root { --costa-header-h: 53px; }
@media (max-width: 767px) { :root { --costa-header-h: 82px; } }
html { scroll-padding-top: var(--costa-header-h); }
#header { position: fixed; z-index: 1000; transition: box-shadow 0.3s ease; }
#header.is-rolado { box-shadow: 0 6px 18px -10px rgba(58, 29, 22, 0.35); }
#page { padding-top: var(--costa-header-h); }

/* header do mockup: menu a esquerda, logo no centro, botao a direita.
   O markup clonado tem o logo antes do menu; reordena sem mexer no DOM. */
.header-layout-branding-center .header-display-desktop .header-title-nav-wrapper { display: contents; }
.header-layout-branding-center .header-display-desktop .header-nav { order: 0; flex: 1 1 0; width: auto; }
.header-layout-branding-center .header-display-desktop .header-title { order: 1; flex: 0 0 auto; width: auto; }
.header-layout-branding-center .header-display-desktop .header-actions { order: 2; flex: 1 1 0; width: auto; justify-content: flex-end; }

/* o acento do modelo aparece fixo em alguns pontos: realinha com a marca */
.sqsrte-text-color--accent { color: var(--costa-marrom) !important; }

/* -- Logo: a marca da Costa e bem mais larga que a do modelo (5.57:1 contra
   3.32:1). Dimensionada so pela altura, ficava ~67% mais larga que o original.
   Limita pela largura para manter a mesma presenca no header. -- */
.header-title-logo a,
.header-title-logo img {
    max-height: 32px !important;
    max-width: 180px !important;
    width: auto;
    height: auto;
    object-fit: contain;
}
@media (max-width: 767px) {
    .header-title-logo a,
    .header-title-logo img {
        max-height: 26px !important;
        max-width: 148px !important;
    }
}

/* ==========================================================
   Secoes montadas a partir do mockup da Costa (PDFs):
   Home, Services e Projects.
   ========================================================== */
.costa-sec { padding: 72px 24px; }
.costa-sec--claro  { background: var(--costa-bege); color: var(--costa-marrom); }
.costa-sec--escuro { background: var(--costa-marrom); color: #fff; }
.costa-sec--medio  { background: var(--costa-marrom-medio); color: #fff; }
.costa-sec--faixa  { padding: 40px 24px; }
.costa-sec--faixa .costa-sec__titulo { margin: 0; }

.costa-sec__titulo {
    margin: 0 0 34px;
    text-align: center;
    color: inherit;
    font-size: 40px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.15;
}
.costa-sec__titulo--sm { font-size: 22px; letter-spacing: 0.22em; margin-bottom: 10px; }
.costa-sec__titulo--misto,
.costa-titulo-misto span { text-transform: none; }
.costa-sec__subtitulo {
    margin: -22px 0 56px;
    text-align: center;
    font-size: 22px;
    line-height: 1.4;
    opacity: 0.85;
}
.costa-sec__linha {
    margin: 0 auto 34px;
    max-width: 760px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.88;
}
.costa-sec__texto {
    margin: 0 auto 18px;
    max-width: 900px;
    text-align: center;
    font-size: 17px;
    line-height: 1.75;
}
.costa-sec__texto:last-child,
.costa-sec__linha:last-child { margin-bottom: 0; }

/* -- faixas de imagem de ponta a ponta -- */
.costa-faixa { margin: 0; padding: 0; background: var(--costa-bege); }
.costa-faixa img {
    display: block;
    width: 100%;
    height: clamp(240px, 32vw, 620px);
    object-fit: cover;
}
.costa-faixa--hero img { height: clamp(300px, 39vw, 740px); }
.costa-faixa--alta img { height: clamp(300px, 46vw, 860px); }

/* -- mosaico de 4 fotos com moldura branca (home) -- */
.costa-mosaico {
    list-style: none;
    margin: 64px auto 56px;
    padding: 6px;
    max-width: 1000px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.costa-mosaico img {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 7;
    object-fit: cover;
}

/* -- lista de servicos -- */
.costa-servicos { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; }
.costa-servico {
    text-align: center;
    font-size: 21px;
    line-height: 1.45;
    padding: 8px 0;
}

/* -- parceiros -- */
.costa-parceiros {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 22px;
}
.costa-parceiro {
    flex: 0 1 230px;
    background: #fff;
    border-radius: 2px;
    padding: 26px 22px;
    display: flex; align-items: center; justify-content: center;
    min-height: 128px;
}
.costa-parceiro img { max-width: 100%; max-height: 76px; width: auto; object-fit: contain; }

/* -- projetos: grade de 2 colunas com moldura -- */
.costa-projetos {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 960px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 44px;
}
.costa-projeto__foto {
    position: relative;
    display: block;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--costa-marrom);
    cursor: zoom-in;
}
.costa-projeto__foto img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.1;
    object-fit: cover;
}
.costa-projeto__titulo { margin: 14px 0 2px; text-align: center; font-size: 17px; letter-spacing: 0.04em; }
.costa-projeto__meta { margin: 0; text-align: center; font-size: 14px; opacity: 0.7; }
.gallery-badge {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    padding: 5px 10px; border-radius: 20px;
    background: rgba(58, 29, 22, 0.82); color: #fff;
    font-size: 12px; font-weight: 700; line-height: 1;
    pointer-events: none; transition: background 0.25s ease;
}
.costa-projeto__foto:hover .gallery-badge { background: var(--costa-marrom-medio); }
/* fundo do Fancybox (galeria de cada projeto) puxado para o marrom da marca */
.fancybox__container { --fancybox-bg: rgba(30, 15, 11, 0.96); }

/* -- rodape: redes, depoimentos e endereco -- */
.costa-social {
    display: flex; justify-content: center; gap: 8px;
    padding: 12px 16px;
    background: #fff;
}
.costa-social__link {
    display: inline-flex;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--costa-marrom);
    transition: background 0.2s ease;
}
.costa-social__link:hover { background: var(--costa-marrom-medio); }
.costa-social__link svg { width: 100%; height: 100%; fill: #fff; }

.costa-rodape__corpo { padding: 56px 24px 48px; background: var(--costa-marrom-medio) !important; color: #fff; }
/* -- depoimentos em carrossel (costa-depoimentos.js): 3 por pagina no
   desktop, 2 no tablet e 1 no celular. O JS le --costa-por-pagina. -- */
.costa-carrossel { --costa-por-pagina: 3; max-width: 1180px; margin: 40px auto 0; }
.costa-carrossel__janela { overflow: hidden; }
.costa-carrossel.is-estatico .costa-carrossel__controles { display: none; }
.costa-depoimentos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.costa-depoimento {
    flex: 0 0 calc(100% / var(--costa-por-pagina));
    box-sizing: border-box;
    padding: 0 18px;
    display: flex; align-items: flex-start; gap: 18px;
    text-align: left;
}
.costa-depoimento__foto {
    flex: 0 0 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    color: var(--costa-marrom);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; letter-spacing: 0.06em;
}
.costa-depoimento__autor { margin: 6px 0 6px; font-size: 17px; }
.costa-depoimento__autor span { display: block; font-size: 13px; opacity: 0.7; margin-top: 1px; }
.costa-depoimento__texto { margin: 0; font-size: 14px; line-height: 1.6; opacity: 0.9; }

.costa-carrossel__controles {
    display: flex; align-items: center; justify-content: center; gap: 18px;
    margin-top: 30px;
}
.costa-carrossel__seta {
    -webkit-appearance: none; appearance: none;
    width: 38px; height: 38px;
    padding: 0 0 3px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font: inherit; font-size: 24px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.costa-carrossel__seta:hover,
.costa-carrossel__seta:focus-visible { background: #fff; color: var(--costa-marrom); }
.costa-carrossel__pontos { display: flex; gap: 10px; }
.costa-carrossel__ponto {
    -webkit-appearance: none; appearance: none;
    width: 9px; height: 9px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    transition: background-color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}
.costa-carrossel__ponto.is-ativo { background: currentColor; opacity: 1; transform: scale(1.2); }

.costa-rodape__info {
    max-width: 600px;
    margin: 56px auto 0;
    padding-top: 34px;
    border-top: 2px solid var(--costa-marrom);
    text-align: center;
    font-size: 14px;
    line-height: 1.7;
}
.costa-rodape__info p { margin: 0 0 12px; }
/* mapa do Google acima do endereco, 500x300 centralizado */
.costa-rodape__mapa {
    overflow: hidden;
    width: 500px;
    max-width: 100%;
    height: 300px;
    margin: 0 auto 28px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.costa-rodape__mapa iframe { display: block; width: 100%; height: 100%; border: 0; }
.costa-rodape__rota {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.2s ease;
}
.costa-rodape__rota:hover, .costa-rodape__rota:focus-visible { color: #fff; opacity: 0.76; }
.costa-social__link:focus-visible { outline: 2px solid var(--costa-marrom); outline-offset: 3px; }

/* ==========================================================
   Efeitos sutis: hovers e entrada suave ao rolar.
   A entrada so esconde o conteudo quando o JS marcou o <html>
   (.costa-js), entao sem JS tudo aparece normalmente.
   ========================================================== */
.header-display-desktop .header-nav-item > a {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size 0.35s ease;
}
.header-display-desktop .header-nav-item > a:hover { background-size: 100% 1px; }

.header-actions-action--cta .btn,
.header-menu-cta .btn { transition: background-color 0.3s ease, color 0.3s ease; }
.header-actions-action--cta .btn:hover,
.header-menu-cta .btn:hover { background-color: var(--costa-marrom-medio) !important; opacity: 1; }

@keyframes costa-hero-entrada {
    from { transform: scale(1.06); opacity: 0.6; }
    to   { transform: scale(1); opacity: 1; }
}
.costa-faixa--hero { overflow: hidden; }
.costa-faixa--hero img { animation: costa-hero-entrada 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) both; }

.costa-mosaico li { overflow: hidden; }
.costa-mosaico img { transition: transform 0.8s ease; }
.costa-mosaico li:hover img { transform: scale(1.04); }

.costa-parceiro,
.costa-projeto__foto { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.costa-parceiro:hover,
.costa-projeto__foto:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -12px rgba(58, 29, 22, 0.35);
}

/* mesma lista do costa-efeitos.js; o estado inicial vem do CSS para nao
   piscar o conteudo antes do script rodar */
.costa-js :is(.costa-sec__titulo, .costa-sec__subtitulo, .costa-sec__linha, .costa-sec__texto,
              .costa-mosaico > li, .costa-servico, .costa-parceiros, .costa-projeto,
              .costa-carrossel, .costa-rodape__info) {
    opacity: 0;
    transform: translateY(18px);
}
.costa-js :is(.costa-sec__titulo, .costa-sec__subtitulo, .costa-sec__linha, .costa-sec__texto,
              .costa-mosaico > li, .costa-servico, .costa-parceiros, .costa-projeto,
              .costa-carrossel, .costa-rodape__info).is-visivel {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--costa-atraso, 0s);
}

@media (prefers-reduced-motion: reduce) {
    .costa-faixa--hero img { animation: none; }
    .costa-mosaico li:hover img,
    .costa-parceiro:hover,
    .costa-projeto__foto:hover { transform: none; }
    .costa-depoimentos { transition: none; }
}

@media (max-width: 900px) {
    .costa-carrossel { --costa-por-pagina: 2; }
}
@media (max-width: 600px) {
    .costa-carrossel { --costa-por-pagina: 1; }
    .costa-depoimento { flex-direction: column; align-items: center; gap: 14px; padding: 0 8px; text-align: center; }
    .costa-depoimento__foto { flex-basis: auto; width: 84px; }
    .costa-depoimento__texto { font-size: 16px; line-height: 1.65; }
}
@media (max-width: 767px) {
    .costa-sec { padding: 48px 18px; }
    .costa-sec__titulo { font-size: 29px; }
    .costa-sec__titulo--sm { font-size: 19px; }
    .costa-sec__subtitulo { font-size: 18px; margin: -18px 0 36px; }
    .costa-sec__texto { font-size: 16px; }
    .costa-servico { font-size: 17px; }
    .costa-mosaico { grid-template-columns: repeat(2, 1fr); margin: 40px auto; }
    .costa-projetos { grid-template-columns: 1fr; gap: 36px; }
}

/* ==========================================================
   Listagem News (blog-basic-grid)

   O CSS do export fixa 2 colunas e monta a caixa da foto com
   height:0 + padding-bottom + display:flex. Esse truque depende
   do JS do Squarespace para posicionar a <img>, que nao roda
   aqui — a caixa abria vazia. Trocado por aspect-ratio.
   ========================================================== */
.blog-basic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-column-gap: 34px;
    grid-row-gap: 52px;
}
@media (max-width: 991px) {
    .blog-basic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
    .blog-basic-grid { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
}

.blog-basic-grid .image-wrapper {
    display: block !important;
    height: auto !important;
    padding-bottom: 0 !important;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    margin-bottom: 18px;
}
.blog-basic-grid .image-wrapper img {
    position: static !important;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: none;
    transition: transform 0.5s ease;
}
.blog-basic-grid .image-wrapper:hover img { transform: scale(1.04); }
