/* ==========================================================================
   TradePredictor Blog — editorial layer over the trading-terminal aesthetic.

   Everything is scoped under .tp-blog so no rule can leak into the rest of
   the app. Motion is transform/opacity only and fully disabled under
   prefers-reduced-motion.
   ========================================================================== */

.tp-blog {
    --ink: #eef2f8;
    --ink-soft: #a6b3c6;
    --ink-mute: #6b7a90;
    --cyan: #00d4ff;
    --indigo: #6366f1;
    --violet: #8b5cf6;
    --mint: #10b981;
    --surface: rgba(19, 25, 40, 0.62);
    --surface-solid: #131926;
    --edge: rgba(148, 163, 184, 0.13);
    --edge-lit: rgba(0, 212, 255, 0.42);
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);

    position: relative;
    padding: 0 0 120px;
    color: var(--ink);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: clip;
}

/* ── Atmosphere: drifting aurora + fine grain ─────────────────────────── */

.tp-blog__sky {
    position: absolute;
    inset: -10% -10% auto -10%;
    height: 900px;
    pointer-events: none;
    z-index: 0;
    filter: blur(90px);
    opacity: .55;
}

.tp-blog__sky i {
    position: absolute;
    display: block;
    border-radius: 50%;
    mix-blend-mode: screen;
    animation: tpDrift 24s var(--ease) infinite alternate;
}

.tp-blog__sky i:nth-child(1) {
    width: 46vw; height: 46vw; left: -6vw; top: -4vw;
    background: radial-gradient(circle at 30% 30%, rgba(0, 212, 255, .55), transparent 65%);
}
.tp-blog__sky i:nth-child(2) {
    width: 40vw; height: 40vw; right: -4vw; top: 2vw;
    background: radial-gradient(circle at 60% 40%, rgba(99, 102, 241, .55), transparent 65%);
    animation-delay: -8s;
}
.tp-blog__sky i:nth-child(3) {
    width: 34vw; height: 34vw; left: 34vw; top: 12vw;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, .38), transparent 68%);
    animation-delay: -15s;
}

@keyframes tpDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(3vw, 2vw, 0) scale(1.12); }
    100% { transform: translate3d(-2vw, 4vw, 0) scale(.95); }
}

.tp-blog__grain {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .16;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

.tp-blog__inner {
    position: relative;
    z-index: 2;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.tp-blog__mast {
    padding: 78px 0 46px;
    text-align: center;
}

.tp-blog__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px 7px 12px;
    margin-bottom: 22px;
    border-radius: 100px;
    border: 1px solid rgba(0, 212, 255, .26);
    background: rgba(0, 212, 255, .07);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--cyan);
}

.tp-blog__pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .7);
    animation: tpPulse 2.4s infinite;
}

