/* =========================================================
   checkmysetup.online — Blog Stylesheet
   Extends: /style.css design system
   DM Sans + DM Mono · Burgundy accent system
   ========================================================= */

/* ---------- Blog nav link ---------- */
.blog-nav-link {
  color: var(--muted);
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s ease;
}
.blog-nav-link:hover { color: var(--accent); }
.blog-nav-link .sep { margin: 0 3px; opacity: .4; }

/* ---------- Blog index hero ---------- */
.blog-hero {
  padding-block: clamp(80px, 10vw, 140px) clamp(48px, 6vw, 80px);
  background: var(--white);
  border-bottom: 1px solid var(--gray);
}
.blog-hero .eyebrow { margin-bottom: 20px; }
.blog-hero h1 {
  font-size: clamp(2.4rem, 4vw + 0.6rem, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
  font-weight: 700;
  max-width: 18ch;
  margin-bottom: 20px;
}
.blog-hero .lead {
  max-width: 54ch;
  margin: 0;
}

/* ---------- Category filter ---------- */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 32px 0 8px;
}
.category-filter button {
  background: var(--white);
  border: 1.5px solid var(--gray);
  color: var(--muted);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.category-filter button:hover {
  border-color: var(--main);
  color: var(--main);
}
.category-filter button.active {
  background: var(--main);
  border-color: var(--main);
  color: var(--white);
}

/* ---------- Blog grid ---------- */
.blog-section {
  padding-block: clamp(48px, 6vw, 80px);
  background: var(--bg);
  min-height: 40vh;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* ---------- Blog card ---------- */
.blog-card {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .18s ease, box-shadow .18s ease;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(45,33,36,0.08);
  text-decoration: none;
  color: inherit;
}
.blog-card .card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
  padding: 3px 9px 4px;
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  align-self: flex-start;
}
.blog-card .card-title {
  font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--main);
}
.blog-card .card-excerpt {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  flex-grow: 1;
}
.blog-card .card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
}
.blog-card .card-meta .sep { opacity: .4; }
.blog-card .card-read-more {
  font-size: .88rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  transition: gap .15s ease;
}
.blog-card:hover .card-read-more { gap: 7px; }

/* ---------- Featured card ---------- */
.blog-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 40px;
  padding: 36px 40px;
  background: var(--main);
  border-color: var(--main);
  color: var(--bg);
}
.blog-card.featured .card-title { color: var(--bg); }
.blog-card.featured .card-excerpt { color: rgba(245,245,245,.7); }
.blog-card.featured .card-meta { color: rgba(245,245,245,.55); }
.blog-card.featured .card-category {
  background: rgba(255,255,255,.1);
  color: #f0c6d0;
}
.blog-card.featured .card-read-more { color: #f0c6d0; }
.blog-card.featured .featured-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  border-radius: 4px;
  padding: 2px 9px 3px;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.featured-left {
  flex: 1.4;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.featured-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
@media (max-width: 720px) {
  .blog-card.featured {
    flex-direction: column;
    padding: 28px;
    gap: 20px;
  }
}

/* ---------- No posts message ---------- */
.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Post layout ---------- */
.post-hero {
  padding-top: clamp(80px, 10vw, 130px);
  padding-bottom: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray);
}
.post-hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  padding-bottom: clamp(36px, 5vw, 60px);
}

.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.post-breadcrumb a { color: var(--muted); transition: color .15s; }
.post-breadcrumb a:hover { color: var(--accent); }
.post-breadcrumb .sep { opacity: .4; }

.post-header { max-width: 780px; }
.post-header .post-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
  padding: 4px 11px 5px;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 16px;
}
.post-header h1 {
  font-size: clamp(2rem, 3.5vw + 0.5rem, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.038em;
  font-weight: 700;
  margin-bottom: 20px;
  max-width: 22ch;
}
.post-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .88rem;
  color: var(--muted);
  padding-bottom: 2px;
}
.post-byline .author { font-weight: 600; color: var(--main); }
.post-byline .sep { opacity: .35; }

/* ---------- Post body layout ---------- */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) var(--gutter);
  align-items: start;
}
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-toc { display: none; }
}

