/* ============================================================
   TFK POST FEATURES CSS — snewz/TOI-style features (Dark Theme)
   ============================================================ */

:root {
    --tfk-red: #e31837;
    --tfk-red-dark: #b3122b;
    --tfk-dark: #12151c;
    --tfk-dark-2: #1a1e28;
    --tfk-border: rgba(255, 255, 255, 0.08);
    --tfk-text: #e8eaf0;
    --tfk-muted: #9aa3b2;
}

/* ============================================================
   1. BREAKING NEWS TICKER
   ============================================================ */
.tfk-ticker {
    display: flex;
    align-items: stretch;
    background: #0d0f14;
    border-bottom: 2px solid var(--tfk-red);
    position: relative;
    z-index: 1050;
    overflow: hidden;
    height: 40px;
}
.tfk-ticker-label {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--tfk-red);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1.5px;
    padding: 0 16px;
    white-space: nowrap;
    flex-shrink: 0;
    clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
    padding-right: 26px;
}
.tfk-ticker-track {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.tfk-ticker-move {
    display: inline-flex;
    white-space: nowrap;
    animation: tfkTicker 40s linear infinite;
    will-change: transform;
}
.tfk-ticker:hover .tfk-ticker-move { animation-play-state: paused; }
@keyframes tfkTicker {
    0%   { transform: translateX(20vw); }
    100% { transform: translateX(-100%); }
}
.tfk-ticker-item {
    color: var(--tfk-text);
    font-size: 14px;
    font-weight: 600;
    margin-right: 42px;
    text-decoration: none;
    transition: color 0.2s;
}
.tfk-ticker-item:hover { color: var(--tfk-red); }
.tfk-ticker-bullet { color: var(--tfk-red); font-size: 9px; vertical-align: 2px; margin-right: 6px; }
.tfk-ticker-close {
    background: none;
    border: none;
    color: var(--tfk-muted);
    font-size: 20px;
    padding: 0 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.tfk-ticker-close:hover { color: #fff; }

/* live pulsing dot */
.tfk-live-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: tfkPulse 1.2s ease-in-out infinite;
}
@keyframes tfkPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.75); }
}

/* ============================================================
   2. READING PROGRESS BAR
   ============================================================ */
.tfk-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 2000;
    pointer-events: none;
}
.tfk-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--tfk-red), #ff6b6b);
    transition: width 0.08s linear;
}

/* ============================================================
   BADGES (LIVE / BREAKING / EXCLUSIVE / SPONSORED / LABEL)
   ============================================================ */
