/* ============================================================
   RESOURCES — Blog index + article page styles
   ============================================================ */

/* ── Blog hero (dark, full-width featured post) ──────────── */
.blog-hero {
  position: relative;
  background: var(--d-bg);
  padding: calc(var(--nav-h) + 80px) 48px 96px;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 50%, rgba(61,220,164,0.05) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 20% 30%, rgba(90,167,255,0.04) 0%, transparent 65%);
  pointer-events: none;
}

.blog-hero-inner {
  position: relative;
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: center;
  min-height: 380px;
}

.blog-hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s ease;
}
.blog-back-link:hover {
  color: rgba(255,255,255,0.85);
}
.blog-back-link svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.blog-back-link:hover svg {
  transform: translateX(-3px);
}

.blog-hero-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--d-muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-hero-kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--green);
  flex-shrink: 0;
}

.blog-hero-title {
  font-family: var(--heading);
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  color: var(--d-fg);
  margin-bottom: 22px;
}

.blog-hero-excerpt {
  font-size: 15px;
  line-height: 1.65;
  color: var(--d-muted);
  max-width: 52ch;
  margin-bottom: 36px;
}

.blog-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--d-fg);
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding-bottom: 3px;
  transition: color 0.18s, border-color 0.18s;
  width: fit-content;
}

.blog-hero-cta:hover {
  color: var(--green);
  border-color: var(--green);
}

.blog-hero-cta .arr {
  display: inline-block;
  transition: transform 0.18s;
}

.blog-hero-cta:hover .arr {
  transform: translateX(3px);
}

/* Hero image */
.blog-hero-img {
  position: relative;
  border: 1px solid var(--d-border-strong);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}

.blog-hero-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.blog-hero-img:hover img {
  transform: scale(1.02);
}

/* Corner brackets on hero image */
.blog-hero-img .bk {
  color: rgba(255,255,255,0.35);
  width: 16px; height: 16px;
  z-index: 2;
}


/* ── Articles grid section ───────────────────────────────── */
.articles-section {
  position: relative;
  background: var(--l-bg);
  padding: 80px 48px 96px;
}

.articles-section-head {
  max-width: 1360px;
  margin: 0 auto 56px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.articles-section-title {
  font-family: var(--heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--l-fg);
}

.articles-view-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--l-muted);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding-bottom: 2px;
  transition: color 0.18s, border-color 0.18s;
}

.articles-view-all:hover {
  color: var(--l-fg);
  border-color: rgba(0,0,0,0.4);
}

.articles-grid {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: stretch;
}

.articles-grid > li {
  display: flex;
}


/* ── Article card ────────────────────────────────────────── */
.article-card {
  background: var(--l-card);
  border: 1px solid var(--l-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-shadow: 0 2px 18px rgba(0,0,0,0.055);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  box-shadow: 0 8px 36px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.article-card-img {
  position: relative;
  margin: 16px 16px 0;
  border: 1px solid var(--l-border);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #e8e8e8;
  flex-shrink: 0;
}

.article-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.article-card:hover .article-card-img img {
  transform: scale(1.04);
}

/* corner brackets on card image */
.article-card-img .bk {
  color: rgba(0,0,0,0.22);
  width: 10px; height: 10px;
  z-index: 2;
}

.article-card-body {
  padding: 20px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.article-card-title {
  font-family: var(--heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--l-fg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-excerpt {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--l-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--l-border);
  margin-top: auto;
  gap: 12px;
}

.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--l-fg);
  border-bottom: 1px solid rgba(0,0,0,0.2);
  padding-bottom: 2px;
  transition: color 0.18s, border-color 0.18s;
}

.read-more-link .arr {
  display: inline-block;
  transition: transform 0.18s;
}

.article-card:hover .read-more-link {
  color: var(--green-deep);
  border-color: var(--green-deep);
}

.article-card:hover .read-more-link .arr {
  transform: translateX(2px);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--l-dim);
  flex-shrink: 0;
}

.article-meta-sep {
  opacity: 0.4;
}


/* ── Article page layout ─────────────────────────────────── */
.article-section {
  background: var(--l-bg);
  padding: 72px 48px 80px;
}

.article-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.toc-heading {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--l-muted);
  margin-bottom: 16px;
}

.toc-divider {
  height: 1px;
  background: var(--l-border);
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-list a {
  display: block;
  font-size: 13px;
  color: var(--l-muted);
  padding: 5px 0;
  transition: color 0.18s;
  line-height: 1.4;
}

.toc-list a:hover {
  color: var(--l-fg);
}

.toc-list a.is-active {
  color: var(--green-deep);
  font-weight: 500;
}

.toc-sub {
  list-style: none;
  padding-left: 14px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-sub a {
  font-size: 12.5px;
  color: var(--l-dim);
}

.share-block {
  padding-top: 8px;
  border-top: 1px solid var(--l-border);
}

.share-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--l-muted);
  margin-bottom: 14px;
}

.share-icons {
  display: flex;
  gap: 10px;
}

.share-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--l-border);
  border-radius: 4px;
  color: var(--l-muted);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  flex-shrink: 0;
}

