/* ── Icon extensions (not in header.css) ──────────────────────────────────── */
.jli-timer:before         { content: "\e900"; }
.jli-globe:before         { content: "\e920"; }
.jli-right-chevron:before { content: "\e92a"; }

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
  --sngl-progress-h:    5px;
  --sngl-progress-bg:   rgba(0,0,0,0.08);
  --sngl-progress-fill: linear-gradient(to right, #ae5eff 0%, #8100ff 100%);

  --sngl-max-w:         1180px;
  --sngl-pad-h:         24px;
  --sngl-grid-gap:      28px;
  --sngl-section-pad:   48px 0;

  --sngl-title-size:    35px;
  --sngl-subtitle-size: 17px;
  --sngl-content-size:  17px;
  --sngl-meta-size:     13px;
  --sngl-badge-size:    13px;

  --sngl-radius:        10px;
  --sngl-radius-sm:     6px;
  --sngl-radius-full:   9999px;

  --sngl-feat-ratio:    56.25%; /* 16:9 */

  --sngl-share-size:    38px;
  --sngl-share-gap:     8px;

  --sngl-author-av:     80px;
  --sngl-nav-thumb:     70px;

  --sngl-related-title: 18px;
  --sngl-sidebar-top:   calc(var(--hdr-height, 65px) + 16px);

  /* Sidebar shared component vars */
  --lsoc-box-radius:     10px;
  --lsoc-box-pad:        12px 14px;
  --lexpl-border:        rgba(0, 0, 0, 0.08);
  --lexpl-title-col:     #111827;
  --lexpl-read-col:      #9ca3af;
  --wng-radius:          10px;
  --sec-hdr-title-color: #111827;
}

/* ── Reading progress bar ─────────────────────────────────────────────────── */
.sngl-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--sngl-progress-h);
  background: var(--sngl-progress-bg);
  z-index: 9999;
  pointer-events: none;
}
.sngl-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--sngl-progress-fill);
  transition: width 0.1s linear;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.sngl-outer {
  padding-top: 40px;
  padding-bottom: 60px;
}

.sngl-container {
  max-width: var(--sngl-max-w);
  margin: 0 auto;
  padding: 0 var(--sngl-pad-h);
}

.sngl-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--sngl-grid-gap);
  align-items: start;
}

.sngl-grid--no-sidebar {
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.sngl-header {
  margin-bottom: 28px;
}

.sngl-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: var(--sngl-meta-size);
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.sngl-breadcrumb__link {
  color: var(--color-text-muted);
  font-size: var(--sngl-meta-size);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s;
}
.sngl-breadcrumb__link:hover { color: var(--color-primary); }
.sngl-breadcrumb__sep {
  font-size: 10px;
  margin: 0 5px;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
}
.sngl-breadcrumb__current {
  color: var(--color-text);
  font-size: var(--sngl-meta-size);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.sngl-badge-wrap { margin-bottom: 12px; }
.sngl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--sngl-radius-full);
  font-size: var(--sngl-badge-size);
  font-weight: 500;
  text-decoration: none;
  background: hsl(var(--badge-hue, 258) 65% 52% / 0.12);
  color: hsl(var(--badge-hue, 258) 65% 45%);
  transition: background 0.18s;
}
.sngl-badge:hover { background: hsl(var(--badge-hue, 258) 65% 52% / 0.2); }

.sngl-title {
  font-size: var(--sngl-title-size);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 12px;
}
.sngl-subtitle {
  font-size: var(--sngl-subtitle-size);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 0 16px;
}

.sngl-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: var(--sngl-meta-size);
  color: var(--color-text-muted);
}
.sngl-meta__av-link { display: flex; flex-shrink: 0; text-decoration: none; }
.sngl-meta__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}
.sngl-meta__author {
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.18s;
}
.sngl-meta__author:hover { color: var(--color-primary); }
.sngl-meta__sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}
.sngl-meta__date { color: var(--color-text-muted); }
.sngl-meta__read { display: flex; align-items: center; gap: 4px; }
.sngl-meta__read i { font-size: 13px; }

