/*
 * Media Blog v3 visual layer.
 * Shared layout stays generic; app colors and assets come from Customizer/presets.
 */

.mb-v3 {
    background: var(--mb-bg);
}

.mb-v3 .mb-site-header {
    background: color-mix(in srgb, var(--mb-surface) 94%, transparent);
}

.mb-v3 .mb-brand-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 5px 14px rgba(18, 18, 18, .13);
}

.mb-v3 .mb-archive-hero {
    overflow: hidden;
    background: var(--mb-surface-soft);
}

.mb-v3.mb-visual-bold .mb-archive-hero {
    background: var(--mb-accent);
    border-bottom-color: var(--mb-text);
}

.mb-v3 .mb-archive-hero-inner {
    min-height: 500px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 46%);
    align-items: center;
    padding: 58px 0 44px;
}

.mb-v3 .mb-kicker {
    color: var(--mb-accent-2);
}

.mb-v3 .mb-hero-copy h1 {
    max-width: 720px;
    font-size: clamp(2.45rem, 5.5vw, 4.8rem);
    line-height: 1.03;
    letter-spacing: -.055em;
}

.mb-v3 .mb-hero-copy p:last-of-type {
    max-width: 620px;
    color: color-mix(in srgb, var(--mb-text) 72%, transparent);
    font-size: 1.08rem;
    line-height: 1.8;
}

.mb-v3 .mb-hero-proofs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.mb-v3 .mb-hero-proofs li {
    padding: 7px 11px;
    border: 0;
    border-radius: 3px;
    background: color-mix(in srgb, var(--mb-surface) 78%, transparent);
    color: var(--mb-text);
    font-size: .8rem;
    font-weight: 800;
}

.mb-v3 .mb-hero-visual {
    position: relative;
    display: block;
    min-height: 410px;
    padding: 0;
    isolation: isolate;
}

.mb-v3 .mb-hero-screen {
    position: absolute;
    width: 230px;
    max-height: 470px;
    border: 7px solid #171717;
    border-radius: 32px;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 26px 56px rgba(18, 18, 18, .24);
}

.mb-v3 .mb-hero-screen--primary {
    z-index: 2;
    right: 22%;
    top: -8px;
    transform: rotate(-3deg);
}

.mb-v3 .mb-hero-screen--secondary {
    z-index: 1;
    right: -1%;
    top: 56px;
    transform: rotate(5deg);
}

.mb-v3 .mb-hero-app-icon {
    position: absolute;
    z-index: 3;
    left: 3%;
    bottom: 22px;
    width: 94px;
    height: 94px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 18px 34px rgba(18, 18, 18, .28);
}

.mb-v3 .mb-hero-search-band {
    padding: 0 0 34px;
}

.mb-v3.mb-visual-bold .mb-hero-search-band .mb-search input {
    border-color: var(--mb-text);
}

.mb-v3 .mb-topic-nav {
    margin-top: 30px;
    overflow-x: auto;
    overflow-y: hidden;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
    scrollbar-width: none;
}

.mb-v3 .mb-topic-nav::-webkit-scrollbar {
    display: none;
}

.mb-v3 .mb-topic-nav-link {
    position: relative;
    flex: 0 0 auto;
    border-right: 0;
    background: transparent;
}

.mb-v3 .mb-topic-nav-link::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: -1px;
    left: 14px;
    height: 3px;
    background: transparent;
}

.mb-v3 .mb-topic-nav-link:hover,
.mb-v3 .mb-topic-nav-link.is-active {
    background: transparent;
}

.mb-v3 .mb-topic-nav-link.is-active::after {
    background: var(--mb-accent);
}

.mb-v3 .mb-topic-nav-link small {
    min-width: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.mb-v3.mb-cards-editorial .mb-article-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 34px;
}

.mb-v3.mb-cards-editorial .mb-post-card--featured,
.mb-v3.mb-cards-editorial .mb-pagination,
.mb-v3.mb-cards-editorial .mb-empty {
    grid-column: 1 / -1;
}

.mb-v3 .mb-post-card {
    position: relative;
    align-content: start;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mb-v3 .mb-post-card:not(.mb-post-card--featured) {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--mb-border);
}

.mb-v3 .mb-post-card--featured {
    grid-template-columns: minmax(0, 47%) minmax(0, 1fr);
    min-height: 330px;
    border-top: 1px solid var(--mb-text);
    border-bottom: 1px solid var(--mb-border);
}