@keyframes tpPulse {
    70%  { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tp-blog__title {
    margin: 0 0 18px;
    font-size: clamp(2.6rem, 6.4vw, 4.6rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.035em;
}

.tp-blog__title em {
    font-family: 'Newsreader', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    background: linear-gradient(105deg, var(--cyan), var(--indigo) 55%, var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 220% auto;
    animation: tpSheen 7s linear infinite;
}

@keyframes tpSheen {
    to { background-position: 220% center; }
}

.tp-blog__lede {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.03rem;
    line-height: 1.72;
    color: var(--ink-soft);
}

/* ── Filter rail ──────────────────────────────────────────────────────── */

.tp-blog__rail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 100%;
    padding: 16px 18px;
    margin-bottom: 46px;
    border-radius: 18px;
    border: 1px solid var(--edge);
    background: var(--surface);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.tp-blog__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    /* Without this a flex item refuses to shrink below its content width and
       spills out of the rail instead of wrapping. */
    min-width: 0;
}

.tp-chip {
    position: relative;
    padding: 9px 17px;
    border-radius: 100px;
    border: 1px solid transparent;
    background: rgba(148, 163, 184, .07);
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color .3s var(--ease), background .3s var(--ease),
                border-color .3s var(--ease), transform .3s var(--ease);
}

.tp-chip:hover {
    color: var(--ink);
    background: rgba(0, 212, 255, .1);
    border-color: rgba(0, 212, 255, .3);
    transform: translateY(-2px);
    text-decoration: none;
}

.tp-chip--on {
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 8px 24px -8px rgba(0, 212, 255, .65);
}

.tp-chip--on:hover { color: #06121c; }

.tp-blog__search {
    position: relative;
    flex: 0 1 260px;
}

.tp-blog__search input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border-radius: 100px;
    border: 1px solid var(--edge);
    background: rgba(9, 13, 22, .6);
    color: var(--ink);
    font-family: inherit;
    font-size: .84rem;
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.tp-blog__search input::placeholder { color: var(--ink-mute); }

.tp-blog__search input:focus {
    outline: none;
    border-color: var(--edge-lit);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, .1);
}

.tp-blog__search i {
    position: absolute;
    left: 15px; top: 50%;
    transform: translateY(-50%);
    color: var(--ink-mute);
    font-size: .82rem;
    pointer-events: none;
}

/* ── 3D card mechanics ────────────────────────────────────────────────── */

.tp-tilt {
    position: relative;
    transform-style: preserve-3d;
    transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
    will-change: transform;
}

.tp-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
        420px circle at var(--mx, 50%) var(--my, 50%),
        rgba(255, 255, 255, .1), transparent 42%
    );
    transition: opacity .45s var(--ease);
}

.tp-tilt:hover::after { opacity: 1; }

.tp-tilt__lift { transform: translateZ(38px); }

/* ── Featured story ───────────────────────────────────────────────────── */

.tp-feat {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 0;
    margin-bottom: 62px;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid var(--edge);
    background: linear-gradient(135deg, rgba(0, 212, 255, .05), rgba(99, 102, 241, .05));
    box-shadow: 0 34px 90px -40px rgba(0, 0, 0, .9);
    text-decoration: none;
    color: inherit;
}

.tp-feat:hover {
    box-shadow: 0 46px 110px -38px rgba(0, 212, 255, .34);
    border-color: rgba(0, 212, 255, .28);
    text-decoration: none;
    color: inherit;
}

.tp-feat__body {
    padding: 46px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tp-feat__flag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
    padding: 6px 13px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    color: #06121c;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.tp-feat h2 {
    margin: 0 0 16px;
    font-size: clamp(1.6rem, 2.9vw, 2.35rem);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.024em;
    color: #fff;
}

.tp-feat p {
    margin: 0 0 26px;
    font-size: .97rem;
    line-height: 1.72;
    color: var(--ink-soft);
}

.tp-feat__art {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    background: linear-gradient(150deg, #0d1420, #161f33);
}

.tp-feat__art img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 1.1s var(--ease-out);
}

.tp-feat:hover .tp-feat__art img { transform: scale(1.07); }

.tp-feat__art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 20, 33, .9), transparent 42%);
}

/* Fallback monogram when a post has no cover image */
.tp-glyph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 7rem;
    font-weight: 800;
    letter-spacing: -.06em;
    background: linear-gradient(135deg, var(--cyan), var(--indigo), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: .17;
}

/* ── Post grid ────────────────────────────────────────────────────────── */

.tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 26px;
}

.tp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--edge);
    background: var(--surface);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 18px 46px -30px rgba(0, 0, 0, .95);
}

.tp-card:hover {
    border-color: rgba(0, 212, 255, .3);
    box-shadow: 0 34px 70px -30px rgba(0, 212, 255, .3);
    text-decoration: none;
    color: inherit;
}

.tp-card__art {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(150deg, #0d1420, #161f33);
}

.tp-card__art img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .9s var(--ease-out);
}

.tp-card:hover .tp-card__art img { transform: scale(1.08); }

.tp-card__tag {
    position: absolute;
    left: 14px; bottom: 14px;
    padding: 5px 12px;
    border-radius: 7px;
    background: rgba(6, 12, 22, .82);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
    border: 1px solid rgba(0, 212, 255, .25);
    color: var(--cyan);
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.tp-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px 22px 22px;
}

.tp-card h3 {
    margin: 0 0 11px;
    font-size: 1.13rem;
    font-weight: 650;
    line-height: 1.36;
    letter-spacing: -.014em;
    color: #fff;
    transition: color .3s var(--ease);
}

