/* TooFan News customisations (loaded after the theme CSS) */
:root {
    --tf-navy: #232a7d;
    --tf-orange: #ff7a1a;
    --tf-neu-bg: #eef0f5;
    --tf-neu-light: #ffffff;
    --tf-neu-dark: #c9cdd8;
}

/* Today's day and date in the top bar */
.tf-today-date {
    font-size: 11.5px;
    line-height: 1;
    letter-spacing: .2px;
    color: #c9c9c9;
    white-space: nowrap;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, .18);
}

/* Speed strip: spinning tornado + scrolling headlines */
.tf-speed {
    background: linear-gradient(90deg, var(--tf-navy) 0%, #2d36a0 55%, #3a2a8f 100%);
    color: #fff;
    overflow: hidden;
    position: relative;
}
.tf-speed::before {
    /* wind streaks */
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(100deg, transparent 0 60px, rgba(255, 255, 255, .06) 60px 62px, transparent 62px 140px);
    animation: tf-wind 1.6s linear infinite;
    pointer-events: none;
}
.tf-speed-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 46px;
    position: relative;
}
.tf-speed-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-right: 14px;
    border-right: 1px solid rgba(255, 255, 255, .2);
}
.tf-tornado {
    display: inline-flex;
    perspective: 120px;
}
.tf-tornado svg {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}
.tf-tornado-swirl {
    transform-origin: 32px 32px;
    animation: tf-spin 1.4s linear infinite;
}
.tf-speed-title {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    background: linear-gradient(90deg, #fff 0%, #ffd27a 40%, #fff 80%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: tf-shine 2.4s linear infinite;
}
.tf-speed-date .tf-today-date {
    border: 0;
    margin: 0;
    padding: 0;
    color: #d8dbf5;
    font-size: 10.5px;
}
.tf-speed-track {
    flex: 1;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.tf-speed-items {
    display: inline-flex;
    gap: 42px;
    white-space: nowrap;
    animation: tf-ticker 60s linear infinite;
    will-change: transform;
}
.tf-speed-track:hover .tf-speed-items {
    animation-play-state: paused;
}
.tf-speed-items a {
    color: #fff;
    font-size: 14px;
    position: relative;
}
.tf-speed-items a::before {
    content: "⚡";
    margin-right: 8px;
    color: #ffc20e;
}
.tf-speed-items a:hover {
    color: #ffd27a;
}
@keyframes tf-spin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}
@keyframes tf-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@keyframes tf-wind {
    from { background-position: 0 0; }
    to { background-position: -140px 0; }
}
@keyframes tf-shine {
    from { background-position: 200% 0; }
    to { background-position: 0 0; }
}
@media (max-width: 767px) {
    .tf-speed-inner { min-height: 40px; gap: 10px; }
    .tf-speed-badge { flex-direction: column; align-items: flex-start; gap: 0; padding-right: 10px; }
    .tf-tornado { display: none; }
    .tf-speed-title { font-size: 12px; }
    .tf-speed-items a { font-size: 13px; }
}

/* Neumorphic reactions */
.reactions .col-reaction {
    width: 84px;
    margin: 0 10px 14px 0;
}
.reactions .icon-cnt {
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
    float: none;
    border-radius: 22px;
    background: var(--tf-neu-bg);
    box-shadow: 6px 6px 12px var(--tf-neu-dark), -6px -6px 12px var(--tf-neu-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow .2s ease, transform .2s ease;
}
.reactions .img-reaction {
    width: 46px;
    height: 46px;
    transition: transform .2s ease;
}
.reactions .col-reaction:hover .icon-cnt {
    transform: translateY(-2px);
}
.reactions .col-reaction:hover .img-reaction {
    transform: scale(1.12);
}
.reactions .col-reaction:active .icon-cnt,
.reactions .col-reaction:has(.label-reaction-voted) .icon-cnt {
    box-shadow: inset 5px 5px 10px var(--tf-neu-dark), inset -5px -5px 10px var(--tf-neu-light);
}
.reactions .reaction-num-votes {
    top: -6px;
    right: -6px;
    background: var(--tf-orange);
    border-radius: 12px;
    padding: 2px 7px;
    opacity: 1;
    box-shadow: 0 2px 6px rgba(255, 122, 26, .45);
}
.reactions .col-reaction p {
    margin-top: 2px;
}
.reactions .label-reaction {
    background: transparent;
    color: #555;
    font-size: 12px;
    font-weight: 600;
}
.reactions .label-reaction-voted {
    color: var(--tf-orange);
}
[data-bs-theme="dark"] .reactions .icon-cnt {
    background: #23262d;
    box-shadow: 6px 6px 12px #15171b, -6px -6px 12px #31353f;
}
[data-bs-theme="dark"] .reactions .col-reaction:has(.label-reaction-voted) .icon-cnt {
    box-shadow: inset 5px 5px 10px #15171b, inset -5px -5px 10px #31353f;
}
[data-bs-theme="dark"] .reactions .label-reaction {
    color: #bbb;
}

/* Footer: partner with us */
.tf-partner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding: 22px 24px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(35, 42, 125, .55), rgba(255, 122, 26, .18));
    border: 1px solid rgba(255, 255, 255, .08);
}
.tf-partner-title {
    color: #fff;
    font-size: 18px;
    margin: 0 0 6px;
}
.tf-partner-text {
    margin: 0;
    color: #bbb;
    max-width: 640px;
}
.tf-partner-btn {
    background: var(--tf-orange);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 600;
    white-space: nowrap;
}
.tf-partner-btn:hover {
    background: #ff8f3d;
}

