/*
|--------------------------------------------------------------------------
| Media Hub additions
|--------------------------------------------------------------------------
|
| IMPORTANT:
| This file is intentionally loaded AFTER your existing site.css and
| subscribe-section.css. It contains only the new carousel / View All
| functionality requested in the latest update.
|
| Your existing header, hero, typography, spacing, footer, audio player,
| quote styling and responsive rules remain untouched.
|
*/

/* =========================================================
   Shared red View All action
   ========================================================= */

.media-section-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: clamp(22px, 2.6vw, 38px);
}

.media-view-all {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--red);
    text-decoration: none;
    text-transform: uppercase;
    font-family: var(--rail);
    font-size: clamp(14px, 1.1vw, 17px);
    font-weight: 700;
    line-height: 1;
}

.media-view-all__arrow {
    width: 34px;
    height: 18px;
    flex: 0 0 34px;
    display: block;
    color: var(--red);
    transform-origin: center;
    transition: transform .22s ease;
}

.media-view-all__arrow svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-view-all:hover .media-view-all__arrow {
    transform: rotate(-45deg) translateX(2px);
}

.media-view-all--dark {
    color: var(--red);
}

/* =========================================================
   Tribune Views carousel
   Desktop: exactly 3 visible cards
   Mobile: exactly 1 visible card
   ========================================================= */

.tribune-views-carousel {
    position: relative;
}

.tribune-views-carousel__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.tribune-views-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.tribune-views-carousel__track {
    --tribune-view-gap: clamp(18px, 5vw, 75px);

    display: flex;
    align-items: stretch;
    gap: var(--tribune-view-gap);
}

.tribune-views-carousel__item {
    /*
     * Same large gap feeling as your existing .video-grid,
     * but three cards are visible in one desktop row.
     */
    flex: 0 0 calc(
        (100% - (var(--tribune-view-gap) * 2)) / 3
    );

    scroll-snap-align: start;
}

/* Slim carousel chevrons — no circle or filled background. */
.section-carousel-arrow {
    position: absolute;
    top: 42%;
    z-index: 20;
    width: 34px;
    height: 52px;
    border: 0;
    padding: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--red);
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        transform .18s ease,
        opacity .18s ease,
        color .18s ease;
}

.section-carousel-arrow__icon {
    display: block;
    width: 13px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.section-carousel-arrow:hover:not(:disabled) {
    color: var(--red-dark);
}

.section-carousel-arrow--prev:hover:not(:disabled) {
    transform: translate(-3px, -50%);
}

.section-carousel-arrow--next:hover:not(:disabled) {
    transform: translate(3px, -50%);
}

.section-carousel-arrow:disabled {
    opacity: .2;
    cursor: default;
}

.section-carousel-arrow--prev {
    left: -18px;
}

.section-carousel-arrow--next {
    right: -18px;
}

/* =========================================================
   In Conversation / Postscript footer
   ========================================================= */

.editorial-section-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-top: 28px;
}

.editorial-section-footer .conversation-controls {
    margin: 0;
}

/*
 * In Conversation / Postscript use the same clean chevrons.
 */
.editorial-section-footer .conversation-controls > button {
    width: 34px;
    height: 42px;
    border: 0;
    padding: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--red);
    transition:
        transform .18s ease,
        color .18s ease;
}

.editorial-chevron {
    display: block;
    width: 11px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editorial-section-footer .conversation-controls > button:hover {
    color: var(--red-dark);
}

.editorial-section-footer .conversation-controls > button:first-child:hover {
    transform: translateX(-2px);
}

.editorial-section-footer .conversation-controls > button:last-child:hover {
    transform: translateX(2px);
}

/* =========================================================
   Responsive additions only
   ========================================================= */

@media (max-width: 1100px) {
    .section-carousel-arrow--prev {
        left: -12px;
    }

    .section-carousel-arrow--next {
        right: -12px;
    }
}

@media (max-width: 820px) {
    .tribune-views-carousel__track {
        --tribune-view-gap: 18px;
    }

    .tribune-views-carousel__item {
        flex-basis: 100%;
    }

    .section-carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .section-carousel-arrow--prev {
        left: 6px;
    }

    .section-carousel-arrow--next {
        right: 6px;
    }

    .media-view-all {
        font-size: 14px;
    }

    .media-view-all__arrow {
        width: 30px;
        height: 16px;
        flex-basis: 30px;
    }
}

@media (max-width: 560px) {
    .editorial-section-footer {
        flex-wrap: wrap;
        gap: 18px;
    }

    .editorial-section-footer .conversation-controls {
        order: 1;
    }

    .editorial-section-footer .media-view-all {
        order: 2;
        margin-left: auto;
    }

    .media-section-actions {
        margin-top: 24px;
    }
}
