/* ================================================================
   THE WHEEL LAB — Single Post (Premium Editorial)
   Scoped to .twl-sp
   ================================================================ */

.twl-sp {
  --sp-bg:      #ffffff;
  --sp-text:    #1a1a1a;
  --sp-body:    #333333;
  --sp-muted:   #888888;
  --sp-border:  #eeeeee;
  --sp-surface: #f8f8f8;
  --sp-gold:    #d4af37;
  --sp-orange:  #ff6a00;
  --sp-radius:  8px;
  --sp-shadow:  0 1px 3px rgba(0,0,0,0.06);
  --sp-max:     1600px;
  --sp-content: 740px;
  --sp-sidebar: 300px;
  --sp-gutter:  24px;
}

/* ── Parent theme overrides ── */
body.single-post {
  background: #ffffff !important;
}
body.single-post .page_wrap {
  background: #ffffff !important;
}
body.single-post .page_title_wrap,
body.single-post .sidebar,
body.single-post .sidebar_inner,
body.single-post .nav-links-single,
body.single-post .related_wrap,
body.single-post .comments_wrap {
  display: none !important;
}
body.single-post .top_panel {
  margin-bottom: 0 !important;
}
body.single-post .page_content_wrap {
  background: #ffffff !important;
  padding: 0 !important;
  margin-top: 0 !important;
}
body.single-post .content_wrap {
  max-width: 100% !important;
  padding: 0 !important;
  width: 100% !important;
}
body.single-post .page_content_wrap > .content_wrap {
  display: block !important;
  float: none !important;
}
body.single-post .content {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

/* ── Main ── */
.twl-sp {
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

/* ── Progress bar ── */
.twl-sp__progress {
  position: fixed;
  top: 95px;
  left: 0;
  height: 10px;
  width: 0;
  background: var(--sp-orange);
  z-index: 10001;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Container: 2-column grid ── */
.twl-sp__container {
  max-width: var(--sp-max);
  margin: 0 auto;
  padding: 0 var(--sp-gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sp-sidebar);
  gap: 48px;
}

/* ── Content column ── */
.twl-sp__content-col {
  max-width: 90%;
  min-width: 0;
}

/* ── Breadcrumbs ── */
.twl-sp__breadcrumbs {
  padding: 20px 0 0;
}
.twl-sp .twl-breadcrumbs {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.twl-sp .twl-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.twl-sp .twl-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--sp-muted);
}
.twl-sp .twl-breadcrumbs li + li::before {
  content: '/';
  margin: 0 6px;
  color: var(--sp-border);
}
.twl-sp .twl-breadcrumbs a {
  color: var(--sp-muted);
  text-decoration: none;
}
.twl-sp .twl-breadcrumbs a:hover {
  color: var(--sp-text);
}
.twl-sp .twl-breadcrumbs li[aria-current="page"] {
  color: var(--sp-text);
}

/* ── Header ── */
.twl-sp__header {
  margin-top: 32px;
}
.twl-sp__cat {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-gold);
  text-decoration: none;
  border-bottom: 2px solid var(--sp-gold);
  padding-bottom: 2px;
  margin-bottom: 16px;
}
.twl-sp__cat:hover {
  color: var(--sp-orange);
  border-color: var(--sp-orange);
}
.twl-sp__title {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--sp-text);
  margin: 0 0 16px;
  text-transform: none;
  letter-spacing: -0.01em;
}
.twl-sp__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sp-muted);
}

/* ── Featured image ── */
.twl-sp__hero {
  margin: 28px 0 32px;
  line-height: 0;
}
.twl-sp__hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
}

/* ================================================================
   CONTENT TYPOGRAPHY
   ================================================================ */
.twl-sp__body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--sp-body);
  max-width: 100%;
}
.twl-sp__body > *:first-child {
  margin-top: 0;
}
.twl-sp__body p,
.twl-sp__body li,
.twl-sp__body td,
.twl-sp__body th,
.twl-sp__body blockquote,
.twl-sp__body figcaption,
.twl-sp__body dt,
.twl-sp__body dd,
.twl-sp__body span {
  font-family: 'Inter', sans-serif;
}
.twl-sp__body p {
  margin: 0 0 1.5rem;
}

/* Headings */
.twl-sp__body h2 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
  color: var(--sp-text);
  margin: 48px 0 18px;
  padding-left: 16px;
  border-left: 3px solid var(--sp-gold);
  position: relative;
}
.twl-sp__body h2::after {
  display: none;
}
.twl-sp__body h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  color: var(--sp-text);
  margin: 36px 0 12px;
}
.twl-sp__body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sp-text);
  margin: 28px 0 10px;
}

