/* ===========================================================
   Fives Dev — Blog / Insights styles
   Extends the existing style.css tokens (--primary, --accent, etc.)
   Load AFTER css/style.css
   =========================================================== */

:root{
  --blog-radius: 18px;
  --blog-shadow-sm: 0 1px 2px rgba(18,74,61,.04), 0 1px 3px rgba(18,74,61,.05);
  --blog-shadow-md: 0 4px 12px rgba(18,74,61,.06), 0 12px 32px -12px rgba(18,74,61,.14);
  --blog-shadow-lg: 0 10px 24px rgba(18,74,61,.08), 0 28px 60px -20px rgba(18,74,61,.22);
  --blog-line: #E7EDE9;
  --blog-ink-soft: #3B4744;
}

/* ------ Blog hero ------ */
.blog-hero{
  padding: 72px 0 40px;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(242,183,5,.10), transparent 60%),
    radial-gradient(900px 400px at 10% -20%, rgba(28,110,88,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-soft), #fff 90%);
  border-bottom: 1px solid var(--blog-line);
}
.blog-hero .eyebrow{
  display:inline-block;
  font-family: var(--font-sans);
  font-size:13px; font-weight:600;
  color: var(--primary-light);
  letter-spacing:.14em; text-transform:uppercase;
  background:#fff; border:1px solid var(--blog-line);
  padding:6px 12px; border-radius:999px;
  margin-bottom:18px;
}
.blog-hero h1{
  font-size: clamp(38px, 6vw, 64px);
  line-height:1.02;
  letter-spacing:-.02em;
  margin:0 0 16px;
  color: var(--primary);
}
.blog-hero h1 .accent{ color: var(--accent-dark); }
.blog-hero .lead{
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 32px;
}

/* Search + chips */
.blog-search{
  display:flex; align-items:center; gap:10px;
  background:#fff;
  border:1px solid var(--blog-line);
  border-radius:999px;
  padding:8px 8px 8px 20px;
  max-width:560px;
  box-shadow: var(--blog-shadow-sm);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.blog-search:focus-within{
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(28,110,88,.12);
}
.blog-search svg{ flex-shrink:0; color: var(--muted); }
.blog-search input{
  flex:1; border:0; outline:0; background:transparent;
  font: 500 16px/1.4 var(--font-sans);
  color: var(--text);
  padding: 8px 0;
}
.blog-search input::placeholder{ color: #9AA6A1; }
.blog-search .clear-btn{
  border:0; background:var(--bg-soft);
  width:34px; height:34px; border-radius:999px;
  display:none; align-items:center; justify-content:center;
  color: var(--muted); cursor:pointer;
}
.blog-search.has-value .clear-btn{ display:inline-flex; }

.chip-row{
  display:flex; flex-wrap:wrap; gap:8px;
  margin-top:22px;
}
.chip{
  border:1px solid var(--blog-line);
  background:#fff;
  padding:8px 14px;
  border-radius:999px;
  font: 600 14px/1 var(--font-sans);
  color: var(--blog-ink-soft);
  cursor:pointer;
  transition: all .15s ease;
}
.chip:hover{ border-color: var(--primary-light); color: var(--primary); }
.chip.is-active{
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
}

/* ------ Featured article ------ */

/* Category badge */
.cat-badge{
  display:inline-flex; align-items:center; gap:6px;
  background: #EAF3EE;
  color: var(--primary);
  border:1px solid #D6E7DD;
  font: 700 12px/1 var(--font-sans);
  letter-spacing:.10em; text-transform:uppercase;
  padding:7px 11px; border-radius:999px;
}

/* Meta line: author • date • reading time */
.meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  color: var(--muted);
  font-size:14px;
}
.meta .dot{ opacity:.5; }
.meta a{ color: var(--blog-ink-soft); text-decoration:none; font-weight:600; }
.meta a:hover{ color: var(--primary); text-decoration:underline; text-underline-offset:2px; }

/* ------ Blog grid ------ */
.grid-wrap{ padding: 32px 0 80px; }
.grid-head{
  display:flex; align-items:end; justify-content:space-between;
  margin-bottom:24px; gap:16px; flex-wrap:wrap;
}
.grid-head h2{
  font-size: clamp(22px, 2.4vw, 28px);
  margin:0; color: var(--primary);
}
.grid-head .count{ color: var(--muted); font-size:14px; }

.article-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}
.article-card{
  background:#fff;
  border:1px solid var(--blog-line);
  border-radius: var(--blog-radius);
  overflow:hidden;
  display:flex; flex-direction:column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.article-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--blog-shadow-md);
  border-color: #D6E1DA;
}
.article-card .media{
  aspect-ratio: 16 / 10;
  overflow:hidden; background:#EEF2EF;
}
.article-card .media img{
  width:100%; height:100%; object-fit:cover; display:block;
  transition: transform .4s ease;
}
.article-card:hover .media img{ transform: scale(1.04); }
.article-card .body{
  padding: 22px 22px 24px;
  display:flex; flex-direction:column; gap:12px; flex:1;
}
.article-card h3{
  font-size: 19px; line-height:1.3; margin:0;
  letter-spacing:-.005em;
}
.article-card h3 a{ color: var(--primary); text-decoration:none; }
.article-card h3 a:hover{ color: var(--primary-light); }
.article-card .excerpt{
  color: var(--muted); font-size: 14.5px; margin:0;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
  overflow:hidden;
}
.article-card .continue{
  margin-top:auto;
  align-self:flex-start;
  color: var(--primary-light);
  font-weight:600; font-size:14px;
  text-decoration:none;
}
.article-card .continue:hover{ color: var(--primary); }
.article-card .continue::after{
  content:" →"; transition: transform .2s ease; display:inline-block;
}
.article-card:hover .continue::after{ transform: translateX(3px); }

