/* ==========================================================================
   AUDIMEC — estilos globais
   A identidade (cores, Inter, componentes) vive no @theme de cada página.
   Aqui ficam apenas comportamentos e componentes compartilhados.
   ========================================================================== */

* {
    font-family: inter, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

button {
    cursor: pointer;
}

::selection {
    background: #92B600;
    color: #1C352E;
}

/* Âncoras não ficam escondidas atrás do menu fixo */
[id] {
    scroll-margin-top: 96px;
}

/* --------------------------------------------------------------------------
   Acessibilidade: foco visível e link "pular para o conteúdo"
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid #DA7800;
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 8px;
    background: #1C352E;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    transform: translateY(-160%);
    transition: transform .2s ease;
}

.skip-link:focus {
    transform: none;
}

/* --------------------------------------------------------------------------
   Navegação
   -------------------------------------------------------------------------- */
.nav-link {
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: #92B600;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.nav-dropdown-panel {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

.nav-dropdown.is-open .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

.nav-dropdown.is-open .nav-dropdown-caret {
    transform: rotate(180deg);
}

@media (hover: hover) and (min-width: 1024px) {
    .nav-dropdown:hover .nav-dropdown-panel {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
        transition: opacity .2s ease, transform .2s ease, visibility 0s;
    }

    .nav-dropdown:hover .nav-dropdown-caret {
        transform: rotate(180deg);
    }
}

.mobile-menu {
    max-height: calc(100svh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-menu [aria-current="page"] {
    color: #3E7566;
}

.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s ease, opacity .2s ease;
}

.menu-toggle .bar + .bar {
    margin-top: 5px;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Fluxo de etapas (Como auditamos / definição do trabalho)
   Mobile: lista vertical com linha à esquerda. Desktop: linha horizontal.
   -------------------------------------------------------------------------- */
.flow {
    --flow-line: rgba(255, 255, 255, .22);
    display: grid;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.flow--light {
    --flow-line: rgba(146, 182, 0, .45);
}

.flow-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

.flow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 32px;
    top: 68px;
    bottom: -16px;
    width: 1px;
    background: var(--flow-line);
}

.flow-num {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .15em;
    opacity: .6;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
}

/* Números do fluxo em fundo claro: opacidade maior para contraste AA */
.flow--light .flow-num {
    opacity: .95;
}

.flow-icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .flow {
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .flow-step {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .flow-step:not(:last-child)::after {
        left: calc(50% + 44px);
        right: calc(-50% + 38px);
        top: 32px;
        bottom: auto;
        width: auto;
        height: 1px;
    }
}

/* --------------------------------------------------------------------------
   Cards das etapas (Como auditamos / percurso) — fundo escuro
   Mobile: 1 coluna · Tablet: 2 colunas · Desktop: 4 + 3 em grade de 12
   -------------------------------------------------------------------------- */
.step-cards {
    display: grid;
    gap: 16px;
    list-style: none;
    margin: 64px 0 0;
    padding: 64px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.step-card {
    position: relative;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .14);
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}

.step-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 24px;
    width: 32px;
    height: 2px;
    background: var(--color-secondary-light-color, #92b600);
    transition: width .3s ease;
}

@media (hover: hover) {
    .step-card:hover {
        background: rgba(255, 255, 255, .09);
        border-color: rgba(146, 182, 0, .45);
        transform: translateY(-2px);
    }

    .step-card:hover::before {
        width: 56px;
    }
}

@media (min-width: 768px) {
    .step-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .step-cards > :last-child {
        grid-column: span 2;
    }
}

@media (min-width: 1024px) {
    .step-cards {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 24px;
    }

    .step-cards > :nth-child(-n+4) {
        grid-column: span 3;
    }

    .step-cards > :nth-child(n+5) {
        grid-column: span 4;
    }
}

/* Variante com 6 etapas: 2 colunas no tablet, 3 + 3 no desktop */
@media (min-width: 768px) {
    .step-cards--six > :last-child {
        grid-column: auto;
    }
}

@media (min-width: 1024px) {
    .step-cards--six > :nth-child(n) {
        grid-column: span 4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .step-card,
    .step-card::before {
        transition: none;
    }

    .step-card:hover {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Acordeão (O que oferecemos)
   -------------------------------------------------------------------------- */
details > summary::-webkit-details-marker {
    display: none;
}

details[open] > summary + * {
    animation: accordion-in .3s ease;
}

@keyframes accordion-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Um único momento de movimento: a entrada do conteúdo do topo da página.
   O restante do site fica parado — o movimento só responde a ações.
   -------------------------------------------------------------------------- */
@keyframes hero-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.js main > header .relative.z-10 > div > * {
    animation: hero-in .9s cubic-bezier(.22, 1, .36, 1) both;
}

.js main > header .relative.z-10 > div > :nth-child(2) { animation-delay: .08s; }
.js main > header .relative.z-10 > div > :nth-child(3) { animation-delay: .16s; }
.js main > header .relative.z-10 > div > :nth-child(4) { animation-delay: .24s; }
.js main > header .relative.z-10 > div > :nth-child(n+5) { animation-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Carrossel de clientes (Owl Carousel)
   Linguagem de "livro-razão": células numeradas separadas por fios finos,
   logos em tom neutro que ganham cor ao interagir e fio verde de destaque.
   -------------------------------------------------------------------------- */
.clientes-head {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (min-width: 1024px) {
    .clientes-head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.clientes-controles {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.clientes-controles[hidden] {
    display: none;
}

.clientes-contador {
    margin-right: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #1C352E;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.clientes-contador__sep {
    margin: 0 6px;
    color: #9aa5a1;
    font-weight: 500;
}

.clientes-contador [data-clientes-total] {
    color: #6b7571;
    font-weight: 500;
}

.clientes-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(28, 53, 46, .18);
    background: #fff;
    color: #1C352E;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}

.clientes-btn:hover {
    background: #1C352E;
    border-color: #1C352E;
    color: #fff;
}

.clientes-btn:active {
    transform: scale(.94);
}

.clientes-btn__play,
.clientes-btn[aria-pressed="true"] .clientes-btn__pausa {
    display: none;
}

.clientes-btn[aria-pressed="true"] .clientes-btn__play {
    display: block;
}

/* Vitrine */
.clientes-vitrine {
    position: relative;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.carousel-clientes .owl-stage-outer {
    /* fios verticais nas bordas da faixa visível */
    box-shadow: inset 1px 0 0 #e2e8f0, inset -1px 0 0 #e2e8f0;
}

.carousel-clientes .owl-stage {
    display: flex;
}

.carousel-clientes .owl-item {
    display: flex;
}

.cliente {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 168px;
    margin: 0;
    padding: 36px 20px;
    border-right: 1px solid #e2e8f0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-clientes.owl-grab .cliente:active {
    cursor: grabbing;
}

/* Fio verde que cresce no topo da célula */
.cliente::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #92B600;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

.cliente__index {
    position: absolute;
    top: 16px;
    left: 18px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    color: #9aa5a1;
    font-variant-numeric: tabular-nums;
    transition: color .3s ease;
}

.cliente__nome {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #3E7566;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .3s ease, transform .3s ease;
}

.carousel-clientes .cliente__logo {
    display: block;
    width: min(var(--logo-w, 128px), 100%);
    height: auto;
    max-height: 60px;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .55;
    transition: filter .4s ease, opacity .4s ease, transform .4s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

@media (hover: hover) {
    .cliente:hover::before {
        transform: scaleX(1);
    }

    .cliente:hover .cliente__logo {
        filter: grayscale(0);
        opacity: 1;
        transform: translateY(-4px);
    }

    .cliente:hover .cliente__index {
        color: #1C352E;
    }

    .cliente:hover .cliente__nome {
        opacity: 1;
        transform: none;
    }
}

/* Em telas de toque não há hover: logos em cor, discretos */
@media (hover: none) {
    .carousel-clientes .cliente__logo {
        filter: grayscale(0);
        opacity: .9;
    }
}

/* Sem JavaScript (ou se o Owl não carregar): faixa com rolagem horizontal */
.carousel-clientes:not(.owl-loaded) {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    box-shadow: inset 1px 0 0 #e2e8f0;
}

.carousel-clientes:not(.owl-loaded) .cliente {
    flex: 0 0 200px;
    scroll-snap-align: start;
    cursor: default;
}

@media (max-width: 639px) {
    .cliente {
        height: 136px;
        padding: 32px 16px;
    }

    .cliente__index {
        top: 12px;
        left: 14px;
    }

    .clientes-contador {
        margin-right: auto;
    }

    .clientes-controles {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Botão flutuante do WhatsApp
   -------------------------------------------------------------------------- */
.button-wpp {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    background-image: url(../img/wpp.png);
    background-size: cover;
    background-color: #fff;
    z-index: 40;
    border-radius: 100px;
    box-shadow: 0 10px 24px rgba(28, 53, 46, .22);
    transition: transform .25s ease, box-shadow .25s ease;
}

.button-wpp:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 30px rgba(28, 53, 46, .3);
}

@media (min-width: 768px) {
    .button-wpp {
        bottom: 32px;
        right: 28px;
    }
}

/* --------------------------------------------------------------------------
   Ícones
   -------------------------------------------------------------------------- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.nav-dropdown-panel a[aria-current="page"] {
    background: #f7f9fb;
}

/* --------------------------------------------------------------------------
   Imagens de conteúdo (todas as páginas)
   Moldura com proporção fixa, cantos iguais aos cards e filete da marca.
   -------------------------------------------------------------------------- */
.media-frame {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #e6ebe8;
    box-shadow: 0 4px 20px rgba(14, 62, 105, .05);
}

.media-frame picture,
.media-frame img {
    display: block;
    width: 100%;
    height: 100%;
}

.media-frame img {
    object-fit: cover;
}

.media-frame::after {
    content: '';
    position: absolute;
    left: 24px;
    bottom: 0;
    width: 48px;
    height: 3px;
    background: var(--color-secondary-light-color, #92b600);
    pointer-events: none;
}

.media-frame--43 { aspect-ratio: 4 / 3; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--portrait { aspect-ratio: 4 / 5; }
.media-frame--wide { aspect-ratio: 16 / 7; }

.media-frame--on-dark {
    background: rgba(255, 255, 255, .06);
    box-shadow: none;
}

/* Legenda sobre a foto (retrato do fundador) */
.media-frame:has(.media-caption) .media-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 56px 24px 22px;
    background: linear-gradient(to top, rgba(28, 53, 46, .92), rgba(28, 53, 46, 0));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.4;
}

.media-frame:has(.media-caption)::after {
    z-index: 1;
}

/* Imagem + citação sobrepostas (Como auditamos / abordagem) */
.media-stack {
    display: grid;
}

.media-stack__card {
    position: relative;
    margin: -48px 16px 0;
}

@media (min-width: 1024px) {
    .media-stack__card {
        margin: -72px 0 0 -40px;
        max-width: 88%;
    }
}

/* Faixa de fotos (Home / A AUDIMEC) */
.photo-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0 0 48px;
    padding: 0;
}

@media (min-width: 1024px) {
    .photo-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
        margin-bottom: 96px;
    }

    .photo-strip > li:nth-child(even) {
        transform: translateY(40px);
    }
}

/* --------------------------------------------------------------------------
   Seções de solução com imagem (Auditoria, Consultoria, Avaliações, Tributário)
   Mobile: texto → imagem → cards.
   Desktop: imagem e texto lado a lado (alternando o lado a cada seção),
   cards de "Quando é indicado" / "Principais entregas" lado a lado abaixo.
   -------------------------------------------------------------------------- */
.solution-layout {
    display: grid;
    gap: 40px;
    grid-template-areas: "text" "media" "cards";
}

.solution-layout > .solution-text { grid-area: text; }
.solution-layout > .solution-media { grid-area: media; aspect-ratio: 4 / 3; }
.solution-layout > .solution-cards { grid-area: cards; }

.solution-cards {
    display: grid;
    gap: 24px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .solution-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .solution-layout {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        grid-template-areas:
            "media text"
            "cards cards";
        column-gap: 64px;
        row-gap: 56px;
        align-items: center;
    }

    .solution-layout--flip {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        grid-template-areas:
            "text media"
            "cards cards";
    }

    .solution-layout--no-cards {
        grid-template-areas: "media text";
    }

    .solution-layout--no-cards.solution-layout--flip {
        grid-template-areas: "text media";
    }

    .solution-layout > .solution-media {
        aspect-ratio: 1 / 1;
    }

    .solution-layout > .solution-cards {
        align-self: stretch;
    }
}

/* Lista de perguntas entre os parágrafos (Avaliações / finalidade) */
.purpose-list {
    margin: 24px 0;
}

/* Seções com três cards (Tributário): sem card órfão */
@media (min-width: 768px) {
    .solution-cards:has(> :nth-child(3)) > :nth-child(3) {
        grid-column: span 2;
    }
}

@media (min-width: 1024px) {
    .solution-cards:has(> :nth-child(3)) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .solution-cards:has(> :nth-child(3)) > :nth-child(3) {
        grid-column: auto;
    }
}

/* ==========================================================================
   Imagens no mobile e tablet (< 1024px)
   ========================================================================== */
@media (max-width: 1023.98px) {
    /* Home: faixa de fotos vira um carrossel com rolagem lateral e "espiada"
       do próximo item, em vez de 4 miniaturas pequenas */
    .photo-strip {
        display: flex;
        gap: 12px;
        margin-inline: -24px;
        padding: 4px 24px 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 24px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .photo-strip::-webkit-scrollbar {
        display: none;
    }

    .photo-strip > li {
        flex: 0 0 78%;
        scroll-snap-align: start;
    }

    .photo-strip:focus-visible {
        outline: 2px solid var(--color-secondary-light-color, #92b600);
        outline-offset: 4px;
    }

    /* Fotos de seção sangram até a borda da tela: quebram colunas longas de
       texto e marcam o ritmo entre seções. O filete continua alinhado ao texto. */
    .solution-layout > .solution-media,
    .media-frame--wide,
    .grid > .media-frame--43 {
        margin-inline: -24px;
        border-radius: 0;
        box-shadow: none;
    }

    .media-frame--wide {
        aspect-ratio: 3 / 2;
        max-width: none;
    }

    /* A AUDIMEC: título antes do retrato, retrato antes do texto */
    .story-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .story-text {
        display: contents;
    }

    .story-text > :nth-child(1) { order: 1; }
    .story-text > :nth-child(2) { order: 2; }
    .story-media { order: 3; margin-bottom: 32px; }
    .story-text > :nth-child(n+3) { order: 4; }

    .story-media .media-frame {
        aspect-ratio: 1 / 1;
    }

    .story-media .media-frame img {
        object-position: 50% 15%;
    }
}

@media (min-width: 640px) and (max-width: 1023.98px) {
    .photo-strip > li {
        flex-basis: 42%;
    }

    .solution-layout > .solution-media,
    .grid > .media-frame--43 {
        aspect-ratio: 16 / 9;
    }

    .story-media .media-frame {
        aspect-ratio: 4 / 3;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .photo-strip {
        scroll-behavior: smooth;
    }
}