.mb-v3 .mb-post-card-thumb {
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 3px;
    background: #e9e6dc;
}

.mb-v3 .mb-post-card-thumb img {
    transition: transform .35s ease, opacity .2s ease;
}

.mb-v3 .mb-post-card-thumb:hover img {
    transform: scale(1.025);
    opacity: .94;
}

.mb-v3 .mb-post-card--featured .mb-post-card-thumb {
    height: 100%;
    min-height: 330px;
    aspect-ratio: auto;
    border-radius: 0;
}

.mb-v3 .mb-post-card-body {
    padding: 14px 0 0;
}

.mb-v3 .mb-post-card--featured .mb-post-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 34px;
}

.mb-v3 .mb-post-card-title {
    margin-top: 10px;
    font-size: 1.08rem;
    line-height: 1.48;
}

.mb-v3 .mb-post-card--featured .mb-post-card-title {
    font-size: clamp(1.55rem, 2.5vw, 2.05rem);
    line-height: 1.32;
}

.mb-v3 .mb-post-card-excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: .88rem;
    line-height: 1.75;
}

.mb-v3 .mb-post-card--featured .mb-post-card-excerpt {
    -webkit-line-clamp: 4;
    font-size: .93rem;
}

.mb-v3 .mb-post-card-meta {
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
}

.mb-v3 .mb-post-card--featured .mb-post-card-meta {
    padding-top: 15px;
    border-top: 1px solid var(--mb-border);
}

.mb-v3.mb-cards-editorial .mb-article-list--compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 34px;
}

.mb-v3 .mb-article-list--compact-grid .mb-post-card--grid {
    display: block;
    padding: 0;
    border: 0;
}

.mb-v3 .mb-post-card--grid .mb-post-card-thumb {
    aspect-ratio: 16 / 9;
    border-radius: 0;
}

.mb-v3 .mb-post-card--grid .mb-post-card-body {
    display: flex;
    flex-direction: column;
    padding: 12px 0 0;
}

.mb-v3 .mb-post-card--grid .mb-post-card-top {
    display: contents;
}

.mb-v3 .mb-post-card--grid .mb-topic-chip {
    position: absolute;
    z-index: 1;
    top: 8px;
    right: 0;
    min-height: 22px;
    padding: 2px 8px;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--mb-text) 82%, transparent);
    color: var(--mb-surface);
    font-size: .65rem;
}

.mb-v3 .mb-post-card--grid .mb-topic-chip:hover {
    background: var(--mb-text);
    color: var(--mb-surface);
}

.mb-v3 .mb-post-card--grid .mb-post-card-top > span {
    order: 2;
    margin-top: 7px;
    color: var(--mb-faint);
    font-size: .71rem;
    font-weight: 600;
}

.mb-v3 .mb-post-card--grid .mb-post-card-title {
    display: -webkit-box;
    order: 1;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 1rem;
    line-height: 1.48;
}

.mb-v3 .mb-post-card--grid .mb-post-card-excerpt,
.mb-v3 .mb-post-card--grid .mb-post-card-meta {
    display: none;
}

.mb-v3 .mb-topic-chip,
.mb-v3 .mb-post-topic {
    min-height: 21px;
    padding: 0 6px;
    border-color: color-mix(in srgb, var(--mb-accent-2) 35%, transparent);
    border-radius: 2px;
    background: var(--mb-surface-soft);
    color: var(--mb-text);
    font-size: .67rem;
}

.mb-v3 .mb-store-placeholder,
.mb-v3 .mb-store-link {
    min-width: 135px;
    min-height: 44px;
    padding: 7px 12px;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--mb-text);
    border-radius: 7px;
    background: var(--mb-text);
    color: var(--mb-surface);
    line-height: 1.1;
    opacity: .78;
}

.mb-v3 .mb-store-link {
    opacity: 1;
}

.mb-v3 .mb-store-link:hover {
    color: var(--mb-surface);
    opacity: .86;
    text-decoration: none;
}

.mb-v3 .mb-store-placeholder strong,
.mb-v3 .mb-store-link strong {
    font-size: .82rem;
}

.mb-v3 .mb-store-placeholder small,
.mb-v3 .mb-store-link small {
    margin-top: 4px;
    font-size: .67rem;
    font-weight: 700;
}