/* Links */
.twl-sp__body a {
  color: var(--sp-text);
  text-decoration: underline;
  text-decoration-color: var(--sp-gold);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.twl-sp__body a:hover {
  text-decoration-color: var(--sp-orange);
}

/* Lists */
.twl-sp__body ul,
.twl-sp__body ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5em;
}
.twl-sp__body li {
  margin-bottom: 8px;
}

/* Blockquote */
.twl-sp__body blockquote {
  margin: 28px 0;
  padding: 0 0 0 20px;
  border-left: 3px solid var(--sp-gold);
  background: none;
  border-radius: 0;
  font-style: italic;
  color: var(--sp-muted);
}
.twl-sp__body blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables */
.twl-sp__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.92rem;
}
.twl-sp__body thead th {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sp-text);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--sp-border);
}
.twl-sp__body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sp-border);
}
.twl-sp__body tbody tr:last-child td {
  border-bottom: none;
}

/* Images */
.twl-sp__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--sp-radius);
  margin: 8px 0;
  cursor: zoom-in;
}
.twl-sp__body figure {
  margin: 28px 0;
}
.twl-sp__body figcaption {
  font-size: 0.82rem;
  color: var(--sp-muted);
  margin-top: 8px;
}

/* Code */
.twl-sp__body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--sp-text);
}
.twl-sp__body pre {
  background: var(--sp-surface);
  color: var(--sp-text);
  padding: 20px;
  border-radius: var(--sp-radius);
  overflow-x: auto;
  margin: 28px 0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.twl-sp__body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Tags — pills ── */
.twl-sp__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--sp-border);
}
.twl-sp__tags a {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sp-body);
  text-decoration: none;
  background: #f0f0f0;
  padding: 6px 14px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.twl-sp__tags a:hover {
  background: var(--sp-gold);
  color: #fff;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.twl-sp__sidebar {
  min-width: 0;
  padding-top: 80px;
}
.twl-sp__sidebar-inner {
  position: sticky;
  top: 100px;
}
.twl-sp__sidebar-section {
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 20px;
  margin-bottom: 20px;
}
.twl-sp__sidebar-label {
  font-family: 'Conthrax', 'Inter', sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sp-text);
  margin: 0 0 16px;
}
.twl-sp__sidebar-post {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--sp-border);
}
.twl-sp__sidebar-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.twl-sp__sidebar-post:first-of-type {
  padding-top: 0;
}
.twl-sp__sidebar-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.twl-sp__sidebar-thumb--empty {
  display: block;
  background: var(--sp-surface);
}
.twl-sp__sidebar-post-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sp-text);
  line-height: 1.35;
}
.twl-sp__sidebar-post:hover .twl-sp__sidebar-post-title {
  color: var(--sp-gold);
}

/* Sidebar CTA */
.twl-sp__sidebar-cta {
  border-top: 3px solid var(--sp-gold);
  background: var(--sp-bg);
  border-radius: 0 0 var(--sp-radius) var(--sp-radius);
  padding: 24px 20px;
  box-shadow: var(--sp-shadow);
}
.twl-sp__sidebar-cta-heading {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sp-text);
  margin: 0 0 8px;
}
.twl-sp__sidebar-cta-text {
  font-size: 0.88rem;
  color: var(--sp-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.twl-sp__sidebar-cta-btn {
  display: block;
  text-align: center;
  background: var(--sp-gold);
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}
.twl-sp__sidebar-cta-btn:hover {
  background: var(--sp-orange);
}

/* ================================================================
   HOOKED CONTENT OVERRIDES (scoped to .twl-sp)
   ================================================================ */

/* Pillar link — muted, no background */
.twl-sp .twl-pillar-link {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 20px 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.85rem !important;
  color: var(--sp-muted) !important;
}
.twl-sp .twl-pillar-link a {
  color: var(--sp-muted) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--sp-border) !important;
}
.twl-sp .twl-pillar-link a:hover {
  color: var(--sp-text) !important;
}

/* Related posts — 2-col grid with images */
.twl-sp .twl-related-posts {
  background: none !important;
  border: none !important;
  border-top: 1px solid var(--sp-border) !important;
  border-radius: 0 !important;
  padding: 24px 0 0 !important;
  margin-top: 36px !important;
}
.twl-sp .twl-related-posts h3 {
  font-family: 'Conthrax', 'Inter', sans-serif !important;
  font-size: 0.78rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--sp-text) !important;
  border: none !important;
  margin-bottom: 16px !important;
}
.twl-sp .twl-related-posts__grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
}
.twl-sp .twl-related-posts__card {
  display: flex !important;
  flex-direction: column !important;
  background: var(--sp-bg) !important;
  border: 1px solid var(--sp-border) !important;
  border-radius: var(--sp-radius) !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: var(--sp-shadow) !important;
  text-decoration: none !important;
  transition: box-shadow 0.2s, transform 0.2s !important;
}
.twl-sp .twl-related-posts__card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}
.twl-sp .twl-related-posts__img {
  display: block !important;
  line-height: 0 !important;
  overflow: hidden !important;
}
.twl-sp .twl-related-posts__img img {
  width: 100% !important;
  height: 140px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
}
.twl-sp .twl-related-posts__card h4 {
  padding: 12px 14px 4px !important;
  margin: 0 !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: var(--sp-text) !important;
  font-family: 'Inter', sans-serif !important;
  text-transform: none !important;
  line-height: 1.35 !important;
}
.twl-sp .twl-related-posts__card:hover h4 {
  color: var(--sp-gold) !important;
}
.twl-sp .twl-related-posts__time {
  padding: 0 14px 12px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.75rem !important;
  color: var(--sp-muted) !important;
}

