/*
Theme Name: JobPresence Pro
Theme URI: https://jobpresence.com
Author: JobPresence
Author URI: https://jobpresence.com
Description: Professional dark finance blog theme with WooCommerce support. Built for trading blogs and digital product sales.
Version: 1.0.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jobpresence
Tags: dark, blog, finance, woocommerce, responsive, two-columns, right-sidebar
*/

/* Google Fonts loaded via functions.php as non-blocking preload */
/* @import moved to wp_head for performance — see functions.php */

/* === CSS VARIABLES === */
:root {
  --bg:        #0f1117;
  --bg2:       #161b24;
  --bg3:       #1d2433;
  --border:    #242b38;
  --text:      #dce3ef;
  --muted:     #6b7a99;
  --accent:    #3b82f6;
  --accent2:   #10b981;
  --red:       #ef4444;
  --gold:      #f59e0b;
  --white:     #ffffff;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  background: #0f1117 !important;
  background-color: #0f1117 !important;
  color: #dce3ef !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Kill Newspaper theme leftover wrappers */
#wrapper, #main, .layout, #content, .site, #page,
.td-main-content, .td-container, .td-pb-row {
  background: #0f1117 !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
  box-shadow: none !important;
}

/* Hide old Newspaper theme header */
.header-wrap, .td-header-wrap, .td-header-style-1,
.td-main-menu-logo, #td-header-menu,
.td-header-top-menu-full, .td-affix { display: none !important; }

a { text-decoration: none !important; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

/* === LAYOUT === */
.site-wrapper { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

/* === TOPBAR === */
#topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 12px;
  color: var(--muted);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 40px;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar-markets { display: flex; gap: 28px; flex-wrap: wrap; }
.market-item { display: flex; align-items: center; gap: 6px; }
.market-item .sym { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--text); font-size: 12px; }
.market-item .val { font-family: 'DM Mono', monospace; font-size: 12px; }
.up   { color: var(--accent2); }
.down { color: var(--red); }
.topbar-date { font-family: 'DM Mono', monospace; font-size: 11px; }

/* === NAVIGATION === */
#site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 40px;
  display: flex; align-items: center;
  height: 64px;
}
.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 800;
  color: var(--white); letter-spacing: -0.5px;
  margin-right: 48px; flex-shrink: 0;
}
.site-logo span { color: var(--accent); }
.main-nav { display: flex; gap: 0; flex: 1; }
.main-nav a {
  display: block; padding: 0 18px;
  height: 64px; line-height: 64px;
  font-size: 13px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item a,
.main-nav .current_page_item a {
  color: var(--white);
  border-bottom-color: var(--accent);
}
.nav-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-search-form input[type="search"] {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px;
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  width: 200px; outline: none;
  transition: border-color 0.2s;
}
.nav-search-form input[type="search"]:focus { border-color: var(--accent); }
.nav-search-form input::placeholder { color: var(--muted); }
.nav-cta-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 9px 22px; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s; white-space: nowrap;
  display: inline-block;
}
.nav-cta-btn:hover { opacity: 0.88; color: #fff; }

/* === HAMBURGER (mobile) === */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 24px; margin-left: auto;
  padding: 8px;
}

/* === HERO STRIP === */
#hero-strip {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 0;
}
.hero-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 40px;
  display: grid; grid-template-columns: 1fr 340px; gap: 0;
}
.hero-main {
  border-right: 1px solid var(--border);
  padding-right: 40px; padding-bottom: 48px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 4px 12px; margin-bottom: 20px;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 44px; font-weight: 800;
  line-height: 1.1; letter-spacing: -1px;
  color: var(--white); margin-bottom: 16px; max-width: 620px;
}
.hero-title span { color: var(--accent); }
.hero-excerpt {
  font-size: 16px; color: var(--muted);
  max-width: 560px; line-height: 1.7; margin-bottom: 24px;
}
.hero-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--muted);
}
.hero-meta .author { color: var(--accent); font-weight: 600; }
.hero-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }
.read-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 10px 22px;
  font-size: 13px; font-weight: 500;
  transition: all 0.2s; margin-top: 28px;
}
.read-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Trending Sidebar */
.hero-sidebar { padding-left: 40px; padding-bottom: 48px; }
.sidebar-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.trending-list { display: flex; flex-direction: column; }
.trending-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.trending-item:hover { opacity: 0.75; }
.trending-num {
  font-family: 'Playfair Display', serif;
  font-size: 32px; font-weight: 700; color: var(--border);
  line-height: 1; flex-shrink: 0; width: 28px; margin-top: 2px;
}
.trending-item:hover .trending-num { color: var(--accent); }
.trending-cat {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent2); font-weight: 600; margin-bottom: 4px;
}
.trending-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.trending-time { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* === MAIN CONTENT AREA === */
#main-content {
  max-width: 1280px; margin: 0 auto; padding: 48px 40px;
  display: grid; grid-template-columns: 1fr 320px; gap: 60px;
  align-items: start;
}

