/* RV Daily: global */

/* Ads: base */
div[id^="google_ads_iframe_"] iframe {
    display: inline-block;
}

/* Layout */
.ct-container[data-sidebar] {
    height: auto !important;
}

[data-sidebar] {
    overflow: visible !important;
}

/* Ad slots */
.madv-ad {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2.5rem auto;
    max-width: 100%;
}

.madv-ad iframe,
.madv-ad > div {
    max-width: 100%;
}

.madv-ad[data-ad-unit="header"]            { min-height: 250px; }
.madv-ad[data-ad-unit="article_incontent"] { min-height: 250px; }
.madv-ad[data-ad-unit="sidebar"]           { min-height: 0; }

@media (min-width: 768px) {
    .madv-ad[data-ad-unit="header"]            { min-height: 100px; }
    .madv-ad[data-ad-unit="article_incontent"] { min-height: 90px; }
}

@media (min-width: 1024px) {
    .madv-ad[data-ad-unit="header"]            { min-height: 250px; }
    .madv-ad[data-ad-unit="sidebar"]           { min-height: 600px; }

    .madv-ad.madv-ad--fitted[data-ad-unit="header"] { min-height: 90px; }
}

.madv-ad[data-ad-unit="article_cta_button"],
.madv-ad[data-ad-unit="native_card"] {
    min-height: 0;
    overflow: visible;
}

.madv-ad::before {
    content: "Advertisement";
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.5;
    pointer-events: none;
}

.madv-ad[data-ad-unit="article_cta_button"]::before,
.madv-ad[data-ad-unit="native_card"]::before {
    content: none;
}

.madv-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid rgba(29, 59, 65, 0.1);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(calc(100% + 24px));
    transition: transform 0.35s ease;
}

.madv-sticky.is-visible {
    transform: translateY(0);
}

.madv-sticky__slot {
    line-height: 0;
}

.madv-sticky__slot iframe {
    display: block;
    max-width: 100%;
}

.madv-sticky__close {
    position: absolute;
    top: -12px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-height: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(29, 59, 65, 0.15) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #1D3B41 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    opacity: 0.85;
}

.madv-sticky__close::after {
    content: "";
    position: absolute;
    inset: -10px;
}

.madv-sticky__close:hover,
.madv-sticky__close:focus-visible {
    opacity: 1;
}

.madv-sticky__close:focus-visible {
    outline: 2px solid #1D3B41;
    outline-offset: 2px;
}

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

body.madv-sticky-on {
    padding-bottom: var(--madv-sticky-h, 0px);
}

body.madv-sticky-on .ct-back-to-top {
    bottom: calc(var(--madv-sticky-h, 0px) + 16px) !important;
    transition: bottom 0.35s ease;
}

/* Category partner */
.madv-cat-sponsor {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.madv-cat-sponsor__label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

.madv-cat-sponsor img {
    max-height: 40px;
    width: auto;
}

@media (max-width: 767px) {
    .madv-cat-sponsor {
        gap: 8px;
        margin: 1rem 0;
    }
    .madv-cat-sponsor img { max-height: 32px; }
}

/* Type and links */
:root {
    --rvd-muted: rgba(29, 59, 65, 0.75);
}

body.single-post article.type-post > .entry-content a:not(.wp-block-button__link):not(.kb-button):not([class*="rvd-"]) {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--theme-palette-color-1);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

body.single-post article.type-post > .entry-content a:not(.wp-block-button__link):not(.kb-button):not([class*="rvd-"]):hover {
    text-decoration-color: currentColor;
}

body.single-post article.type-post > .entry-content a:not(.wp-block-button__link):not(.kb-button):not([class*="rvd-"]):focus-visible {
    outline: 2px solid var(--theme-palette-color-4);
    outline-offset: 2px;
}

.entry-content p,
.entry-content li {
    font-weight: 450 !important;
    -webkit-font-smoothing: antialiased;
}

/* Buttons */
.wp-block-button__link {
    color: #123b4b !important;
    background-color: #DEAC65 !important;
}

.wp-block-button__link:hover {
    color: #DEAC65 !important;
    background-color: #123b4b !important;
}

/* Dates */
.post-date-wrapper {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 400;
}

.post-date-wrapper strong {
    font-weight: 400;
    margin-right: 5px;
}

@media (max-width: 767px) {
    .post-date-wrapper {
        margin-top: 5px;
        display: block;
        text-align: left;
    }
}

/* Social icons */
.wp-block-social-links .wp-block-social-link a,
.wp-block-social-links .wp-block-social-link-anchor {
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Sidebar */
.rvd-side-head {
    position: relative;
    margin: 0 0 18px;
    padding-bottom: 10px;
    color: var(--theme-palette-color-4);
    font-size: 18px !important;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: left;
}

.rvd-side-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--theme-palette-color-1);
}

p:has(> .rvd-latest) {
    margin: 0;
}

.rvd-latest {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rvd-latest a {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.rvd-latest img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.rvd-latest__lead {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: var(--theme-palette-color-4);
    box-shadow: 0 16px 32px -20px rgba(16, 24, 40, 0.5);
}

.rvd-latest__media {
    position: absolute;
    inset: 0;
    display: block;
}

.rvd-latest__lead::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0) 75%);
}

.rvd-latest__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
}

.rvd-latest__pill {
    display: inline-block;
    padding: 3px 8px;
    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-4);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.rvd-latest__lead .rvd-latest__title {
    display: block;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.rvd-latest__lead:hover img {
    transform: scale(1.05);
}

.rvd-latest__item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(29, 59, 65, 0.1);
}

.rvd-latest__thumb {
    display: block;
    width: 96px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background: #e9e7e1;
}

.rvd-latest__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rvd-latest__kicker {
    color: var(--rvd-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.rvd-latest__item .rvd-latest__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--theme-palette-color-4);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.rvd-latest__item:hover .rvd-latest__title {
    color: var(--theme-palette-color-1);
}

.rvd-latest__item:hover img {
    transform: scale(1.06);
}

.rvd-latest__lead:focus-visible,
.rvd-latest__item:focus-visible {
    outline: 2px solid var(--theme-palette-color-4);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .rvd-latest img {
        transition: none;
    }
}