.mb-v3 .mb-app-cta {
    border-radius: 3px;
    background: var(--mb-surface-soft);
}

.mb-v3.mb-visual-bold .mb-app-cta {
    border-top: 3px solid var(--mb-accent);
}

.mb-v3 .mb-archive-sidebar,
.mb-v3 .mb-single-sidebar {
    gap: 30px;
}

.mb-v3 .mb-side-box {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mb-v3 .mb-side-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    color: var(--mb-text);
    font-size: .85rem;
    letter-spacing: .04em;
    text-align: center;
}

.mb-v3 .mb-side-title::before,
.mb-v3 .mb-side-title::after {
    content: "";
    flex: 1 1 24px;
    height: 1px;
    background: var(--mb-border-strong);
}

.mb-v3 .mb-side-links {
    margin-top: 12px;
    border-top: 0;
}

.mb-v3 .mb-side-links a {
    min-height: 43px;
    font-size: .84rem;
    font-weight: 700;
}

.mb-v3 .mb-app-cta--sidebar {
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--mb-accent) 32%, var(--mb-border));
}

.mb-v3 .mb-single-article {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mb-v3 .mb-post-header {
    position: relative;
    padding: 4px 0 24px;
}

.mb-v3 .mb-post-header::before {
    content: none;
}

.mb-v3 .mb-post-header h1 {
    max-width: 19em;
    margin: 16px 0 14px;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.25;
}

.mb-v3 .mb-post-topic {
    min-height: 22px;
    padding: 2px 7px;
    border: 0;
    border-radius: 0;
    background: var(--mb-text);
    color: var(--mb-surface);
    font-size: .68rem;
}

.mb-v3 .mb-post-content {
    color: var(--mb-text);
    font-size: 1.08rem;
}

.mb-v3 .mb-post-content h2 {
    position: relative;
    margin-top: 2.7em;
    padding: 0 0 12px;
    border-top: 0;
    border-bottom: 1px solid var(--mb-border);
    background: transparent;
}

.mb-v3 .mb-post-content h2::before {
    top: auto;
    right: auto;
    bottom: -1px;
    left: 0;
    width: min(34%, 220px);
    height: 2px;
    border-radius: 0;
    background: var(--mb-text);
}

.mb-v3 .mb-post-content h3 {
    margin-top: 2.2em;
    padding: 0 0 9px;
    border-left: 0;
    border-bottom: 1px solid var(--mb-border);
    font-size: 1.18rem;
}

.mb-v3 .mb-related {
    margin-top: 52px;
    padding-top: 32px;
}

.mb-v3 .mb-related .mb-section-heading {
    margin-bottom: 20px;
}

.mb-v3 .mb-related .mb-section-heading h2 {
    display: inline-block;
    margin-bottom: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--mb-text);
    font-size: 1.35rem;
}

.mb-v3 .mb-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 30px;
}

.mb-v3 .mb-post-card--compact {
    display: block;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mb-v3 .mb-post-card--compact .mb-post-card-thumb {
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 0;
}

.mb-v3 .mb-post-card--compact .mb-post-card-body {
    display: flex;
    flex-direction: column;
    padding: 10px 0 0;
}

.mb-v3 .mb-post-card--compact .mb-post-card-top {
    display: contents;
}

.mb-v3 .mb-post-card--compact .mb-topic-chip {
    position: absolute;
    z-index: 1;
    top: 7px;
    right: 0;
    min-height: 21px;
    padding: 2px 7px;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--mb-text) 82%, transparent);
    color: var(--mb-surface);
    font-size: .62rem;
}

.mb-v3 .mb-post-card--compact .mb-post-card-top > span {
    order: 2;
    margin-top: 6px;
    color: var(--mb-faint);
    font-size: .69rem;
}

.mb-v3 .mb-post-card--compact .mb-post-card-title {
    display: -webkit-box;
    order: 1;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: .92rem;
    line-height: 1.48;
}

.mb-v3 .mb-post-card--compact .mb-post-card-excerpt,
.mb-v3 .mb-post-card--compact .mb-post-card-meta {
    display: none;
}

.mb-v3 .app-cta-box {
    margin: 36px 0 8px;
    padding: 22px;
    border: 1px solid var(--mb-border);
    border-top: 5px solid var(--mb-accent);
    border-radius: 12px;
    background: var(--mb-surface-soft);
}