/* Empty state */
.empty-state{
  grid-column: 1 / -1;
  text-align:center;
  padding: 64px 24px;
  border: 1px dashed var(--blog-line);
  border-radius: var(--blog-radius);
  background: var(--bg-soft);
  color: var(--muted);
}
.empty-state strong{ color: var(--primary); display:block; font-size:18px; margin-bottom:6px; }

/* ==============================================
   ARTICLE PAGE
   ============================================== */
.reading-progress{
  position: fixed; top:0; left:0; height:3px; width:0%;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  z-index:100; transition: width .1s linear;
}
.article-hero{
  padding: 48px 0 24px;
  background: linear-gradient(180deg, var(--bg-soft), #fff 95%);
}
.article-hero .cat-badge{ margin-bottom:18px; }
.article-hero h1{
  font-size: clamp(30px, 4.5vw, 48px);
  line-height:1.1; letter-spacing:-.02em;
  max-width: 22ch; margin:0 0 18px;
}
.article-hero .meta{ font-size:15px; }
.article-cover{
  max-width: var(--maxw); margin: 8px auto 0; padding: 0 20px;
}
.article-cover img{
  width:100%; border-radius: var(--blog-radius);
  aspect-ratio: 16 / 8; object-fit: cover; display:block;
  box-shadow: var(--blog-shadow-md);
}
.article-body-wrap{ padding: 48px 0 32px; }
.article-layout{
  display:grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
}
.toc{
  position: sticky; top: 92px; align-self:flex-start;
  font-size: 14px;
  border-left: 2px solid var(--blog-line);
  padding-left: 16px;
}
.toc h4{
  font: 700 12px/1 var(--font-sans);
  color: var(--muted); letter-spacing:.14em; text-transform:uppercase;
  margin:0 0 10px;
}
.toc a{
  display:block; color: var(--blog-ink-soft); text-decoration:none;
  padding: 6px 0; line-height:1.35;
}
.toc a:hover{ color: var(--primary); }

.article-content{
  max-width: 68ch;
  font-size: 18px; line-height: 1.75;
  color: var(--text);
}
.article-content h2{
  font-size: 28px; margin: 40px 0 14px; color: var(--primary);
  letter-spacing:-.01em;
}
.article-content h3{ font-size: 22px; margin: 32px 0 10px; color: var(--primary); }
.article-content p{ margin: 0 0 18px; }
.article-content p.lede{
  font-size: 21px; line-height: 1.6; font-weight: 500;
  color: var(--blog-ink-soft); margin: 0 0 28px;
  padding-left: 16px; border-left: 3px solid var(--accent);
}
.article-content strong{ color: var(--text); font-weight: 700; }
.article-content h2:first-child{ margin-top: 8px; }
.article-content ul, .article-content ol{ padding-left: 22px; margin: 0 0 18px; }
.article-content li{ margin-bottom: 8px; }
.article-content blockquote{
  margin: 24px 0; padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 12px 12px 0;
  color: var(--blog-ink-soft); font-style: italic;
}
.article-content a{ color: var(--primary-light); text-underline-offset: 3px; }

/* Share bar */
.share-bar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin: 36px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--blog-line);
  border-radius: 14px;
  background: #fff;
}
.share-bar span{ font: 600 14px/1 var(--font-sans); color: var(--muted); margin-right:4px; }
.share-btn{
  width:38px; height:38px; border-radius:999px;
  border:1px solid var(--blog-line); background:#fff;
  color: var(--primary); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  transition: all .15s ease;
}
.share-btn:hover{ background: var(--primary); color:#fff; border-color: var(--primary); }

/* Prev / Next */
.prev-next{
  display:grid; grid-template-columns: 1fr 1fr; gap:16px;
  margin: 24px 0 40px;
}
.prev-next a{
  display:block; padding:18px 20px;
  border:1px solid var(--blog-line); border-radius: 14px;
  background:#fff; text-decoration:none; color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
}
.prev-next a:hover{ border-color: var(--primary-light); transform: translateY(-2px); }
.prev-next .kicker{
  font: 600 12px/1 var(--font-sans);
  color: var(--muted); letter-spacing:.12em; text-transform:uppercase;
  margin-bottom:6px;
}
.prev-next .title{ color: var(--primary); font-weight:600; }
.prev-next .next{ text-align:right; }

/* Related */
.related-wrap{ padding: 8px 0 64px; }
.related-wrap h2{
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 0 0 24px; color: var(--primary);
}

/* Newsletter box */
.newsletter{
  margin: 24px 0;
  padding: 32px;
  border-radius: var(--blog-radius);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(242,183,5,.16), transparent 60%),
    linear-gradient(135deg, var(--primary), var(--primary-light));
  color:#fff;
}
.newsletter h3{ color:#fff; font-size:22px; margin:0 0 8px; }
.newsletter p{ color: rgba(255,255,255,.85); margin: 0 0 18px; max-width: 52ch; }
.newsletter form{ display:flex; gap:10px; flex-wrap:wrap; }
.newsletter input{
  flex:1; min-width: 220px;
  padding: 12px 16px; border-radius:999px; border:0;
  font: 500 15px/1.3 var(--font-sans); background:#fff; color: var(--text);
}
.newsletter input:focus{ outline: 3px solid var(--accent); }
.newsletter button{
  padding: 12px 22px; border-radius:999px; border:0;
  background: var(--accent); color:#231a00;
  font: 700 15px/1 var(--font-sans); cursor:pointer;
  transition: background .15s ease;
}
.newsletter button:hover{ background: var(--accent-dark); color:#fff; }

/* Comments UI */
.comments{
  margin-top: 24px; padding: 28px;
  border:1px solid var(--blog-line); border-radius: var(--blog-radius);
  background:#fff;
}
.comments h3{ margin:0 0 14px; color: var(--primary); font-size:20px; }
.comments textarea{
  width:100%; min-height:100px; padding:12px 14px;
  border:1px solid var(--blog-line); border-radius: 12px;
  font: 400 15px/1.5 var(--font-sans); resize:vertical;
  color: var(--text); background: var(--bg-soft);
}
.comments textarea:focus{ outline:0; border-color: var(--primary-light); background:#fff; }
.comments .comment-actions{ display:flex; justify-content:flex-end; margin-top:10px; }
.comment-list{ list-style:none; padding:0; margin: 20px 0 0; }
.comment-item{
  padding:14px 0; border-top:1px solid var(--blog-line);
  display:flex; gap:12px;
}
.comment-avatar{
  width:38px; height:38px; border-radius:999px;
  background: var(--bg-soft);
  display:flex; align-items:center; justify-content:center;
  color: var(--primary); font-weight:700;
}
.comment-item .name{ font-weight:600; color: var(--primary); }
.comment-item .when{ color: var(--muted); font-size:13px; margin-left:8px; }
.comment-item p{ margin: 4px 0 0; color: var(--blog-ink-soft); font-size:15px; }

/* ==============================================
   AUTHOR PAGE
   ============================================== */
.social-links{ display:flex; gap:10px; }
.social-links a{
  width:38px; height:38px; border-radius:999px;
  border:1px solid var(--blog-line); background:#fff;
  color: var(--primary);
  display:inline-flex; align-items:center; justify-content:center;
  transition: all .15s ease; text-decoration:none;
}
.social-links a:hover{ background: var(--primary); color:#fff; border-color: var(--primary); }

.expertise-tags{ display:flex; flex-wrap:wrap; gap:8px; }
.expertise-tags span{
  background:#fff; border:1px solid var(--blog-line);
  padding:8px 14px; border-radius:999px;
  font: 600 13px/1 var(--font-sans); color: var(--blog-ink-soft);
}
.mini-list{ list-style:none; padding:0; margin:0; }
.mini-list li{
  padding:12px 0; border-bottom:1px solid var(--blog-line);
  display:flex; justify-content:space-between; gap:16px;
}
.mini-list li:last-child{ border-bottom:0; }
.mini-list a{
  color: var(--primary); text-decoration:none; font-weight:600; font-size:15px;
}
.mini-list a:hover{ color: var(--primary-light); }
.mini-list .when{ color: var(--muted); font-size:13px; flex-shrink:0; }

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 900px){
  .article-layout{ grid-template-columns: 1fr; gap: 24px; }
  .toc{ position: static; border-left:0; padding-left:0;
        border-top:1px solid var(--blog-line); border-bottom:1px solid var(--blog-line);
        padding: 14px 0; }
  .prev-next{ grid-template-columns: 1fr; }
  .prev-next .next{ text-align:left; }
}
@media (max-width: 560px){
  .blog-hero{ padding: 48px 0 32px; }
  .article-content{ font-size: 17px; }
  /* Stop grid children from forcing the page wider than a 320px phone. */
  .article-layout > *{ min-width: 0; }
  .article-content{ overflow-wrap: anywhere; }
  .article-content pre,
  .article-content table{ max-width: 100%; overflow-x: auto; display: block; }
}

/* Focus states for a11y */
.chip:focus-visible,
.share-btn:focus-visible,
.social-links a:focus-visible,
.blog-search input:focus-visible,
.newsletter input:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