/* Section Heading */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; padding-bottom: 14px;
  border-bottom: 2px solid var(--border); position: relative;
}
.section-head::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 60px; height: 2px; background: var(--accent);
}
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: -0.3px;
}
.section-head a { font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: 0.3px; }
.section-head a:hover { text-decoration: underline; }

/* === PRODUCTS GRID === */
.products-section { margin-bottom: 48px; }
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.product-card {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 28px; transition: border-color 0.2s, background 0.2s; position: relative;
}
.product-card:hover { border-color: var(--accent); background: var(--bg3); }
.product-badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--gold); color: #000;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px;
}
.product-icon { font-size: 28px; margin-bottom: 16px; }
.product-cat {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 8px;
}
.product-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: var(--white);
  margin-bottom: 8px; letter-spacing: -0.3px;
}
.product-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.product-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.product-price { font-family: 'DM Mono', monospace; font-size: 20px; color: var(--white); font-weight: 500; }
.product-price small { font-size: 12px; color: var(--muted); }
.buy-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 9px 20px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s; font-family: 'DM Sans', sans-serif;
}
.buy-btn:hover { opacity: 0.85; }

/* === ARTICLE CARDS === */
.articles-list { display: flex; flex-direction: column; }
.article-card {
  display: grid; grid-template-columns: 1fr 140px; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.article-card:hover { opacity: 0.82; }
.article-card:first-child { padding-top: 0; }
.article-cat {
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  font-weight: 600; color: var(--accent2); margin-bottom: 8px;
}
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: var(--white);
  line-height: 1.3; letter-spacing: -0.3px; margin-bottom: 10px;
}
.article-excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.article-meta { font-size: 11px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.article-meta .aut { color: var(--text); font-weight: 500; }
.article-thumb {
  width: 140px; height: 100px; background: var(--bg3);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 36px; border: 1px solid var(--border); align-self: start;
  overflow: hidden;
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* === SIDEBAR === */
#sidebar { display: flex; flex-direction: column; gap: 36px; }
.widget {
  background: var(--bg2); border: 1px solid var(--border); padding: 24px;
}
.widget-title {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* Newsletter Widget */
.widget-newsletter { background: var(--bg3); }
.widget-newsletter .widget-title { color: var(--accent); border-color: rgba(59,130,246,0.2); }
.widget-newsletter p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.widget-newsletter input[type="text"],
.widget-newsletter input[type="email"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px;
  font-size: 13px; font-family: 'DM Sans', sans-serif;
  outline: none; margin-bottom: 10px; transition: border-color 0.2s;
}
.widget-newsletter input:focus { border-color: var(--accent); }
.widget-newsletter input::placeholder { color: var(--muted); }
.widget-newsletter button {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 11px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: opacity 0.2s;
}
.widget-newsletter button:hover { opacity: 0.85; }

/* Markets Widget */
.market-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.market-row:last-child { border-bottom: none; }
.market-sym { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--text); }
.market-price { font-family: 'DM Mono', monospace; color: var(--muted); font-size: 12px; }
.market-change { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; }

/* Tags Widget */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; padding: 5px 12px;
  transition: all 0.2s;
}
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent); }

/* Recent Posts Widget */
.recent-post {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border); transition: opacity 0.15s;
}
.recent-post:last-child { border-bottom: none; }
.recent-post:hover { opacity: 0.75; }
.recent-post-thumb {
  width: 60px; height: 50px; background: var(--bg3);
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 4px; }
.recent-post-date { font-size: 11px; color: var(--muted); }

