/**
 * Advertisement Slots Styles
 *
 * @package Media_Khodro
 */

/* ── Shared slot ── */
.mk-ad-slot {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.mk-ad-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mk-ad-image {
    max-width: 100%;
}

.mk-ad-image--gif {
    object-fit: contain;
}

.mk-ad-link {
    display: block;
    height: 100%;
}

/* Placeholder graphic */
.mk-ad-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e8edf4 45%, #f8fafc 100%);
}

.mk-ad-placeholder-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.45;
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 12px,
            rgba(29, 53, 87, 0.04) 12px,
            rgba(29, 53, 87, 0.04) 24px
        );
}

.mk-ad-placeholder-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1rem;
    color: #64748b;
}

.mk-ad-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 0.65rem;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.1);
    color: var(--mk-primary, #e63946);
    font-size: 1.15rem;
}

.mk-ad-placeholder-content strong {
    display: block;
    font-size: 0.92rem;
    color: #1d3557;
    margin-bottom: 0.25rem;
}

.mk-ad-placeholder-content small {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}

.mk-ad-slot--placeholder {
    border: 2px dashed #cbd5e1;
    background: transparent;
}

/* ── Site top: ad + header stack ── */
.mk-site-top {
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.mk-site-top .mk-ad-header-top {
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}

.mk-site-top .mk-header {
    margin-top: 0;
}

/* ── Header top leaderboard ── */
.mk-ad-header-top {
    background: #0f172a;
    padding: 0;
    direction: rtl;
    line-height: 0;
    font-size: 0;
}

.mk-ad-header-top .mk-container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    line-height: 0;
}

.mk-ad-slot--leaderboard {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    max-height: 90px;
    border-radius: 0;
    border: none;
    background: #0f172a;
    display: block;
    overflow: hidden;
    line-height: 0;
}

.mk-ad-slot--leaderboard .mk-ad-link {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    line-height: 0;
}

.mk-ad-slot--leaderboard .mk-ad-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    vertical-align: top;
}

.mk-ad-slot--leaderboard .mk-ad-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%);
}

.mk-ad-slot--leaderboard .mk-ad-placeholder-content strong,
.mk-ad-slot--leaderboard .mk-ad-placeholder-content small {
    color: rgba(255, 255, 255, 0.75);
}

.mk-ad-slot--leaderboard .mk-ad-placeholder-icon {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.mk-ad-slot--leaderboard .mk-ad-placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
}

.mk-ad-slot--leaderboard .mk-ad-placeholder-content strong,
.mk-ad-slot--leaderboard .mk-ad-placeholder-content small {
    display: inline;
    margin: 0;
    font-size: 0.8rem;
}

/* Header top: desktop vs mobile banners */
.mk-ad-header-top--responsive .mk-ad-slot--mobile {
    display: none;
}

.mk-ad-header-top--responsive .mk-ad-slot--desktop {
    display: block;
}

/* ── Magazine sidebar skyscraper ── */
.mk-magazine-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 1.5rem;
    align-items: stretch;
}

.mk-magazine-main {
    min-width: 0;
}

.mk-magazine-ads {
    display: flex;
    flex-direction: column;
    padding-right: 0;
    margin-right: 0;
    border-right: 1px solid rgba(29, 53, 87, 0.08);
    padding-left: 1rem;
}

.mk-magazine-ads-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.mk-magazine-ads-stack .mk-ad-slot--skyscraper {
    flex: none;
    min-height: auto;
    height: auto;
}

.mk-ad-slot--skyscraper {
    flex: 1;
    min-height: 100%;
    height: 100%;
}

.mk-magazine-ads-stack .mk-ad-slot--skyscraper .mk-ad-placeholder {
    min-height: 200px;
}

/* ── Dual row between magazine & appraisal ── */
.mk-ads-section {
    padding: 1.75rem 0;
    direction: rtl;
}

.mk-ads-section--dual {
    background: #f8fafc;
}

.mk-ads-dual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.mk-ad-slot--half {
    min-height: 180px;
}

.mk-ad-slot--half .mk-ad-placeholder {
    min-height: 180px;
}

/* ── Before brands wide banner ── */
.mk-ads-section--single {
    background: #fff;
    padding: 1.5rem 0;
}

.mk-ads-banner-grid {
    display: grid;
    grid-template-columns: repeat(var(--mk-ad-cols, 1), minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.mk-ad-slot--wide {
    min-height: 140px;
    height: 100%;
}

.mk-ad-slot--wide .mk-ad-placeholder {
    min-height: 140px;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .mk-magazine-layout {
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: 1.25rem;
    }
}

@media (max-width: 992px) {
    .mk-magazine-layout {
        grid-template-columns: 1fr;
    }

    .mk-magazine-ads {
        margin-right: 0;
        margin-top: 1.5rem;
        padding-right: 0;
        padding-left: 0;
        border-right: none;
        border-top: 1px solid rgba(29, 53, 87, 0.08);
        padding-top: 1.25rem;
    }

    .mk-magazine-ads-stack .mk-ad-slot--skyscraper .mk-ad-placeholder {
        min-height: 160px;
    }

    .mk-ads-dual-grid {
        grid-template-columns: 1fr;
    }

    .mk-ads-banner-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mk-ad-header-top--responsive .mk-ad-slot--desktop {
        display: none;
    }

    .mk-ad-header-top--responsive .mk-ad-slot--mobile {
        display: block;
    }

    .mk-ad-slot--leaderboard {
        min-height: 72px;
        max-height: 90px;
        height: auto;
    }

    .mk-ad-slot--leaderboard .mk-ad-image {
        min-height: 72px;
        max-height: 90px;
        object-fit: contain;
    }

    .mk-ad-slot--leaderboard .mk-ad-placeholder {
        min-height: 72px;
    }

    .mk-ad-slot--leaderboard .mk-ad-placeholder-content {
        padding: 0.35rem 0.75rem;
        gap: 0.5rem;
        line-height: 1.3;
    }

    .mk-ad-slot--leaderboard .mk-ad-placeholder-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .mk-ad-slot--leaderboard .mk-ad-placeholder-content strong,
    .mk-ad-slot--leaderboard .mk-ad-placeholder-content small {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .mk-ad-slot--leaderboard {
        min-height: 68px;
        max-height: 84px;
    }

    .mk-ad-slot--leaderboard .mk-ad-image {
        min-height: 68px;
        max-height: 84px;
    }

    .mk-ad-slot--leaderboard .mk-ad-placeholder {
        min-height: 68px;
    }

    .mk-ad-slot--half {
        min-height: 140px;
    }

    .mk-ad-slot--wide {
        min-height: 120px;
    }

    .mk-ads-banner-grid {
        gap: 1rem;
    }
}
