/* SocraNext article layout v2 – reading column with sticky table of contents.
   Loads on top of artikel_default.css; the Styler overrides the variables. */

/* Defaults live on the plain id selector so the Styler CSS, which is appended
   after this file with the same specificity, can override them.
   Design note: the accent is used sparingly and deliberately — category chip,
   active TOC item, takeaways box, CTA and progress bar. Structure (borders,
   surfaces, table chrome) stays neutral so one loud brand color cannot turn
   the whole page monochrome. */
#socranext-artikel {
  --sn-article-reading-width: 760px;
  --sn-article-rail-width: 230px;
  --sn-article-rail-gap: 3.5rem;
  --sn-article-layout-width: calc(
    var(--sn-article-rail-width) + var(--sn-article-rail-gap) +
      var(--sn-article-reading-width)
  );
  --sn-article-rail-top: 6rem;
  --sn-article-accent: #111827;
  --sn-article-accent-contrast: #ffffff;
  /* Reading bar fill: site gradient (--sn-grad / --sn-gradient) when the host
     page has one, otherwise the accent. The Styler overwrites this for a
     two-stop brand gradient. */
  --sn-article-accent-fill: var(
    --sn-grad,
    var(--sn-gradient, var(--sn-article-accent))
  );
  /* Accent variants for text: contrast-corrected against the page (ink) and
     against the accent-contrast surface (ink-inverse). The Styler overwrites
     both; a bright brand color stays a surface color and never becomes
     unreadable 11px text. */
  --sn-article-accent-ink: #111827;
  --sn-article-accent-ink-inverse: #111827;
  --sn-article-accent-soft: rgba(17, 24, 39, 0.07);
  --sn-article-surface: rgba(17, 24, 39, 0.035);
  --sn-article-border: rgba(17, 24, 39, 0.16);
  --sn-article-muted: rgba(17, 24, 39, 0.66);
  --sn-article-radius: 12px;
  --sn-article-hero-radius: 16px;
  --sn-article-hero-ratio: 16 / 9;
}

/* ---------- Layout skeleton ---------- */

#socranext-artikel.sn-layout-v2 .sn-article-header {
  max-width: var(--sn-article-reading-width);
  margin: 0 auto 3rem;
}

/* With a rail the header spans the full container (rail + gap + reading
   column): title and hero sit centered over the whole article and the
   two-column grid only starts below the hero. Aligning the header with the
   reading column left it floating at the right of the page. */
#socranext-artikel.sn-layout-v2 .sn-has-rail .sn-article-header {
  max-width: var(--sn-article-layout-width);
}

/* Two columns: rail + reading column. A third "phantom" rail on the right
   squeezed the reading column inside normal theme containers (1170px left
   barely 600px for the text). No align-items: grid items must stretch to the
   row height, otherwise the rail is only as tall as its own content and the
   sticky TOC has no room to travel. */
#socranext-artikel.sn-layout-v2 .sn-article-grid {
  display: grid;
  grid-template-columns:
    minmax(0, var(--sn-article-rail-width))
    minmax(0, var(--sn-article-reading-width));
  column-gap: var(--sn-article-rail-gap);
  justify-content: center;
}

#socranext-artikel.sn-layout-v2 .sn-article-grid--single {
  grid-template-columns: minmax(0, var(--sn-article-reading-width));
}

#socranext-artikel.sn-layout-v2 .sn-article-body {
  min-width: 0;
}

#socranext-artikel.sn-layout-v2 .sn-article-footer {
  max-width: var(--sn-article-reading-width);
  margin: 4.5rem auto 0;
}

/* Related articles span the same full layout width as the header (rail +
   gap + reading column). Aligning them with the reading column left empty
   space under the table of contents. */
#socranext-artikel.sn-layout-v2 .sn-has-rail .sn-article-footer {
  max-width: var(--sn-article-layout-width);
}

/* ---------- Reading progress ---------- */

#socranext-artikel.sn-layout-v2 .sn-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: transparent;
  pointer-events: none;
}

#socranext-artikel.sn-layout-v2 .sn-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sn-article-accent-fill);
  /* Size the gradient to the viewport so both stops stay visible as the bar
     grows, instead of compressing into a 3px-tall diagonal strip. */
  background-size: 100vw 100%;
  background-repeat: no-repeat;
  transition: width 80ms linear;
}

