/* ==========================================================================
   5centsCDN Blog — Single Post (Website 2026 Light Theme)
   Heading block · 2-col body · breadcrumb · author · tags · TOC · share
   Layered on top of style.css base.
   NOTE: spacing/colors approximated from Figma screenshots + design tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Heading block (breadcrumb · author · tags · title)
   -------------------------------------------------------------------------- */

.single-hero {
  padding: 40px 0 32px;
  background: #F4F5F7;
  border-bottom: 1px solid var(--border);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

.breadcrumb-home {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-home img {
  width: 16px;
  height: 16px;
  display: block;
}

.breadcrumb a {
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb .sep { opacity: 0.5; }

.breadcrumb .current {
  color: var(--foreground);
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb svg { width: 15px; height: 15px; }

/* Author row */
.single-author-row {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.author-row-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 48px;
  background: var(--border);
}

.single-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-author .author-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.single-author .author-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.3;
}

.single-author .author-role {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.3;
}

/* Inline social share (author row, right side) */
.share-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-inline a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  color: var(--foreground);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-inline a:hover { opacity: 0.7; transform: translateY(-1px); }
.share-inline a img { width: 25px; height: 25px; display: block; }
.share-inline svg { width: 18px; height: 18px; }

/* Tags + meta row */
.single-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  background: #E1E1E1;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tag-pill:hover { border-color: var(--primary); color: var(--primary); }

.single-postmeta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.single-postmeta .meta-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.single-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 900px;
}

/* --------------------------------------------------------------------------
   2. Body layout (2-col with sticky TOC sidebar)
   -------------------------------------------------------------------------- */

.single-body {
  padding: 48px 0 24px;
  background: #FAFAFA;
}

.single-body .container {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

/* No-TOC variant: single centered column */
.single-body.no-toc .container {
  display: block;
  max-width: 800px;
}

.single-sidebar {
  position: sticky;
  top: 190px;
  align-self: start;
}

.single-main { min-width: 0; }

/* --------------------------------------------------------------------------
   3. TOC sidebar ("On this blog")
   -------------------------------------------------------------------------- */

.toc {
  font-size: 14px;
}

.toc-heading {
  display: none; /* visible only on mobile toggle */
}

.toc-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.toc-list a {
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--border);
  color: var(--muted-foreground);
  line-height: 1.4;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

.toc-list a.is-active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.toc-list .toc-l3 a { padding-left: 28px; font-size: 13px; }
.toc-list .toc-l4 a { padding-left: 42px; font-size: 13px; }

/* Share article block under TOC */
.share-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.share-block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 14px;
}

.share-circles {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-circles a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-circles a:hover { opacity: 0.88; transform: translateY(-2px); }
.share-circles a img { width: 36px; height: 36px; display: block; }
.share-circles svg { width: 18px; height: 18px; }

/* Mobile TOC toggle */
.toc-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.toc-toggle svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
.toc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   4. Article content (the_content)
   -------------------------------------------------------------------------- */

.single-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--foreground);
}

.single-content > p { margin: 0 0 24px; }

.single-content h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  scroll-margin-top: 120px;
}

.single-content h3 {
  font-size: 21px;
  font-weight: 700;
  margin: 36px 0 12px;
  scroll-margin-top: 120px;
}

.single-content h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 10px;
  scroll-margin-top: 120px;
}

.single-content img,
.single-content figure {
  border-radius: var(--radius-lg);
  margin: 28px 0;
}

.single-content figure img { margin: 0; }

.single-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

.single-content ul,
.single-content ol {
  margin: 0 0 24px;
  padding-left: 24px;
  list-style: revert;
}

.single-content li { margin-bottom: 8px; }

.single-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--muted-foreground);
}

.single-content pre {
  background: #0d0e10;
  color: #f5f7f8;
  padding: 24px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 32px 0;
  font-size: 14px;
}

.single-content code {
  background: var(--muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.single-content pre code { background: transparent; padding: 0; }

/* Prev / Next post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 48px 0 8px;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-nav a:hover { border-color: var(--primary); box-shadow: 0 4px 24px rgba(0,0,0,0.05); }
.post-nav .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); }
.post-nav .title { font-size: 15px; font-weight: 600; color: var(--foreground); }
.post-nav .next { text-align: right; }

/* --------------------------------------------------------------------------
   5. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .single-body .container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .single-sidebar { position: static; }
  .toc-toggle { display: flex; }
  .toc {
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
  .toc-title { display: none; }
  .share-block { margin-top: 20px; }
  .single-title { font-size: 32px; }
}

@media (max-width: 768px) {
  .single-hero { padding: 28px 0 24px; }
  .single-title { font-size: 26px; }
  .single-content { font-size: 16px; }
  .single-content h2 { font-size: 24px; margin-top: 36px; }
  .post-nav { grid-template-columns: 1fr; }
  .single-author-row { gap: 16px; }
  .author-row-divider { display: none; }
}

@media (max-width: 480px) {
  .single-title { font-size: 22px; }
  .breadcrumb .current { max-width: 180px; }
}
