/* ==========================================
   BLOG PAGE styles
   ========================================== */

.blog-body {
  background: var(--bg);
  min-height: 100vh;
}

/* Ambient background (replaces 3D scene for blog) */
.blog-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
}
.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,184,158,0.55) 0%, transparent 70%);
  top: -100px;
  left: -120px;
}
.orb-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0,131,116,0.45) 0%, transparent 70%);
  top: 30%;
  right: -200px;
}
.orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(94,234,212,0.3) 0%, transparent 70%);
  bottom: 0;
  left: 30%;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,184,158,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,184,158,0.06) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  opacity: 0.6;
}

/* Active nav link */
.nav-links a.active {
  color: #fff;
  background: rgba(0,184,158,0.15);
}

/* ==========================================
   HERO
   ========================================== */
.blog-hero {
  position: relative;
  z-index: 2;
  padding: 160px 0 60px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-dim);
  font-size: 13px;
  font-family: var(--mono);
  margin-bottom: 26px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .2s, background .2s, border-color .2s;
}
.back-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
  border-color: var(--border-strong);
}
.blog-title {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 600;
  color: #fff;
  margin: 0 0 22px;
  text-wrap: balance;
}
.blog-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--teal-2);
}
.blog-lede {
  font-size: 19px;
  color: var(--ink-dim);
  max-width: 60ch;
  margin: 0 0 40px;
  line-height: 1.55;
}

/* Toolbar */
.blog-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 380px;
}
.search svg {
  position: absolute;
  left: 16px;
  color: var(--ink-mute);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--ink-mute); }
.search input:focus {
  border-color: var(--teal-2);
  background: rgba(255,255,255,0.06);
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all .2s ease;
}
.chip:hover {
  color: #fff;
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal-2);
  box-shadow: 0 8px 24px -10px rgba(0,131,116,0.7);
}

/* ==========================================
   SECTIONS
   ========================================== */
.blog-section {
  position: relative;
  z-index: 2;
  padding: 40px 0;
}
.blog-section.pb { padding-bottom: 100px; }

.section-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.bar-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
}
.bar-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

/* ==========================================
   FEATURED ARTICLE
   ========================================== */
.featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0,131,116,0.12) 0%, rgba(0,184,158,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 26px;
  margin-bottom: 80px;
  backdrop-filter: blur(10px);
}
.feat-thumb {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 16/10;
  display: block;
}
.feat-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--teal-2);
  color: #022826;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
}
.feat-meta { padding: 8px 16px; }
.feat-tags { display: flex; gap: 6px; margin-bottom: 14px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,184,158,0.12);
  border: 1px solid rgba(0,184,158,0.25);
  color: var(--teal-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.feat-meta h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 14px;
  color: #fff;
  text-wrap: balance;
}
.feat-meta h2 a { color: #fff; transition: color .2s; }
.feat-meta h2 a:hover { color: var(--teal-3); }
.feat-meta p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 22px;
  max-width: 50ch;
}
.feat-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.read-link {
  font-size: 14px;
  color: var(--teal-2);
  font-weight: 500;
  transition: color .2s;
}
.read-link:hover { color: var(--teal-3); }

/* ==========================================
   AUTHOR
   ========================================== */