/* === SINGLE POST === */
.single-content { max-width: 1280px; margin: 0 auto; padding: 48px 40px; display: grid; grid-template-columns: 1fr 320px; gap: 60px; }
.post-header { margin-bottom: 32px; }
.post-category { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; color: var(--accent2); margin-bottom: 12px; }
.post-title { font-family: 'Playfair Display', serif; font-size: 38px; font-weight: 800; line-height: 1.15; letter-spacing: -0.8px; color: var(--white); margin-bottom: 16px; }
.post-meta { font-size: 12px; color: var(--muted); display: flex; gap: 16px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.post-meta .aut { color: var(--accent); font-weight: 600; }
.post-featured-img { width: 100%; height: 400px; object-fit: cover; margin-bottom: 32px; border: 1px solid var(--border); }
.post-body { font-size: 16px; line-height: 1.8; color: var(--text); }
.post-body h2, .post-body h3 { font-family: 'Playfair Display', serif; color: var(--white); margin: 32px 0 16px; }
.post-body h2 { font-size: 28px; }
.post-body h3 { font-size: 22px; }
.post-body p { margin-bottom: 20px; }
.post-body a { color: var(--accent); border-bottom: 1px solid rgba(59,130,246,0.3); }
.post-body a:hover { border-bottom-color: var(--accent); }
.post-body ul, .post-body ol { margin: 0 0 20px 24px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote { border-left: 3px solid var(--accent); padding: 16px 24px; background: var(--bg2); margin: 24px 0; color: var(--muted); font-style: italic; }
.post-body img { max-width: 100%; margin: 24px 0; border: 1px solid var(--border); }
.post-body code { background: var(--bg3); padding: 2px 8px; font-family: 'DM Mono', monospace; font-size: 13px; color: var(--accent2); }
.post-body pre { background: var(--bg3); padding: 20px; overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); }

/* === FOOTER === */
#site-footer {
  background: var(--bg2); border-top: 1px solid var(--border); padding: 48px 0 24px;
}
.footer-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 40px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 40px;
}
.footer-logo { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.footer-logo span { color: var(--accent); }
.footer-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }
.footer-col h4 { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a { font-size: 13px; color: var(--muted); transition: color 0.15s; }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1280px; margin: 0 auto; padding: 24px 40px 0;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted);
}

/* === WOOCOMMERCE OVERRIDES === */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info { background: var(--bg2); border-top-color: var(--accent); color: var(--text); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-family: 'Playfair Display', serif; color: var(--white); }
.woocommerce ul.products li.product .price { color: var(--accent2); font-family: 'DM Mono', monospace; }
.woocommerce ul.products li.product { background: var(--bg2); border: 1px solid var(--border); padding: 24px; }
.woocommerce ul.products li.product:hover { border-color: var(--accent); }
.woocommerce a.button, .woocommerce button.button { background: var(--accent); color: #fff; font-family: 'DM Sans', sans-serif; font-weight: 600; }
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--accent2); color: #fff; }

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-main { animation: fadeInUp 0.5s ease both; }
.hero-sidebar { animation: fadeInUp 0.5s 0.1s ease both; }
.article-card { animation: fadeInUp 0.4s ease both; }
.product-card { animation: fadeInUp 0.4s ease both; }

/* =====================================================
   RESPONSIVE — MOBILE & TABLET
   ===================================================== */
@media (max-width: 1024px) {
  /* Hero */
  .hero-grid {
    grid-template-columns: 1fr !important;
    padding: 0 24px !important;
  }
  .hero-main {
    border-right: none !important;
    padding-right: 0 !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
    margin-bottom: 32px;
  }
  .hero-sidebar { padding-left: 0 !important; }

  /* Main layout */
  #main-content { grid-template-columns: 1fr !important; gap: 40px; }
  .single-content { grid-template-columns: 1fr !important; }

  /* Products */
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .topbar-markets { gap: 16px; }
}

