/* =============================================================
   digirelation · Single Article (Editorial)
   ============================================================= */

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--wide {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Reading Progress ───────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: var(--header-actual, 72px);
  left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 95;
  pointer-events: none;
}
.reading-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--rp, 0%);
  background: linear-gradient(90deg, var(--c-accent-top) 0%, var(--c-accent-hover) 100%);
  box-shadow: 0 0 10px rgba(174,207,228,0.6);
  transition: width 100ms linear;
}

/* ── Header ─────────────────────────────────────────────────── */
.article-header {
  background: #F8F9FA;
  padding: 56px 0 52px;
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .article-header {
  background: #0A151C;
  border-bottom-color: rgba(242,248,250,0.08);
}

.article-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 20px;
}
.article-crumbs a { color: var(--muted); }
.article-crumbs a:hover { color: var(--heading); }
.article-crumbs span[aria-hidden] { opacity: 0.4; }

.article-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-accent-ink);
  background: linear-gradient(180deg, var(--c-accent-top) 0%, var(--c-accent) 100%);
  box-shadow: var(--glow-sm);
  margin-bottom: 22px;
}

.article-title {
  font-family: var(--font-sans);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.07;
  color: var(--heading);
  margin: 0 0 22px;
  max-width: 22ch;
}

.article-subtitle {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 36px;
  max-width: 58ch;
  font-weight: 400;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
[data-theme="dark"] .article-meta { border-top-color: rgba(242,248,250,0.1); }

.article-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.article-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent-top) 0%, var(--c-accent) 100%);
  color: var(--c-accent-ink);
  display: inline-flex;
  align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.article-author-meta { display: flex; flex-direction: column; gap: 1px; }
.article-author-meta strong { font-size: 14px; font-weight: 700; color: var(--heading); }
.article-author-meta span  { font-size: 12px; color: var(--muted); }

.article-facts {
  display: flex;
  gap: 28px;
  margin: 0;
}
.article-facts > div { display: flex; flex-direction: column; gap: 2px; }
.article-facts dt {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.article-facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
}

/* ── Cover ──────────────────────────────────────────────────── */
.article-cover {
  margin: 0 auto 56px;
  padding-top: 48px;
}
.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  box-shadow: 0 16px 64px rgba(7,15,22,0.14);
}
[data-theme="dark"] .article-cover img {
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
}

/* no-cover: extra space below header */
.article-wrap:not(:has(.article-cover)) .article-body {
  padding-top: 56px;
}
.article-wrap:has(.article-cover) .article-body {
  padding-top: 0;
}

/* ── Body ───────────────────────────────────────────────────── */
.article-body {
  padding-bottom: 64px;
  font-size: 18px;
  line-height: 1.78;
  color: var(--text);
}
[data-theme="dark"] .article-body { color: rgba(242,248,250,0.82); }

.article-body p {
  margin: 0 0 26px;
  max-width: 65ch;
}
.article-body h2 {
  font-family: var(--font-sans);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--heading);
  margin: 60px 0 16px;
  max-width: 30ch;
}
.article-body h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--c-accent);
  margin-bottom: 14px;
}
.article-body h3 {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 40px 0 10px;
}
.article-body ul, .article-body ol {
  margin: 0 0 28px;
  padding-left: 24px;
  max-width: 62ch;
}
.article-body li { margin: 0 0 10px; }
.article-body ul li::marker { color: var(--c-accent-deep); }
[data-theme="dark"] .article-body ul li::marker { color: var(--c-accent); }

