/* ==========================================================================
   iPressly v2 — Main Stylesheet
   Crypto News Platform Design Language
   Target: < 30KB total CSS, zero render-blocking fonts, sub-200ms LCP
   ========================================================================== */

/* ---------- CSS Variables (Customizer-overridden inline) ---------- */
:root {
    --stf-primary: #2563eb;
    --stf-primary-dark: #1d4ed8;
    --stf-secondary: #7c3aed;
    --stf-accent: #f59e0b;
    --stf-positive: #10b981;   /* price up / bullish */
    --stf-negative: #ef4444;   /* price down / bearish */
    --stf-header-bg: #0f172a;  /* dark nav — crypto standard */
    --stf-header-text: #f1f5f9;
    --stf-footer-bg: #0f172a;
    --stf-footer-text: #94a3b8;
    --stf-body-bg: #ffffff;
    --stf-body-text: #1e293b;
    --stf-font-size: 16px;
    --stf-line-height: 1.7;
    --stf-border: #e2e8f0;
    --stf-muted: #64748b;
    --stf-surface: #f8fafc;
    --stf-radius: 6px;
    --stf-shadow: 0 1px 3px rgba(0,0,0,.08);
    --stf-shadow-lg: 0 4px 16px rgba(0,0,0,.1);
    --stf-font-body: -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
    --stf-font-heading: -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
    --stf-container: 1240px;
}

