/* =========================================================
   bloco: hero
   Um ou varios slides, cada um com imagem e texto proprios.
   Os slides ficam empilhados e trocam em fade - a altura vem
   do min-height, nunca do conteudo, senao a pagina saltaria.
   ========================================================= */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-secondary);
    overflow: hidden;
    isolation: isolate;
}

.hero--baixa { min-height: 340px; }
.hero--media { min-height: 540px; }
.hero--alta  { min-height: 78vh; }

/* ---------- slide ---------- */

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .9s ease-in-out, visibility 0s linear .9s;
}

/* Sem JS, o primeiro slide fica visivel: o data-active vem do PHP. */
.hero-slide[data-active] {
    opacity: 1;
    visibility: visible;
    transition: opacity .9s ease-in-out;
}

/* O primeiro tambem dita a altura minima quando o conteudo e maior
   que o min-height da secao. */
.hero-slide:first-child {
    position: relative;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -1;
}

/* Veu: sem ele, texto claro sobre foto clara some. */
.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        to right,
        rgba(6, 56, 68, .82) 0%,
        rgba(6, 56, 68, .62) 55%,
        rgba(6, 56, 68, .38) 100%
    );
}

.hero--centro .hero-slide::after {
    background: rgba(6, 56, 68, .62);
}

.hero-slide--sem-imagem::after {
    background: none;
}

/* ---------- conteudo ---------- */

.hero-content {
    position: relative;
    padding-top: 72px;
    padding-bottom: 96px;
    width: 100%;
}

.hero--esquerda .hero-content { text-align: left; }
.hero--centro   .hero-content { text-align: center; }

.hero-chapeu {
    font: 600 11px/1 var(--mono);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 18px;
}

.hero-titulo {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(32px, 5.4vw, 52px);
    line-height: 1.12;
    color: var(--on-dark);
    margin: 0 0 20px;
    max-width: 20ch;
    text-wrap: pretty;
}

.hero--centro .hero-titulo {
    max-width: 24ch;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitulo {
    font-size: 19px;
    line-height: 1.65;
    color: var(--on-dark-soft);
    margin: 0;
    max-width: 46ch;
    text-wrap: pretty;
}

.hero--centro .hero-subtitulo {
    margin-left: auto;
    margin-right: auto;
}

.hero-botao {
    display: inline-block;
    margin-top: 32px;
    padding: 15px 32px;
    background: var(--color-accent);
    color: #1B1200;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
}

.hero-botao:hover {
    background: #FFB63F;
    color: #1B1200;
}

/* ---------- indicadores ---------- */

.hero-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 36px;
    z-index: 2;
}

.hero-nav-inner {
    display: flex;
    gap: 10px;
}

.hero--centro .hero-nav-inner {
    justify-content: center;
}

.hero-nav button {
    position: relative;
    width: 38px;
    height: 4px;
    padding: 0;
    border: none;
    background: rgba(247, 254, 255, .35);
    cursor: pointer;
}

.hero-nav button:hover {
    background: rgba(247, 254, 255, .65);
}

.hero-nav button[aria-current='true'] {
    background: var(--color-accent);
}

/* Alvo de toque de 44px sem engordar o tracinho. */
.hero-nav button::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 38px;
    height: 44px;
}

@media (max-width: 900px) {
    .hero--alta { min-height: 62vh; }

    .hero-slide::after,
    .hero--centro .hero-slide::after {
        background: rgba(6, 56, 68, .72);
    }

    .hero-content {
        padding-top: 56px;
        padding-bottom: 84px;
    }

    .hero-nav {
        bottom: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
}

.hero-seta {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(247, 254, 255, .35);
    background: rgba(6, 56, 68, .45);
    color: var(--on-dark);
    font-size: 18px;
    cursor: pointer;
}

.hero-seta:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.hero-seta--anterior { left: 16px; }
.hero-seta--proximo  { right: 16px; }

.hero-contador {
    margin-left: auto;
    font: 500 13px/1 var(--mono);
    color: rgba(247, 254, 255, .7);
    align-self: center;
}

@media (max-width: 900px) {
    .hero-seta {
        width: 40px;
        height: 40px;
    }

    .hero-seta--anterior { left: 8px; }
    .hero-seta--proximo  { right: 8px; }
}