.sngl-meta__share {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.sngl-meta__share-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--sngl-meta-size);
  color: var(--color-text-muted);
}
.sngl-meta__share-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sngl-meta__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--sngl-radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.18s, color 0.18s;
}
.sngl-meta__share-btn--fb { color: #1877f2; }
.sngl-meta__share-btn--tw { color: #374151; }
.sngl-meta__share-btn--pi { color: #e60023; }
.sngl-meta__share-btn--li { color: #0a66c2; }
.sngl-meta__share-btn--fb:hover { background: #1877f2; color: #fff; }
.sngl-meta__share-btn--tw:hover { background: #000;    color: #fff; }
.sngl-meta__share-btn--pi:hover { background: #e60023; color: #fff; }
.sngl-meta__share-btn--li:hover { background: #0a66c2; color: #fff; }

/* ── Featured image ───────────────────────────────────────────────────────── */
.sngl-feat { margin-bottom: 32px; }
.sngl-feat__ratio {
  position: relative;
  width: 100%;
  padding-bottom: var(--sngl-feat-ratio);
  border-radius: var(--sngl-radius);
  overflow: hidden;
}
.sngl-feat__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Body wrap + sticky share bar ────────────────────────────────────────── */
.sngl-body-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.sngl-share-bar {
  flex: 0 0 var(--sngl-share-size);
  position: sticky;
  top: calc(var(--sngl-sidebar-top) + 16px);
  align-self: flex-start;
}
.sngl-share-bar__list {
  display: flex;
  flex-direction: column;
  gap: var(--sngl-share-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
.sngl-share-bar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sngl-share-size);
  height: var(--sngl-share-size);
  border-radius: var(--sngl-radius-sm);
  background: transparent;
  text-decoration: none;
  font-size: 17px;
  transition: color 0.18s, background 0.18s, transform 0.18s;
}
.sngl-share-bar__btn:hover { transform: scale(1.15); }
/* Brand colors — resting state (icon only, no card) */
.sngl-share-bar__btn--fb { color: #1877f2; }
.sngl-share-bar__btn--tw { color: #374151; }
.sngl-share-bar__btn--pi { color: #e60023; }
.sngl-share-bar__btn--li { color: #0a66c2; }
.sngl-share-bar__btn--wa { color: #25d366; }
/* Hover — subtle tinted bg, icon stays brand color */
.sngl-share-bar__btn--fb:hover { background: rgba(24, 119, 242, 0.10); }
.sngl-share-bar__btn--tw:hover { background: rgba(0, 0, 0, 0.06); color: #000; }
.sngl-share-bar__btn--pi:hover { background: rgba(230, 0, 35, 0.10); }
.sngl-share-bar__btn--li:hover { background: rgba(10, 102, 194, 0.10); }
.sngl-share-bar__btn--wa:hover { background: rgba(37, 211, 102, 0.10); }

/* ── Article body ─────────────────────────────────────────────────────────── */
.sngl-body {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--sngl-content-size);
  line-height: 1.6;
  color: var(--color-text);
  overflow-wrap: break-word;
}
.sngl-body > * + * { margin-top: 0.65em; }
.sngl-body h2 { font-size: 26px; font-weight: 700; margin-top: 1.1em; margin-bottom: 0.5em; }
.sngl-body h3 { font-size: 22px; font-weight: 700; margin-top: 1.0em; margin-bottom: 0.45em; }
.sngl-body h4 { font-size: 19px; font-weight: 600; margin-top: 0.85em; margin-bottom: 0.4em; }
.sngl-body h5 { font-size: 17px; font-weight: 600; margin-top: 0.75em; margin-bottom: 0.35em; }
.sngl-body p  { margin: 0 0 0.65em; }
/* Collapse truly empty <p> and <p><br></p> artifacts. Note: <p>&nbsp;</p> is handled
   server-side in custom-hooks.php (CSS cannot select by text content). */
.sngl-body p:empty,
.sngl-body p:has(> br:only-child) { display: none; }
.sngl-body a  { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.sngl-body a:hover { color: var(--color-primary-dark); }
.sngl-body img { max-width: 100%; border-radius: var(--sngl-radius); height: auto; }
.sngl-body figure { margin: 0; max-width: 100%; }
.sngl-body figcaption { font-size: 13px; color: var(--color-text-muted); margin-top: 6px; text-align: center; }

/* ── Responsive media containment ────────────────────────────────────────── */
.sngl-body iframe,
.sngl-body embed,
.sngl-body object,
.sngl-body video { max-width: 100%; }

.sngl-body .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--sngl-radius-sm);
}
.sngl-body .wp-block-embed__wrapper iframe,
.sngl-body .wp-block-embed__wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.sngl-body .wp-caption,
.sngl-body .wp-block-image { max-width: 100%; }
.sngl-body .wp-caption img { max-width: 100%; height: auto; display: block; }
.sngl-body .wp-caption-text { font-size: 13px; color: var(--color-text-muted); text-align: center; margin-top: 6px; }

/* ── Block-level separator / spacer / group ──────────────────────────────── */
/* Replace wp-block-library CSS we dequeue; prevents unstyled "mystery" boxes. */
.sngl-body .wp-block-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  height: 0;
  margin: 0;
  background: none;
  clear: both;
}
.sngl-body .wp-block-spacer {
  /* renders height via inline style only — no visible border/background */
  border: none;
  outline: none;
  background: none;
  clear: both;
}
/* All tables: shared base styles */
.sngl-body table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}
.sngl-body table th,
.sngl-body table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid var(--color-border);
  vertical-align: top;
}
.sngl-body table th { font-weight: 600; background: var(--color-bg-alt); }
/* Reset the 3px solid border that wp-block-table/style.css adds to thead/tfoot */
.sngl-body table thead,
.sngl-body table tfoot { border: none; }

/* Gutenberg wp-block-table: figure is the scroll container, table renders naturally */
.sngl-body .wp-block-table {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sngl-body .wp-block-table table {
  display: table;
}
/* Prevent empty figcaption from adding phantom line-height gap */
.sngl-body .wp-block-table figcaption:empty { display: none; }

/* Standalone table (classic editor, no wp-block-table wrapper): self-scroll */
.sngl-body :not(.wp-block-table) > table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


.sngl-body ul, .sngl-body ol { padding-left: 1.5em; margin-bottom: 0.65em; }
.sngl-body li  { margin-bottom: 0; }
.sngl-body li + li { margin-top: 0.25em; }
.sngl-body blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 12px 20px;
  margin: 0;
  background: var(--color-bg-alt);
  border-radius: 0 var(--sngl-radius-sm) var(--sngl-radius-sm) 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.sngl-body blockquote cite {
  display: block;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  margin-top: 8px;
  color: var(--color-text);
}

/* ── Tags ─────────────────────────────────────────────────────────────────── */
.sngl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}
.sngl-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--sngl-radius-full);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.sngl-tag:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Author box ───────────────────────────────────────────────────────────── */
.sngl-author {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--sngl-radius);
  background: rgba(0,0,0,0.04);
  margin-top: 28px;
}
.sngl-author__avatar-link { flex-shrink: 0; }
.sngl-author__avatar {
  width: var(--sngl-author-av);
  height: var(--sngl-author-av);
  border-radius: 50%;
  object-fit: cover;
}
.sngl-author__body { flex: 1; min-width: 0; }
.sngl-author__written-by {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.sngl-author__name { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.sngl-author__name a { color: var(--color-text); text-decoration: none; transition: color 0.18s; }
.sngl-author__name a:hover { color: var(--color-primary); }
.sngl-author__bio { font-size: 13px; line-height: 1.5; color: var(--color-text-muted); margin: 0 0 10px; }
.sngl-author__socials {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.sngl-author__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--sngl-radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--color-border);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.sngl-author__socials a[data-soc="facebook"]:hover  { background: #1877f2; color: #fff; border-color: #1877f2; }
.sngl-author__socials a[data-soc="twitter"]:hover   { background: #000;    color: #fff; border-color: #000;    }
.sngl-author__socials a[data-soc="linkedin"]:hover  { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.sngl-author__socials a[data-soc="instagram"]:hover { background: #e1306c; color: #fff; border-color: #e1306c; }
.sngl-author__socials a[data-soc="pinterest"]:hover { background: #e60023; color: #fff; border-color: #e60023; }
.sngl-author__socials a[data-soc="youtube"]:hover   { background: #ff0000; color: #fff; border-color: #ff0000; }
.sngl-author__socials a[data-soc="website"]:hover   { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.sngl-author__socials a:not([data-soc]):hover        { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Prev / next navigation ───────────────────────────────────────────────── */
/* Prev: [thumb LEFT][text RIGHT, left-aligned]                               */
/* Next: [text LEFT, right-aligned][thumb RIGHT]                              */
.sngl-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}
.sngl-nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 10px 0;
  transition: opacity 0.18s;
}
.sngl-nav__link:hover { opacity: 0.75; }
/* Next: push group to the right of its column */
.sngl-nav__item--next .sngl-nav__link { justify-content: flex-end; }
.sngl-nav__item--next .sngl-nav__text  { text-align: right; align-items: flex-end; }
/* Wrapper handles fixed size + circular clip — img height can't be overridden */
.sngl-nav__thumb-wrap {
  width: var(--sngl-nav-thumb);
  height: var(--sngl-nav-thumb);
  min-width: var(--sngl-nav-thumb);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.sngl-nav__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 0;
}
.sngl-nav__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sngl-nav__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.sngl-nav__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  max-width: 60%;
}

/* ── Comments ─────────────────────────────────────────────────────────────── */
.sngl-comments {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}
.sngl-comments__head  { margin-bottom: 20px; }
.sngl-comments__title { font-size: 20px; font-weight: 700; margin: 0; color: var(--color-text); }

/* ── Comment list wrapper ──────────────────────────────────────────────── */
.cmt-list-wrap { margin-bottom: 36px; }

.cmt-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

/* List reset — root + nested children */
.cmt-list,
.cmt-list .children {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Nested replies: left-border indent */
.cmt-list .children {
  margin-left: 24px;
  padding-left: 18px;
  border-left: 2px solid var(--color-border);
}

/* ── Single comment ────────────────────────────────────────────────────── */
.cmt-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.cmt-list > .cmt-item:first-child { padding-top: 0; }
.cmt-item:last-child              { border-bottom: none; }

/* Layout: avatar + content */
.cmt-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* Avatar */
.cmt-avatar            { flex-shrink: 0; width: 44px; height: 44px; }
.cmt-avatar .cmt-avatar__img,
.cmt-avatar img {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Main area */
.cmt-main { flex: 1; min-width: 0; }

/* Header row: author + time + edit */
.cmt-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-bottom: 8px;
  line-height: 1.3;
}
.cmt-author { font-size: 14px; font-weight: 600; color: var(--color-text); }
.cmt-author a { color: inherit; text-decoration: none; transition: color 0.18s; }
.cmt-author a:hover { color: var(--color-primary); }

.cmt-time-link { text-decoration: none; }
.cmt-time {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: color 0.18s;
}
.cmt-time-link:hover .cmt-time { color: var(--color-primary); }

.cmt-edit a {
  font-size: 11px;
  color: var(--color-text-light);
  text-decoration: none;
  padding: 1px 7px;
  border-radius: var(--sngl-radius-sm);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  transition: color 0.18s, border-color 0.18s;
}
.cmt-edit a:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* Moderation notice */
.cmt-pending {
  font-size: 12px;
  color: var(--color-accent);
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--sngl-radius-sm);
  padding: 4px 10px;
  margin: 0 0 8px;
}

/* Comment text */
.cmt-content { font-size: 14.5px; line-height: 1.65; color: var(--color-text); }
.cmt-content p { margin: 0 0 8px; }
.cmt-content p:last-child { margin-bottom: 0; }

/* Reply button */
.cmt-actions { margin-top: 10px; }
.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 3px 10px;
  border-radius: var(--sngl-radius-sm);
  border: 1px solid var(--color-border);
  background: transparent;
  line-height: 1.6;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.comment-reply-link:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(37,99,235,0.04);
  text-decoration: none;
}

/* Pagination */
.cmt-pagination {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
}
.cmt-pagination a { font-size: 13px; font-weight: 500; color: var(--color-primary); text-decoration: none; }
.cmt-pagination a:hover { text-decoration: underline; }

/* Password-protected notice */
.cmt-protected { font-size: 14px; color: var(--color-text-muted); }

/* ── Comment form ──────────────────────────────────────────────────────── */
.comment-respond { margin-top: 0; }

/* Form heading "Leave a Reply" / "Reply to X" */
#reply-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.3;
}
#cancel-comment-reply-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 3px 9px;
  border-radius: var(--sngl-radius-sm);
  border: 1px solid var(--color-border);
  transition: color 0.18s, border-color 0.18s;
}
#cancel-comment-reply-link:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* Logged-in notice */
.comment-form .logged-in-as {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}
.comment-form .logged-in-as a { color: var(--color-primary); text-decoration: none; }
.comment-form .logged-in-as a:hover { text-decoration: underline; }
.comment-form .comment-notes { font-size: 12px; color: var(--color-text-muted); margin: 0; }
.comment-form .required { color: var(--color-danger); }

/* Grid: Name / Email / Website on one row; all other <p> full-width */
.sngl-comments__wrap #commentform {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.sngl-comments__wrap #commentform > p { grid-column: 1 / -1; margin: 0; }
.sngl-comments__wrap #commentform .comment-form-author,
.sngl-comments__wrap #commentform .comment-form-email,
.sngl-comments__wrap #commentform .comment-form-url { grid-column: span 1; }

/* Labels */
.sngl-comments__wrap .comment-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  display: block;
  margin-bottom: 5px;
}

/* Inputs & textarea */
.sngl-comments__wrap .comment-form textarea,
.sngl-comments__wrap .comment-form input[type="text"],
.sngl-comments__wrap .comment-form input[type="email"],
.sngl-comments__wrap .comment-form input[type="url"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--sngl-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.sngl-comments__wrap .comment-form textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}
.sngl-comments__wrap .comment-form textarea::placeholder,
.sngl-comments__wrap .comment-form input::placeholder { color: var(--color-text-light); }

/* Focus ring */
.sngl-comments__wrap .comment-form textarea:focus,
.sngl-comments__wrap .comment-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

/* Cookie consent checkbox (WP 4.9+) */
.sngl-comments__wrap .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.sngl-comments__wrap .comment-form-cookies-consent input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-primary);
}
.sngl-comments__wrap .comment-form-cookies-consent label {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  display: inline;
  margin: 0;
  line-height: 1.5;
  cursor: pointer;
}

/* Submit button */
.sngl-comments__wrap .comment-form .submit,
.sngl-comments__wrap .comment-form #submit {
  display: inline-flex;
  align-items: center;
  padding: 10px 26px;
  border-radius: var(--sngl-radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.18s, box-shadow 0.18s;
}
.sngl-comments__wrap .comment-form .submit:hover,
.sngl-comments__wrap .comment-form #submit:hover { background: var(--color-primary-dark); }
.sngl-comments__wrap .comment-form .submit:focus,
.sngl-comments__wrap .comment-form #submit:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}

/* ── Table of Contents (injected inside .entry-content via filter) ─────────── */
.sngl-toc {
  margin: 28px 0 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--sngl-radius);
  background: var(--color-bg-alt);
  overflow: hidden;
}
/* head: always clickable to toggle */
.sngl-toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.18s;
}
.sngl-toc__head:hover { background: rgba(0,0,0,0.025); }
.sngl-toc--collapsed .sngl-toc__head { border-bottom-color: transparent; }
.sngl-toc__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.sngl-toc__icon { opacity: 0.55; flex-shrink: 0; }
.sngl-toc__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-border);
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0;
}
/* toggle button — always visible when rendered by PHP */
.sngl-toc__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--sngl-radius-sm);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}
.sngl-toc__toggle:hover { background: rgba(0,0,0,0.06); color: var(--color-text); }
.sngl-toc__chevron { display: block; transition: transform 0.22s ease; }
.sngl-toc--collapsed .sngl-toc__chevron { transform: rotate(180deg); }
/* list — height/opacity/padding animated by JS inline styles */
.sngl-toc__list {
  list-style: none;
  margin: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  /* transition applied as inline style by JS for accurate animation */
}
/* .sngl-toc--collapsed state: height/opacity/padding set via JS inline styles */
.sngl-toc__item { display: flex; }
.sngl-toc__item--d1 { padding-left: 14px; }
.sngl-toc__item--d2 { padding-left: 26px; }
/* Higher specificity (.sngl-toc .sngl-toc__link) overrides .sngl-body a underline */
.sngl-toc .sngl-toc__link {
  display: block;
  flex: 1;
  padding: 5px 8px 5px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--sngl-radius-sm) var(--sngl-radius-sm) 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.sngl-toc .sngl-toc__item--d0 .sngl-toc__link { font-size: 14px; font-weight: 500; color: var(--color-text); }
.sngl-toc .sngl-toc__item--d1 .sngl-toc__link { font-size: 13px; }
.sngl-toc .sngl-toc__item--d2 .sngl-toc__link { font-size: 12px; }
.sngl-toc .sngl-toc__link:hover { color: var(--color-primary); background: rgba(0,0,0,0.04); text-decoration: none; }
.sngl-toc .sngl-toc__item.is-active > .sngl-toc__link {
  color: var(--color-primary);
  background: rgba(0,0,0,0.04);
  border-left-color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

/* ── Sidebar (sticky in grid) ─────────────────────────────────────────────── */
.sngl-sidebar {
  position: sticky;
  top: var(--sngl-sidebar-top);
  align-self: flex-start;
  overflow-y: auto;
  max-height: calc(100vh - var(--sngl-sidebar-top) - 16px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sngl-sidebar::-webkit-scrollbar { display: none; }

/* ── Sidebar shared components: lsoc-*, ocard, lexpl-* ───────────────────── */
.arch-soc-grid {
  margin-bottom: 24px;
}

.lsoc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lsoc-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--lsoc-box-pad);
  border-radius: var(--lsoc-box-radius);
  background: var(--lsoc-color, #1877f2);
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-width: 0;
}
.lsoc-box:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.lsoc-box__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #ffffff;
  width: 20px;
  height: 20px;
}
.lsoc-box__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lsoc-box__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.lsoc-box__name {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lsoc-box__count {
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Explore more header ──────────────────────────────────────────────────── */
.lexpl-hdr {
  margin: 16px 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--sec-hdr-title-color);
  display: flex;
  align-items: center;
  gap: 4px;
}
.lexpl-hdr__chevron {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.45;
  display: inline-flex;
  align-items: center;
}

/* ── Featured overlay card ────────────────────────────────────────────────── */
.lexpl-feat {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}
.lexpl-feat .ocard {
  position: absolute;
  inset: 0;
  border-radius: 0;
  height: 100%;
}

/* ── Overlay card (ocard) ─────────────────────────────────────────────────── */
.ocard {
  position: relative;
  border-radius: var(--wng-radius);
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: block;
}
.ocard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ocard:hover .ocard__img {
  transform: scale(1.05);
}
.ocard__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.84) 0%,
    rgba(0, 0, 0, 0.32) 52%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 22px;
  pointer-events: none;
}
.ocard--small .ocard__overlay {
  padding: 14px 16px;
}
.ocard__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-decoration: none;
  margin-bottom: 8px;
  width: fit-content;
  pointer-events: auto;
  transition: background-color 0.2s ease;
}
.ocard__badge:hover {
  background: rgba(255, 255, 255, 0.28);
}
.ocard--small .ocard__badge {
  padding: 2px 8px 2px 6px;
  margin-bottom: 6px;
}
.ocard__badge-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--badge-hue, 258), 70%, 60%);
}
.ocard__badge-text {
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ocard__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.40;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ocard--small .ocard__title {
  font-size: 13px;
  margin-bottom: 8px;
}
.ocard__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ocard__title-link:hover {
  color: #e71d36;
}

body.dark-mode .ocard__title-link:hover {
  color: #ff4d6d;
}

.ocard__title-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
}
.ocard__badge,
.ocard__meta {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.ocard__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.ocard__av-wrap {
  flex-shrink: 0;
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  text-decoration: none;
}
.ocard__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ocard__author {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  max-width: 90px;
  transition: color 0.2s ease;
}
.ocard__author:hover { color: #ffffff; }
.ocard__sep {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.50);
  font-size: 11px;
}
.ocard__clock {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.55);
}
.ocard__readtime {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.70);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Compact explore list ─────────────────────────────────────────────────── */
.lexpl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lexpl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--lexpl-border);
}
.lexpl-item__thumb-wrap {
  flex-shrink: 0;
  display: block;
  width: 120px;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  text-decoration: none;
}
.lexpl-item__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lexpl-item:hover .lexpl-item__thumb {
  transform: scale(1.06);
}
.lexpl-item__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lexpl-item__cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.lexpl-item__cat-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--badge-hue, 258), 70%, 50%);
}
.lexpl-item__cat-name {
  color: hsl(var(--badge-hue, 258), 58%, 42%);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.lexpl-item__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.40;
  color: var(--lexpl-title-col);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lexpl-item__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.lexpl-item__title-link:hover { color: #e71d36; }
.lexpl-item__read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--lexpl-read-col);
  font-size: 11px;
  line-height: 1;
}

