/*
 * Motor de layout das seções de destaque (hero) e banners.
 *
 * Carregado tanto pelo site quanto pelo painel: é a MESMA folha nos dois lados,
 * então a pré-visualização não tem como divergir do resultado real.
 *
 * O responsivo usa container queries, não media queries. No site o container é a
 * largura da página; no painel, a moldura de 1280px / 390px do preview. Assim as
 * regras de "computador" e "celular" disparam de verdade nos dois contextos.
 *
 * Os valores por registro chegam como custom properties inline:
 *   sem sufixo = celular (base)   |   sufixo -d = computador
 */

.hero-root {
    container-type: inline-size;
    container-name: hero;
    position: relative;
}

/* O carrossel alterna slides com esta classe; declarada aqui para não depender
   do Tailwind, já que esta folha também é usada dentro do painel. */
.hero.hidden {
    display: none;
}

.hero {
    position: relative;
    display: flex;
    align-items: var(--hero-align-y, center);
    justify-content: var(--hero-align-x, flex-start);
    min-height: var(--hero-h, auto);
    padding: var(--hero-py, 64px) var(--hero-px, 16px);
    color: var(--hero-text, #ffffff);
    text-align: var(--hero-text-align, left);
    overflow: hidden;

    background-color: var(--hero-bg, #1c2c47);
    background-image: var(--hero-img, none);
    background-size: var(--hero-fit, cover);
    background-position: var(--hero-pos, 50% 50%);
    background-repeat: no-repeat;
}

/*
 * O véu fica num pseudo-elemento, e não como camada de background-image, para
 * não ser afetado por `background-size: contain` — senão ele escureceria também
 * as tarjas vazias das laterais.
 */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-ov, none);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: var(--hero-align-x, flex-start);
    gap: 2.5rem;
}

.hero__content {
    width: var(--hero-content-w, 100%);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: var(--hero-text-items, flex-start);
}

/* Cartões de destaque: escondidos no celular, onde o espaço é curto. */
.hero__cards {
    display: none;
}

/* ---------------- Computador ---------------- */

@container hero (min-width: 64rem) {
    .hero {
        align-items: var(--hero-align-y-d, center);
        justify-content: var(--hero-align-x-d, flex-start);
        min-height: var(--hero-h-d, auto);
        padding: var(--hero-py-d, 96px) var(--hero-px-d, 32px);
        color: var(--hero-text-d, #ffffff);
        text-align: var(--hero-text-align-d, left);

        background-image: var(--hero-img-d, none);
        background-size: var(--hero-fit-d, cover);
        background-position: var(--hero-pos-d, 50% 50%);
    }

    .hero::before {
        background: var(--hero-ov-d, none);
    }

    .hero__inner {
        justify-content: var(--hero-align-x-d, flex-start);
    }

    .hero__content {
        width: var(--hero-content-w-d, 50%);
        align-items: var(--hero-text-items-d, flex-start);
    }

    .hero__cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        flex: 0 0 auto;
        margin-inline-start: auto;
    }
}

/* ---------------- Elementos internos ---------------- */

.hero__badge {
    display: inline-block;
    width: fit-content;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background-color: rgb(255 255 255 / 0.15);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero__title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

@container hero (min-width: 64rem) {
    .hero__title {
        font-size: 3rem;
    }
}

.hero__text {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.85;
    overflow-wrap: anywhere;
}

.hero__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

@container hero (min-width: 40rem) {
    .hero__actions {
        flex-direction: row;
        width: auto;
    }
}

/*
 * Peso forte + caixa alta + leve espaçamento entre letras: mesma linguagem
 * de botão do site principal (barbieriagricola.com.br), pra criar
 * continuidade visual entre os dois sites.
 */
.hero__btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    transition: background-color 0.15s, color 0.15s;
}

.hero__btn--primary {
    background-color: #ffffff;
    color: #1c2c47;
}

.hero__btn--primary:hover {
    background-color: #eef2f8;
}

.hero__btn--ghost {
    border: 1px solid rgb(255 255 255 / 0.5);
    color: inherit;
}

.hero__btn--ghost:hover {
    background-color: rgb(255 255 255 / 0.1);
}

.hero__card {
    padding: 1.5rem;
    border-radius: 0.75rem;
    background-color: rgb(255 255 255 / 0.1);
}

.hero__card-value {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.1;
}

.hero__card-label {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.75;
}

/* ---------------- Controles do carrossel ---------------- */

.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: none;
    padding: 0.5rem;
    border-radius: 999px;
    background-color: rgb(255 255 255 / 0.15);
    color: #ffffff;
    backdrop-filter: blur(4px);
    transition: background-color 0.15s;
}

.hero-nav:hover {
    background-color: rgb(255 255 255 / 0.25);
}

.hero-nav--prev {
    left: 0.75rem;
}

.hero-nav--next {
    right: 0.75rem;
}

@container hero (min-width: 40rem) {
    .hero-nav {
        display: block;
    }
}

.hero-dots {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.hero-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background-color: rgb(255 255 255 / 0.4);
    transition: width 0.2s, background-color 0.2s;
}

.hero-dot[data-active] {
    width: 1.5rem;
    background-color: #ffffff;
}