.article-body a {
  color: var(--heading);
  border-bottom: 1px solid var(--c-accent);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.article-body a:hover { color: var(--c-accent-deep); border-color: var(--c-accent-deep); }
[data-theme="dark"] .article-body a:hover { color: var(--c-accent); border-color: var(--c-accent); }
.article-body strong { color: var(--heading); font-weight: 700; }

/* images & figures inside CMS content */
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(7,15,22,0.10);
}
[data-theme="dark"] .article-body img {
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.article-body figure {
  margin: 32px 0;
  text-align: center;
}
.article-body figure img {
  margin: 0 auto 12px;
}
.article-body figcaption {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

/* blockquote */
.article-body blockquote {
  margin: 40px 0;
  padding: 24px 24px 24px 28px;
  border-left: 3px solid var(--c-accent);
  background: var(--c-accent-soft);
  border-radius: 0 10px 10px 0;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--heading);
}
[data-theme="dark"] .article-body blockquote {
  background: rgba(174,207,228,0.06);
}
.article-body blockquote p { margin: 0; max-width: none; font-size: inherit; }

/* code */
.article-body code {
  font-family: var(--font-mono);
  font-size: .87em;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--c-accent-deep);
}
[data-theme="dark"] .article-body code { color: var(--c-accent); }
.article-body pre {
  background: #070F16;
  border-radius: 12px;
  padding: 22px 26px;
  overflow-x: auto;
  margin: 0 0 28px;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: #AECFE4;
}

/* hr */
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 52px 0;
}

/* table */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.5;
}
.article-body th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
}
.article-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: top;
}
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:hover td { background: var(--hover); }

/* pull-quote class (legacy) */
.article-quote {
  margin: 40px 0;
  padding: 32px 0 32px 28px;
  border-left: 3px solid var(--c-accent);
  max-width: 60ch;
}
.article-quote p {
  font-family: var(--font-sans);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0;
}

/* inline image */
.article-inline-image {
  margin: 40px -40px;
  max-width: calc(100% + 80px);
}
.article-inline-image img {
  width: 100%;
  border-radius: 14px;
  display: block;
}
.article-inline-image figcaption {
  margin-top: 12px;
  padding: 0 40px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

/* ── Tags ───────────────────────────────────────────────────── */
.article-tags {
  padding: 0 0 64px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.article-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--c-accent-soft);
  border: 1px solid rgba(174,207,228,0.45);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-accent-deep);
  transition: background var(--t-fast), color var(--t-fast);
}
.article-tag:hover {
  background: var(--c-accent);
  color: var(--c-accent-ink);
}
[data-theme="dark"] .article-tag {
  background: rgba(174,207,228,0.08);
  border-color: rgba(174,207,228,0.2);
  color: var(--c-accent);
}
[data-theme="dark"] .article-tag:hover {
  background: rgba(174,207,228,0.18);
  color: var(--c-white);
}

/* ── Related articles ───────────────────────────────────────── */
.article-related {
  background: #F8F9FA;
  border-top: 1px solid var(--border);
  padding: 64px 0 96px;
}
[data-theme="dark"] .article-related {
  background: #070F16;
  border-top-color: rgba(242,248,250,0.08);
}

.article-related-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 32px;
}

.article-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-related-list li {
  display: flex;
}
.article-related-list a {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
[data-theme="dark"] .article-related-list a {
  background: rgba(242,248,250,0.03);
  border-color: rgba(242,248,250,0.1);
}
.article-related-list a:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(7,15,22,0.12);
  border-color: var(--c-accent);
}
[data-theme="dark"] .article-related-list a:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: rgba(174,207,228,0.4);
}

/* thumbnail */
.article-related-list a > span:first-child {
  display: block;
  flex-shrink: 0;
}
.article-related-list a img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.article-related-list a .rel-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--c-accent-soft) 0%, rgba(174,207,228,0.12) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .article-related-list a .rel-placeholder {
  background: rgba(174,207,228,0.06);
}
.article-related-list a .rel-placeholder svg {
  width: 28px; height: 28px;
  opacity: 0.3;
  color: var(--c-accent-deep);
}