@media (max-width: 768px) {
  /* Global padding */
  .site-wrapper { padding: 0 16px !important; }
  .topbar-inner { padding: 0 16px !important; }
  .topbar-markets { display: none; }

  /* Nav */
  .nav-inner { padding: 0 16px !important; height: 56px; }
  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 300;
    padding: 16px 0;
    width: 100%;
  }
  .main-nav.open { display: flex !important; }
  .main-nav a {
    height: auto !important;
    line-height: 1.4 !important;
    padding: 12px 20px !important;
    border-bottom: none !important;
    border-left: 2px solid transparent;
    width: 100%;
  }
  .main-nav a:hover { border-left-color: var(--accent); }
  .nav-right { display: none !important; }
  .nav-toggle { display: block !important; }
  .site-logo { margin-right: auto; font-size: 18px; }

  /* Hero strip */
  #hero-strip { padding: 24px 0 0; }
  .hero-grid {
    grid-template-columns: 1fr !important;
    padding: 0 16px !important;
    gap: 0;
  }
  .hero-main {
    border-right: none !important;
    padding-right: 0 !important;
    padding-bottom: 24px;
    margin-bottom: 24px;
  }
  .hero-sidebar { padding-left: 0 !important; padding-bottom: 24px; }
  .hero-title { font-size: 28px !important; letter-spacing: -0.5px; }
  .hero-excerpt { font-size: 14px; }

  /* Main content */
  #main-content {
    grid-template-columns: 1fr !important;
    padding: 24px 16px !important;
    gap: 32px;
  }

  /* Products — single column on mobile */
  .products-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .product-card { padding: 20px; }

  /* Articles */
  .article-card {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .article-thumb {
    width: 100% !important;
    height: 160px !important;
    order: -1;
  }

  /* Sidebar goes below on mobile */
  #sidebar { width: 100%; }

  /* Footer */
  .footer-grid {
    padding: 0 16px !important;
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .footer-bottom {
    padding: 20px 16px 0 !important;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* Single post — FORCE block layout on mobile */
  html body .single-content {
    display: block !important;
    grid-template-columns: none !important;
    padding: 24px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html body .single-content main {
    display: block !important;
    width: 100% !important;
  }
  html body .single-content #sidebar {
    display: block !important;
    width: 100% !important;
    margin-top: 32px !important;
    padding: 0 !important;
  }
  html body .post-title { font-size: 24px !important; }
  html body .post-featured-img { height: 200px !important; object-fit: cover !important; width: 100% !important; }
  html body .post-header { padding-bottom: 16px !important; margin-bottom: 16px !important; }
  html body .post-body { font-size: 15px !important; }
  html body .post-body h2 { font-size: 22px !important; }
  html body .post-body h3 { font-size: 18px !important; }
}

@media (max-width: 480px) {
  html body .hero-title { font-size: 24px !important; }
  html body .products-grid { grid-template-columns: 1fr !important; }
  .nav-search-form { display: none; }
  .product-badge { font-size: 8px; padding: 2px 6px; }
  .section-head h2 { font-size: 18px; }
  .hero-eyebrow { font-size: 10px; }
  html body .single-content { padding: 16px 12px !important; }
  html body .post-title { font-size: 20px !important; }
}

/* === CATEGORY-BLOGS & ALL SINGLE POST CONFLICT FIX === */
body.category-blogs,
body[class*="category-"],
body[class*="single-format"],
body.single-post {
  background: #0f1117 !important;
  background-color: #0f1117 !important;
  color: #dce3ef !important;
}
body.category-blogs #wrapper,
body.category-blogs #main,
body.category-blogs #page,
body[class*="category-"] #wrapper,
body[class*="category-"] #main,
body.single-post #wrapper,
body.single-post #main {
  background: #0f1117 !important;
  color: #dce3ef !important;
}

/* === FEATURED IMAGE MOBILE FIX === */
.post-featured-img,
.wp-post-image,
img.post-featured-img,
.post-thumbnail img,
.post-thumbnail,
article img:first-of-type {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
}
@media (max-width: 768px) {
  .post-featured-img,
  .wp-post-image,
  img.post-featured-img,
  .post-thumbnail img,
  .post-thumbnail {
    width: 100% !important;
    max-width: 100vw !important;
    height: 220px !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 0 20px 0 !important;
    float: none !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  }
  /* Fix article card thumbnails too */
  .article-thumb img,
  .article-thumb {
    width: 100% !important;
    max-width: 100% !important;
    height: 160px !important;
    object-fit: cover !important;
  }
}

/* === BLACK SCREEN FIX — Force all post text visible === */
.post-body,
.entry-content,
.post-body p,
.post-body li,
.post-body span,
.post-body div {
  color: #dce3ef !important;
  background-color: transparent !important;
}
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
  color: #ffffff !important;
  background-color: transparent !important;
}
/* Fix Gutenberg block backgrounds */
.wp-block-cover,
.wp-block-cover__inner-container,
.wp-block-group,
.wp-block-columns,
.wp-block-column {
  background-color: transparent !important;
  color: #dce3ef !important;
}
/* Fix any white text on white background or black on black */
[style*="color:#fff"],
[style*="color: #fff"],
[style*="color:white"],
[style*="color: white"] { color: #ffffff !important; }
[style*="background:#000"],
[style*="background: #000"],
[style*="background:black"] { background: transparent !important; }

/* === GLOBAL MOBILE OVERFLOW FIX === */
/* Prevents any wide element from breaking mobile layout */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  /* Post content — all elements stay within screen */
  .post-body *,
  .post-body img,
  .post-body iframe,
  .post-body video,
  .post-body table,
  .post-body figure,
  .post-body .wp-block-image,
  .post-body .wp-block-table,
  .post-body .wp-block-embed,
  .post-body .wp-block-cover,
  .post-body pre,
  .entry-content *,
  .entry-content img,
  .entry-content iframe,
  .entry-content table {
    max-width: 100% !important;
    overflow-x: auto !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }
  /* Fix Gutenberg blocks on mobile */
  .wp-block-image img { width: 100% !important; height: auto !important; }
  .wp-block-cover { min-height: 200px !important; }
  .wp-block-table { display: block !important; overflow-x: auto !important; }
  .wp-block-embed__wrapper { overflow: hidden !important; }
  .wp-block-embed__wrapper iframe {
    max-width: 100% !important;
    width: 100% !important;
  }
  /* Fix any floated elements */
  .post-body .alignleft,
  .post-body .alignright {
    float: none !important;
    display: block !important;
    margin: 16px auto !important;
    max-width: 100% !important;
  }
}