/* ---------- Header ---------- */

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs {
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  color: var(--sn-article-muted);
}

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs li + li::before {
  content: "";
  width: 0.32em;
  height: 0.32em;
  flex: 0 0 auto;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.45;
}

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs a:hover {
  color: var(--sn-article-accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

#socranext-artikel.sn-layout-v2 .sn-breadcrumbs [aria-current="page"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}

#socranext-artikel.sn-layout-v2 .sn-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--sn-article-muted);
}

#socranext-artikel.sn-layout-v2 .sn-article-category {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: var(--sn-article-accent-soft);
  color: var(--sn-article-accent-ink);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.6875rem;
  line-height: 1.4;
  transition: filter 120ms ease;
}

#socranext-artikel.sn-layout-v2 a.sn-article-category:hover {
  filter: brightness(0.92);
}

#socranext-artikel.sn-layout-v2 .sn-article-updated::before {
  content: "·";
  margin-right: 0.875rem;
  opacity: 0.5;
}

/* The "hide page title" toggle applies to the heading only; breadcrumbs, meta
   and the hero image stay visible. min() keeps long titles from overflowing on
   a phone without ignoring the size chosen in the Styler. */
#socranext-artikel.sn-layout-v2 .sn-article-title {
  display: var(--sn-article-page-title-display);
  margin: 0;
  font-size: min(var(--sn-article-title-font-size), 9vw);
  line-height: var(--sn-article-title-line-height);
  color: var(--sn-article-title-color) !important;
  text-align: var(--sn-article-title-text-align) !important;
  font-family: var(--sn-article-title-font-family, inherit);
  font-weight: var(--sn-article-title-font-weight, inherit);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

#socranext-artikel.sn-layout-v2 .sn-article-hero {
  margin: 2.25rem 0 0;
}

#socranext-artikel.sn-layout-v2 .sn-article-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--sn-article-hero-ratio);
  object-fit: cover;
  border-radius: var(--sn-article-hero-radius);
  border: 1px solid var(--sn-article-border);
  box-shadow: 0 18px 40px -24px rgba(17, 24, 39, 0.35);
}

/* ---------- Table of contents ---------- */

#socranext-artikel.sn-layout-v2 .sn-toc {
  position: sticky;
  top: var(--sn-article-rail-top);
  max-height: calc(100vh - var(--sn-article-rail-top) - 2rem);
  /* No overscroll-behavior here: when the TOC fits on screen the wheel must
     scroll the page, and when it overflows the browser chains to the page
     once the TOC hits its end. */
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.45;
  padding-bottom: 0.5rem;
}

#socranext-artikel.sn-layout-v2 .sn-toc-title {
  margin: 0 0 0.875rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sn-article-muted);
}

#socranext-artikel.sn-layout-v2 .sn-toc-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1.05rem;
  border: 1px solid var(--sn-article-border);
  border-radius: var(--sn-article-radius);
  background: var(--sn-article-surface);
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

#socranext-artikel.sn-layout-v2 .sn-toc-toggle::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 150ms ease;
}

#socranext-artikel.sn-layout-v2 .sn-toc-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

#socranext-artikel.sn-layout-v2 .sn-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#socranext-artikel.sn-layout-v2 .sn-toc-item {
  margin: 0 0 0.125rem;
}

#socranext-artikel.sn-layout-v2 .sn-toc-level-3 a {
  padding-left: 1.6rem;
  font-size: 0.8125rem;
}

#socranext-artikel.sn-layout-v2 .sn-toc-list a {
  position: relative;
  display: block;
  padding: 0.4rem 0.75rem 0.4rem 0.9rem;
  border-radius: 8px;
  color: var(--sn-article-muted);
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}

#socranext-artikel.sn-layout-v2 .sn-toc-list a:hover {
  color: var(--sn-article-accent-ink);
  background: var(--sn-article-surface);
}

#socranext-artikel.sn-layout-v2 .sn-toc-item.is-active > a {
  color: var(--sn-article-accent-ink);
  background: var(--sn-article-accent-soft);
  font-weight: 600;
}

#socranext-artikel.sn-layout-v2 .sn-toc-item.is-active > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 3px;
  background: var(--sn-article-accent);
}

/* ---------- Key takeaways ---------- */

#socranext-artikel.sn-layout-v2 .sn-takeaways {
  margin: 0 0 2.5rem;
  padding: 1.35rem 1.6rem;
  border: 1px solid var(--sn-article-border);
  border-left: 3px solid var(--sn-article-accent);
  border-radius: var(--sn-article-radius);
  background: var(--sn-article-accent-soft);
}

#socranext-artikel.sn-layout-v2 .sn-takeaways-title {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sn-article-muted);
}

#socranext-artikel.sn-layout-v2 .sn-takeaways ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#socranext-artikel.sn-layout-v2 .sn-takeaways li {
  position: relative;
  padding-left: 1.5rem;
}

