/* =========================================================
   SINGLE POST READING SYSTEM (mobile-first)
   Scope: only single posts (single.php)
   Place this AFTER existing styles to override them.
   ========================================================= */

body.single-post main {
    background-color: #FCFCFD;
    padding: 133px 0 0 0;
}

@media (min-width: 515px) {
    body.single-post main {
        padding: 115px 0 0 0;
    }
}

body.single-post .container {
  /* Helps readability by preventing ultra-wide layouts on huge screens */
  max-width: 1200px;
}

/* --- Title / meta line ---------------------------------- */
body.single-post .col-lg-8 > h1.fw-bold {
  font-size: clamp(1.75rem, 1.15rem + 2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem !important;
}

body.single-post .col-lg-8 > p.text-muted.small {
  font-size: 0.95rem !important;
  line-height: 1.4;
  margin-bottom: 1.25rem !important;
}

/* --- Main reading area ---------------------------------- */
body.single-post .post-content {
  /* Fluid body type */
  font-size: clamp(1.03rem, 0.98rem + 0.25vw, 1.12rem) !important;
  line-height: 1.75 !important;
  text-rendering: optimizeLegibility;

  /* Keep lines readable inside the 8-col area */
  max-width: 75ch;
}

/* If you prefer left-aligned rather than centered, remove these 2 lines */
body.single-post .post-content {
  margin-left: auto;
  margin-right: auto;
}

/* Consistent vertical rhythm */
body.single-post .post-content > * {
  margin-top: 0;
  margin-bottom: 1.05em;
}

body.single-post .post-content p {
  margin-bottom: 1.1em !important;
}

body.single-post .post-content strong {
  font-weight: 700;
}

/* Links: readable, subtle, accessible */
body.single-post .post-content a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}
body.single-post .post-content a:hover {
  text-decoration-thickness: 0.12em;
}

/* Headings: spacing + scroll offset for TOC anchors */
body.single-post .post-content h2:not(.simpletoc-title),
body.single-post .post-content .wp-block-heading:is(h2) {
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.9rem) !important;
  line-height: 1.25;
  margin-top: 2.1em !important;
  margin-bottom: 0.7em !important;
  scroll-margin-top: 110px; /* header offset */
}

body.single-post .post-content h3,
body.single-post .post-content .wp-block-heading:is(h3) {
  font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.5rem) !important;
  line-height: 1.3;
  margin-top: 1.6em !important;
  margin-bottom: 0.6em !important;
  scroll-margin-top: 110px;
}

body.single-post .post-content h4 {
  font-size: 1.05rem !important;
  line-height: 1.35;
  margin-top: 1.3em !important;
  margin-bottom: 0.5em !important;
  scroll-margin-top: 110px;
}

/* Lists */
body.single-post .post-content ul,
body.single-post .post-content ol {
  padding-left: 1.2rem;
  margin-bottom: 1.2em !important;
}

body.single-post .post-content li {
  margin-bottom: 0.45em;
}

body.single-post .post-content ul ul,
body.single-post .post-content ol ol {
  margin-top: 0.6em;
}

/* Blockquotes */
body.single-post .post-content blockquote {
  border-left: 4px solid rgba(15, 23, 42, 0.25);
  padding: 0.9rem 1rem;
  margin: 1.4em 0 !important;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 10px;
}
body.single-post .post-content blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* Separators */
body.single-post .post-content hr,
body.single-post .post-content .wp-block-separator {
  margin: 2em 0 !important;
  opacity: 0.15;
}

/* Images */
body.single-post .post-content img:not(.emoji) {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

body.single-post .post-content figure {
  margin: 1.2em 0 !important;
}

body.single-post .post-content figcaption {
  font-size: 0.92rem;
  color: rgba(31, 41, 55, 0.75);
  margin-top: 0.5rem;
}

/* Emoji images (WordPress) */
body.single-post .post-content img.emoji {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  margin: 0 0.12em;
}

/* --- YouTube embeds: responsive + nicer spacing --------- */
body.single-post .post-content .wp-block-embed-youtube {
  margin: 0 0 1.2em !important;
}

body.single-post .post-content .wp-block-embed__wrapper iframe {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
}

/* --- Continue watching block (compact bar) --------------- */
/* Targets the injected bar (mt-3 mb-4 p-3 bg-light border rounded) without adding new classes */
body.single-post .post-content > .mt-3.mb-4.p-3.bg-light.border.rounded {
  padding: 0.95rem !important;
  border-radius: 12px !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(15, 23, 42, 0.03) !important;
}
body.single-post .post-content > .mt-3.mb-4.p-3.bg-light.border.rounded .small {
  line-height: 1.45;
}
body.single-post .post-content > .mt-3.mb-4.p-3.bg-light.border.rounded .btn {
  white-space: nowrap;
}

/* --- Table of Contents (SimpleTOC) ----------------------- */
body.single-post .post-content .simpletoc {
  padding: 1rem !important;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
}

body.single-post .post-content .simpletoc-title {
  font-size: 1rem !important;
  font-weight: 700;
  margin-bottom: 0.6rem !important;
}

body.single-post .post-content .simpletoc-list {
  margin: 0 !important;
  padding-left: 1.1rem;
}

body.single-post .post-content .simpletoc-list a {
  text-decoration: none;
}
body.single-post .post-content .simpletoc-list a:hover {
  text-decoration: underline;
}

/* --- Share section -------------------------------------- */
body.single-post .col-lg-8 .mb-5 > h6.fw-bold {
  font-size: 1rem;
  margin-bottom: 0.6rem !important;
}
body.single-post .col-lg-8 .mb-5 .d-flex.gap-3 a {
  line-height: 1;
}

/* --- Bottom podcast nav --------------------------------- */
body.single-post .podcast-episode-nav .card {
  border-radius: 14px;
}
body.single-post .podcast-episode-nav .card-body {
  padding: 1rem;
}
body.single-post .podcast-episode-nav .fw-semibold {
  line-height: 1.35;
}

/* --- Sidebar tweaks (All Episodes) ----------------------- */
body.single-post .single-sidebar {
  margin-top: 0.75rem;
}

body.single-post .single-sidebar .list-group-item h6 {
  font-size: 0.98rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

body.single-post .single-sidebar .list-group-item .small {
  font-size: 0.85rem;
}

body.single-post .single-sidebar .list-group {
  border-radius: 12px;
  overflow: hidden;
}

/* Better tap targets */
body.single-post .single-sidebar .list-group-item {
  padding: 0.85rem 0.9rem !important;
}

/* Optional: make sidebar sticky on large screens (nice UX)
   Uncomment if you want the episode list to stay visible while scrolling.
*/
/*
@media (min-width: 992px) {
  body.single-post .single-sidebar {
    position: sticky;
    top: 100px;
  }
}
*/

/* --- Desktop refinements -------------------------------- */
@media (min-width: 992px) {
  body.single-post .post-content {
    font-size: clamp(1.05rem, 0.95rem + 0.3vw, 1.15rem) !important;
  }

  body.single-post .col-lg-8 > p.text-muted.small {
    font-size: 0.98rem !important;
  }
}