/* text area */
.article-related-list a > span:nth-child(2) {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-related-list strong {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--heading);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-related-list .r-read {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: auto;
  padding-top: 4px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .article-related-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .article-header { padding: 36px 0 32px; }
  .article-title { letter-spacing: -0.025em; }
  .article-meta { gap: 14px; }
  .article-facts { gap: 16px; }

  .article-cover { padding-top: 32px; margin-bottom: 36px; }
  .article-cover img { border-radius: 14px; aspect-ratio: 4/3; }

  .article-body { font-size: 17px; line-height: 1.7; }
  .article-body h2 { margin-top: 44px; }

  .article-inline-image { margin: 28px -20px; max-width: calc(100% + 40px); }
  .article-inline-image figcaption { padding: 0 20px; }

  .article-related { padding: 48px 0 72px; }
  .article-related-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .article-related-list a img,
  .article-related-list a .rel-placeholder {
    height: 180px;
  }

  .article-body table { font-size: 14px; display: block; overflow-x: auto; }
}

/* ── 2-column article layout ────────────────────────────────── */
.article-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.article-main-col {
  min-width: 0;
}

/* Remove old container--narrow from body since we use grid now */
.article-layout .article-body {
  padding-top: 56px;
  padding-bottom: 40px;
}

.article-sidebar {
  position: sticky;
  top: calc(var(--header-actual, 72px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 56px;
  padding-bottom: 40px;
}

/* ── Sidebar CTA ────────────────────────────────────────────── */
.asb-cta {
  background: linear-gradient(145deg, #EDF4F9 0%, #D6E8F3 100%);
  border: 1px solid rgba(79,130,168,0.25);
  border-radius: 16px;
  padding: 24px;
}
[data-theme="dark"] .asb-cta {
  background: linear-gradient(145deg, rgba(79,130,168,0.12) 0%, rgba(79,130,168,0.06) 100%);
  border-color: rgba(174,207,228,0.2);
}
.asb-cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent-deep);
  margin-bottom: 10px;
}
[data-theme="dark"] .asb-cta-eyebrow { color: var(--c-accent); }
.asb-cta-headline {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--heading);
  margin: 0 0 8px;
}
.asb-cta-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
}
.asb-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--c-accent-top) 0%, var(--c-accent) 100%);
  color: var(--c-accent-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--glow-sm);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.asb-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Focus keyword ──────────────────────────────────────────── */
.asb-kw {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
}
.asb-kw-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.asb-kw-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-accent-deep);
  background: var(--c-accent-soft);
  border: 1px solid rgba(174,207,228,0.4);
  border-radius: 20px;
  padding: 3px 10px;
}
[data-theme="dark"] .asb-kw-chip { color: var(--c-accent); background: rgba(174,207,228,0.08); }

/* ── Generic sidebar block ──────────────────────────────────── */
.asb-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-raised);
}
[data-theme="dark"] .asb-block {
  background: rgba(242,248,250,0.03);
  border-color: rgba(242,248,250,0.08);
}
.asb-block-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .asb-block-title { border-bottom-color: rgba(242,248,250,0.08); }

/* ── Sidebar: related articles list ────────────────────────── */
.asb-articles {
  list-style: none;
  margin: 0;
  padding: 0;
}
.asb-articles li + li {
  border-top: 1px solid var(--border);
}
[data-theme="dark"] .asb-articles li + li { border-top-color: rgba(242,248,250,0.08); }

.asb-art-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
}
.asb-art-link:hover { background: var(--hover); }

.asb-art-img {
  width: 52px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.asb-art-img--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-accent-soft);
}
.asb-art-img--ph svg { width: 16px; height: 16px; opacity: 0.4; color: var(--c-accent-deep); }

.asb-art-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.asb-art-info strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asb-art-info span {
  font-size: 11px;
  color: var(--muted);
}

/* ── Sidebar: portfolio teaser ──────────────────────────────── */
.asb-portfolio {
  list-style: none;
  margin: 0;
  padding: 0;
}
.asb-portfolio li + li { border-top: 1px solid var(--border); }
[data-theme="dark"] .asb-portfolio li + li { border-top-color: rgba(242,248,250,0.08); }

.asb-pj-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
}
.asb-pj-link:hover { background: var(--hover); }
.asb-pj-link img {
  width: 44px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.asb-pj-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.2;
}
.asb-pj-cat {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.asb-more-link {
  display: block;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-accent-deep);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background var(--t-fast);
}
[data-theme="dark"] .asb-more-link { color: var(--c-accent); border-top-color: rgba(242,248,250,0.08); }
.asb-more-link:hover { background: var(--hover); }

/* ── Responsive: collapse sidebar below 960px ───────────────── */
@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .article-sidebar {
    position: static;
    padding-top: 0;
    padding-bottom: 64px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .asb-cta { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .article-sidebar {
    grid-template-columns: 1fr;
  }
}