.tfk-badges-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.tfk-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 4px 10px;
    border-radius: 3px;
    text-decoration: none;
    line-height: 1.4;
}
.tfk-badge-live      { background: var(--tfk-red); color: #fff; }
.tfk-badge-breaking  { background: #ff9f1a; color: #14110a; }
.tfk-badge-exclusive { background: linear-gradient(135deg, #d4af37, #f3d97c); color: #2a230a; }
.tfk-badge-sponsored { background: #2f3542; color: #cfd6e4; }
.tfk-badge-label     { background: transparent; color: var(--tfk-red); border: 1px solid var(--tfk-red); }
a.tfk-badge-label:hover { background: var(--tfk-red); color: #fff; }

/* ============================================================
   3. SUBTITLE / STANDFIRST
   ============================================================ */
.tfk-subtitle {
    font-size: 19px;
    line-height: 1.55;
    color: var(--tfk-muted);
    font-weight: 400;
    margin: 10px 0 18px;
    border-left: 3px solid var(--tfk-red);
    padding-left: 14px;
}

/* Updated time */
.tfk-updated { color: #7bed9f !important; }
.tfk-updated i { font-size: 11px; }

/* ============================================================
   5. KEY HIGHLIGHTS BOX (TOI style)
   ============================================================ */
.tfk-highlights {
    background: var(--tfk-dark-2);
    border: 1px solid var(--tfk-border);
    border-left: 4px solid var(--tfk-red);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 0 0 26px;
}
.tfk-highlights-head {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--tfk-red);
    margin-bottom: 10px;
}
.tfk-highlights-head i { margin-right: 6px; }
.tfk-highlights ul { margin: 0; padding: 0 0 0 20px; }
.tfk-highlights li {
    color: var(--tfk-text);
    font-size: 15.5px;
    line-height: 1.6;
    margin-bottom: 7px;
}
.tfk-highlights li::marker { color: var(--tfk-red); }
.tfk-highlights li:last-child { margin-bottom: 0; }

/* ============================================================
   6. FEATURED VIDEO / AUDIO EMBEDS
   ============================================================ */
.tfk-embed { margin: 0 0 24px; border-radius: 8px; overflow: hidden; background: #000; }
.tfk-embed-video { position: relative; padding-bottom: 56.25%; height: 0; }
.tfk-embed-video iframe,
.tfk-embed-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.tfk-embed-audio { background: transparent; padding-bottom: 0; }
.tfk-embed-audio iframe { width: 100%; border: 0; border-radius: 8px; }

/* ============================================================
   7. PULL QUOTE
   ============================================================ */
.tfk-pullquote {
    position: relative;
    margin: 32px 0;
    padding: 24px 28px 24px 64px;
    background: var(--tfk-dark-2);
    border: 1px solid var(--tfk-border);
    border-left: 4px solid var(--tfk-red);
    border-radius: 6px;
}
.tfk-pullquote i {
    position: absolute;
    left: 22px;
    top: 24px;
    font-size: 24px;
    color: var(--tfk-red);
    opacity: 0.85;
}
.tfk-pullquote p {
    margin: 0;
    font-size: 20px;
    line-height: 1.55;
    font-weight: 600;
    font-style: italic;
    color: var(--tfk-text);
}

/* ============================================================
   8. ALSO READ BOX
   ============================================================ */
.tfk-also-read {
    display: flex;
    align-items: baseline;
    gap: 12px;
    background: rgba(227, 24, 55, 0.06);
    border: 1px dashed rgba(227, 24, 55, 0.45);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 24px 0;
}
.tfk-also-read-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--tfk-red);
    white-space: nowrap;
}
.tfk-also-read a {
    color: var(--tfk-text);
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.5;
    text-decoration: none;
}
.tfk-also-read a:hover { color: var(--tfk-red); text-decoration: underline; }

/* Dateline */
.tfk-dateline { color: var(--tfk-red); letter-spacing: 0.5px; }

/* ============================================================
   9. ARTICLE TOOLS BAR
   ============================================================ */
.tfk-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--tfk-border);
    border-bottom: 1px solid var(--tfk-border);
}
.tfk-tool {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--tfk-dark-2);
    border: 1px solid var(--tfk-border);
    color: var(--tfk-text);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}
.tfk-tool:hover { border-color: var(--tfk-red); color: var(--tfk-red); }
.tfk-tool.active { background: var(--tfk-red); border-color: var(--tfk-red); color: #fff; }
.tfk-fontsize { padding: 0; overflow: hidden; gap: 0; }
.tfk-fontsize button {
    background: none;
    border: none;
    border-right: 1px solid var(--tfk-border);
    color: var(--tfk-text);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.tfk-fontsize button:last-child { border-right: 0; }
.tfk-fontsize button:hover { color: var(--tfk-red); }

/* font size levels applied by JS */
.article-body.tfk-fs-1 p, .article-body.tfk-fs-1 li { font-size: 17.5px !important; }
.article-body.tfk-fs-2 p, .article-body.tfk-fs-2 li { font-size: 19px !important; }
.article-body.tfk-fs-3 p, .article-body.tfk-fs-3 li { font-size: 21px !important; }
.article-body.tfk-fs--1 p, .article-body.tfk-fs--1 li { font-size: 14px !important; }

/* ============================================================
   11. SOURCE / VIA
   ============================================================ */
.tfk-attribution {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 22px 0 0;
    padding: 12px 16px;
    background: var(--tfk-dark-2);
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--tfk-muted);
}
.tfk-attribution a { color: var(--tfk-red); text-decoration: none; }
.tfk-attribution a:hover { text-decoration: underline; }

/* ============================================================
   12. PREV / NEXT NAVIGATION
   ============================================================ */
.tfk-postnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 30px 0;
}
.tfk-postnav-item {
    display: block;
    background: var(--tfk-dark-2);
    border: 1px solid var(--tfk-border);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    transition: all 0.2s;
}
.tfk-postnav-item:hover { border-color: var(--tfk-red); transform: translateY(-2px); }
.tfk-postnav-next { text-align: right; }
.tfk-postnav-prev:only-child,
.tfk-postnav-next:only-child { grid-column: span 2; }
.tfk-postnav-dir {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--tfk-red);
    margin-bottom: 6px;
}
.tfk-postnav-title {
    color: var(--tfk-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

/* ============================================================
   13. STICKY SHARE RAIL
   ============================================================ */
.tfk-share-rail {
    position: fixed;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 900;
}
.tfk-rail-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s;
}
.tfk-rail-btn:hover { transform: scale(1.12); color: #fff; }
.tfk-rail-btn.wa { background: #25d366; }
.tfk-rail-btn.fb { background: #1877f2; }
.tfk-rail-btn.tw { background: #14171a; border: 1px solid #333; }
.tfk-rail-btn.tg { background: #229ed9; }
.tfk-rail-btn.cp { background: #3a4150; }

/* ============================================================
   15. BACK TO TOP
   ============================================================ */
.tfk-backtotop {
    position: fixed;
    right: 18px;
    bottom: 80px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tfk-red);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.tfk-backtotop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.tfk-backtotop:hover { background: var(--tfk-red-dark); }

/* toast for copy/save feedback */
.tfk-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    background: #fff;
    color: #14171c;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 50px;
    z-index: 3000;
    opacity: 0;
    transition: all 0.25s;
    pointer-events: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.tfk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* full-width layout when sidebar = none */
.tfk-no-sidebar .col-lg-8 { flex: 0 0 100%; max-width: 860px; margin: 0 auto; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .tfk-share-rail {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        flex-direction: row;
        justify-content: space-around;
        background: rgba(13, 15, 20, 0.97);
        border-top: 1px solid var(--tfk-border);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        backdrop-filter: blur(8px);
    }
    .tfk-rail-btn { width: 40px; height: 40px; box-shadow: none; }
    .tfk-backtotop { bottom: 74px; }
    .tfk-postnav { grid-template-columns: 1fr; }
    .tfk-postnav-next { text-align: left; }
    .tfk-subtitle { font-size: 17px; }
    .tfk-pullquote p { font-size: 18px; }
}
@media (max-width: 576px) {
    .tfk-ticker-label { font-size: 10.5px; padding: 0 10px 0 12px; }
    .tfk-ticker-item { font-size: 13px; }
    .tfk-tools { gap: 7px; }
    .tfk-tool { padding: 7px 11px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .tfk-ticker-move { animation: none; }
    .tfk-live-dot { animation: none; }
}
