/*
 * Banners do portal (ViewComponent "Banner")
 * Carregado uma única vez em Pages/Layouts/_Site1Layout.cshtml
 * Documentação: !Guias/publicidade-espacos-e-especificacoes.md
 */

/* ---------- Base (banners de imagem e HTML) ---------- */
.banners-container {
    text-align: center;
    width: 100%;
}

.banner-item {
    display: block;
    width: 100%;
}

.banner-item > img,
.banner-item > a > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-item > a:hover > img {
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Sidebars viram largura total abaixo de 992px: limitar para não virar um bloco gigante */
@media (max-width: 991.98px) {
    .position-imovel-sidebar,
    .position-detalhe-sidebar {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---------- Anúncios em HTML (house ads) ----------
 * Variantes: .ad-house (escuro) | .ad-house--light (claro) | .ad-house--slim (uma linha)
 * Cores por anúncio: style="--ad-c1:#...; --ad-c2:#...; --ad-accent:#..."
 */

/* O wrapper do ViewComponent passa a ser o container de referência */
.banner-item {
    container-type: inline-size;
}

.ad-house {
    --ad-c1: #073B3A;
    --ad-c2: #0f6b68;
    --ad-accent: #CBCD30;
    --ad-ink: #ffffff;
    --ad-ink-soft: rgba(255, 255, 255, 0.78);
    --ad-pattern: #ffffff;
    --ad-cta-bg: var(--ad-accent);
    --ad-cta-ink: var(--ad-c1);

    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 26px 22px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ad-c1) 0%, var(--ad-c2) 100%);
    color: var(--ad-ink);
    text-align: left;
    text-decoration: none;
    box-shadow: 0 6px 18px -8px rgba(3, 14, 15, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ad-house,
.ad-house *,
.ad-house::before,
.ad-house::after {
    box-sizing: border-box;
}

.ad-house:hover,
.ad-house:focus {
    color: var(--ad-ink);
    text-decoration: none;
}

/* Textura: círculos + malha de pontos, desvanecendo para a esquerda */
.ad-house::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    color: var(--ad-pattern);
    opacity: 0.14;
    background:
        radial-gradient(circle 90px at calc(100% - 24px) 12px, currentColor 0 98%, transparent 100%),
        radial-gradient(circle 130px at 100% 100%, currentColor 0 98%, transparent 100%),
        radial-gradient(currentColor 1px, transparent 1.4px) 0 0 / 16px 16px;
    -webkit-mask-image: linear-gradient(100deg, transparent 15%, #000 75%);
    mask-image: linear-gradient(100deg, transparent 15%, #000 75%);
    pointer-events: none;
}

/* Brilho que atravessa o card no hover */
.ad-house::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.16) 50%, transparent 65%);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.ad-house:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -14px rgba(3, 14, 15, 0.5);
}

.ad-house:hover::after {
    transform: translateX(100%);
}

.ad-house:focus-visible {
    outline: 3px solid var(--ad-accent);
    outline-offset: 3px;
}

/* Ícone ou logo */
.ad-house__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--ad-accent);
    font-size: 22px;
}

.ad-house__icon img {
    max-width: 72%;
    max-height: 72%;
    object-fit: contain;
}

.ad-house__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ad-house__tag {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ad-accent);
}

.ad-house__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ad-ink);
}

.ad-house__text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ad-ink-soft);
}

.ad-house__cta {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding: 11px 20px;
    border-radius: 999px;
    background: var(--ad-cta-bg);
    color: var(--ad-cta-ink);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.ad-house__cta i {
    transition: transform 0.25s ease;
}

.ad-house:hover .ad-house__cta i {
    transform: translateX(4px);
}

/* ---------- Faixa larga ---------- */
@container (min-width: 600px) {
    .ad-house {
        flex-direction: row;
        align-items: center;
        gap: 22px;
        padding: 24px 30px;
    }

    .ad-house__body {
        flex: 1;
    }

    .ad-house__icon {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }

    .ad-house__title {
        font-size: 24px;
    }

    .ad-house__text {
        -webkit-line-clamp: 2;
    }

    .ad-house__cta {
        width: auto;
        margin-top: 0;
        padding: 13px 24px;
    }
}

@container (min-width: 1000px) {
    .ad-house {
        gap: 28px;
        padding: 30px 44px;
    }

    .ad-house__icon {
        width: 76px;
        height: 76px;
        border-radius: 18px;
        font-size: 30px;
    }

    .ad-house__title {
        font-size: 28px;
    }

    .ad-house__text {
        font-size: 15.5px;
    }
}

/* ---------- Variante clara ---------- */
.ad-house--light {
    --ad-ink: #030E0F;
    --ad-ink-soft: #5b6b6b;
    --ad-pattern: var(--ad-c2);
    --ad-cta-bg: var(--ad-c1);
    --ad-cta-ink: #ffffff;

    background: #ffffff;
    border: 1px solid #e3eaea;
    box-shadow: inset 4px 0 0 var(--ad-c2), 0 6px 18px -10px rgba(3, 14, 15, 0.18);
}

.ad-house--light:hover {
    box-shadow: inset 4px 0 0 var(--ad-c2), 0 16px 32px -16px rgba(3, 14, 15, 0.28);
}

.ad-house--light::before {
    opacity: 0.07;
}

.ad-house--light::after {
    background: linear-gradient(115deg, transparent 35%, rgba(7, 59, 58, 0.06) 50%, transparent 65%);
}

.ad-house--light .ad-house__icon {
    background: linear-gradient(135deg, var(--ad-c1), var(--ad-c2));
    border: 0;
    color: #ffffff;
}

.ad-house--light .ad-house__tag {
    color: var(--ad-c2);
}

/* ---------- Variante slim (uma linha) ---------- */
.ad-house--slim {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.ad-house--slim .ad-house__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
}

.ad-house--slim .ad-house__body {
    flex: 1;
}

.ad-house--slim .ad-house__title {
    font-size: 16px;
}

.ad-house--slim .ad-house__text {
    -webkit-line-clamp: 2;
    font-size: 13px;
}

/* No estreito, o botão vira só a seta redonda (o card inteiro é clicável) */
.ad-house--slim .ad-house__cta {
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
}

.ad-house--slim .ad-house__cta-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@container (min-width: 600px) {
    .ad-house--slim {
        gap: 18px;
        padding: 14px 18px 14px 24px;
    }

    .ad-house--slim .ad-house__icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .ad-house--slim .ad-house__body {
        flex-direction: row;
        align-items: baseline;
        gap: 14px;
    }

    .ad-house--slim .ad-house__tag,
    .ad-house--slim .ad-house__title {
        flex: none;
        white-space: nowrap;
    }

    .ad-house--slim .ad-house__title {
        font-size: 18px;
    }

    .ad-house--slim .ad-house__text {
        flex: 1;
        -webkit-line-clamp: 1;
        font-size: 14px;
    }

    .ad-house--slim .ad-house__cta {
        width: auto;
        height: auto;
        padding: 10px 20px;
    }

    .ad-house--slim .ad-house__cta-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ad-house,
    .ad-house::after,
    .ad-house__cta i {
        transition: none;
    }

    .ad-house:hover {
        transform: none;
    }
}