#socranext-artikel.sn-layout-v2 .sn-takeaways li + li {
  margin-top: 0.55rem;
}

#socranext-artikel.sn-layout-v2 .sn-takeaways li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.5em;
  width: 0.55em;
  height: 0.3em;
  border-left: 2px solid var(--sn-article-accent-ink);
  border-bottom: 2px solid var(--sn-article-accent-ink);
  transform: rotate(-45deg);
}

/* ---------- Article content ---------- */

#socranext-artikel.sn-layout-v2 .sn-article-content {
  font-size: var(--sn-article-content-font-size);
  line-height: var(--sn-article-content-line-height);
}

#socranext-artikel.sn-layout-v2 .sn-article-content > h2 {
  scroll-margin-top: var(--sn-article-rail-top);
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--sn-article-border);
  letter-spacing: -0.012em;
  text-wrap: balance;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > h2:first-child {
  padding-top: 0;
  border-top: 0;
  margin-top: 0;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > h3 {
  scroll-margin-top: var(--sn-article-rail-top);
  margin-top: 2rem;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > p a,
#socranext-artikel.sn-layout-v2 .sn-article-content > ul a,
#socranext-artikel.sn-layout-v2 .sn-article-content > ol a,
#socranext-artikel.sn-layout-v2 .sn-article-content > blockquote a,
#socranext-artikel.sn-layout-v2 .sn-article-content .sn-table-wrap a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 120ms ease;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > p a:hover,
#socranext-artikel.sn-layout-v2 .sn-article-content > ul a:hover,
#socranext-artikel.sn-layout-v2 .sn-article-content > ol a:hover {
  text-decoration-color: currentColor;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > ul,
#socranext-artikel.sn-layout-v2 .sn-article-content > ol {
  padding-left: 1.5rem;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > ul > li + li,
#socranext-artikel.sn-layout-v2 .sn-article-content > ol > li + li {
  margin-top: 0.55rem;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--sn-article-accent);
  background: var(--sn-article-surface);
  border-radius: 0 var(--sn-article-radius) var(--sn-article-radius) 0;
  font-style: normal;
  font-size: 1.0625em;
  opacity: 1;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > blockquote > :first-child {
  margin-top: 0;
}

#socranext-artikel.sn-layout-v2 .sn-article-content > blockquote > :last-child {
  margin-bottom: 0;
}

/* ---------- Tables ---------- */

#socranext-artikel.sn-layout-v2 .sn-table-wrap {
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--sn-article-border);
  border-radius: var(--sn-article-radius);
  -webkit-overflow-scrolling: touch;
}

#socranext-artikel.sn-layout-v2 .sn-table-wrap > table,
#socranext-artikel.sn-layout-v2 .sn-article-content > table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Fallback for content stored before tables were wrapped server-side. */
#socranext-artikel.sn-layout-v2 .sn-article-content > table {
  margin: 2rem 0;
  border: 1px solid var(--sn-article-border);
}

#socranext-artikel.sn-layout-v2 .sn-article-content th,
#socranext-artikel.sn-layout-v2 .sn-article-content td {
  padding: 0.8rem 1.05rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--sn-article-border);
}

#socranext-artikel.sn-layout-v2 .sn-article-content thead th {
  background: var(--sn-article-surface);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sn-article-muted);
  white-space: nowrap;
}

#socranext-artikel.sn-layout-v2 .sn-article-content tbody tr:last-child td {
  border-bottom: 0;
}

#socranext-artikel.sn-layout-v2 .sn-article-content tbody tr:nth-child(even) td {
  background: var(--sn-article-surface);
}

/* ---------- CTA ---------- */

#socranext-artikel.sn-layout-v2 .sn-cta {
  position: relative;
  overflow: hidden;
  margin: 3rem 0 0;
  padding: 2rem 2.1rem;
  border-radius: calc(var(--sn-article-radius) + 4px);
  background: var(--sn-article-accent);
  color: var(--sn-article-accent-contrast);
}

/* Soft highlight so a flat brand color still has some depth. */
#socranext-artikel.sn-layout-v2 .sn-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 130% at 0% 0%,
    rgba(255, 255, 255, 0.14),
    transparent 55%
  );
  pointer-events: none;
}

#socranext-artikel.sn-layout-v2 .sn-cta--inline {
  margin: 3rem 0;
}

#socranext-artikel.sn-layout-v2 .sn-cta-title {
  position: relative;
  margin: 0 0 0.5rem;
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: inherit;
}

#socranext-artikel.sn-layout-v2 .sn-cta-text {
  position: relative;
  margin: 0;
  max-width: 48ch;
  color: inherit;
  opacity: 0.88;
}

