/* Single Post template — .sp scoped styles
   Source design: .design/blog-post.dc.html */

.sp {
  --sp-paper: #FFFFFF;
  --sp-canvas: var(--nu-canvas, #F6F5F1);
  --sp-mist: #ECEBE5;
  --sp-line: #E2E0D9;
  --sp-line-soft: #EBEAE3;
  --sp-charcoal: #26262B;
  --sp-ink: #17171B;
  --sp-muted: #6B6B72;
  --sp-muted-2: #8C8C92;
  --sp-sans: 'Hanken Grotesk', system-ui, sans-serif;
  --sp-display: 'Newsreader', Georgia, serif;
  --sp-mono: 'JetBrains Mono', ui-monospace, monospace;
  --sp-radius: 12px;
  --sp-ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  font-family: var(--sp-sans);
  color: var(--sp-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.single-post {
  background: var(--nu-canvas, #F6F5F1);
}

.sp a {
  text-decoration: none;
  color: inherit;
}

.sp-wrap {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--nu-gutter, clamp(1.25rem, 4vw, 3rem));
}

/* =========================================================
   HERO BAND (dark)
   ========================================================= */

.sp-hero {
  background: var(--sp-ink);
  padding-block: 20px;
}

.sp-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sp-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding-top: 1.5rem;
}

.sp-crumb a {
  color: #fff;
}

.sp-crumb a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sp-crumb .sep {
  color: rgba(255, 255, 255, 0.35);
}

.sp-hero-inner {
  padding-block: clamp(2rem, 4vw, 3.25rem) clamp(2rem, 4vw, 3rem);
}

.sp-hero-grid {
  display: grid !important;
  grid-template-columns: calc(50% - 50px) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: stretch;
}

/* Hero column owns its vertical rhythm — kill kit widget-spacing
   so title→deck isn't 20px kit + 1.15rem CSS (~38px). */
.sp-hero-col > .elementor-widget {
  --kit-widget-spacing: 0px;
}

.sp-hero-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Eyebrow */
.sp-eyb {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sp-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}

.sp-eyb .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.sp-eyb .muted {
  color: rgba(255, 255, 255, 0.6);
}

/* Title (theme-post-title widget) */
.sp-title .elementor-heading-title {
  font-family: var(--sp-sans);
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: #f6f4ee;
  margin: 1.1rem 0 0;
  text-wrap: balance;
}

/* Deck (theme-post-excerpt widget) */
.sp-deck {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 1.15rem;
  max-width: 44ch;
}

.sp-deck p {
  margin: 0;
  text-wrap: pretty;
}

/* Byline */
.sp-hero-col .elementor-widget-html:last-child {
  width: 100%;
  margin-top: auto;
}

.sp-byline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sp-byline__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sp-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

.sp-byline__meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

/* Share buttons */
.sp-share {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.sp-share a {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--sp-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-muted);
  transition: all 0.15s;
}

.sp-hero .sp-share a {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.7);
}

.sp-share a:hover {
  border-color: var(--sp-ink);
  color: #fff;
  background: var(--sp-ink);
}

.sp-hero .sp-share a:hover {
  background: #fff;
  color: var(--sp-ink);
  border-color: #fff;
}

.sp-share a.is-copied::after {
  content: "Copied";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--sp-ink);
  color: #fff;
  font-family: var(--sp-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
}

.sp-hero .sp-share a.is-copied::after {
  background: #fff;
  color: var(--sp-ink);
}

@media (max-width: 520px) {
  .sp-byline .sp-share {
    display: none;
  }
}

/* Hero media */
.sp-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
}

.sp-figure .sp-media {
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16 / 9;
  border-radius: var(--sp-radius);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sp-figcap {
  margin-top: 0.7rem;
  font-family: var(--sp-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

/* Media block (shared with related cards) */
.sp-media {
  position: relative;
  overflow: hidden;
  background: #e3e2df;
}

.sp-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.5) 0 1.25px, transparent 1.25px 8px);
  pointer-events: none;
}

.sp-media[style*="background-image"]::after {
  content: none;
}

.sp-media--charcoal {
  background: linear-gradient(135deg, #33343a 0%, #242429 55%, #1c1c20 100%);
}

.sp-media--charcoal::after {
  content: "";
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 1.25px, transparent 1.25px 8px);
  mix-blend-mode: overlay;
}

.sp-media .cap {
  position: absolute;
  left: 0.95rem;
  bottom: 0.7rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sp-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.sp-media .cap::before {
  content: "";
  width: 12px;
  height: 2px;
  background: currentColor;
  opacity: 0.9;
}

/* =========================================================
   BODY
   ========================================================= */

.sp-body {
  padding-block: clamp(2.5rem, 4vw, 3.5rem) clamp(3rem, 6vw, 4.5rem);
}

.sp-body-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 100px;
  align-items: start;
}

/* Prose — styles the theme-post-content widget output */
.sp-prose p {
  font-size: 1.0625rem;
  line-height: 1.75;
  margin: 0 0 1.2em;
  text-wrap: pretty;
  color: var(--sp-ink);
}

.sp-prose h2 {
  font-family: var(--sp-sans);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--sp-ink);
  margin: 2.1rem 0 0.85rem;
  text-wrap: balance;
}

