/* ==========================================================================
   Learn articles (/learn/{slug}) — Pen "Learn Article" redesign. Loaded after
   editorial.css by layouts/learn-article.blade.php only; every rule is scoped
   to .ed-article so shared styles stay untouched.
   ========================================================================== */

.ed-article { --ed-red-strong: #D1173A; --ed-article-top: calc(var(--site-header-height, 76px) + 24px); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.ed-article__hero { padding-block: calc(var(--site-header-height, 76px) + 48px) 64px; }
.ed-article__crumbs { align-items: center; }
.ed-article__crumbs ol { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ed-article__crumbs li { min-width: 0; }
.ed-article__crumbs li + li::before { content: "/"; margin-right: 10px; }
.ed-article__crumbs a:hover { color: var(--ed-ink); }
.ed-article__crumbs [aria-current] { color: var(--ed-ink); }
.ed-article__topic { flex-shrink: 0; }

.ed-article__title { margin: 48px 0 0; }
.ed-article__title .ed-display { font-size: clamp(52px, 8.4vw, 132px); }
.ed-article__title .ed-contrast { font-size: clamp(44px, 6.9vw, 108px); line-height: 1; padding-block: 0.04em 0.08em; letter-spacing: -0.05em; color: var(--ed-red-strong); }

.ed-article__intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: end; margin-top: 40px; }
.ed-article__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; color: var(--ed-muted); }
.ed-article__dek { margin: 0; font-size: 20px; line-height: 1.45; font-weight: 500; }

/* ── Reading layout: contents rail + one column ──────────────────────────── */
.ed-article__layout { display: grid; grid-template-columns: 288px minmax(0, 720px); column-gap: 96px; padding-block: 24px 96px; border-top: 1px solid var(--ed-line); }
.ed-article__aside { position: sticky; top: var(--ed-article-top); align-self: start; max-height: calc(100vh - var(--ed-article-top) - 24px); overflow-y: auto; padding-top: 32px; }
.ed-article__toc-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ed-ink); font-size: 11px; color: var(--ed-muted); }
.ed-article__toc-head span:first-child { color: var(--ed-ink); }
.ed-article__toc ol { margin: 0; padding: 0; list-style: none; }
.ed-article__toc a { display: block; padding: 10px 0; border-bottom: 1px solid var(--ed-line); color: var(--ed-muted); font-size: 15px; font-weight: 500; line-height: 1.3; transition: color .2s var(--ed-ease), padding .2s var(--ed-ease); }
.ed-article__toc a:hover { color: var(--ed-ink); }
.ed-article__toc a[aria-current] { color: var(--ed-ink); font-weight: 700; padding-left: 12px; box-shadow: inset 3px 0 0 var(--ed-red); }
.ed-article__progress { margin-top: 24px; }
.ed-article__progress-label { display: block; margin-bottom: 8px; font-size: 10px; color: var(--ed-muted); }
.ed-article__progress-track { display: block; height: 3px; background: var(--ed-paper-2); }
.ed-article__progress-track i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ed-red); }
.ed-article__toc-m { display: none; }