.mb-v3 .app-cta-box .cta-title {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1.16rem;
}

.mb-v3 .app-cta-box .cta-description {
    margin-bottom: 14px;
}

.mb-v3 .app-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mb-v3 .store-badge-placeholder {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 7px;
    background: var(--mb-text);
    color: var(--mb-surface);
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.2;
}

.mb-v3 .mb-site-footer {
    background: var(--mb-surface-soft);
}

@media (max-width: 980px) {
    .mb-v3 .mb-archive-hero-inner {
        min-height: auto;
        grid-template-columns: minmax(0, 1fr) minmax(300px, 42%);
        gap: 20px;
    }

    .mb-v3 .mb-hero-screen {
        width: 190px;
        max-height: 390px;
    }

    .mb-v3 .mb-hero-visual {
        min-height: 360px;
    }

    .mb-v3 .mb-hero-app-icon {
        width: 76px;
        height: 76px;
        border-radius: 19px;
    }
}

@media (max-width: 760px) {
    .mb-v3 {
        font-size: 16px;
    }

    .mb-v3 .mb-header-nav,
    .mb-v3 .mb-topic-nav {
        scrollbar-width: none;
    }

    .mb-v3 .mb-topic-nav {
        padding-left: 16px;
        padding-right: 32px;
        touch-action: pan-x;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
    }

    .mb-v3 .mb-header-nav::-webkit-scrollbar,
    .mb-v3 .mb-topic-nav::-webkit-scrollbar {
        display: none;
    }

    .mb-v3 .mb-archive-hero-inner {
        grid-template-columns: 1fr;
        padding: 38px 0 24px;
    }

    .mb-v3 .mb-hero-copy h1 {
        font-size: clamp(2.2rem, 12vw, 3.25rem);
    }

    .mb-v3 .mb-hero-copy p:last-of-type {
        font-size: 1rem;
    }

    .mb-v3 .mb-hero-visual {
        min-height: 360px;
        width: min(100%, 430px);
        margin: 8px auto 0;
    }

    .mb-v3 .mb-hero-screen {
        width: 182px;
        max-height: 370px;
        border-width: 6px;
        border-radius: 28px;
    }

    .mb-v3 .mb-hero-screen--primary {
        right: 35%;
    }

    .mb-v3 .mb-hero-screen--secondary {
        right: 3%;
    }

    .mb-v3 .mb-hero-app-icon {
        left: 0;
        bottom: 10px;
    }

    .mb-v3.mb-cards-editorial .mb-article-list {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .mb-v3.mb-cards-editorial .mb-article-list--compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 28px;
    }

    .mb-v3 .mb-post-card--grid .mb-post-card-body {
        padding-top: 9px;
    }

    .mb-v3 .mb-post-card--grid .mb-post-card-title {
        font-size: .9rem;
        line-height: 1.45;
    }

    .mb-v3 .mb-post-card--grid .mb-topic-chip {
        top: 6px;
        padding: 2px 6px;
        font-size: .6rem;
    }

    .mb-v3 .mb-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 26px;
    }

    .mb-v3 .mb-post-card--compact .mb-post-card-title {
        font-size: .84rem;
    }

    .mb-v3 .mb-post-card--featured {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .mb-v3 .mb-post-card--featured .mb-post-card-thumb {
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .mb-v3 .mb-post-card--featured .mb-post-card-body {
        padding: 20px 0 24px;
    }

    .mb-v3 .mb-post-card--featured .mb-post-card-title {
        font-size: 1.3rem;
    }

    .mb-v3 .mb-post-card:not(.mb-post-card--featured) {
        padding-bottom: 24px;
    }

    .mb-v3 .mb-single-article {
        padding: 0;
    }

    .mb-v3 .mb-post-header::before {
        content: none;
    }

    .mb-v3 .mb-post-content {
        font-size: 1rem;
        line-height: 1.9;
    }
}

@media (max-width: 420px) {
    .mb-v3 .mb-hero-visual {
        min-height: 330px;
    }

    .mb-v3 .mb-hero-screen {
        width: 160px;
        max-height: 330px;
    }

    .mb-v3 .mb-hero-app-icon {
        width: 68px;
        height: 68px;
        border-radius: 17px;
    }
}