/* Join page: area coordinator */
.tf-coordinator {
    border: 1px solid #ffd8b8;
    background: #fff7f0;
    border-radius: 10px;
    padding: 14px 16px;
}
.tf-coordinator-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #b25a12;
    margin-bottom: 6px;
}
.tf-coordinator-row + .tf-coordinator-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #f3c9a5;
}
[data-bs-theme="dark"] .tf-coordinator {
    background: #2a2118;
    border-color: #5a3a1f;
}

@media (prefers-reduced-motion: reduce) {
    .tf-speed::before, .tf-tornado-swirl, .tf-speed-title, .tf-speed-items {
        animation: none;
    }
    .tf-speed-track { overflow-x: auto; }
}

/* Local ad strip on every page */
.tf-local-ad-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    margin: 0 0 14px;
    padding: 0 12px;
    border: 1px solid #ffd8b8;
    border-radius: 8px;
    background: #fff7f0;
    color: #222 !important;
    overflow: hidden;
}
.tf-local-ad-strip img {
    height: 44px;
    width: auto;
    max-width: 120px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.tf-local-ad-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}
.tf-local-ad-phone {
    white-space: nowrap;
    font-weight: 600;
    font-size: 13px;
}
.tf-local-ad-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #b25a12;
    background: #ffe9d6;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
}
[data-bs-theme="dark"] .tf-local-ad-strip {
    background: #2a2118;
    border-color: #5a3a1f;
    color: #eee !important;
}
@media (max-width: 767px) {
    .tf-local-ad-strip { height: 40px; gap: 8px; padding: 0 8px; margin-top: 6px; }
    .tf-local-ad-strip img { height: 32px; max-width: 70px; }
    .tf-local-ad-text { font-size: 12.5px; }
    .tf-local-ad-phone { display: none; }
}

.tf-speed { margin-bottom: 14px; }