#socranext-artikel.sn-layout-v2 .sn-cta-button {
  position: relative;
  display: inline-block;
  margin-top: 1.35rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--sn-article-accent-contrast);
  color: var(--sn-article-accent-ink-inverse);
  font-weight: 650;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

#socranext-artikel.sn-layout-v2 .sn-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.45);
}

/* ---------- Author card ---------- */

#socranext-artikel.sn-layout-v2 .sn-author {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.35rem 1.6rem;
  border: 1px solid var(--sn-article-border);
  border-radius: var(--sn-article-radius);
  background: var(--sn-article-surface);
}

#socranext-artikel.sn-layout-v2 .sn-author-image {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.18);
}

#socranext-artikel.sn-layout-v2 .sn-author-name {
  margin: 0;
  font-weight: 650;
}

#socranext-artikel.sn-layout-v2 .sn-author-name a {
  color: inherit;
  text-decoration: none;
}

#socranext-artikel.sn-layout-v2 .sn-author-name a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

#socranext-artikel.sn-layout-v2 .sn-author-role,
#socranext-artikel.sn-layout-v2 .sn-author-bio {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--sn-article-muted);
}

/* ---------- Related articles ---------- */

#socranext-artikel.sn-layout-v2 .sn-related-title {
  margin: 0 0 1.4rem;
  font-size: var(--sn-article-content-h2-font-size);
  line-height: var(--sn-article-content-h2-line-height);
  color: var(--sn-article-content-heading-color);
  font-family: var(--sn-article-content-heading-font-family, inherit);
  letter-spacing: -0.012em;
}

#socranext-artikel.sn-layout-v2 .sn-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#socranext-artikel.sn-layout-v2 .sn-related-item a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--sn-article-border);
  border-radius: var(--sn-article-radius);
  background: var(--sn-article-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

#socranext-artikel.sn-layout-v2 .sn-related-item-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sn-article-border);
}

#socranext-artikel.sn-layout-v2 .sn-related-item-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#socranext-artikel.sn-layout-v2 .sn-related-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.35rem 1.25rem;
}

#socranext-artikel.sn-layout-v2 .sn-related-item a:hover {
  border-color: var(--sn-article-accent);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(17, 24, 39, 0.35);
}

#socranext-artikel.sn-layout-v2 .sn-related-item-title {
  display: block;
  font-weight: 650;
  line-height: 1.35;
}

#socranext-artikel.sn-layout-v2 .sn-related-item a:hover .sn-related-item-title {
  color: var(--sn-article-accent-ink);
}

#socranext-artikel.sn-layout-v2 .sn-related-item-excerpt {
  display: block;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--sn-article-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  #socranext-artikel.sn-layout-v2 .sn-article-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: var(--sn-article-reading-width);
    margin-left: auto;
    margin-right: auto;
  }

  #socranext-artikel.sn-layout-v2 .sn-has-rail .sn-article-header,
  #socranext-artikel.sn-layout-v2 .sn-has-rail .sn-article-footer {
    max-width: var(--sn-article-reading-width);
  }

  #socranext-artikel.sn-layout-v2 .sn-article-rail {
    order: -1;
    margin-bottom: 2rem;
  }

  #socranext-artikel.sn-layout-v2 .sn-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }

  #socranext-artikel.sn-layout-v2 .sn-toc-toggle:not([hidden]) {
    display: flex;
  }

  #socranext-artikel.sn-layout-v2 .sn-toc-toggle:not([hidden]) + .sn-toc-title {
    display: none;
  }

  #socranext-artikel.sn-layout-v2 .sn-toc[data-collapsed="true"] .sn-toc-list {
    display: none;
  }

  #socranext-artikel.sn-layout-v2 .sn-toc-toggle:not([hidden]) ~ .sn-toc-list {
    margin-top: 0.875rem;
  }
}

@media (max-width: 640px) {
  #socranext-artikel.sn-layout-v2 .sn-cta {
    padding: 1.5rem 1.35rem;
  }

  #socranext-artikel.sn-layout-v2 .sn-takeaways {
    padding: 1.1rem 1.25rem;
  }

  #socranext-artikel.sn-layout-v2 .sn-author {
    padding: 1.1rem 1.25rem;
  }

  #socranext-artikel.sn-layout-v2 .sn-article-content th,
  #socranext-artikel.sn-layout-v2 .sn-article-content td {
    padding: 0.65rem 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #socranext-artikel.sn-layout-v2 * {
    scroll-behavior: auto;
    transition-duration: 0ms !important;
  }
}