.sp-prose h3 {
  font-family: var(--sp-sans);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--sp-ink);
  margin: 1.9rem 0 0.75rem;
  text-wrap: balance;
}

.sp-prose ul,
.sp-prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.25em;
  text-wrap: pretty;
}

.sp-prose li {
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 0.55em;
}

.sp-prose li::marker {
  color: var(--sp-muted-2);
}

.sp-prose .elementor-widget-theme-post-content a {
  color: var(--sp-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--sp-muted-2);
}

.sp-prose .elementor-widget-theme-post-content a:hover {
  text-decoration-color: var(--sp-ink);
}

.sp-prose blockquote {
  margin: 1.9rem 0;
  padding-left: 1.6rem;
  border-left: 3px solid var(--sp-ink);
  background: none;
}

.sp-prose blockquote p {
  font-family: var(--sp-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.36;
  margin: 0;
}

.sp-prose blockquote cite {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--sp-sans);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sp-muted);
}

.sp-prose hr {
  border: 0;
  border-top: 1px solid var(--sp-line);
  margin: 2.2rem 0;
}

.sp-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--sp-radius);
}

/* Tag pills */
.sp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2.25rem;
}

.sp-tag {
  font-family: var(--sp-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sp-muted);
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: var(--sp-mist);
  transition: all 0.15s;
}

.sp-tag:hover {
  background: var(--sp-line);
  color: var(--sp-ink);
}

/* End share row */
.sp-endshare {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--sp-line);
}

.sp-endshare .sp-share {
  margin-left: 0;
}

.sp-endshare__label {
  font-family: var(--sp-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sp-muted);
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sp-side {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  position: sticky;
  top: 2rem;
}

.sp-side-h {
  font-family: var(--sp-sans);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sp-ink);
  margin: 0;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--sp-ink);
}

.sp-rank-item {
  display: flex;
  gap: 0.95rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--sp-line-soft);
}

.sp-rank-item:last-child {
  border-bottom: 0;
}

.sp-rank-item__head {
  font-family: var(--sp-sans);
  font-size: 0.95rem;
  line-height: 1.32;
  font-weight: 700;
  color: var(--sp-ink);
  margin: 0;
  text-wrap: balance;
}

.sp-rank-item:hover .sp-rank-item__head {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sp-rank-item__meta {
  font-family: var(--sp-mono);
  font-size: 0.66rem;
  color: var(--sp-muted-2);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sp-tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

.sp-side-tag {
  font-family: var(--sp-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sp-muted);
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: var(--sp-mist);
  transition: background 0.15s, color 0.15s;
}

.sp-side-tag:hover {
  background: var(--sp-line);
  color: var(--sp-ink);
}

/* =========================================================
   RELATED POSTS
   ========================================================= */

.sp-related {
  border-top: 1px solid var(--sp-line);
  padding-block: clamp(2.5rem, 4vw, 3.5rem) clamp(3rem, 6vw, 4.5rem);
}

.sp-related__h {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 1.75rem;
}

.sp-related__h::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 5px;
  background: var(--sp-ink);
  border-radius: 999px;
}

.sp-related__h .k {
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sp-ink);
}

.sp-related__h h2 {
  font-family: var(--sp-sans);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--sp-ink);
  margin: 0.35rem 0 0;
}

.sp-rel-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.sp-rel-card {
  display: flex;
  flex-direction: column;
  background: var(--sp-paper);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  overflow: hidden;
  transition: transform 0.45s var(--sp-ease-out), box-shadow 0.45s var(--sp-ease-out);
}

.sp-rel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.45);
}

.sp-rel-card .sp-media {
  aspect-ratio: 16 / 9;
}

.sp-rel-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sp-rel-card__meta {
  font-family: var(--sp-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--sp-muted);
  text-transform: uppercase;
}

.sp-rel-card__body h4 {
  font-family: var(--sp-sans);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--sp-ink);
  margin: 0;
  text-wrap: balance;
}

.sp-rel-card__more {
  margin-top: auto;
  padding-top: 0.9rem;
  font-family: var(--sp-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sp-rel-card:hover .sp-rel-card__more {
  color: var(--sp-ink);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 960px) {
  .sp-body-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .sp-side {
    position: static;
  }
}

@media (max-width: 880px) {
  .sp-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

@media (max-width: 820px) {
  .sp-rel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .sp-wrap {
    padding-inline: var(--nu-gutter, clamp(1.25rem, 4vw, 3rem));
  }

  .sp-title .elementor-heading-title {
    font-size: 2.05rem;
  }

  .sp-deck {
    font-size: 1.1rem;
  }

  .sp-prose p,
  .sp-prose li {
    font-size: 1.1rem;
  }

  .sp-prose blockquote p {
    font-size: 1.35rem;
  }
}

/* ---- Motion audit (2026-07-13): base-state transitions so no interaction snaps.
   Tint tier 0.2s / travel tier 0.45s, house curve. See AGENTS.md motion rules. ---- */
.sp-rank-item .sp-rank-item__head { transition: color 0.2s var(--sp-ease-out), text-underline-offset 0.2s var(--sp-ease-out); }
.sp-rel-card .sp-rel-card__more { transition: color 0.2s var(--sp-ease-out); }