/* Service CTA — card with gold top border + button */
.twl-sp .twl-blog-service-cta {
  background: var(--sp-bg) !important;
  border: 1px solid var(--sp-border) !important;
  border-top: 3px solid var(--sp-gold) !important;
  border-radius: 0 0 var(--sp-radius) var(--sp-radius) !important;
  color: var(--sp-text) !important;
  padding: 24px !important;
  margin-top: 32px !important;
  box-shadow: var(--sp-shadow) !important;
}
.twl-sp .twl-blog-service-cta p {
  margin: 0 0 12px !important;
}
.twl-sp .twl-blog-service-cta strong {
  font-family: 'Poppins', 'Inter', sans-serif !important;
  font-size: 1.05rem !important;
  color: var(--sp-text) !important;
}
.twl-sp .twl-blog-service-cta a.twl-btn {
  display: inline-block !important;
  background: var(--sp-gold) !important;
  color: #fff !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  padding: 10px 24px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  margin-top: 4px !important;
  transition: background 0.2s !important;
}
.twl-sp .twl-blog-service-cta a.twl-btn:hover {
  background: var(--sp-orange) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ================================================================
   MORE ARTICLES — 3-col cards on surface bg
   ================================================================ */
.twl-sp__more {
  background: var(--sp-surface);
  margin-top: 64px;
  padding: 48px var(--sp-gutter) 80px;
}
.twl-sp__more-heading {
  font-family: 'Conthrax', 'Inter', sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sp-text);
  text-align: center;
  margin: 0 0 32px;
}
.twl-sp__more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: var(--sp-max);
  margin: 0 auto;
}
.twl-sp__more-card {
  background: var(--sp-bg);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--sp-text);
  transition: box-shadow 0.2s, transform 0.2s;
}
.twl-sp__more-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.twl-sp__more-card:hover h3 {
  color: var(--sp-gold);
}
.twl-sp__more-img {
  line-height: 0;
  overflow: hidden;
}
.twl-sp__more-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.twl-sp__more-cat {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sp-gold);
  display: block;
  margin-bottom: 6px;
}
.twl-sp__more-body {
  padding: 16px 18px 18px;
}
.twl-sp__more-body h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sp-text);
  line-height: 1.35;
  margin: 0 0 8px;
  transition: color 0.2s;
}
.twl-sp__more-meta {
  font-size: 0.78rem;
  color: var(--sp-muted);
}

/* ================================================================
   FADE-IN ANIMATION
   ================================================================ */
.twl-sp__fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.twl-sp__fade-in--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   LIGHTBOX
   ================================================================ */
.twl-sp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 40px;
}
.twl-sp-lightbox--open {
  opacity: 1;
}
.twl-sp-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--sp-radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 960px) {
  .twl-sp__container {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .twl-sp__content-col {
    max-width: 100%;
  }
  .twl-sp__sidebar {
    padding-top: 40px;
    border-top: 1px solid var(--sp-border);
    margin-top: 40px;
  }
  .twl-sp__sidebar-inner {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 760px) {
  .twl-sp__more-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .twl-sp .twl-related-posts__grid {
    grid-template-columns: 1fr !important;
  }
  .twl-sp__sidebar-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .twl-sp {
    --sp-gutter: 16px;
  }
  .twl-sp__title {
    font-size: 1.75rem;
  }
  .twl-sp__hero {
    margin-left: calc(-1 * var(--sp-gutter));
    margin-right: calc(-1 * var(--sp-gutter));
  }
  .twl-sp__hero img {
    border-radius: 0;
  }
  .twl-sp__body pre {
    margin-left: calc(-1 * var(--sp-gutter));
    margin-right: calc(-1 * var(--sp-gutter));
    padding-left: var(--sp-gutter);
    padding-right: var(--sp-gutter);
    border-radius: 0;
  }
  .twl-sp__more-grid {
    grid-template-columns: 1fr;
  }
}