/* ── Article body ────────────────────────────────────────────────────────── */
.ed-article__body { min-width: 0; padding-top: 40px; font-size: 19px; line-height: 1.6; }
.ed-article__body p { margin: 0 0 22px; }
.ed-article__body a { text-decoration: underline; text-decoration-color: var(--ed-red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ed-article__body a:hover { color: var(--ed-red-strong); }
.ed-article__body strong { font-weight: 700; }
.ed-article__section { margin-top: 32px; }
.ed-article__section > h2 { margin: 0 0 24px; padding-top: 48px; border-top: 1px solid var(--ed-ink); font-family: var(--ed-display-text); font-weight: 700; font-size: clamp(36px, 3.5vw, 50px); line-height: 0.95; text-transform: uppercase; scroll-margin-top: var(--ed-article-top); }
.ed-article__body h3 { margin: 32px 0 10px; font-size: 23px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.ed-article__lead { font-size: 24px; line-height: 1.42; font-weight: 500; letter-spacing: -0.01em; }
.ed-article__em { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
.ed-article__body .ed-article__pull { position: relative; margin: 40px 0; padding-top: 52px; border-top: 3px solid var(--ed-red); font-size: clamp(28px, 2.8vw, 40px); line-height: 1.12; font-weight: 500; letter-spacing: -0.035em; }
.ed-article__pull::before { content: "\201C"; position: absolute; top: 14px; left: 0; font-family: var(--ed-display); font-weight: 900; font-size: 72px; line-height: 0.7; color: var(--ed-red); }
.ed-article__body .ed-article__note { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--ed-line); font-size: 14px; line-height: 1.5; color: var(--ed-muted); }

.ed-article__steps { margin: 8px 0 24px; }
.ed-article__step { padding-top: 24px; border-top: 1px solid var(--ed-line); }
.ed-article__step + .ed-article__step { margin-top: 8px; }
.ed-article__step > h3:first-child { margin-top: 0; }

.ed-article__list { margin: 8px 0 28px; padding: 0; list-style: none; border-top: 1px solid var(--ed-line); }
.ed-article__list li { position: relative; padding: 13px 0 13px 28px; border-bottom: 1px solid var(--ed-line); line-height: 1.45; }
.ed-article__list li::before { content: ""; position: absolute; left: 2px; top: calc(13px + 0.6em); width: 12px; height: 2px; background: var(--ed-red); }

.ed-article__template { margin: 8px 0 28px; padding: 22px 26px 24px; background: var(--ed-paper-2); border-left: 3px solid var(--ed-red); border-radius: 0 4px 4px 0; font-size: 17px; }
.ed-article__template-label { margin-bottom: 14px; font-size: 10px; color: var(--ed-muted); }
.ed-article__body .ed-article__template p { margin: 0 0 12px; }
.ed-article__body .ed-article__template p:last-child { margin-bottom: 0; }

.ed-article__section--faq > h3 { margin: 28px 0 10px; padding-top: 22px; border-top: 1px solid var(--ed-line); font-size: 22px; }

/* In-article CTA */
.ed-article__cta { margin-top: 64px; padding: clamp(28px, 4vw, 48px); background: var(--ed-ink); color: #fff; border-radius: 4px; }
.ed-article__cta h2 { margin: 0 0 20px; font-family: var(--ed-display-text); font-weight: 700; font-size: clamp(30px, 3.2vw, 44px); line-height: 0.98; text-transform: uppercase; }
.ed-article__body .ed-article__cta p { margin: 0 0 28px; color: rgba(255, 255, 255, 0.78); font-size: 18px; line-height: 1.55; }
.ed-article__body .ed-article__cta-btn { padding: 18px 28px; font-size: 19px; text-decoration: none; white-space: normal; text-align: left; }
.ed-article__body .ed-article__cta-btn:hover { color: #fff; }

/* ── Related guides ──────────────────────────────────────────────────────── */
.ed-article__related { padding-block: 80px 120px; background: var(--ed-paper-2); }
.ed-article__related .ed-label-row { color: var(--ed-muted); border-bottom-color: var(--ed-ink); }
.ed-article__kicker { margin: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ed-ink); }
.ed-article__rel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; margin: 40px 0 0; padding: 0; list-style: none; }
.ed-article__rel { display: flex; flex-direction: column; gap: 16px; height: 100%; padding-bottom: 28px; border-bottom: 1px solid var(--ed-line); }
.ed-article__rel-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--ed-muted); }
.ed-article__rel-meta span { color: var(--ed-red-strong); }
.ed-article__rel-title { margin: 0; font-size: clamp(24px, 2.08vw, 30px); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; transition: color .2s var(--ed-ease); }
.ed-article__rel-read { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-size: 15px; font-weight: 700; }
.ed-article__rel-read svg { transition: transform .25s var(--ed-ease); }
.ed-article__rel:hover .ed-article__rel-title { color: var(--ed-red-strong); }
.ed-article__rel:hover .ed-article__rel-read svg { transform: translateX(3px); }

/* Final CTA: the shared red band, sized for a two-line headline. */
.ed-article .ed-final__head .ed-display,
.ed-article .ed-final__head .ed-contrast { font-size: clamp(52px, 8.4vw, 132px); }

/* ── Tablet: contents collapse above the column ──────────────────────────── */
@media (max-width: 1100px) {
    .ed-article__layout { grid-template-columns: minmax(0, 720px); }
    .ed-article__aside { display: none; }
    .ed-article__toc-m { display: block; margin-top: 8px; border-top: 1px solid var(--ed-ink); border-bottom: 1px solid var(--ed-ink); }
    .ed-article__toc-m summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; color: var(--ed-ink); font-size: 11px; cursor: pointer; list-style: none; }
    .ed-article__toc-m summary::-webkit-details-marker { display: none; }
    .ed-article__toc-m summary svg { flex-shrink: 0; transition: transform .2s var(--ed-ease); }
    .ed-article__toc-m[open] summary svg { transform: rotate(180deg); }
    .ed-article__toc-m ol { padding-bottom: 8px; }
    .ed-article__toc-m a { border-bottom: 0; border-top: 1px solid var(--ed-line); }
    .ed-article__rel-grid { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 8px; }
    .ed-article__rel { padding-block: 24px; }
}

