/* Lab ads general */
:root {
    --hm-ads-placeholder-bg: #fafafa;
    --hm-ads-label-color: #c4c4c4;
    --hm-ads-ia-label-color: #aaa;
    --hm-ads-ia-spinner-color: #ccc;
    --hm-ads-ia-spinner-accent-color: #888;
    --hm-ads-ia-border-color: #ddd;
}

/* All Ads */
body .column.google-ad {
    min-height: 250px;
    margin: 0 auto;
    background-color: var(--hm-ads-placeholder-bg);
}

body .column.google-ad.display-label .ad-label{
    display: inline;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    font-size: 28px;
    color: var(--hm-ads-label-color);
    text-transform: uppercase;
}

body .column.google-ad.google-ad--filled {
    display: block;
    margin: 50px auto;
    background-color: unset;
}

body .column.google-ad.display-label.google-ad--filled .ad-label {
    display: block;
    position: static;
    top: unset;
    left: unset;
    transform: unset;
    z-index: 1;
    font-size: 14px;
    text-align: center;
}

body .column.google-ad > .adunit {
    z-index: 2;
}

/* 
 * Article Ads Exceptions
 *
 * element .bodytext should contain only IA and halfpage (300x600) ads and they have different placeholder style
 * element .related contains only one IA ad (ia-6) - this exception is only for Gloria
 * the rest of the page could contain other types of ads, placeholder should be the same as front page ads
 */

body.article .bodytext > .column.google-ad:not(.floatRight),
body.article .bodytext > .column.adnuntius-ad { 
    float: none; 
}

body.article .bodytext > .column.google-ad.floatRight {
    width: auto;
}

body.article .bodytext > .column.google-ad:not(.floatRight),
body.article .related .column.google-ad {
    display: flex;
    justify-content: center;
    position: relative;
    max-width: min(600px, var(--bodytext-width)) !important;
    min-height: 250px;
    margin-block: 50px;
    margin-inline: calc((100% - min(600px, var(--bodytext-width))) / 2) !important;
    padding: 30px 0;
    background-color: unset;
    border-top: 1px solid var(--hm-ads-ia-border-color);
    border-bottom: 1px solid var(--hm-ads-ia-border-color); 
    clear: unset !important;
}

body.article .bodytext > .column.google-ad:not(.floatRight)::after,
body.article .related .column.google-ad::after {
    content: '';
    position: absolute;
    top: calc(50% - 18px);
    left: calc(50% - 18px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px dashed var(--hm-ads-ia-spinner-color);
    border-top-color: var(--hm-ads-ia-spinner-accent-color);
    animation: ad-spinner-loader 1.6s ease-in-out infinite;
    z-index: 0;
}

body.article .bodytext >.column.google-ad.google-ad--filled::after,
body.article .related .column.google-ad.google-ad--filled::after {
    display: none;
}

body.article .bodytext > .column.google-ad.display-label:not(.floatRight) .ad-label, 
body.article .related .column.google-ad.display-label .ad-label {
    display: flex;
    justify-content: center;
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    text-align: center;
    background: #fff;
    width: 100px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    z-index: 2;
}

body.article .bodytext .gloria-article-rail > .column.google-ad,
body.article .bodytext .gloria-article-rail > .column.google-ad.google-ad--filled {
    width: 100%;
    max-width: none;
    min-height: 0;
    margin-block: 0 !important;
    margin-inline: auto !important;
    padding: 0;
    float: none;
    clear: none;
    background-color: transparent;
    border: 0;
    text-align: center; 
}


/* float ads are pinned to the viewport by ads.js (position:fixed;bottom:0), so their in-flow placeholder must not reserve any space. */
.placeholder.placement-overlay .column.google-ad:has(.adunit[id*="_float"]), 
.placeholder.placement-body-top .column.google-ad:has(.adunit[id*="_float"]) {
    margin: 0;
    padding: 0;
    min-height: 0;
}

/* TEMP  - Section and subsection pages*/
@media (min-width: 1024px) {
    .main.front .row > .columns:has(> .row > .column.toplist),
    .main.front .row > .column:has(> .row > .column.toplist) {
        align-self: stretch;
    }

    .main.front .columns > .row:has(> .column.toplist),
    .main.front .column > .row:has(> .column.toplist) {
        display: grid;
        row-gap: 50px;
        align-content: start;
        position: sticky;
        top: 5rem;
    }

    .main.front .row:has(> .column.toplist) > .column.toplist,
    .main.front .row:has(> .column.toplist) > .column.google-ad {
        position: relative;
        top: auto;
        margin-block: 0 !important;
        min-height: 0;
    }
    .main.front .row:has(> .column.toplist) > .column.toplist .toplist-results {
        padding-bottom: 0;
    }
}

@keyframes ad-spinner-loader {
    0% {transform: rotate(0deg);}
    to {transform: rotate(360deg);}
}