/* ===========================================================
   Blog-only polish (blog.html + blog post pages)
   Scoped under .blog-page (listing) and .post-page (articles)
   so shared components on other pages keep their design.
   v2: added article figures & visual summary elements.
   =========================================================== */

/* -----------------------------------------------------------
   1. Listing — header
   ----------------------------------------------------------- */
.blog-page .blog-header {
  padding: 88px 40px 32px;
}
.blog-page .blog-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.blog-page .blog-header .eyebrow {
  margin: 0 0 16px;
}
.blog-page .blog-header-desc {
  margin: 0 auto;
  max-width: 620px;
}

/* -----------------------------------------------------------
   2. Listing — layout & post cards
   ----------------------------------------------------------- */
.blog-page .blog-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  padding: 40px 40px 104px;
}
.blog-page .blog-feed {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.blog-page .blog-post {
  display: block;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.blog-page .blog-post:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #c7d2fe;
}
.blog-page .post-thumb {
  display: block;
  margin: 0;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface-2);
}
.blog-page .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.blog-page .blog-post:hover .post-thumb img {
  transform: scale(1.03);
}
.blog-page .post-body {
  padding: 28px 30px 30px;
}
.blog-page .post-cat {
  display: inline-block;
  margin-bottom: 14px;
}
.blog-page .post-title {
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.blog-page .post-title a {
  color: var(--text);
}
.blog-page .post-title a:hover {
  color: var(--accent);
}
.blog-page .post-excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 18px;
}
.blog-page .post-meta {
  font-size: 13px;
}

/* -----------------------------------------------------------
   3. Sidebar
   ----------------------------------------------------------- */
.blog-page .blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
  align-self: start;
}
.blog-page .side-card {
  padding: 24px;
  border-radius: 14px;
}
.blog-page .side-card h3 {
  font-size: 14px;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}
.blog-page .side-about p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}
.blog-page .side-posts li + li {
  margin-top: 16px;
}
.blog-page .side-posts a {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 10px;
  row-gap: 3px;
  align-items: baseline;
}
.blog-page .side-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.blog-page .side-post-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}
.blog-page .side-posts a:hover .side-post-title {
  color: var(--accent);
}
.blog-page .side-post-meta {
  grid-column: 2;
  font-size: 12px;
  color: var(--text-3);
}
.blog-page .side-cta {
  background: var(--grad-brand);
  border: none;
  color: #fff;
  text-align: center;
}
.blog-page .side-cta h3 {
  color: #fff;
}
.blog-page .side-cta p {
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 18px;
}
.blog-page .side-cta .btn-primary {
  background: #fff;
  color: var(--accent);
  border: none;
}
.blog-page .side-cta .btn-primary:hover {
  background: #eef2ff;
  color: var(--accent);
}
.blog-page .side-cta-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  margin-bottom: 12px;
}

/* -----------------------------------------------------------
   4. Article page
   ----------------------------------------------------------- */
.post-page .post-wrap {
  max-width: 780px;
  padding: 56px 40px 96px;
  margin: 0 auto;
}
.post-page .post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 28px;
}
.post-page .post-back:hover {
  color: var(--accent);
}
.post-page .post-head {
  margin: 0 0 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.post-page .post-head .post-cat {
  display: inline-block;
}
.post-page .post-head h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 14px 0 14px;
}
.post-page .hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 20px;
}
.post-page .post-meta {
  font-size: 13.5px;
  color: var(--text-3);
}

/* reading typography */
.post-page .docs-article {
  max-width: 720px;
  font-size: 17.5px;
  line-height: 1.78;
  color: #334155;
}
.post-page .docs-article h2 {
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 48px 0 16px;
}
.post-page .docs-article h3 {
  font-size: 19px;
  line-height: 1.4;
  color: var(--text);
  margin: 34px 0 12px;
}
.post-page .docs-article p {
  margin: 0 0 20px;
}
.post-page .docs-article ul,
.post-page .docs-article ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.post-page .docs-article li {
  margin: 8px 0;
}
.post-page .docs-article strong {
  color: var(--text);
  font-weight: 650;
}
.post-page .docs-article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: #c7d2fe;
  text-underline-offset: 3px;
}
.post-page .docs-article a:hover {
  text-decoration-color: var(--accent);
}
.post-page .docs-article code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text);
  display: inline-block;
  vertical-align: baseline;
  hyphens: none;
}
.post-page .docs-article pre {
  background: #0f172a;
  border: none;
  border-radius: 12px;
  padding: 20px 22px;
  margin: 0 0 22px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.75;
}
.post-page .docs-article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: #e2e8f0;
}
.post-page .docs-callout {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  color: var(--text);
}
.post-page .docs-callout svg {
  color: var(--accent);
  flex: 0 0 auto;
  margin-top: 2px;
}