.tp-card:hover h3 { color: var(--cyan); }

.tp-card p {
    flex: 1;
    margin: 0 0 20px;
    font-size: .88rem;
    line-height: 1.68;
    color: var(--ink-soft);
}

.tp-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .74rem;
    color: var(--ink-mute);
}

.tp-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tp-meta i { font-size: .72rem; opacity: .8; }

.tp-meta__dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--ink-mute);
}

/* ── Reveal on scroll ─────────────────────────────────────────────────── */

.tp-rise {
    opacity: 0;
    transform: translateY(26px);
}

.tp-rise.tp-in {
    opacity: 1;
    transform: none;
    transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}

/* ── Empty + pagination ───────────────────────────────────────────────── */

.tp-empty {
    padding: 84px 24px;
    text-align: center;
    border-radius: 22px;
    border: 1px dashed var(--edge);
    background: rgba(19, 25, 40, .4);
}

.tp-empty i {
    font-size: 2.4rem;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tp-empty h3 { margin: 0 0 8px; font-size: 1.2rem; color: #fff; }
.tp-empty p { margin: 0; color: var(--ink-soft); font-size: .9rem; }

.tp-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 54px;
}

.tp-pager a, .tp-pager span {
    min-width: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--edge);
    background: rgba(19, 25, 40, .55);
    color: var(--ink-soft);
    font-size: .84rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all .3s var(--ease);
}

.tp-pager a:hover {
    color: #fff;
    border-color: var(--edge-lit);
    transform: translateY(-2px);
    text-decoration: none;
}

.tp-pager .tp-pager__on {
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    border-color: transparent;
    font-weight: 700;
}

/* ==========================================================================
   ARTICLE
   ========================================================================== */

.tp-prog {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--cyan), var(--indigo), var(--violet));
    box-shadow: 0 0 14px rgba(0, 212, 255, .75);
    transition: width .1s linear;
}

.tp-art { max-width: 780px; margin: 0 auto; }

.tp-crumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 34px 0 22px;
    font-size: .78rem;
    color: var(--ink-mute);
}

.tp-crumbs a { color: var(--ink-soft); text-decoration: none; transition: color .25s var(--ease); }
.tp-crumbs a:hover { color: var(--cyan); text-decoration: none; }

.tp-art__head { padding-bottom: 34px; }

.tp-art__cat {
    display: inline-block;
    padding: 6px 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, .28);
    background: rgba(0, 212, 255, .08);
    color: var(--cyan);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.tp-art h1 {
    margin: 0 0 20px;
    font-size: clamp(2rem, 4.6vw, 3.15rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.032em;
    color: #fff;
}

.tp-art__lede {
    margin: 0 0 26px;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.24rem;
    line-height: 1.62;
    color: var(--ink-soft);
}

.tp-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 22px;
    border-top: 1px solid var(--edge);
}

.tp-byline__av {
    width: 42px; height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    color: #06121c;
    font-weight: 800;
    font-size: .8rem;
    letter-spacing: -.03em;
    flex-shrink: 0;
}

.tp-byline__who { font-size: .87rem; font-weight: 600; color: var(--ink); }
.tp-byline__when { font-size: .76rem; color: var(--ink-mute); margin-top: 2px; }

.tp-art__cover {
    position: relative;
    margin: 8px 0 44px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--edge);
    box-shadow: 0 34px 80px -40px rgba(0, 0, 0, .95);
    aspect-ratio: 16 / 8;
    background: linear-gradient(150deg, #0d1420, #161f33);
}

.tp-art__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    will-change: transform;
}

/* ── Long-form prose ──────────────────────────────────────────────────── */

.tp-prose {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.82;
    color: #d5dde9;
}