.author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #00b89e, #008374);
  border: 1px solid var(--border-strong);
  position: relative;
}
.avatar::after {
  content: attr(data-letter, 'O');
}
.a1 { background: linear-gradient(135deg, #5eead4, #008374); }
.a2 { background: linear-gradient(135deg, #00b89e, #042e2a); }
.a3 { background: linear-gradient(135deg, #34d399, #064e3b); }

.author > div { display: flex; flex-direction: column; line-height: 1.3; }
.author-name { font-size: 13px; color: #fff; font-weight: 500; }
.author-name.small { font-size: 13px; color: var(--ink-dim); }
.author-date { font-size: 12px; color: var(--ink-mute); font-family: var(--mono); }

/* ==========================================
   POST GRID
   ========================================== */
.posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.post {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s ease;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
}
.post:hover {
  transform: translateY(-4px);
  border-color: rgba(0,184,158,0.3);
}
.post-thumb {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  display: block;
  border-bottom: 1px solid var(--border);
}
.post-meta { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.post-meta .tag { align-self: flex-start; margin-bottom: 12px; }
.post-meta h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: #fff;
  text-wrap: balance;
}
.post-meta h3 a { color: #fff; transition: color .2s; }
.post-meta h3 a:hover { color: var(--teal-3); }
.post-meta p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 18px;
  flex: 1;
}
.post-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--mono);
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.post-foot .dot { opacity: 0.4; }

/* ==========================================
   THUMBNAIL BUILDER
   ========================================== */
.th-window {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.th-mac {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.th-mac span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.th-mac span:nth-child(1) { background: #ff5f57; }
.th-mac span:nth-child(2) { background: #ffbd2e; }
.th-mac span:nth-child(3) { background: #28c941; }
.th-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
}
.th-icon {
  font-size: 42px;
  filter: drop-shadow(0 0 24px rgba(255,255,255,0.4));
  color: #fff;
}
.th-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 70%;
  max-width: 280px;
}
.th-bars div {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
}
.th-bars div:nth-child(1) { width: 100%; }
.th-bars div:nth-child(2) { width: 80%; background: rgba(255,255,255,0.3); }
.th-bars div:nth-child(3) { width: 60%; background: rgba(255,255,255,0.3); }
.th-bars div:nth-child(4) { width: 45%; background: rgba(255,255,255,0.18); }
.th-bars div:nth-child(5) { width: 35%; background: rgba(255,255,255,0.12); }

/* per-thumb gradient backgrounds */
.th-feat { background: linear-gradient(135deg, #00b89e 0%, #014a42 100%); }
.th-1 { background: linear-gradient(135deg, #00b89e 0%, #004d44 100%); }
.th-2 { background: linear-gradient(135deg, #5eead4 0%, #0f5e57 100%); }
.th-3 { background: linear-gradient(135deg, #008374 0%, #02201e 100%); }
.th-4 { background: linear-gradient(135deg, #34d399 0%, #064e3b 100%); }
.th-5 { background: linear-gradient(135deg, #2dd4bf 0%, #0f3f3a 100%); }
.th-6 { background: linear-gradient(135deg, #06b6a4 0%, #044e44 100%); }
.th-7 { background: linear-gradient(135deg, #14b89e 0%, #033f37 100%); }
.th-8 { background: linear-gradient(135deg, #5eead4 0%, #064e3b 100%); }
.th-9 { background: linear-gradient(135deg, #00b89e 0%, #022826 100%); }
.th-10 { background: linear-gradient(135deg, #34d399 0%, #014a42 100%); }
.th-11 { background: linear-gradient(135deg, #2dd4bf 0%, #044e44 100%); }
.th-12 { background: linear-gradient(135deg, #5eead4 0%, #033f37 100%); }

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty {
  text-align: center;
  padding: 80px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 22px;
  background: rgba(255,255,255,0.02);
}
.empty-icon {
  font-size: 44px;
  color: var(--teal-2);
  margin-bottom: 14px;
  opacity: 0.7;
}
.empty h3 { font-size: 20px; color: #fff; margin: 0 0 8px; font-weight: 600; }
.empty p { color: var(--ink-dim); margin: 0; }

/* ==========================================
   NEWSLETTER
   ========================================== */
.newsletter {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0,131,116,0.18) 0%, rgba(0,184,158,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 50px;
  backdrop-filter: blur(10px);
}
.newsletter h2 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 14px;
  line-height: 1.15;
  text-wrap: balance;
}
.newsletter h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--teal-2);
}
.newsletter p { color: var(--ink-dim); margin: 0; font-size: 16px; }
.news-form {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.news-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  padding: 12px 18px;
  font-family: var(--sans);
  font-size: 14px;
}
.news-form input::placeholder { color: var(--ink-mute); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 980px) {
  .featured, .newsletter { grid-template-columns: 1fr; gap: 30px; padding: 24px; }
  .posts { grid-template-columns: 1fr 1fr; }
  .feat-meta { padding: 0; }
  .feat-foot { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 620px) {
  .posts { grid-template-columns: 1fr; }
  .news-form { flex-direction: column; border-radius: 18px; }
  .news-form button { width: 100%; justify-content: center; }
  .blog-hero { padding: 130px 0 40px; }
  .newsletter { padding: 30px; }
}