/* ── Phones (Pen "Learn Article — Mobile (390)") ─────────────────────────── */
@media (max-width: 760px) {
    .ed-article__hero { padding-block: calc(var(--site-header-height, 76px) + 20px) 32px; }
    .ed-article__crumbs { font-size: 11px; padding-bottom: 12px; }
    .ed-article__crumbs [aria-current] { display: none; }
    .ed-article__title { margin-top: 28px; }
    .ed-article__title .ed-display { font-size: 14.4vw; }
    .ed-article__title .ed-contrast { font-size: 10.6vw; line-height: 1.04; }
    .ed-article__intro { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 24px; }
    .ed-article__dek { order: -1; font-size: 19px; line-height: 1.4; }
    .ed-article__meta { font-size: 11px; gap: 6px 16px; }
    .ed-article__layout { padding-block: 0 56px; border-top: 0; }
    .ed-article__body { padding-top: 32px; font-size: 17px; }
    .ed-article__body p { margin-bottom: 20px; }
    .ed-article__section { margin-top: 20px; }
    .ed-article__section > h2 { padding-top: 32px; margin-bottom: 20px; font-size: 34px; }
    .ed-article__body h3 { font-size: 20px; margin-top: 28px; }
    .ed-article__lead { font-size: 21px; line-height: 1.38; }
    .ed-article__em { font-size: 21px; }
    .ed-article__body .ed-article__pull { margin: 32px 0; padding-top: 48px; font-size: 27px; }
    .ed-article__list li { padding-block: 12px; }
    .ed-article__template { padding: 18px 18px 20px; font-size: 16px; }
    .ed-article__section--faq > h3 { font-size: 19px; }
    .ed-article__cta { margin-top: 48px; padding: 24px 20px 28px; }
    .ed-article__cta h2 { font-size: 30px; }
    .ed-article__body .ed-article__cta p { font-size: 16px; margin-bottom: 22px; }
    .ed-article__body .ed-article__cta-btn { width: 100%; justify-content: space-between; padding: 18px 22px; }
    .ed-article__related { padding-block: 48px 56px; }
    .ed-article__rel { display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: center; column-gap: 14px; row-gap: 6px; padding-block: 18px; }
    .ed-article__rel-meta { grid-column: 1; justify-content: flex-start; gap: 8px; font-size: 10px; }
    .ed-article__rel-meta time::before { content: "·"; margin-right: 8px; }
    .ed-article__rel-title { grid-column: 1; font-size: 19px; line-height: 1.2; }
    .ed-article__rel-read { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 0; }
    .ed-article__rel-read svg { width: 18px; height: 18px; }
    .ed-article .ed-final__head .ed-display, .ed-article .ed-final__head .ed-contrast { font-size: 13vw; }
}

@media (prefers-reduced-motion: reduce) {
    .ed-article__toc a, .ed-article__rel-title, .ed-article__rel-read svg, .ed-article__toc-m summary svg { transition: none; }
}
