/* blog.css — page-specific styles. Global vars/nav/footer in global.css */
body { background: var(--border-light); }

/* HERO */
.blog-hero { background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 60%, var(--dark-3) 100%); padding: 60px 5%; position: relative; overflow: hidden; }
.blog-hero::before { content: ''; position: absolute; top: -100px; right: -50px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(232,100,42,0.13) 0%, transparent 65%); border-radius: 50%; }
.blog-hero-inner { max-width: 1280px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.hero-label { display: inline-flex; align-items: center; gap: 8px; background: rgba(232,100,42,0.15); border: 1px solid rgba(232,100,42,0.3); color: #FF9A6C; padding: 5px 14px; border-radius: 50px; font-size: 12px; font-weight: 600; margin-bottom: 18px; text-transform: uppercase; letter-spacing: 1px; }
.blog-hero h1 { font-family: 'Sora', sans-serif; font-size: clamp(28px, 4vw, 48px); font-weight: 800; color: white; letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 14px; }
.blog-hero h1 em { color: var(--orange); font-style: normal; }
.blog-hero p { font-size: 16px; color: rgba(255,255,255,0.6); max-width: 520px; margin: 0 auto 32px; font-weight: 300; line-height: 1.7; }

/* Search bar */
.blog-search { display: flex; gap: 0; max-width: 520px; margin: 0 auto; background: white; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-md); }
.blog-search input { flex: 1; padding: 14px 18px; border: none; outline: none; font-size: 14px; font-family: 'DM Sans', sans-serif; color: var(--text); }
.blog-search input::placeholder { color: var(--text-lighter); }
.blog-search button { padding: 12px 22px; background: var(--orange); color: white; border: none; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: background .2s; white-space: nowrap; }
.blog-search button:hover { background: var(--orange-dark); }

/* STATS BAR */
.blog-stats { background: white; border-bottom: 1px solid var(--border); padding: 14px 5%; }
.blog-stats-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.bstat { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-light); }
.bstat strong { color: var(--dark); }

/* MAIN LAYOUT */
.blog-layout { max-width: 1280px; margin: 0 auto; padding: 40px 5%; display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }

/* CATEGORY PILLS */
.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.cpill { padding: 7px 18px; border-radius: 50px; border: 1.5px solid var(--border); font-size: 13px; font-weight: 500; color: var(--text-light); background: white; cursor: pointer; transition: all .2s; text-decoration: none; }
.cpill:hover, .cpill.active { background: var(--orange); border-color: var(--orange); color: white; }