/* Top bar: support link */
.tf-support-link {
    background: #d24a1f;
    color: #fff !important;
    padding: 3px 12px !important;
    border-radius: 14px;
    font-weight: 600;
}
.tf-support-link:hover { background: #b93e17; }

/* Premium posts locked for readers without a subscription: grey blurred image + lock */
a:has(> .tf-lock-overlay) { overflow: hidden; }
/* outside fixed-ratio boxes (small items) the link must hold the overlay itself */
:not(.ratio) > a:has(> .tf-lock-overlay) { position: relative; display: block; }
a:has(> .tf-lock-overlay) img { filter: grayscale(1) blur(3px) brightness(.85); transform: scale(1.06); transition: filter .25s ease; }
a:has(> .tf-lock-overlay):hover img { filter: grayscale(1) blur(2px) brightness(.9); }
.tf-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 40, 40, .28);
    z-index: 2;
    pointer-events: none;
}
.tf-lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #222;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.post-item-small a:has(> .tf-lock-overlay) .tf-lock-icon { width: 30px; height: 30px; }
.post-item-small a:has(> .tf-lock-overlay) .tf-lock-icon svg { width: 15px; height: 15px; }
[data-bs-theme="dark"] .tf-lock-icon { background: rgba(30, 30, 30, .92); color: #f2f2f2; }

/* Reader's place in the header, with a "change place" tooltip */
.tf-place-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 190px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
}
.tf-place-badge .tf-place-name { overflow: hidden; text-overflow: ellipsis; }
.tf-place-badge-top { color: #ffd27a !important; background: rgba(255, 255, 255, .08); margin-left: 12px; }
.tf-place-badge-top:hover { background: rgba(255, 255, 255, .16); }
.tf-place-badge-mobile { color: #d24a1f !important; background: rgba(210, 74, 31, .08); max-width: 28vw; min-width: 0; flex-shrink: 1; font-size: 11px; padding: 4px 7px; margin-left: auto; margin-right: 2px; }
.tf-place-badge::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #111;
    color: #fff;
    font-size: 11.5px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.tf-place-badge:hover::after, .tf-place-badge:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.tf-place-badge-mobile::after { left: auto; right: 0; transform: translateY(-4px); }
.tf-place-badge-mobile:hover::after, .tf-place-badge-mobile:focus-visible::after { transform: translateY(0); }

/* Mobile header with the place badge: buttons keep their size, logo and badge shrink */
.mobile-header .header-btn { flex-shrink: 0; }
.mobile-header .header-logo { min-width: 0; flex-shrink: 1; }
.mobile-header .header-logo img { max-width: 9.5rem; }
@media (max-width: 360px) {
    .tf-place-badge-mobile .tf-place-name { display: none; }
    .tf-place-badge-mobile { padding: 6px; }
}

/* Reader's topics: header badge, homepage strip and picker switch */
.tf-interest-badge.tf-place-badge-top { margin-left: 6px; color: #b9e3ff !important; }
.tf-interest-mobile { margin-left: 0; padding: 6px; }
.tf-interest-mobile .tf-place-name { display: none; }
.tf-place-badge-mobile.tf-interest-mobile::after { right: -40px; }
.int-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 10px 0 14px; padding: 9px 14px; border-radius: 8px; background: #fff4e8; color: #5a3a12; font-size: 14px; }
.int-strip-actions { display: inline-flex; align-items: center; gap: 6px; }
.int-strip .ln-link { padding: 0; }
.int-switch { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 600; font-size: 14px; }
[data-bs-theme="dark"] .int-strip { background: #2d2216; color: #f3d9b8; }

/* WhatsApp share (post pages) */
.tf-wa { display: flex; flex-wrap: wrap; gap: 10px; }
.tf-wa-top { margin: 4px 0 16px; }
.tf-wa-btn { display: inline-flex; align-items: center; gap: 8px; background: #25d366; color: #fff !important; font-weight: 700; font-size: 15px; padding: 9px 18px; border-radius: 24px; text-decoration: none; line-height: 1.2; }
.tf-wa-btn:hover { background: #1ebe5b; }
.tf-wa-btn-outline { background: #fff; color: #128c3e !important; border: 2px solid #25d366; padding: 7px 16px; }
.tf-wa-btn-outline:hover { background: #effcf3; }
.tf-wa-bottom { align-items: center; justify-content: space-between; margin-top: 28px; padding: 16px 18px; border-radius: 12px; background: #effcf3; border: 1px solid #c5f0d4; }
.tf-wa-text strong { display: block; font-size: 17px; color: #0b5c2a; }
.tf-wa-text span { font-size: 14px; color: #3c6b4d; }
.tf-wa-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tf-wa-float { display: none; }
@media (max-width: 767px) {
    .tf-wa-float { display: flex; position: fixed; right: 14px; bottom: 74px; z-index: 1040; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff !important; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
    .tf-wa-float svg { width: 30px; height: 30px; }
    .tf-wa-top .tf-wa-btn { flex: 1 1 auto; justify-content: center; }
}
[data-bs-theme="dark"] .tf-wa-bottom { background: #10291a; border-color: #1d4a2e; }
[data-bs-theme="dark"] .tf-wa-text strong { color: #8ff0b2; }
[data-bs-theme="dark"] .tf-wa-text span { color: #b9e6c9; }
[data-bs-theme="dark"] .tf-wa-btn-outline { background: transparent; color: #8ff0b2 !important; }