/* article CTA card */
.post-page .post-cta {
  margin-top: 48px;
  padding: 34px 36px;
  border-radius: 16px;
  background: var(--grad-brand);
  border: none;
  color: #fff;
  flex-direction: column;
  text-align: center;
}
.post-page .post-cta p {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}
.post-page .post-cta .btn-primary {
  background: #fff;
  color: var(--accent);
  border: none;
}
.post-page .post-cta .btn-primary:hover {
  background: #eef2ff;
  color: var(--accent);
}

/* -----------------------------------------------------------
   6. Article figures & visual summary elements
   ----------------------------------------------------------- */

/* key takeaways box */
.post-page .post-tldr {
  margin: 0 0 32px;
  padding: 22px 26px 24px;
  background: linear-gradient(180deg, #eef2ff, #f6f7ff);
  border: 1px solid #c7d2fe;
  border-radius: 14px;
}
.post-page .tldr-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.post-page .post-tldr ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-page .post-tldr li {
  position: relative;
  padding-left: 28px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  margin: 9px 0;
}
.post-page .post-tldr li:first-child { margin-top: 0; }
.post-page .post-tldr li:last-child { margin-bottom: 0; }
.post-page .post-tldr li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.post-page .post-tldr li + li {
  border-top: 1px dashed #c7d2fe;
  padding-top: 14px;
  margin-top: 14px;
}

/* figure frame (diagram card) */
.post-page .post-figure {
  margin: 30px 0 34px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.post-page .fig-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.post-page .fig-head svg {
  color: var(--accent);
  flex: 0 0 auto;
}
.post-page .fig-body {
  padding: 24px 26px 26px;
}

/* dashed annotation chip */
.post-page .fig-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: #eef2ff;
  border: 1px dashed #a5b4fc;
  border-radius: 6px;
  padding: 2px 9px;
  margin-top: 8px;
  line-height: 1.4;
}

/* mock Google search result */
.post-page .mock-serp {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}
.post-page .mock-serp .fav {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  color: #fff;
}
.post-page .mock-serp .serp-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.post-page .mock-serp .serp-site {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 2px;
}
.post-page .mock-serp .serp-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a0dab;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.post-page .mock-serp .serp-url {
  font-size: 12px;
  color: #0d652d;
  margin-top: 2px;
}
.post-page .mock-serp .serp-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  margin-top: 6px;
}
.post-page .mock-serp .fig-tag {
  align-self: flex-start;
}

