:root {
    --ad-line: #ded4c4;
    --ad-paper: #fffdf8;
    --ad-muted: #747c73;
    --ad-forest: #334435;
}

.ad-slot {
    width: 100%;
    max-width: min(100%, var(--ad-width));
    margin: 1.4rem auto;
    color: var(--ad-muted);
}

.ad-slot-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    color: #7b746a;
}

.ad-slot-frame {
    width: 100%;
    min-height: var(--ad-height);
    border-radius: 8px;
    background: transparent;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.ad-slot:has(.ad-slot-placeholder) .ad-slot-frame {
    border: 1px dashed var(--ad-line);
    background: #faf7f1;
}

.ad-slot-placeholder {
    display: grid;
    place-items: center;
    gap: 0.2rem;
    width: 100%;
    min-height: var(--ad-height);
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
}

.ad-slot-placeholder strong {
    color: var(--ad-forest);
    font-weight: 700;
}

.ad-slot-placeholder span {
    font-size: 0.9rem;
}

.ad-slot-html,
.ad-slot-banner-link,
.ad-slot-frame > img {
    display: block;
    width: 100%;
    max-width: var(--ad-width);
    margin: 0 auto;
}

.ad-slot-banner-link img,
.ad-slot-frame > img,
.ad-slot-html img {
    width: 100%;
    max-width: var(--ad-width);
    height: auto;
    display: block;
}

.ad-slot-html iframe,
.ad-slot-html object,
.ad-slot-html embed {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

.ad-slot--300-250 {
    max-width: min(100%, 300px);
}

.ad-slot--320-50 {
    max-width: min(100%, 320px);
}

.ad-slot--300-50 {
    max-width: min(100%, 300px);
}

.ad-slot--250-250 {
    max-width: min(100%, 250px);
}

.ad-slot--160-600 {
    max-width: min(100%, 160px);
}

.ad-slot--120-600 {
    max-width: min(100%, 120px);
}

.ad-slot--200-175,
.ad-slot--200-100 {
    max-width: min(100%, 200px);
}

.ad-slot--120-60 {
    max-width: min(100%, 120px);
}

.ad-slot--100-100 {
    max-width: min(100%, 100px);
}

.ad-slot--88-31 {
    max-width: min(100%, 88px);
}

.ad-slot--83-61 {
    max-width: min(100%, 83px);
}

.ad-slot--mobile-only {
    display: none;
}

.blog-grid-ad {
    grid-column: 1 / -1;
}

.ad-slot--in-content {
    max-width: min(100%, 336px);
    margin: 1.8rem auto;
}

.ad-slot--mobile-sticky {
    display: none;
}

body.brand-takeover-enabled {
    background:
        linear-gradient(90deg, #e8dcc8 0, #f7f3ea 14%, #f7f3ea 86%, #e8dcc8 100%);
}

body.brand-takeover-enabled main,
body.brand-takeover-enabled .navbar,
body.brand-takeover-enabled .site-footer {
    position: relative;
    z-index: 1;
}

body.has-mobile-sticky-ad {
    padding-bottom: 82px;
}

@media (max-width: 767.98px) {
    .ad-slot {
        max-width: min(100%, var(--ad-width));
        margin: 1.1rem auto;
    }

    .ad-slot--desktop-only {
        display: none;
    }

    .ad-slot--mobile-only {
        display: block;
    }

    .ad-slot-frame,
    .ad-slot-placeholder {
        min-height: min(var(--ad-height), 250px);
    }

    .ad-slot--728-90,
    .ad-slot--468-60 {
        display: none;
    }

    .ad-slot--mobile-sticky {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 1080;
        display: block;
        width: calc(100% - 24px);
        max-width: 320px;
        margin: 0;
        transform: translateX(-50%);
        filter: drop-shadow(0 10px 24px rgba(32, 42, 34, 0.22));
    }

    .ad-slot--mobile-sticky .ad-slot-label {
        display: none;
    }

    .ad-slot--mobile-sticky .ad-slot-frame,
    .ad-slot--mobile-sticky .ad-slot-placeholder {
        min-height: 50px;
        border-radius: 6px;
    }

    .ad-slot-close {
        position: absolute;
        right: -8px;
        top: -8px;
        z-index: 3;
        width: 30px;
        height: 30px;
        border: 1px solid #d8ccba;
        border-radius: 999px;
        background: #fffdf8;
        color: #334435;
        font-size: 1.25rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
}

@media (min-width: 768px) {
    body.has-mobile-sticky-ad {
        padding-bottom: 0;
    }
}

@media (max-width: 1199.98px) {
    body.brand-takeover-enabled {
        background: #f7f3ea;
    }
}