/* ---------- Table of contents ---------- */
.post-toc {
  position: sticky;
  top: 90px;
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 20px 22px;
}
.post-toc-title {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.post-toc nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.post-toc nav ul li a {
  display: block;
  font-size: .84rem;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1.35;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.post-toc nav ul li a:hover,
.post-toc nav ul li a.active {
  background: var(--tag-bg);
  color: var(--accent);
}

/* ---------- Post body prose ---------- */
.post-body {
  min-width: 0;
  max-width: 720px;
}
.post-body h2 {
  font-size: clamp(1.4rem, 1.5vw + 1rem, 1.95rem);
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.15;
  border-bottom: 1px solid var(--gray);
  padding-bottom: 12px;
  margin-top: 52px;
  margin-bottom: 20px;
  scroll-margin-top: 90px;
}
.post-body h2:first-child { margin-top: 0; }
.post-body h3 {
  font-size: clamp(1.1rem, 0.7vw + 0.9rem, 1.4rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 36px;
  margin-bottom: 12px;
  scroll-margin-top: 90px;
}
.post-body h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 24px;
  margin-bottom: 8px;
}
.post-body p {
  line-height: 1.65;
  margin-top: 0;
  margin-bottom: 18px;
  color: var(--main);
}
.post-body ul,
.post-body ol {
  padding-left: 22px;
  margin-bottom: 18px;
  line-height: 1.65;
}
.post-body li { margin-bottom: 6px; }
.post-body li p { margin-bottom: 0; }
.post-body strong { font-weight: 700; }
.post-body em { font-style: italic; }
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity .15s;
}
.post-body a:hover { opacity: .75; }
.post-body code {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 1px 4px;
  border-radius: 3px;
}
.post-body pre {
  background: #1e1a1b;
  color: #f0e8ea;
  padding: 20px 22px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: .88rem;
  line-height: 1.55;
}
.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
}
.post-body blockquote p { margin-bottom: 0; color: inherit; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: .92rem;
}
.post-body th {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray);
}
.post-body td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray);
  color: var(--main);
}
.post-body tr:last-child td { border-bottom: none; }
.post-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 24px 0;
  display: block;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--gray);
  margin: 36px 0;
}

/* ---------- Callout blocks ---------- */
.post-callout {
  background: var(--tag-bg);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.post-callout .callout-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.post-callout .callout-body {
  font-size: .92rem;
  color: var(--tag-text);
  line-height: 1.55;
}
.post-callout .callout-body p { margin: 0; color: inherit; }
.post-callout.callout-warning { border-left-color: #b85c00; background: #fdf3e8; }
.post-callout.callout-warning .callout-body { color: #7a3d00; }

/* ---------- Post tags ---------- */
.post-footer {
  padding: clamp(20px, 3vw, 32px) 0 0;
  margin-top: clamp(36px, 5vw, 56px);
  border-top: 1px solid var(--gray);
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  align-items: center;
}
.post-tags .tags-label {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin-right: 4px;
}
.post-tags .tag-pill {
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .15s;
}
.post-tags .tag-pill:hover { background: var(--gray); color: var(--main); }

/* ---------- Post nav (prev/next) ---------- */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--gray);
}
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 45%;
  text-decoration: none;
  color: inherit;
  padding: 12px 0;
}
.post-nav a:hover .nav-post-title { color: var(--accent); }
.post-nav .nav-direction {
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-nav .nav-post-title {
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--main);
  transition: color .15s;
}
.post-nav .next-link { text-align: right; align-items: flex-end; }

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color .15s;
}
.back-to-blog:hover { color: var(--accent); }

/* ---------- ToC scroll spy ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- RTL support ---------- */
[dir="rtl"] .post-layout { direction: rtl; }
[dir="rtl"] .post-body blockquote { border-left: none; border-right: 3px solid var(--accent); padding-left: 0; padding-right: 20px; }
[dir="rtl"] .post-body ul, [dir="rtl"] .post-body ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .post-toc { text-align: right; }
[dir="rtl"] .post-nav .next-link { text-align: left; align-items: flex-start; }
