/* ==========================================================================
   Article pages (page.php) — light themes: clean, bold, magazine, minimal
   Also loaded inside the admin editor, so .art-body looks the same there.
   ========================================================================== */
.art {
  --measure: 700px;
  --tocw: 0px;
  --frame: calc(var(--measure) + var(--tocw));
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #86868b;
  --hair: rgba(0, 0, 0, .09);
  --soft: color-mix(in srgb, var(--accent) 7%, #fff);
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --bleed: 0px;
  padding-bottom: 72px;
}
.art.w-narrow { --measure: 620px; }
.art.w-normal { --measure: 700px; }
.art.w-wide   { --measure: 840px; }
.art.w-full   { --measure: 1040px; }
@media (min-width: 1000px) {
  .art.has-toc { --tocw: 248px; }
  .art { --bleed: 56px; }
  .art.w-full { --bleed: 0px; }
}

/* ---------------------------------------------------------------- frame */
.art-shell { padding: 0 22px; }
.art-hero, .art-head, .art-steps, .art-grid { max-width: var(--frame); margin-left: auto; margin-right: auto; }
.art-head, .art-steps { padding-left: var(--tocw); }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 1000px) {
  .art.has-toc .art-grid { grid-template-columns: 200px minmax(0, 1fr); column-gap: 48px; }
}

.art-notice {
  max-width: var(--frame); margin: 24px auto 0; padding: 0 22px;
  font-size: .8125rem; font-weight: 600; color: #a35200;
}
.art-notice::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff9f0a; margin-right: 8px; vertical-align: 1px; }

/* ---------------------------------------------------------------- progress */
.art-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.art-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------------------------------------------------------------- hero */
.art-hero { margin-top: clamp(20px, 4vw, 40px); }
.art-hero-img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 22px; background: #f2f2f5; }
.art-beside { margin: 0; }
.art-beside-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 22px; background: #f2f2f5; }