/* heading ladder */
.post-page .mock-ladder {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-page .mock-ladder .bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-page .mock-ladder .bar-label {
  flex: 0 0 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
}
.post-page .mock-ladder .bar-track {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-page .lvl-h1 { background: #312e81; }
.post-page .lvl-h2 { background: #4f46e5; margin-left: 24px; }
.post-page .lvl-h3 { background: #818cf8; margin-left: 48px; }

/* character-limit meters */
.post-page .mock-meters {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-page .mock-meter .m-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}
.post-page .mock-meter .m-row span:last-child {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.post-page .mock-meter .m-track {
  position: relative;
  height: 14px;
  background: #eef0ff;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.post-page .mock-meter .m-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  border-radius: 999px;
}
.post-page .mock-meter .m-fill.fill-title { width: 60%; }
.post-page .mock-meter .m-fill.fill-desc { width: 72%; }
.post-page .mock-meter .m-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  background: #dc2626;
  border-radius: 2px;
}
.post-page .mock-meter .m-mark.mark-title { left: 61%; }
.post-page .mock-meter .m-mark.mark-desc { left: 73%; }
.post-page .mock-meter .m-note {
  margin: 2px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

/* mock social share card */
.post-page .mock-card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.post-page .mc-img {
  height: 128px;
  background: linear-gradient(135deg, #312e81, #4f46e5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #c7d2fe;
}
.post-page .mc-img-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
}
.post-page .mc-body {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.post-page .mc-domain {
  font-size: 11.5px;
  color: #6b7280;
  margin-bottom: 2px;
}
.post-page .mc-title {
  font-size: 15.5px;
  font-weight: 650;
  color: #111827;
  line-height: 1.35;
}
.post-page .mc-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: #6b7280;
}

/* mock accordion (details element) */
.post-page .mock-details {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.post-page .md-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 600;
  color: #111827;
  border-top: 1px solid var(--border);
}
.post-page .md-row:first-child {
  border-top: 0;
}
.post-page .md-row .md-caret {
  flex: 0 0 auto;
  color: var(--accent);
}
.post-page .md-row .md-caret.closed {
  transform: rotate(-90deg);
}
.post-page .md-row .fig-tag {
  margin: 0 0 0 auto;
}
.post-page .md-row .md-open-tag {
  display: none;
}
.post-page .md-panel {
  position: relative;
  padding: 2px 16px 14px 38px;
  border-bottom: 1px solid var(--border);
}
.post-page .md-panel .fig-tag {
  margin-top: 6px;
}
.post-page .md-panel p {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #6b7280;
}

/* code block copy buttons */
.post-page .docs-article .code-block {
  position: relative;
}
.post-page .docs-article .code-block pre {
  padding-top: 48px;
}
.post-page .docs-article .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.post-page .docs-article .copy-btn:hover {
  color: #fff;
  border-color: #64748b;
}
.post-page .docs-article .copy-btn.copied {
  color: #4ade80;
  border-color: #22c55e;
  background: #064e3b;
}

/* gotcha table */
.post-page .docs-article .table-scroll {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.post-page .docs-article .gotcha-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.65;
}
.post-page .docs-article .gotcha-table th,
.post-page .docs-article .gotcha-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.post-page .docs-article .gotcha-table thead th {
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.post-page .docs-article .gotcha-table tbody tr:last-child td {
  border-bottom: none;
}
.post-page .docs-article .gotcha-table td:first-child {
  font-weight: 600;
  min-width: 230px;
  color: var(--text);
}
.post-page .docs-article .gotcha-table code {
  white-space: nowrap;
}

/* visualized checklists & warnings */
.post-page .docs-article .check-list,
.post-page .docs-article .warn-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 24px;
}
.post-page .docs-article .check-list li,
.post-page .docs-article .warn-list li {
  position: relative;
  padding-left: 31px;
  margin: 10px 0;
}
.post-page .docs-article .check-list li:first-child,
.post-page .docs-article .warn-list li:first-child {
  margin-top: 0;
}
.post-page .docs-article .check-list li:last-child,
.post-page .docs-article .warn-list li:last-child {
  margin-bottom: 0;
}
.post-page .docs-article .check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: #d1fae5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.post-page .docs-article .warn-list li::before {
  content: "!";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
}

/* -----------------------------------------------------------
   5. Responsive
   ----------------------------------------------------------- */
@media (max-width: 1024px) {
  .blog-page .blog-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 36px;
  }
}
@media (max-width: 900px) {
  .blog-page .blog-layout {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin: 0 auto;
  }
  .blog-page .blog-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .blog-page .side-cta {
    grid-column: 1 / -1;
  }
  .post-page .post-wrap {
    padding: 48px 32px 80px;
  }
}
@media (max-width: 760px) {
  .blog-page .blog-header {
    padding: 64px 24px 24px;
  }
  .blog-page .blog-layout {
    padding: 28px 24px 80px;
  }
  .blog-page .post-body {
    padding: 24px 24px 26px;
  }
  .post-page .post-wrap {
    padding: 40px 24px 72px;
  }
  .post-page .docs-article {
    font-size: 16.5px;
    line-height: 1.75;
  }
  .post-page .docs-article h2 {
    font-size: 22px;
    margin-top: 40px;
  }
}
@media (max-width: 560px) {
  .blog-page .blog-sidebar {
    grid-template-columns: 1fr;
  }
  .blog-page .blog-post .post-title {
    font-size: 19px;
  }
  .post-page .post-head h1 {
    font-size: 26px;
  }
  .post-page .post-cta {
    padding: 28px 24px;
  }
  .post-page .post-tldr {
    padding: 18px 18px 20px;
  }
  .post-page .post-figure {
    margin: 24px 0 28px;
  }
  .post-page .fig-body {
    padding: 18px 12px 20px;
  }
  .post-page .mock-serp {
    padding: 14px;
    gap: 10px;
  }
  .post-page .mock-serp .serp-title {
    font-size: 14px;
  }
  .post-page .mock-ladder .lvl-h2 {
    margin-left: 14px;
  }
  .post-page .mock-ladder .lvl-h3 {
    margin-left: 28px;
  }
  .post-page .mock-meters {
    gap: 16px;
  }
  .post-page .md-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 10px;
    font-size: 12.5px;
  }
  .post-page .md-row .md-caret {
    width: 12px;
    height: 12px;
  }
  .post-page .md-row .fig-tag {
    width: 100%;
    margin: 4px 0 0 18px;
    font-size: 10px;
  }
  .post-page .md-panel {
    padding: 2px 10px 12px 30px;
  }
}
