/* ============================================================
   karrangupta.com — blog / article stylesheet (2026)
   Loaded ON TOP of home.css so it inherits the same tokens,
   nav, footer, buttons and atmosphere. This file only adds the
   article hero + long-form "prose" reading styles.
   ============================================================ */

/* Blog pages have no hero, so keep the nav readable from the top. */
.kg-nav.blog-nav {
  background: rgba(11, 10, 8, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

/* ---------- article hero ---------- */

.article-hero {
  position: relative;
  z-index: 2;
  padding: 148px 0 40px;
}

.article-hero .wrap { max-width: 820px; }

.breadcrumb {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-strong); }
.breadcrumb span { margin: 0 8px; opacity: 0.5; }

.post-title {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.018em;
  font-size: clamp(34px, 5.2vw, 60px);
  max-width: 16ch;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 26px;
  font-size: 14.5px;
  color: var(--muted);
}

.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: 0.7; }
.post-meta strong { color: var(--text); font-weight: 600; }

/* ---------- long-form reading column ---------- */

.article-body { position: relative; z-index: 2; padding: 8px 0 96px; }
.article-body .wrap { max-width: 820px; }

.article-prose {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  color: #d9d4c8;              /* slightly softer than headings for body reading */
}

.article-prose > *:first-child { margin-top: 0; }

.article-prose p { margin: 0 0 1.35em; }

.article-prose h1,
.article-prose h2,
.article-prose h3,
.article-prose h4 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: 1.9em 0 0.6em;
  scroll-margin-top: 96px;    /* so #anchor links don't hide under the fixed nav */
}

/* Body h1s are demoted: the page already has one true <h1> in the hero. */
.article-prose h1,
.article-prose h2 { font-size: clamp(26px, 3.2vw, 34px); }
.article-prose h3 { font-size: clamp(21px, 2.4vw, 25px); }
.article-prose h4,
.article-prose h5 { font-size: 19px; }

.article-prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 169, 78, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.article-prose a:hover { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }

.article-prose ul,
.article-prose ol { margin: 0 0 1.35em; padding-left: 1.4em; }
.article-prose li { margin-bottom: 0.5em; }
.article-prose li::marker { color: var(--accent); }

.article-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.article-prose figure { margin: 2em 0; }
.article-prose figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.article-prose blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--text);
}

.article-prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.6em 0;
}

.article-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

.article-prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 1.6em 0;
}
.article-prose pre code { background: none; border: 0; padding: 0; font-size: 0.9em; }

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 15.5px;
  display: block;
  overflow-x: auto;
}
.article-prose th,
.article-prose td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.article-prose th { color: var(--text); font-weight: 600; }

.article-prose iframe,
.article-prose video {
  max-width: 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 12px;
  margin: 1.8em 0;
}

/* ---------- end-of-article CTA ---------- */

.article-cta {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 72px 0 96px;
}
.article-cta .wrap { max-width: 820px; }
.article-cta h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 14px; }
.article-cta h2 em { font-style: italic; color: var(--accent); }
.article-cta p { color: var(--muted); margin-bottom: 26px; max-width: 52ch; }

/* ---------- TL;DR callout ---------- */

.tldr {
  max-width: 820px;
  margin: 0 0 28px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
}

.tldr-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.tldr ul { margin: 0; padding-left: 1.25em; }
.tldr li { margin-bottom: 0.45em; font-size: 16.5px; line-height: 1.6; color: #d9d4c8; }
.tldr li:last-child { margin-bottom: 0; }
.tldr li::marker { color: var(--accent); }

/* ---------- table of contents ---------- */

.toc {
  max-width: 820px;
  margin: 0 0 40px;
  padding: 20px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.toc-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: 36px;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 8px;
  break-inside: avoid;
  font-size: 15px;
  line-height: 1.45;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.toc a {
  color: #d9d4c8;
  text-decoration: none;
  transition: color 0.15s ease;
}
.toc a:hover { color: var(--accent-strong); }

/* ---------- FAQ (articles + pillar) ---------- */

.article-faq {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 64px 0 72px;
}

.article-faq .wrap { max-width: 820px; }

.article-faq h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  margin-bottom: 28px;
  scroll-margin-top: 96px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 2px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent-strong); }

.faq-item .faq-a { padding: 0 2px 20px; }
.faq-item .faq-a p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.7;
  color: #d9d4c8;
  max-width: 64ch;
}

/* ---------- blog pillar (/blog) ---------- */

.pillar-hero { padding-bottom: 24px; }
.pillar-hero .post-meta span { max-width: 56ch; }

.pillar-section {
  position: relative;
  z-index: 2;
  padding: 28px 0 20px;
}

.pillar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

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

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
  border-color: rgba(227, 169, 78, 0.5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
}

.post-card.is-hidden { display: none; }

.post-thumb {
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-thumb img { filter: none; transform: scale(1.05); }

.post-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 160% at 20% 0%, rgba(227, 169, 78, 0.14) 0%, transparent 60%),
    var(--surface-2);
}

.post-thumb-fallback span {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 500;
  font-style: italic;
  color: var(--accent);
  opacity: 0.85;
}

.post-body { padding: 22px 24px 26px; }

.post-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.post-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--text);
}

.post-card-featured .post-body h3 { font-size: 25px; }

.post-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-body .link-arrow { display: inline-block; font-size: 14.5px; color: var(--accent); }

#feed-sentinel { height: 1px; }

@media (max-width: 900px) {
  .post-grid, .post-grid-featured { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .article-hero { padding-top: 120px; }
  .article-prose { font-size: 17px; }
  .toc ol { columns: 1; }
  .post-grid, .post-grid-featured { grid-template-columns: 1fr; }
}