.tp-prose > p:first-of-type::first-letter {
    float: left;
    margin: 8px 12px 0 0;
    font-size: 3.7rem;
    line-height: .82;
    font-weight: 600;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tp-prose p { margin: 0 0 1.5em; }

.tp-prose h2 {
    margin: 2.4em 0 .7em;
    font-family: 'Poppins', sans-serif;
    font-size: 1.66rem;
    font-weight: 650;
    letter-spacing: -.02em;
    color: #fff;
    scroll-margin-top: 90px;
}

.tp-prose h3 {
    margin: 2em 0 .6em;
    font-family: 'Poppins', sans-serif;
    font-size: 1.28rem;
    font-weight: 600;
    color: #fff;
    scroll-margin-top: 90px;
}

.tp-prose a {
    color: var(--cyan);
    text-decoration: none;
    background-image: linear-gradient(var(--cyan), var(--cyan));
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size .35s var(--ease);
}

.tp-prose a:hover { background-size: 0 1px; color: var(--cyan); }

.tp-prose ul, .tp-prose ol { margin: 0 0 1.5em; padding-left: 1.3em; }
.tp-prose li { margin-bottom: .6em; }
.tp-prose li::marker { color: var(--cyan); }

.tp-prose blockquote {
    margin: 2em 0;
    padding: 4px 0 4px 26px;
    border-left: 2px solid transparent;
    border-image: linear-gradient(180deg, var(--cyan), var(--indigo)) 1;
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #fff;
}

.tp-prose img {
    display: block;
    width: 100%;
    height: auto;
    margin: 2em 0;
    border-radius: 16px;
    border: 1px solid var(--edge);
}

.tp-prose pre {
    margin: 2em 0;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px solid var(--edge);
    background: #0a0f19;
    overflow-x: auto;
    font-size: .88rem;
    line-height: 1.65;
}

.tp-prose code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: .88em;
    color: var(--cyan);
}

.tp-prose pre code { color: #cbd5e1; }

.tp-prose > p > code,
.tp-prose li > code {
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(0, 212, 255, .09);
    border: 1px solid rgba(0, 212, 255, .18);
}

.tp-prose hr {
    margin: 3em 0;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
}

/* ── Article footer ───────────────────────────────────────────────────── */

.tp-share {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 56px 0 0;
    padding-top: 30px;
    border-top: 1px solid var(--edge);
}

.tp-share__lbl { font-size: .8rem; color: var(--ink-mute); margin-right: 2px; }

.tp-share a, .tp-share button {
    width: 40px; height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--edge);
    background: rgba(19, 25, 40, .6);
    color: var(--ink-soft);
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all .3s var(--ease);
}

.tp-share a:hover, .tp-share button:hover {
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    border-color: transparent;
    transform: translateY(-3px);
    text-decoration: none;
}

.tp-cta {
    position: relative;
    margin: 62px 0 0;
    padding: 46px 40px;
    border-radius: 24px;
    overflow: hidden;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, .22);
    background: linear-gradient(135deg, rgba(0, 212, 255, .09), rgba(99, 102, 241, .09));
}

.tp-cta h3 {
    margin: 0 0 12px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}

.tp-cta p {
    max-width: 460px;
    margin: 0 auto 26px;
    font-size: .93rem;
    line-height: 1.7;
    color: var(--ink-soft);
}

.tp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--cyan), var(--indigo));
    color: #06121c;
    font-size: .92rem;
    font-weight: 650;
    text-decoration: none;
    box-shadow: 0 14px 34px -12px rgba(0, 212, 255, .7);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.tp-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 46px -12px rgba(0, 212, 255, .85);
    color: #06121c;
    text-decoration: none;
}

.tp-more { margin-top: 92px; }

.tp-more__hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.tp-more__hd h3 {
    margin: 0;
    font-size: 1.42rem;
    font-weight: 650;
    letter-spacing: -.02em;
    color: #fff;
}

.tp-more__hd a {
    font-size: .85rem;
    color: var(--cyan);
    text-decoration: none;
    transition: gap .25s var(--ease);
}

.tp-more__hd a:hover { text-decoration: none; opacity: .82; }

/* ── AJAX swap ────────────────────────────────────────────────────────── */

#tpResults { transition: opacity .22s var(--ease); }
#tpResults.tp-swap { opacity: .3; pointer-events: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */

/* Laptop / small desktop */
@media (max-width: 1100px) {
    .tp-blog__inner { padding: 0 24px; }
    .tp-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
    .tp-feat__body { padding: 40px 34px; }
}