/* FEATURED POST */
.featured-post { background: white; border-radius: var(--radius-lg); overflow: hidden; border: 1.5px solid var(--border); margin-bottom: 28px; display: grid; grid-template-columns: 1fr 1fr; transition: all .25s; text-decoration: none; }
.featured-post:hover { border-color: var(--orange); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.featured-img { background: linear-gradient(135deg, var(--dark), var(--dark-3)); display: flex; align-items: center; justify-content: center; font-size: 72px; min-height: 280px; position: relative; overflow: hidden; }
.featured-img::after { content: 'FEATURED'; position: absolute; top: 16px; left: 16px; background: var(--orange); color: white; padding: 4px 12px; border-radius: 50px; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.featured-content { padding: 32px; }
.post-cat-tag { display: inline-block; background: var(--orange-pale); color: var(--orange-dark); padding: 4px 12px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.featured-content h2 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -0.5px; line-height: 1.3; margin-bottom: 12px; }
.featured-content p { font-size: 14px; color: var(--text-light); line-height: 1.75; margin-bottom: 20px; }
.post-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.post-author { display: flex; align-items: center; gap: 8px; }
.author-av { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 11px; flex-shrink: 0; }
.author-name { font-size: 12px; font-weight: 600; color: var(--dark); }
.post-date, .post-read-time { font-size: 12px; color: var(--text-lighter); }
.read-more-link { display: inline-flex; align-items: center; gap: 6px; color: var(--orange); font-size: 13px; font-weight: 700; margin-top: 16px; }

/* SECTION HEADER */
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-hdr-title { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 800; color: var(--dark); letter-spacing: -0.5px; }
.view-all { font-size: 13px; color: var(--orange); font-weight: 600; text-decoration: none; }
.view-all:hover { text-decoration: underline; }

/* POSTS GRID */
.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 32px; }
.post-card { background: white; border-radius: var(--radius); border: 1.5px solid var(--border); overflow: hidden; transition: all .25s; text-decoration: none; display: flex; flex-direction: column; }
.post-card:hover { border-color: var(--orange); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.post-thumb { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 44px; position: relative; }
.post-thumb.cost { overflow: hidden; background: linear-gradient(135deg, #1A2332, #243044); }
.post-thumb.howto { background: linear-gradient(135deg, #1B4D3E, #2E7D32); }
.post-thumb.local { background: linear-gradient(135deg, #1A237E, #1565C0); }
.post-thumb.seasonal { background: linear-gradient(135deg, #4A148C, #6A1B9A); }
.post-thumb.emergency { background: linear-gradient(135deg, #7F1D1D, #C00000); }
.post-thumb.compare { background: linear-gradient(135deg, #7F6000, #B8860B); }
.post-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.post-body h3 { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--dark); line-height: 1.4; margin-bottom: 8px; letter-spacing: -0.3px; }
.post-body p { font-size: 13px; color: var(--text-light); line-height: 1.7; flex: 1; margin-bottom: 12px; }
.post-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border-light); }
.post-footer-meta { font-size: 11px; color: var(--text-lighter); }
.post-arrow { color: var(--orange); font-size: 16px; font-weight: 700; }

/* LIST VIEW */
.posts-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.post-list-item { background: white; border-radius: var(--radius); border: 1.5px solid var(--border); display: flex; overflow: hidden; transition: all .25s; text-decoration: none; }
.post-list-item:hover { border-color: var(--orange); box-shadow: var(--shadow); transform: translateY(-2px); }
.pli-thumb { width: 140px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.pli-body { flex: 1; padding: 16px 18px; min-width: 0; } /* min-width:0 prevents text blowout */
.pli-body h3 { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 6px; line-height: 1.4; word-wrap: break-word; overflow-wrap: break-word; }
.pli-body p { font-size: 13px; color: var(--text-light); line-height: 1.65; margin-bottom: 10px; }
.pli-meta { display: flex; align-items: center; gap: 14px; }
.pli-meta span { font-size: 11px; color: var(--text-lighter); }
.pli-arrow { padding: 16px; display: flex; align-items: center; color: var(--text-lighter); font-size: 18px; transition: color .2s; }
.post-list-item:hover .pli-arrow { color: var(--orange); }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; }
.ppage { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: white; font-size: 14px; font-weight: 500; color: var(--text-light); cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; }
.ppage:hover { border-color: var(--orange); color: var(--orange); }
.ppage.active { background: var(--orange); border-color: var(--orange); color: white; }

/* SIDEBAR */
.blog-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.scard { background: white; border-radius: var(--radius); border: 1.5px solid var(--border); overflow: hidden; }
.scard-title { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: var(--dark); padding: 16px 18px; border-bottom: 1px solid var(--border-light); }
.scard-body { padding: 16px 18px; }
.popular-list { display: flex; flex-direction: column; }
.popular-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); text-decoration: none; transition: all .2s; }
.popular-item:last-child { border-bottom: none; padding-bottom: 0; }
.popular-item:hover .popular-title { color: var(--orange); }
.pop-num { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 800; color: var(--border); flex-shrink: 0; width: 28px; line-height: 1; }
.popular-title { font-size: 13px; font-weight: 600; color: var(--dark); line-height: 1.4; transition: color .2s; }
.popular-meta { font-size: 11px; color: var(--text-lighter); margin-top: 3px; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 5px 12px; border-radius: 50px; border: 1.5px solid var(--border); font-size: 12px; color: var(--text-light); text-decoration: none; transition: all .2s; }
.tag:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-pale); }
.newsletter-card { background: linear-gradient(135deg, var(--dark), var(--dark-2)); border-radius: var(--radius); padding: 22px; border: none; }
.newsletter-card .scard-title { color: white; background: transparent; border: none; padding: 0 0 14px 0; }
.newsletter-card p { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.65; margin-bottom: 14px; }
.nl-input { width: 100%; padding: 11px 14px; border: 1.5px solid rgba(255,255,255,0.15); border-radius: var(--radius-sm); font-size: 13px; background: rgba(255,255,255,0.08); color: white; outline: none; font-family: 'DM Sans', sans-serif; margin-bottom: 10px; }
.nl-input::placeholder { color: rgba(255,255,255,0.35); }
.nl-input:focus { border-color: var(--orange); }
.nl-btn { width: 100%; padding: 11px; background: var(--orange); color: white; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .2s; }
.nl-btn:hover { background: var(--orange-dark); }
.nl-note { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 8px; text-align: center; }
.trades-cta { background: var(--orange-pale); border: 1.5px solid rgba(232,100,42,0.2); border-radius: var(--radius); padding: 20px; }
.trades-cta-icon { font-size: 32px; margin-bottom: 10px; }
.trades-cta h4 { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.trades-cta p { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 14px; }
.trades-cta a { display: block; text-align: center; padding: 11px; background: var(--orange); color: white; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; text-decoration: none; transition: all .2s; }
.trades-cta a:hover { background: var(--orange-dark); }

/* RESPONSIVE */
@media (max-width: 960px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-img { min-height: 200px; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .blog-stats-inner { gap: 16px; }

  /* Fix: list item — stack image above text, no overlap */
  .post-list-item {
    flex-direction: column;
  }
  .pli-thumb {
    width: 100%;
    height: 140px;
    flex-shrink: 0;
  }
  .pli-arrow { display: none; }

  /* Fix: featured post — single column, image on top */
  .featured-post {
    grid-template-columns: 1fr;
  }
  .featured-img {
    min-height: 160px;
  }
  .featured-content {
    padding: 20px;
  }
  .featured-content h2 {
    font-size: 18px;
  }

  /* Blog hero search — stack on mobile */
  .blog-search {
    flex-direction: column;
    border-radius: var(--radius-sm);
  }
  .blog-search input {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 1px solid var(--border);
  }
  .blog-search button {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 14px;
  }
}