/* ---------- Reset ---------- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:var(--stf-font-size);-webkit-text-size-adjust:100%}
body{font-family:var(--stf-font-body);line-height:var(--stf-line-height);color:var(--stf-body-text);background:var(--stf-body-bg);-webkit-font-smoothing:antialiased}
a{color:var(--stf-primary);text-decoration:none;transition:color .15s}
a:hover{color:var(--stf-primary-dark)}
img{max-width:100%;height:auto;display:block}
h1,h2,h3,h4,h5,h6{font-family:var(--stf-font-heading);font-weight:700;line-height:1.25;color:var(--stf-body-text)}
h1{font-size:clamp(1.625rem,2.5vw,2.375rem)}
h2{font-size:clamp(1.25rem,2vw,1.75rem)}
h3{font-size:clamp(1.05rem,1.5vw,1.3rem)}
p{margin-bottom:0}

/* ---------- Utility ---------- */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.sr-only:focus{position:fixed;top:0;left:0;z-index:99999;width:auto;height:auto;padding:.75rem 1rem;margin:0;clip:auto;background:var(--stf-primary);color:#fff;font-size:1rem;font-weight:600}
.container{max-width:var(--stf-container);margin:0 auto;padding:0 1rem}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.5rem 1.125rem;border-radius:var(--stf-radius);font-weight:600;font-size:.875rem;cursor:pointer;border:2px solid transparent;transition:all .15s;min-height:40px;white-space:nowrap}
.btn-primary{background:var(--stf-primary);color:#fff;border-color:var(--stf-primary)}
.btn-primary:hover{background:var(--stf-primary-dark);border-color:var(--stf-primary-dark);color:#fff}
.btn-outline{background:transparent;border-color:var(--stf-primary);color:var(--stf-primary)}
.btn-outline:hover{background:var(--stf-primary);color:#fff}
.btn-dark{background:var(--stf-header-bg);color:#fff;border-color:var(--stf-header-bg)}
.btn-dark:hover{background:#1e293b;color:#fff}

/* ---------- Badges ---------- */
.badge{display:inline-block;padding:.175rem .55rem;border-radius:3px;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;line-height:1.4}
.badge-primary{background:var(--stf-primary);color:#fff}
.badge-secondary{background:var(--stf-secondary);color:#fff}
.badge-sm{font-size:.62rem;padding:.1rem .4rem}
.badge-sponsored{background:var(--stf-accent);color:#1e293b}
.badge-breaking{background:#dc2626;color:#fff;animation:pulse-badge 2s ease-in-out infinite}
@keyframes pulse-badge{0%,100%{opacity:1}50%{opacity:.75}}

/* ---------- AMP link ---------- */
.amp-page-link{display:inline-flex;align-items:center;gap:.25rem;font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--stf-primary);background:#eff6ff;border:1px solid #bfdbfe;padding:.125rem .4rem;border-radius:3px}
.amp-page-link:hover{background:var(--stf-primary);color:#fff;border-color:var(--stf-primary)}

/* ---------- Reading Progress ---------- */
.reading-progress-bar{position:fixed;top:0;left:0;height:3px;width:0;background:linear-gradient(90deg,var(--stf-primary),var(--stf-accent));z-index:10000;transition:width .1s linear}

/* ---------- Top Bar ---------- */
.top-bar{background:var(--stf-header-bg);color:var(--stf-header-text);padding:.35rem 0;font-size:.72rem;border-bottom:1px solid rgba(255,255,255,.06)}
.top-bar-inner{display:flex;justify-content:space-between;align-items:center;gap:.75rem}
.top-bar-left{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.top-bar-right{display:flex;align-items:center;gap:.5rem}
.top-bar-date{opacity:.6;font-variant-numeric:tabular-nums}
.trending-label{font-weight:700;color:var(--stf-accent);text-transform:uppercase;font-size:.65rem;letter-spacing:.5px}
.trending-tag{color:var(--stf-header-text);opacity:.8;font-weight:500}
.trending-tag:hover{opacity:1;color:#fff}
.social-link{color:var(--stf-header-text);opacity:.6;display:inline-flex;align-items:center}
.social-link:hover{opacity:1;color:#fff}

/* ---------- Google News Button ---------- */
.gn-follow-btn{display:inline-flex;align-items:center;gap:.35rem;padding:.3rem .65rem;background:#fff;color:#1a73e8;border:1px solid rgba(255,255,255,.15);border-radius:4px;font-size:.72rem;font-weight:700;white-space:nowrap;transition:all .15s}
.gn-follow-btn:hover{background:#e8f0fe;color:#1557b0}
.gn-follow-btn--header{padding:.2rem .55rem;font-size:.68rem}
.gn-follow-btn--post{display:inline-flex;padding:.5rem 1rem;font-size:.8rem;margin-top:.75rem;border:1px solid #dadce0;color:#1a73e8}
.gn-follow-btn--post:hover{background:#e8f0fe}
.gn-follow-btn__icon{flex-shrink:0}
.gn-follow-btn__text{}

/* ---------- Header ---------- */
.site-header{background:var(--stf-header-bg);color:var(--stf-header-text);position:relative;z-index:200}
.sticky-header{position:sticky;top:0}
.header-main{padding:.625rem 0;border-bottom:1px solid rgba(255,255,255,.07)}
.header-inner{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.header-actions{display:flex;gap:.25rem;align-items:center}
.site-branding{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.site-title-link{text-decoration:none}
.site-title{font-size:1.375rem;font-weight:800;color:#fff;letter-spacing:-.02em}
.site-tagline{font-size:.7rem;color:rgba(255,255,255,.45);margin:0}
.logo-img{max-height:44px;width:auto}

.search-toggle,.mobile-menu-toggle{background:none;border:none;cursor:pointer;padding:.4rem;color:var(--stf-header-text);display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;border-radius:4px;transition:background .15s}
.search-toggle:hover,.mobile-menu-toggle:hover{background:rgba(255,255,255,.08)}
.header-search{display:none;padding:.5rem 0;border-top:1px solid rgba(255,255,255,.07)}
.header-search.active{display:block}
.search-form{display:flex;gap:.5rem}
.search-field{flex:1;padding:.45rem .875rem;border:1px solid rgba(255,255,255,.15);border-radius:var(--stf-radius);font-size:.875rem;min-height:40px;background:rgba(255,255,255,.08);color:#fff}
.search-field::placeholder{color:rgba(255,255,255,.4)}
.search-submit{background:var(--stf-primary);color:#fff;border:none;border-radius:var(--stf-radius);padding:0 .875rem;cursor:pointer;display:flex;align-items:center;min-height:40px}

/* ---------- Primary Nav ---------- */
.primary-nav{background:var(--stf-header-bg);border-top:1px solid rgba(255,255,255,.07)}
.primary-nav .container{display:flex;align-items:center}
.primary-menu,.primary-nav ul,.primary-nav .menu{list-style:none;display:flex;gap:0;flex-wrap:wrap;margin:0;padding:0}
.primary-menu li,.primary-nav ul li,.primary-nav .menu li{position:relative;list-style:none}
.primary-menu > li > a,.primary-nav ul > li > a,.primary-nav .menu > li > a{display:block;padding:.6rem .875rem;font-size:.8rem;font-weight:600;color:rgba(255,255,255,.75);transition:color .15s;white-space:nowrap;letter-spacing:.01em}
.primary-menu > li > a:hover,.primary-menu > li.current-menu-item > a,.primary-menu > li.current_page_item > a{color:#fff}
.primary-menu .sub-menu,.primary-nav .children{display:none;position:absolute;top:100%;left:0;background:#1e293b;min-width:220px;box-shadow:var(--stf-shadow-lg);border-radius:0 0 6px 6px;list-style:none;z-index:300;border:1px solid rgba(255,255,255,.08);margin:0;padding:.375rem 0}
.primary-menu li:hover > .sub-menu,.primary-nav li:hover > .children{display:block}
.primary-menu .sub-menu a,.primary-nav .children a{display:block;padding:.45rem 1rem;font-size:.8rem;color:rgba(255,255,255,.7)}
.primary-menu .sub-menu a:hover,.primary-nav .children a:hover{background:rgba(255,255,255,.06);color:#fff}
.menu-item-has-children > a{display:flex;align-items:center;gap:.2rem}
.mobile-menu-toggle{display:none}
@media(max-width:768px){.mobile-menu-toggle{display:flex}.primary-nav{display:none}}

/* ---------- Breaking News ---------- */
.breaking-news-bar{background:#dc2626;color:#fff;padding:.35rem 0;font-size:.76rem;overflow:hidden;white-space:nowrap}
.breaking-news-bar .container{display:flex;align-items:center;gap:.625rem;overflow:hidden}
.breaking-label{font-weight:800;text-transform:uppercase;letter-spacing:.6px;font-size:.68rem;flex-shrink:0;background:rgba(0,0,0,.2);padding:.1rem .4rem;border-radius:2px}
.breaking-ticker{overflow:hidden;flex:1}
.breaking-ticker-track{display:inline-flex;animation:stf-ticker 28s linear infinite}
.breaking-ticker-track:hover{animation-play-state:paused}
.breaking-ticker-item{color:#fff;white-space:nowrap;padding-right:.75rem;font-weight:500}
.breaking-ticker-item:hover{opacity:.85}
.breaking-ticker-sep{opacity:.5;padding-right:.5rem}
@keyframes stf-ticker{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}
@media(prefers-reduced-motion:reduce){.breaking-ticker-track{animation:none}}

/* ---------- Mobile Menu ---------- */
.mobile-menu-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0f172a;z-index:10000;transform:translateX(100%);transition:transform .25s ease;overflow-y:auto}
.mobile-menu-overlay.active{transform:translateX(0)}
.mobile-menu-inner{padding:1.5rem}
.mobile-menu-close{background:none;border:none;cursor:pointer;position:absolute;top:1rem;right:1rem;color:#fff;min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center}
.mobile-search-form{margin:2rem 0 1rem}
.mobile-search-form input{width:100%;padding:.625rem .875rem;border:1px solid rgba(255,255,255,.15);border-radius:var(--stf-radius);font-size:.95rem;background:rgba(255,255,255,.08);color:#fff}
.mobile-search-form input::placeholder{color:rgba(255,255,255,.4)}
.mobile-nav-menu{list-style:none}
.mobile-nav-menu li a{display:block;padding:.625rem 0;border-bottom:1px solid rgba(255,255,255,.08);font-size:.95rem;color:rgba(255,255,255,.85)}
.mobile-nav-menu .sub-menu{padding-left:1rem;list-style:none}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs{padding:.875rem 0 .5rem;font-size:.76rem;color:var(--stf-muted)}
.breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap}
.breadcrumb-item{display:inline}
.breadcrumb-item a{color:var(--stf-muted)}
.breadcrumb-item a:hover{color:var(--stf-primary)}
.breadcrumb-sep{margin:0 .3rem}
.breadcrumb-current{color:var(--stf-body-text)}

/* ---------- Content Layout ---------- */
.content-area{padding:1.25rem 0}
.content-area.has-sidebar{display:grid;gap:2rem}
.content-area.has-sidebar.sidebar-right{grid-template-columns:1fr 300px}
.content-area.has-sidebar.sidebar-left{grid-template-columns:300px 1fr}
@media(max-width:960px){.content-area.has-sidebar{grid-template-columns:1fr}}

/* ---------- Post Cards ---------- */
.posts-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem}
@media(max-width:960px){.posts-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.posts-grid{grid-template-columns:1fr}}

.post-card{background:var(--stf-body-bg);border:1px solid var(--stf-border);border-radius:var(--stf-radius);overflow:hidden;transition:box-shadow .15s,transform .15s}
.post-card:hover{box-shadow:var(--stf-shadow-lg);transform:translateY(-1px)}
.post-card-thumb img{width:100%;height:185px;object-fit:cover}
.post-card-thumb-placeholder{width:100%;height:185px;background:var(--stf-surface)}
.post-card-content{padding:.875rem}
.post-card-content .badge{margin-bottom:.4rem}
.post-card-title{font-size:.95rem;margin:.3rem 0 .4rem;line-height:1.35}
.post-card-title a{color:var(--stf-body-text)}
.post-card-title a:hover{color:var(--stf-primary)}
.post-card-excerpt{font-size:.8rem;color:var(--stf-muted);margin-bottom:.4rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.post-card-meta{font-size:.72rem;color:var(--stf-muted);display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}

/* ---------- Load More ---------- */
.load-more-wrap{text-align:center;padding:1.75rem 0}
.load-more-btn{min-width:180px}
.load-more-btn:disabled{opacity:.6;cursor:wait}

/* ---------- Sidebar ---------- */
.sidebar-inner{position:sticky;top:80px}
.widget{margin-bottom:1.25rem;padding:1.125rem;background:var(--stf-body-bg);border:1px solid var(--stf-border);border-radius:var(--stf-radius)}
.widget-title{font-size:.8rem;text-transform:uppercase;letter-spacing:.6px;margin-bottom:.625rem;padding-bottom:.4rem;border-bottom:2px solid var(--stf-primary)}
.widget ul{list-style:none}
.widget ul li{padding:.25rem 0}
.widget ul li a{color:var(--stf-body-text);font-size:.82rem}
.widget ul li a:hover{color:var(--stf-primary)}
.related-post-item{display:flex;gap:.625rem;margin-bottom:.625rem;align-items:flex-start}
.related-thumb img{width:64px;height:46px;object-fit:cover;border-radius:3px}
.related-title{font-size:.78rem;font-weight:600;color:var(--stf-body-text)}
.toc-nav a{display:block;padding:.25rem 0 .25rem .625rem;font-size:.78rem;color:var(--stf-muted);border-left:2px solid var(--stf-border)}
.toc-nav a:hover,.toc-nav a.active{color:var(--stf-primary);border-left-color:var(--stf-primary)}
.toc-h3{padding-left:1.25rem}

/* ---------- Footer ---------- */
.site-footer{background:var(--stf-footer-bg);color:var(--stf-footer-text);padding-top:2.5rem}
.footer-widgets{padding-bottom:1.75rem}
.footer-grid{display:grid;gap:2rem}
.footer-cols-4{grid-template-columns:repeat(4,1fr)}
.footer-cols-3{grid-template-columns:repeat(3,1fr)}
@media(max-width:768px){.footer-cols-4,.footer-cols-3{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.footer-cols-4,.footer-cols-3{grid-template-columns:1fr}}
.footer-col .widget{background:transparent;border:none;padding:0;color:var(--stf-footer-text)}
.footer-col .widget-title{color:#e2e8f0;border-bottom-color:var(--stf-primary);font-size:.76rem}
.footer-col .widget ul{list-style:none;margin:0;padding:0}
.footer-col .widget ul li{margin-bottom:.3rem}
.footer-col a,.footer-col .widget ul li a{color:var(--stf-footer-text);opacity:.7;font-size:.82rem;transition:opacity .15s}
.footer-col a:hover,.footer-col .widget ul li a:hover{opacity:1;color:#fff}
.footer-about-text{font-size:.82rem;line-height:1.6;opacity:.6;margin-bottom:.625rem}
.footer-contact-email a{color:var(--stf-primary);opacity:1;font-weight:500}
.footer-rss{margin-top:.875rem;padding-top:.625rem;border-top:1px solid rgba(255,255,255,.08)}
.footer-rss a{opacity:.6;font-size:.8rem}
.footer-rss a:hover{opacity:1}
.footer-newsletter-form input{width:100%;padding:.5rem .625rem;margin-bottom:.4rem;border:1px solid rgba(255,255,255,.12);border-radius:var(--stf-radius);background:rgba(255,255,255,.07);color:#fff;font-size:.82rem}
.footer-newsletter-form input::placeholder{color:rgba(255,255,255,.35)}
.footer-newsletter-form .btn{width:100%;font-size:.82rem}
.footer-bottom{border-top:1px solid rgba(255,255,255,.08);padding:1.25rem 0}
.footer-bottom-inner{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.875rem;font-size:.76rem}
.legal-menu{list-style:none;display:flex;gap:.875rem;margin:0;padding:0;flex-wrap:wrap}
.legal-menu li{list-style:none}
.legal-menu a{color:var(--stf-footer-text);opacity:.5;transition:opacity .15s}
.legal-menu a:hover{opacity:1}
.footer-social{display:flex;gap:.625rem}
.footer-social a{color:var(--stf-footer-text);opacity:.5}
.footer-social a:hover{opacity:1;color:#fff}

/* ---------- Back to Top ---------- */
.back-to-top{position:fixed;bottom:1.5rem;right:1.5rem;width:40px;height:40px;background:var(--stf-primary);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:all .25s;z-index:999;box-shadow:var(--stf-shadow-lg)}
.back-to-top.visible{opacity:1;visibility:visible}
.back-to-top:hover{background:var(--stf-primary-dark);color:#fff}

/* ---------- Ad Slots ---------- */
.ad-slot{text-align:center;padding:.875rem 0}
.ad-slot:empty{display:none}

/* ---------- Search ---------- */
.search-result{padding:1.125rem 0;border-bottom:1px solid var(--stf-border)}
.search-result-title{font-size:1.05rem;margin-bottom:.25rem}
.search-result-title a{color:var(--stf-body-text)}
.search-result-title a:hover{color:var(--stf-primary)}
.search-result-meta{font-size:.76rem;color:var(--stf-muted);margin-bottom:.4rem}
.search-result-excerpt{font-size:.875rem}
.search-count{color:var(--stf-muted);margin-bottom:.875rem}

/* ---------- 404 ---------- */
.error-404{text-align:center;padding:3rem 0}
.error-404 h1{margin-bottom:1rem}
.error-404 .search-form{max-width:480px;margin:1.5rem auto}
.recent-posts-list{list-style:none;text-align:left;max-width:480px;margin:.875rem auto}
.recent-posts-list li{padding:.4rem 0;border-bottom:1px solid var(--stf-border)}

/* ---------- Loading ---------- */
.loading-spinner{text-align:center;padding:1.75rem}
.spinner{width:32px;height:32px;margin:0 auto;border:3px solid var(--stf-border);border-top-color:var(--stf-primary);border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- Archive ---------- */
.archive-header{margin-bottom:1.75rem;padding-bottom:.875rem;border-bottom:2px solid var(--stf-border)}
.archive-description{color:var(--stf-muted);margin-top:.4rem;font-size:.9rem}
.page-title{margin-bottom:.875rem}
.subcategories{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.625rem}

/* ---------- Author Hero ---------- */
.author-hero{background:linear-gradient(135deg,#0f172a 0%,#1e293b 100%);color:#fff;padding:2.5rem 0 1.75rem}
.author-hero-inner{display:flex;gap:1.75rem;align-items:flex-start}
.author-hero-avatar{flex-shrink:0;position:relative}
.author-hero-avatar img{border-radius:50%;width:108px;height:108px;border:3px solid rgba(255,255,255,.15)}
.author-hero-info{flex:1}
.author-hero-name{font-size:1.625rem;margin:0 0 .2rem;color:#fff}
.author-hero-role{font-size:.82rem;color:var(--stf-accent);font-weight:700;display:block;margin-bottom:.4rem;text-transform:uppercase;letter-spacing:.5px}
.author-hero-bio{font-size:.875rem;color:#94a3b8;line-height:1.6;max-width:580px;margin-bottom:.625rem}
.author-hero-expertise{display:flex;gap:.35rem;flex-wrap:wrap;margin-bottom:.625rem}
.author-hero-expertise .expertise-tag{background:rgba(37,99,235,.2);color:#93c5fd;border:1px solid rgba(37,99,235,.3)}
.author-hero-links{display:flex;gap:.875rem;flex-wrap:wrap}
.author-link{color:#64748b;font-size:.8rem;display:inline-flex;align-items:center;gap:.25rem}
.author-link:hover{color:#fff}
.author-stats-bar{display:flex;gap:2rem;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid rgba(255,255,255,.08)}
.author-stat{text-align:center}
.author-stat-num{display:block;font-size:1.2rem;font-weight:700;color:#fff}
.author-stat-label{font-size:.68rem;color:#64748b;text-transform:uppercase;letter-spacing:.5px}
@media(max-width:600px){.author-hero-inner{flex-direction:column;align-items:center;text-align:center}.author-hero-expertise,.author-hero-links,.author-stats-bar{justify-content:center}}

/* ---------- Placeholder ---------- */
.post-card-thumb-placeholder,.hero-placeholder{background:var(--stf-surface)}

/* ---------- Accessibility ---------- */
:focus-visible{outline:2px solid var(--stf-primary);outline-offset:2px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms;scroll-behavior:auto;transition-duration:.01ms}}