/* ── Related posts ────────────────────────────────────────────────────────── */
.sngl-related {
  padding: var(--sngl-section-pad);
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}
.sngl-related__hdr { margin-bottom: 24px; }
.sngl-related__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}
.sngl-related__chevron { font-size: 14px; color: var(--color-primary); }

.sngl-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.sngl-rcard { display: flex; flex-direction: column; }
.sngl-rcard__thumb-wrap { display: block; text-decoration: none; }
.sngl-rcard__ratio {
  position: relative;
  width: 100%;
  padding-bottom: 66.67%;
  border-radius: var(--sngl-radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.sngl-rcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.sngl-rcard:hover .sngl-rcard__img { transform: scale(1.03); }

.sngl-rcard__body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sngl-rcard__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--sngl-radius-full);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  background: hsl(var(--badge-hue, 258) 65% 52% / 0.12);
  color: hsl(var(--badge-hue, 258) 65% 45%);
  align-self: flex-start;
}
.sngl-rcard__title { font-size: var(--sngl-related-title); font-weight: 700; line-height: 1.38; margin: 0; }
.sngl-rcard__title-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.18s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sngl-rcard__title-link:hover { color: var(--color-primary); }
.sngl-rcard__excerpt {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sngl-rcard__meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  font-size: 12px;
  line-height: 1;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 4px;
}
.sngl-rcard__av-link { display: flex; }
.sngl-rcard__avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.sngl-rcard__author {
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.sngl-rcard__author:hover { color: var(--color-primary); }
.sngl-rcard__sep {
  display: inline-block;
  flex-shrink: 0;
  align-self: center;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
.sngl-rcard__read { display: flex; align-items: center; gap: 3px; }

/* ── Dark mode ────────────────────────────────────────────────────────────── */
/* Global vars (--color-text, --color-bg, --color-border, etc.) now live in
   variables.css so they apply on ALL pages, not just single.php. */
body.dark-mode {
  /* Single-post sidebar vars only */
  --lexpl-border:        rgba(255, 255, 255, 0.08);
  --lexpl-title-col:     rgba(255, 255, 255, 0.90);
  --lexpl-read-col:      rgba(255, 255, 255, 0.42);
  --sec-hdr-title-color: rgba(255, 255, 255, 0.92);
}

/* Explicit overrides where stronger contrast or different treatment is needed */
body.dark-mode .sngl-progress        { background: rgba(255,255,255,0.08); }
body.dark-mode .sngl-title           { color: #ffffff; }
body.dark-mode .sngl-badge           { background: hsl(var(--badge-hue,258) 65% 55%/0.18); color: hsl(var(--badge-hue,258) 65% 70%); }
body.dark-mode .sngl-meta__avatar    { border-color: rgba(255,255,255,0.15); }
body.dark-mode .sngl-meta__share-btn { background: rgba(255,255,255,0.06); }
body.dark-mode .sngl-feat__ratio     { background: #1a1a1a; }
body.dark-mode .sngl-share-bar__btn--tw { color: rgba(255,255,255,0.70); }
body.dark-mode .sngl-body            { color: rgba(255,255,255,0.88); }
/* typography.css: 'p { color: var(--color-text) }' is explicit, overrides
   inherited .sngl-body color — needs own rule with higher specificity */
body.dark-mode .sngl-body p          { color: rgba(255,255,255,0.88); }
body.dark-mode .sngl-body li         { color: rgba(255,255,255,0.88); }
body.dark-mode .sngl-body h1         { color: #ffffff; }
body.dark-mode .sngl-body h2,
body.dark-mode .sngl-body h3,
body.dark-mode .sngl-body h4,
body.dark-mode .sngl-body h5         { color: #ffffff; }
body.dark-mode .sngl-body a          { color: #93c5fd; }
body.dark-mode .sngl-body blockquote { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.65); }
body.dark-mode .sngl-body blockquote cite { color: rgba(255,255,255,0.85); }
body.dark-mode .sngl-author          { background: rgba(255,255,255,0.04); }
body.dark-mode .sngl-author__name a  { color: #ffffff; }
body.dark-mode .sngl-author__socials a { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
body.dark-mode .sngl-rcard__ratio    { background: #1a1a1a; }
body.dark-mode .sngl-rcard__title-link { color: rgba(255,255,255,0.90); }
body.dark-mode .sngl-rcard__title-link:hover { color: #ffffff; }
body.dark-mode .sngl-rcard__badge    { background: hsl(var(--badge-hue,258) 65% 55%/0.18); color: hsl(var(--badge-hue,258) 65% 70%); }
body.dark-mode .sngl-related__title  { color: #ffffff; }
/* Comments dark mode */
body.dark-mode .sngl-comments__title          { color: #ffffff; }
body.dark-mode .cmt-count                     { color: rgba(255,255,255,0.40); border-color: rgba(255,255,255,0.08); }
body.dark-mode .cmt-item                      { border-color: rgba(255,255,255,0.07); }
body.dark-mode .cmt-list .children            { border-color: rgba(255,255,255,0.10); }
body.dark-mode .cmt-author                    { color: rgba(255,255,255,0.90); }
body.dark-mode .cmt-author a                  { color: rgba(255,255,255,0.90); }
body.dark-mode .cmt-author a:hover            { color: var(--color-primary); }
body.dark-mode .cmt-time                      { color: rgba(255,255,255,0.38); }
body.dark-mode .cmt-edit a                    { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.40); }
body.dark-mode .cmt-edit a:hover              { color: var(--color-primary); border-color: var(--color-primary); }
body.dark-mode .cmt-content                   { color: rgba(255,255,255,0.82); }
body.dark-mode .comment-reply-link            { color: rgba(255,255,255,0.42); border-color: rgba(255,255,255,0.12); }
body.dark-mode .comment-reply-link:hover      { color: var(--color-primary); border-color: var(--color-primary); background: rgba(37,99,235,0.08); }
body.dark-mode .cmt-pagination                { border-color: rgba(255,255,255,0.08); }
body.dark-mode .cmt-pagination a              { color: #93c5fd; }
body.dark-mode #reply-title                   { color: #ffffff; }
body.dark-mode #cancel-comment-reply-link     { border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.42); }
body.dark-mode #cancel-comment-reply-link:hover { color: var(--color-primary); border-color: var(--color-primary); }
body.dark-mode .comment-form .logged-in-as    { color: rgba(255,255,255,0.42); }
body.dark-mode .comment-form .comment-notes   { color: rgba(255,255,255,0.35); }
body.dark-mode .sngl-comments__wrap .comment-form label { color: rgba(255,255,255,0.75); }
body.dark-mode .sngl-comments__wrap .comment-form textarea,
body.dark-mode .sngl-comments__wrap .comment-form input[type="text"],
body.dark-mode .sngl-comments__wrap .comment-form input[type="email"],
body.dark-mode .sngl-comments__wrap .comment-form input[type="url"] {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
}
body.dark-mode .sngl-comments__wrap .comment-form textarea:focus,
body.dark-mode .sngl-comments__wrap .comment-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
body.dark-mode .sngl-comments__wrap .comment-form textarea::placeholder,
body.dark-mode .sngl-comments__wrap .comment-form input::placeholder { color: rgba(255,255,255,0.22); }
body.dark-mode .comment-form-cookies-consent label { color: rgba(255,255,255,0.38); }
body.dark-mode .lexpl-item__thumb-wrap { background: rgba(255,255,255,0.08); }
body.dark-mode .lexpl-item__title-link:hover { color: #ff4d6d; }
body.dark-mode .lexpl-item__cat-name { color: hsl(var(--badge-hue, 258), 70%, 68%); }
/* Table dark mode */
body.dark-mode .sngl-body table th,
body.dark-mode .sngl-body table td { border-color: rgba(255,255,255,0.12); }
body.dark-mode .sngl-body table th { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.92); }
body.dark-mode .sngl-body table td { color: rgba(255,255,255,0.82); }

/* TOC dark mode */
body.dark-mode .sngl-toc                            { background: rgba(255,255,255,0.03); }
body.dark-mode .sngl-toc__head:hover                { background: rgba(255,255,255,0.04); }
body.dark-mode .sngl-toc__item--d0 .sngl-toc__link  { color: rgba(255,255,255,0.82); }
body.dark-mode .sngl-toc__link:hover                { background: rgba(255,255,255,0.07); color: var(--color-primary); }
body.dark-mode .sngl-toc__item.is-active > .sngl-toc__link { background: rgba(255,255,255,0.07); }
body.dark-mode .sngl-toc__toggle:hover              { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.90); }
body.dark-mode .sngl-toc__count                     { background: rgba(255,255,255,0.10); }

/* ── Responsive ≤ 1024px ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --sngl-title-size: 30px;
    --sngl-author-av:  68px;
    --sngl-pad-h:      20px;
  }
  /* minmax(0,1fr) = track minimum is 0, not auto; prevents child content
     from stretching the grid track wider than the container.
     min-width:0 on the item ensures the grid item itself cannot exceed its track. */
  .sngl-grid          { grid-template-columns: minmax(0, 1fr); }
  /* min-width:0 prevents the grid item from stretching the track.
     No overflow-x:clip here — clipping at the column boundary (343px) would
     cut off the right 16px container padding and make text look clipped.
     Clipping is deferred to .sngl-outer at the ≤768px breakpoint below,
     which clips at viewport width and only catches genuine overflow. */
  .sngl-content       { min-width: 0; }
  .sngl-sidebar       { position: static; max-height: none; margin-top: 48px; }
  .sngl-related-grid  { grid-template-columns: repeat(2, 1fr); }
  /* After the grid collapses to one column, alignwide/alignfull must stay within
     the container — there is no wider canvas to bleed into on tablet. */
  .sngl-body .alignwide,
  .sngl-body .alignfull,
  .sngl-body .wp-block-image.alignwide,
  .sngl-body .wp-block-image.alignfull {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ── Responsive ≤ 768px ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --sngl-title-size: 26px;
    --sngl-pad-h:      16px;
    --sngl-author-av:  60px;
    --sngl-nav-thumb:  40px;
  }
  /* overflow-x:clip on the outer page wrapper clips anything that genuinely
     escapes the viewport (not the column) — does NOT create a scroll container
     so position:sticky children remain unaffected. */
  .sngl-outer          { padding-top: 24px; padding-bottom: 40px; overflow-x: clip; }
  .sngl-toc            { margin: 20px 0 24px; }
  .sngl-toc__link      { font-size: 13px; padding: 4px 8px 4px 9px; }
  .sngl-toc__item--d0 .sngl-toc__link { font-size: 13px; }
  .sngl-author         { gap: 12px; padding: 14px 16px; }
  /* Keep prev/next on one row — reduce thumb and tighten gap to fit 2 cols */
  .sngl-nav            { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sngl-nav__link      { gap: 8px; padding: 8px 0; }
  .sngl-nav__label     { font-size: 10px; }
  .sngl-nav__title     { font-size: 12px; max-width: 100%; }
  .sngl-related-grid   { grid-template-columns: 1fr 1fr; gap: 16px; }
  .sngl-body-wrap      { flex-direction: column; gap: 16px; }
  /* ROOT FIX: .sngl-body-wrap uses align-items:flex-start (needed for desktop).
     In column direction on mobile this shrink-wraps .sngl-body to its widest
     child (e.g. a 533px table). width:100% forces cross-axis fill. */
  .sngl-body           { width: 100%; }
  .sngl-share-bar      { position: static; width: 100%; }
  .sngl-share-bar__list { flex-direction: row; flex-wrap: wrap; }
  .sngl-share-bar__btn { width: 36px; height: 36px; font-size: 15px; }
  .sngl-meta__share    { margin-left: 0; width: 100%; }
  /* Comment form: collapse 3 cols to 1 */
  .sngl-comments__wrap #commentform { grid-template-columns: 1fr; }
  .sngl-comments__wrap #commentform .comment-form-author,
  .sngl-comments__wrap #commentform .comment-form-email,
  .sngl-comments__wrap #commentform .comment-form-url { grid-column: 1 / -1; }
  /* Reduce nested indent on mobile */
  .cmt-list .children { margin-left: 16px; padding-left: 12px; }
  /* Slightly smaller avatar on mobile */
  .cmt-avatar,
  .cmt-avatar .cmt-avatar__img,
  .cmt-avatar img { width: 36px !important; height: 36px !important; }
  /* ── Content images & media ──────────────────────────────────────── */
  /* Override Gutenberg inline width="" on figure wrappers */
  .sngl-body figure,
  .sngl-body .wp-block-image,
  .sngl-body .wp-caption {
    max-width: 100% !important;
    width: auto !important;
  }
  .sngl-body figure img,
  .sngl-body .wp-block-image img,
  .sngl-body .wp-caption img {
    max-width: 100% !important;
    height: auto !important;
  }
  /* Un-float left/right aligned images — float layout breaks single-column */
  .sngl-body .alignleft,
  .sngl-body .alignright,
  .sngl-body .wp-block-image.alignleft,
  .sngl-body .wp-block-image.alignright {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* Prevent any block from creating a horizontal scroll */
  .sngl-body > * { max-width: 100%; }
  /* Code/pre blocks: scroll horizontally rather than breaking the container */
  .sngl-body pre,
  .sngl-body .wp-block-code,
  .sngl-body .wp-block-preformatted,
  .sngl-body .wp-block-code pre { overflow-x: auto; max-width: 100%; }
}

/* ── Responsive ≤ 480px ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --sngl-title-size: 22px; }
  .sngl-related-grid { grid-template-columns: 1fr; }
  .sngl-author       { flex-direction: column; }
  /* Clamp deep nesting to prevent overflow */
  .cmt-list .children .children { margin-left: 10px; padding-left: 8px; }
  .cmt-list .children .children .children { margin-left: 0; padding-left: 6px; }
}
