/* /2025/css/tele_magnet.css
   Tele-magnet — curated portrait discovery block under Telegraf sources.
   v1.8: desktop tuned bleed; mobile 2-up full-card carousel + stronger swipe hint. */

.teleMagnetFrontend {
    --tm-gap: 14px;
    --tm-visible: 3;
    --tm-width: 700px;

    width: var(--tm-width);
    max-width: none;
    box-sizing: border-box;
    margin: 44px 0 46px;
    margin-left: max(0px, calc((100% - 800px) / 2));
    padding: 19px 0 0;
    border-top: 4px double #b9b4c4;
    color: #222;
    font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
}

/* 3 cards stay aligned with the ordinary 700px article column.
   4+ cards deliberately bleed only to the RIGHT, keeping the same left edge. */
.teleMagnetFrontend.tmfCount4 {
    --tm-width: 830px;
}

.teleMagnetFrontend.tmfCount5 {
    --tm-width: 1040px;
}

.tmfHead {
    margin-bottom: 16px;
}

.tmfHead__copy {
    min-width: 0;
}

.tmfHead__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 5px;
}

.tmfEyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    color: #665b7e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.tmfEyebrow > i {
    flex: 0 0 auto;
    font-size: 15px;
}

.tmfAdminBadge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid #e4c572;
    border-radius: 999px;
    background: #fff6d8;
    color: #755c17;
    font-size: 9px;
    letter-spacing: .8px;
    white-space: nowrap;
}

.tmfHead h2 {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #24212c;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 22px !important;
    font-weight: 700;
    line-height: 1.2 !important;
}

.tmfHead p {
    width: auto !important;
    max-width: none !important;
    margin: 5px 0 0 !important;
    color: #77717e !important;
    font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
}

/* Desktop is a complete grid: all selected cards are visible, no carousel buttons needed. */
.tmfNav {
    display: none;
    flex: 0 0 auto;
    gap: 5px;
}

.tmfNav__btn {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5d1dc;
    border-radius: 50%;
    background: #fff;
    color: #4f4766;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.tmfNav__btn:hover:not(:disabled) {
    border-color: #615678;
    background: #51466d;
    color: #fff;
}

.tmfNav__btn:disabled {
    opacity: .28;
    cursor: default;
}

.tmfViewport {
    width: 100%;
    overflow: visible;
}

.tmfSwipeHint {
    display: none;
}

.tmfTrack {
    display: flex;
    gap: var(--tm-gap);
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

.tmfCard {
    flex: 0 0 calc(
        (var(--tm-width) - (var(--tm-gap) * (var(--tm-visible) - 1))) / var(--tm-visible)
    );
    width: calc(
        (var(--tm-width) - (var(--tm-gap) * (var(--tm-visible) - 1))) / var(--tm-visible)
    );
    max-width: calc(
        (var(--tm-width) - (var(--tm-gap) * (var(--tm-visible) - 1))) / var(--tm-visible)
    );
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd9e2;
    border-radius: 4px;
    background: #fff;
    color: #272331 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 0 rgba(42, 33, 65, .03);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.tmfCard:hover {
    border-color: #ada4bc;
    background: #fff !important;
    color: #15121c !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(39, 32, 54, .10);
}

.tmfCard__media {
    position: relative;
    overflow: hidden;
    background: #ebe9ee;
}

.tmfCard__image {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #eceaf0;
}

.tmfCard__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .25s ease;
}

.tmfCard:hover .tmfCard__image img {
    transform: scale(1.035);
}

.tmfCard__image--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 40% 30%, rgba(255,255,255,.9), rgba(233,230,239,.82)),
        #eceaf0;
    color: #837c91;
}

.tmfCard__image--empty i {
    font-size: 34px;
}

/* Keep the strong visual badge, but sell the FORMAT rather than the paywall. */
.tmfCard__premium {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 2px;
    background: rgba(39, 32, 62, .92);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .9px;
    line-height: 1;
}

.tmfCard__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 11px 11px 13px;
}