.share-icon:hover {
  color: var(--l-fg);
  border-color: var(--l-border-strong);
  background: rgba(0,0,0,0.03);
}

.share-icon svg {
  width: 15px; height: 15px;
  fill: currentColor;
}

/* Article body content */
.article-body {
  max-width: 72ch;
  min-width: 0;          /* prevent grid blowout — lets wide children scroll instead of expanding the column */
  color: var(--l-fg);
}

.article-body h1 {
  font-family: var(--heading);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 32px;
}

.article-body h2 {
  font-family: var(--heading);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 52px;
  margin-bottom: 18px;
  color: var(--l-fg);
}

.article-body h3 {
  font-family: var(--heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--l-fg);
}

.article-body p {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--l-muted);
  margin-bottom: 22px;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body ul, .article-body ol {
  padding-left: 22px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-body li {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--l-muted);
}

.article-body strong {
  color: var(--l-fg);
  font-weight: 600;
}

.article-body .article-img {
  margin: 40px 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--l-border);
  aspect-ratio: 16 / 8;
}

.article-body .article-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.article-body .article-divider {
  height: 1px;
  background: var(--l-border);
  margin: 52px 0;
}

/* Article tables — Ghost RTF output */
.article-body table {
  width: fit-content;    /* compress to content — no forced full-width */
  max-width: 100%;       /* never spill out of the article column */
  border-collapse: separate;
  border-spacing: 0;
  margin: 36px 0;
  font-size: 14px;
  line-height: 1.58;
  display: block;
  overflow-x: auto;      /* scroll only when content is actually wider */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--l-border);
  border-radius: 8px;
}

.article-body thead {
  background: rgba(0,0,0,0.028);
}

.article-body th {
  padding: 11px 18px;
  text-align: left;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--l-fg);
  border-bottom: 1px solid var(--l-border);
  border-right: 1px solid var(--l-border);
  white-space: nowrap;
}

.article-body th:last-child {
  border-right: none;
}

/* round the top corners of first/last header cells */
.article-body thead tr:first-child th:first-child { border-top-left-radius: 7px; }
.article-body thead tr:first-child th:last-child  { border-top-right-radius: 7px; }

.article-body td {
  padding: 10px 18px;
  color: var(--l-muted);
  border-bottom: 1px solid var(--l-border);
  border-right: 1px solid var(--l-border);
  vertical-align: top;
}

.article-body td:last-child {
  border-right: none;
}

.article-body tr:last-child td {
  border-bottom: none;
}

/* round bottom corners of last-row cells */
.article-body tbody tr:last-child td:first-child { border-bottom-left-radius: 7px; }
.article-body tbody tr:last-child td:last-child  { border-bottom-right-radius: 7px; }

.article-body tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.018);
}

.article-body tbody tr:hover {
  background: rgba(61,220,164,0.04);
}

/* first column as label — slightly muted + mono */
.article-body td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--l-fg);
  white-space: nowrap;
}

/* Article metadata row (published, read time) */
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--l-border);
}

.article-meta-row .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--l-muted);
}

.article-meta-row .meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--l-border);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--l-muted);
}


/* ── Continue reading section ────────────────────────────── */
.continue-reading-section {
  position: relative;
  background: var(--l-bg-2);
  padding: 72px 48px 88px;
  border-top: 1px solid var(--l-border);
}

.continue-reading-head {
  max-width: 1360px;
  margin: 0 auto 48px;
  text-align: center;
}

.continue-reading-title {
  font-family: var(--heading);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--l-fg);
}


/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .blog-hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-layout {
    grid-template-columns: 240px 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding: calc(var(--nav-h) + 48px) 24px 64px;
  }

  .blog-hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 32px;
  }

  .blog-hero-img {
    aspect-ratio: 16 / 9;
    order: 1;
  }

  .blog-hero-body {
    order: 0;
  }

  .articles-section {
    padding: 56px 24px 64px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-section {
    padding: 48px 24px 64px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .article-sidebar {
    position: static;
    display: none; /* collapsed on mobile — TOC hidden */
  }

  .continue-reading-section {
    padding: 56px 24px 72px;
  }

  .continue-reading-section .articles-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .blog-hero-title {
    font-size: 1.7rem;
  }
}


/* ── Blog pagination ─────────────────────────────────────── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 64px;
  padding-bottom: 8px;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--l-border);
  border-radius: 5px;
  background: transparent;
  color: var(--l-muted);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
  line-height: 1;
}

.pg-btn:hover:not(:disabled):not(.pg-active) {
  color: var(--l-fg);
  border-color: var(--l-border-strong);
  background: rgba(0,0,0,0.03);
}

.pg-btn.pg-active {
  background: var(--l-fg);
  color: var(--l-bg);
  border-color: var(--l-fg);
  font-weight: 600;
  cursor: default;
}

.pg-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pg-prev, .pg-next {
  font-size: 15px;
}

.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 38px;
  color: var(--l-dim);
  font-family: var(--mono);
  font-size: 13px;
  user-select: none;
}

@media (max-width: 480px) {
  .pg-btn { min-width: 34px; height: 34px; font-size: 12px; }
  .blog-pagination { gap: 4px; }
}