.art-cover { position: relative; min-height: clamp(380px, 62vh, 640px); display: flex; align-items: flex-end; overflow: hidden; background: #e9e9ee; }
.art-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.62) 100%); }
.art-cover-text { position: relative; z-index: 1; width: 100%; max-width: var(--frame); margin: 0 auto; padding: 0 22px clamp(28px, 5vw, 56px); padding-left: calc(22px + var(--tocw)); color: #fff; }
.art-cover .art-title, .art-cover .art-stand { color: #fff; }
.art-cover .art-kicker { color: rgba(255,255,255,.9); }
.art-cover .art-stand { text-shadow: 0 1px 12px rgba(0,0,0,.25); }

/* ---------------------------------------------------------------- head */
.art-head { padding-top: clamp(28px, 5vw, 56px); padding-bottom: 8px; }
.art-head--beside { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .art-head--beside { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.art-kicker { display: inline-block; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.art-title { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 750; margin: 0; color: var(--ink); text-wrap: balance; }
.art-stand { font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.5; color: var(--ink-2); margin: 16px 0 0; max-width: 46em; text-wrap: pretty; }

.art-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 22px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: .875rem; color: var(--ink-3); }
.art-who { color: var(--ink); font-weight: 600; }
.art-dot { opacity: .6; }
.art-spacer { flex: 1; }
.art-lang { font-weight: 600; font-size: .8125rem; padding: 5px 11px; border-radius: 999px; background: #f2f2f5; color: var(--ink); margin-right: 4px; }
.art-lang:hover { background: #e8e8ed; }
.art-share { display: inline-flex; gap: 4px; }
.art-share a, .art-share button {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: #f2f2f5; color: var(--ink-2); cursor: pointer; padding: 0;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.art-share a:hover, .art-share button:hover { background: var(--soft); color: var(--accent); }
.art-share a:active, .art-share button:active { transform: scale(.94); }
.art-share svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- steps (sub-pages) */
.art-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.art-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #f2f2f5; color: var(--ink-2); font-size: .875rem; font-weight: 600; transition: background-color 150ms ease; }
.art-step b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--ink-2); font-size: .75rem; }
.art-step:hover { background: #e8e8ed; }
.art-step.is-current { background: var(--soft); color: var(--accent); }
.art-step.is-current b { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- contents list */
.art-toc { padding-top: 34px; font-size: .875rem; }
.art-toc details { position: sticky; top: 84px; }
.art-toc summary { list-style: none; cursor: pointer; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.art-toc summary::-webkit-details-marker { display: none; }
.art-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--hair); }
.art-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); line-height: 1.35; transition: color 150ms ease, border-color 150ms ease; }
.art-toc li a:hover { color: var(--ink); }
.art-toc li a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 999px) {
  .art-toc { padding-top: 22px; }
  .art-toc details { position: static; background: #f5f5f7; border-radius: 16px; padding: 14px 18px; }
  .art-toc summary { margin: 0; display: flex; justify-content: space-between; }
  .art-toc summary::after { content: "+"; font-size: 1rem; line-height: 1; }
  .art-toc details[open] summary { margin-bottom: 10px; }
  .art-toc details[open] summary::after { content: "–"; }
}

/* ---------------------------------------------------------------- body text */
.art-col { min-width: 0; }
.art-body { padding-top: 30px; font-size: 1.125rem; line-height: 1.7; color: var(--ink); overflow-wrap: break-word; }
.art-body > :first-child { margin-top: 0; }
.art-body p { margin: 0 0 1.15em; }
.art-body h2 { font-size: 1.75rem; line-height: 1.18; letter-spacing: -.025em; font-weight: 750; margin: 1.9em 0 .6em; scroll-margin-top: 90px; text-wrap: balance; }
.art-body h3 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; margin: 1.6em 0 .45em; scroll-margin-top: 90px; }
.art-body h4 { font-size: 1.05rem; font-weight: 700; margin: 1.4em 0 .4em; }
.art-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.art-body strong, .art-body b { font-weight: 650; }
.art-body ul, .art-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.art-body li { margin: .35em 0; }
.art-body li::marker { color: var(--ink-3); }
.art-body img { max-width: 100%; height: auto; border-radius: 16px; margin: 1.6em 0; }
.art-body figure { margin: 1.8em 0; }
.art-body figure img { margin: 0; }
.art-body figcaption { font-size: .875rem; color: var(--ink-3); margin-top: 10px; }
.art-body blockquote { margin: 1.8em 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--accent); font-size: 1.25rem; line-height: 1.5; color: var(--ink); }
.art-body blockquote p:last-child { margin-bottom: 0; }
.art-body hr { border: 0; height: 1px; background: var(--hair); margin: 2.4em 0; }
.art-body code { background: #f2f2f5; padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.art-body pre { background: #f5f5f7; padding: 16px 18px; border-radius: 14px; overflow: auto; font-size: .9rem; }
.art-body table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 1rem; }
.art-body th, .art-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.art-body th { font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.art-body iframe, .art-body video { max-width: 100%; border-radius: 16px; }

/* Styles from the editor's "Formats" menu */
.art-body p.lead { font-size: 1.3rem; line-height: 1.55; color: var(--ink); letter-spacing: -.005em; }
.art-body p.note { font-size: .9375rem; color: var(--ink-3); }
.art-body ul.checks { list-style: none; padding: 0; }
.art-body ul.checks li { position: relative; padding-left: 32px; margin: .7em 0; }
.art-body ul.checks li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 10.2 2.6 2.6L14 7.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
@supports (mask: url("")) {
  .art-body ul.checks li::before { background: var(--soft); }
  .art-body ul.checks li::after {
    content: ""; position: absolute; left: 3px; top: calc(.32em + 3px); width: 14px; height: 14px; background: var(--accent);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.4 3.8 3.8L16 6' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
.art-body .fact { background: var(--soft); border-radius: 18px; padding: 20px 24px; margin: 1.8em 0; font-size: 1.0625rem; }
.art-body .fact > :last-child { margin-bottom: 0; }
.art-body .fact > :first-child { margin-top: 0; }
.art-body img.wide { width: calc(100% + 2 * var(--bleed)); max-width: none; margin-left: calc(-1 * var(--bleed)); margin-right: calc(-1 * var(--bleed)); border-radius: 22px; }
@media (max-width: 999px) { .art-body img.wide { width: 100%; margin-left: 0; margin-right: 0; } }

/* ---------------------------------------------------------------- prev / next */
.art-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.art-pn-a { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border-radius: 18px; background: #f5f5f7; color: var(--ink); transition: background-color 150ms ease, transform 150ms ease; }
.art-pn-a:hover { background: var(--soft); }
.art-pn-a:active { transform: scale(.985); }
.art-pn-a small { font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.art-pn-a b { font-weight: 650; line-height: 1.3; }
.art-pn-a.next { text-align: right; grid-column: 2; }

/* ---------------------------------------------------------------- call to action */
.art-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; margin-top: 40px; padding: 26px 28px; border-radius: 22px; background: var(--soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }
.art-cta > div { flex: 1 1 280px; }
.art-cta h2 { font-size: 1.375rem; letter-spacing: -.02em; margin: 0 0 4px; color: var(--ink); }
.art-cta p { margin: 0; color: var(--ink-2); }
.art-cta-btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 24px; border-radius: 999px; background: var(--accent); color: #fff !important; font-weight: 650; text-decoration: none !important; white-space: nowrap; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); transition: transform 150ms ease, filter 150ms ease; }
.art-cta-btn:hover { filter: brightness(1.06); }
.art-cta-btn:active { transform: scale(.97); }

.art-sticky {
  position: fixed; left: 50%; bottom: 18px; z-index: 50; display: flex; align-items: center; gap: 16px;
  max-width: min(560px, calc(100vw - 24px)); padding: 8px 8px 8px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .05);
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  transition: transform 380ms cubic-bezier(.23, 1, .32, 1), opacity 200ms ease;
}
.art-sticky span { font-weight: 600; font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.art-sticky .art-cta-btn { height: 40px; padding: 0 18px; font-size: .9375rem; box-shadow: none; flex: none; }
.art-sticky.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
@media (max-width: 520px) { .art-sticky span { display: none; } .art-sticky { padding: 6px; } }

/* ==========================================================================
   Themes
   ========================================================================== */
/* Clean — plain sans-serif, calm */
.theme-clean .art-title { font-weight: 700; letter-spacing: -.03em; }
.theme-clean .art-body h2 { font-weight: 700; font-size: 1.6rem; }

/* Bold — oversized headings with an accent bar */
.theme-bold .art-title { font-weight: 800; font-size: clamp(2.3rem, 5.6vw, 3.8rem); letter-spacing: -.04em; }
.theme-bold .art-body h2 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.theme-bold .art-body h2::after { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--accent); margin-top: 14px; }
.theme-bold .art-body p.lead { font-weight: 500; }

/* Magazine — serif throughout, square images, drop cap */
.theme-magazine .art-title, .theme-magazine .art-stand, .theme-magazine .art-body, .theme-magazine .art-cta h2, .theme-magazine .art-pn-a b { font-family: var(--serif); }
.theme-magazine .art-title { font-weight: 600; letter-spacing: -.02em; font-size: clamp(2.3rem, 5.4vw, 3.7rem); }
.theme-magazine .art-stand { font-style: italic; }
.theme-magazine .art-kicker { font-family: var(--serif); letter-spacing: .14em; font-weight: 600; color: var(--ink-2); }
.theme-magazine .art-body { font-size: 1.1875rem; line-height: 1.72; }
.theme-magazine .art-body h2 { font-weight: 600; letter-spacing: -.01em; font-size: 1.85rem; }
.theme-magazine .art-body h3 { font-weight: 600; font-style: italic; }
.theme-magazine .art-body p.lead::first-letter { float: left; font-size: 4.1em; line-height: .82; padding: .06em .1em 0 0; font-weight: 600; color: var(--accent); }
.theme-magazine .art-body img, .theme-magazine .art-hero-img, .theme-magazine .art-beside-img, .theme-magazine .art-body img.wide { border-radius: 0; }
.theme-magazine .art-body blockquote { border-left: 0; padding: 0; text-align: center; font-style: italic; font-size: 1.5rem; }
.theme-magazine .art-body blockquote::before { content: "“"; display: block; font-size: 3rem; line-height: .6; color: var(--accent); }
.theme-magazine .art-body .fact { border-radius: 0; background: transparent; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--hair); padding: 18px 0; }

/* Minimal — hairline rules instead of bold headings */
.theme-minimal .art-title { font-weight: 600; letter-spacing: -.025em; font-size: clamp(2rem, 4.4vw, 3rem); }
.theme-minimal .art-kicker { color: var(--ink-3); font-weight: 600; }
.theme-minimal .art-byline { border-bottom: 0; }
.theme-minimal .art-body h2 { font-size: 1.3rem; font-weight: 650; letter-spacing: -.01em; padding-top: 1.3em; border-top: 1px solid var(--hair); margin-top: 2em; }
.theme-minimal .art-body h3 { font-size: 1.1rem; font-weight: 650; }
.theme-minimal .art-body .fact { background: transparent; border: 1px solid var(--hair); }
.theme-minimal .art-step, .theme-minimal .art-pn-a { background: transparent; box-shadow: inset 0 0 0 1px var(--hair); }

@media (prefers-reduced-motion: reduce) {
  .art-sticky { transition: opacity 200ms ease; transform: translate(-50%, 0); }
}
@media print {
  .art-progress, .art-sticky, .art-share, .art-toc, .art-steps, .art-pn { display: none !important; }
}