.tmfCard__pretitle {
    display: -webkit-box;
    margin-bottom: 5px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #7a6d8a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1.18;
    text-transform: uppercase;
}

.tmfCard__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    color: #211e29;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.34;
}


/* --------------------------------------------------------------------------
   Mobile / narrow screens: 2-up carousel.
   Exactly two full cards remain visible; navigation controls + a stronger
   swipe hint communicate that more recommendations continue to the right.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .teleMagnetFrontend,
    .teleMagnetFrontend.tmfCount4,
    .teleMagnetFrontend.tmfCount5 {
        --tm-gap: 10px;
        --tm-width: 100%;
        width: 100%;
        max-width: 100%;
        margin: 36px 0 38px;
        margin-left: 0;
        padding-top: 16px;
    }

    .tmfHead {
        margin-bottom: 13px;
    }

    .tmfHead__top {
        margin-bottom: 7px;
    }

    .tmfHead h2 {
        font-size: 19px !important;
        line-height: 1.22 !important;
    }

    /* Kicker + headline already explain the surface on small screens. */
    .tmfHead p {
        display: none;
    }

    .tmfNav {
        display: flex;
    }

    .tmfNav__btn {
        width: 30px;
        height: 30px;
    }

    .tmfViewport {
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .tmfViewport::-webkit-scrollbar {
        display: none;
    }

    /* Keep the track the width of the viewport. Children may overflow it;
       this lets percentage card widths resolve to an exact 2-up layout. */
    .tmfTrack {
        width: 100%;
        min-width: 100%;
    }

    .tmfCard {
        flex: 0 0 calc((100% - var(--tm-gap)) / 2);
        width: calc((100% - var(--tm-gap)) / 2);
        max-width: calc((100% - var(--tm-gap)) / 2);
        scroll-snap-align: start;
    }

    .tmfCard__image {
        aspect-ratio: 4 / 5;
    }

    .tmfCard__body {
        padding: 9px 9px 11px;
    }

    .tmfCard__pretitle {
        margin-bottom: 4px;
        font-size: 9px;
        line-height: 1.16;
        -webkit-line-clamp: 2;
    }

    .tmfCard__title {
        font-size: 12px;
        line-height: 1.30;
        -webkit-line-clamp: 5;
    }

    .tmfCard__premium {
        left: 6px;
        bottom: 6px;
        padding: 4px 6px;
        font-size: 8px;
        letter-spacing: .75px;
    }

    .tmfSwipeHint {
        align-items: center;
        justify-content: center;
        gap: 7px;
        margin: 15px 0 0;
        color: #786f85;
        font-size: 14px;
        font-weight: 650;
        letter-spacing: .1px;
        line-height: 1.25;
        text-align: center;
        user-select: none;
    }

    .teleMagnetFrontend.tmfHasOverflow .tmfSwipeHint {
        display: flex;
    }

    .tmfSwipeHint__arrow {
        color: #51466d;
        font-size: 19px;
        font-weight: 400;
        line-height: 1;
    }
}

/* Very narrow phones: preserve two full cards; only tighten typography/gaps. */
@media (max-width: 420px) {
    .teleMagnetFrontend,
    .teleMagnetFrontend.tmfCount4,
    .teleMagnetFrontend.tmfCount5 {
        --tm-gap: 8px;
    }

    .tmfEyebrow {
        gap: 5px;
        font-size: 8.5px;
        letter-spacing: 1px;
    }

    .tmfAdminBadge {
        font-size: 7.5px;
        letter-spacing: .55px;
    }

    .tmfNav {
        gap: 3px;
    }

    .tmfNav__btn {
        width: 28px;
        height: 28px;
    }

    .tmfHead h2 {
        font-size: 18px !important;
    }

    .tmfCard__body {
        padding: 8px 8px 10px;
    }

    .tmfCard__title {
        font-size: 11.5px;
        -webkit-line-clamp: 5;
    }

    .tmfSwipeHint {
        margin-top: 13px;
        font-size: 13.5px;
    }
}