/* Tablet landscape - rail stacks here so the chips never fight the search box */
@media (max-width: 992px) {
    .tp-blog__mast { padding: 64px 0 40px; }
    .tp-blog__lede { font-size: .98rem; }
    .tp-grid { grid-template-columns: repeat(2, 1fr); }
    .tp-art { max-width: 100%; }

    .tp-blog__rail { flex-direction: column; align-items: stretch; gap: 14px; }
    .tp-blog__chips { width: 100%; }
    .tp-blog__search { flex: 1 1 auto; width: 100%; min-width: 0; }
}

/* Tablet portrait — featured stacks, art on top */
@media (max-width: 900px) {
    .tp-feat { grid-template-columns: 1fr; }
    .tp-feat__art { min-height: 260px; order: -1; }
    .tp-feat__art::after {
        background: linear-gradient(0deg, rgba(15, 20, 33, .94), transparent 58%);
    }
    .tp-feat__body { padding: 30px 28px 34px; }
    .tp-feat h2 { font-size: 1.62rem; }
}

/* Phone */
@media (max-width: 768px) {
    .tp-blog { padding-bottom: 80px; }
    .tp-blog__inner { padding: 0 16px; }
    .tp-blog__mast { padding: 44px 0 30px; }
    .tp-blog__sky { height: 560px; filter: blur(70px); }

    .tp-blog__rail {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        border-radius: 16px;
    }
    /* Chips wrap onto as many rows as needed - nothing is ever clipped */
    .tp-blog__chips {
        flex-wrap: wrap;
        gap: 7px;
        width: 100%;
    }
    .tp-chip {
        flex: 0 1 auto;
        padding: 8px 13px;
        font-size: .76rem;
    }
    .tp-blog__search { flex: 1 1 auto; width: 100%; min-width: 0; }

    .tp-grid { grid-template-columns: 1fr; gap: 18px; }
    .tp-feat { margin-bottom: 40px; border-radius: 20px; }
    .tp-card { border-radius: 18px; }

    .tp-crumbs { padding: 22px 0 16px; font-size: .74rem; }
    .tp-art__lede { font-size: 1.1rem; }
    .tp-prose { font-size: 1.06rem; line-height: 1.78; }
    .tp-prose h2 { font-size: 1.42rem; margin-top: 2em; }
    .tp-prose h3 { font-size: 1.16rem; }
    .tp-prose blockquote { font-size: 1.12rem; padding-left: 18px; }
    .tp-art__cover { aspect-ratio: 16 / 10; border-radius: 16px; margin-bottom: 32px; }
    .tp-cta { padding: 34px 22px; border-radius: 20px; }
    .tp-cta h3 { font-size: 1.34rem; }
    .tp-more { margin-top: 64px; }
    /* Tilt is pointer-only, so flatten any inherited depth on touch */
    .tp-tilt__lift { transform: none; }
}

/* Small phone */
@media (max-width: 480px) {
    .tp-blog__title { font-size: 2.05rem; letter-spacing: -.03em; }
    .tp-blog__lede { font-size: .92rem; }
    .tp-feat h2 { font-size: 1.38rem; }
    .tp-feat__body { padding: 24px 20px 28px; }
    .tp-feat__art { min-height: 200px; }
    .tp-card__body { padding: 20px 18px 18px; }
    .tp-prose { font-size: 1.02rem; }
    .tp-prose > p:first-of-type::first-letter { font-size: 2.9rem; margin-right: 9px; }
    .tp-share { gap: 8px; }
    .tp-share a, .tp-share button { width: 36px; height: 36px; }
    .tp-meta { font-size: .7rem; gap: 9px; }
    .tp-pager a, .tp-pager span { min-width: 36px; padding: 8px 11px; }
}

/* Coarse pointers never get tilt, so keep cards flat and tappable */
@media (hover: none) {
    .tp-tilt { transform: none !important; }
    .tp-tilt::after { display: none; }
}

/* ── Motion preferences ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .tp-blog *,
    .tp-blog *::before,
    .tp-blog *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .tp-rise { opacity: 1; transform: none; }
    .tp-blog__sky i { animation: none; }
}
