/* Alberta Oil — long-form article and library layout. Builds on css/ao.css tokens. */
.art { padding-block: 0 48px; }
.art-mast {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1180px; margin-inline: auto; padding-block: 16px; border-bottom: 1px solid var(--line);
}
.ao-page .art-mark { font: 900 1rem/1 var(--display); font-stretch: 125%; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.art-mark span { color: var(--ochre); }
.art-mast nav { display: flex; gap: 18px; flex-wrap: wrap; font: 600 0.85rem/1 var(--display); font-stretch: 105%; }
.ao-page .art-mast nav a { color: var(--muted); text-decoration: none; }
.ao-page .art-mast nav a:hover, .ao-page .art-mast nav a[aria-current] { color: var(--ink); }

.art-grid {
  max-width: 1180px; margin-inline: auto; padding-top: 40px;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); column-gap: 56px;
  grid-template-areas: "head head" "toc body";
}
.art-head { grid-area: head; display: flex; flex-direction: column; gap: 14px; max-width: 880px; padding-bottom: 32px; }
.art-head h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-stretch: 112%; font-weight: 850; letter-spacing: -0.012em; }
.art-stand { font-size: 1.25rem; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.art-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8rem; color: var(--muted); align-items: center; }
.art-pill { border: 1px solid var(--ochre); color: var(--ochre); border-radius: 999px; padding: 4px 10px; }

.art-toc { grid-area: toc; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); align-self: start; max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.art-toc summary { cursor: pointer; list-style: none; padding-bottom: 8px; }
.art-toc summary::-webkit-details-marker { display: none; }
.art-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); display: flex; flex-direction: column; }
.ao-page .art-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font: 500 0.86rem/1.35 var(--display); font-stretch: 100%; }
.ao-page .art-toc li a:hover { color: var(--ink); }
.ao-page .art-toc li a.is-here { color: var(--ink); border-left-color: var(--ochre); }
.art-related { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; }

.art-body { grid-area: body; max-width: 70ch; font-size: 1.1rem; line-height: 1.7; }
.art-body > * + * { margin-top: 1.1em; }
.art-body p, .art-body li { max-width: none; }
.art-body h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.4em; padding-top: 0.6em; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.art-body h3 { font-size: 1.2rem; margin-top: 1.8em; }
.art-body h2 + *, .art-body h3 + * { margin-top: 0.7em; }
.art-body ul, .art-body ol { padding-left: 1.3em; }
.art-body li + li { margin-top: 0.35em; }
.art-body strong { font-weight: 600; }
.art-body blockquote { margin-inline: 0; padding-left: 18px; border-left: 3px solid var(--ochre); color: var(--muted); }
.cite { font: 500 0.68em/0 var(--mono); vertical-align: super; white-space: nowrap; color: var(--muted); }
.cite a { color: var(--accent); text-decoration: none; }
.cite a:hover { text-decoration: underline; }

.art-facts { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ochre); border-radius: var(--radius); padding: 6px 22px 18px; }
.art-facts h2 { border-top: 0; margin-top: 0.6em; padding-top: 0; font-size: 1.1rem; font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ochre); }
.art-facts ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.art-facts li { padding-left: 18px; position: relative; font-size: 1rem; }
.art-facts li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 8px; height: 8px; background: var(--ochre); }

.art-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.art-table table { border-collapse: collapse; width: 100%; font-size: 0.9rem; line-height: 1.45; min-width: 640px; }
.art-table th { text-align: left; font: 600 0.78rem/1.2 var(--display); font-stretch: 105%; text-transform: uppercase; letter-spacing: 0.04em; background: var(--sunken); color: var(--muted); }
.art-table th, .art-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.art-table tr:last-child td { border-bottom: 0; }

.art-embed { margin-inline: 0; margin-block: 2em; display: flex; flex-direction: column; gap: 10px; }
.art-embed figcaption { font: 400 0.8rem/1.5 var(--mono); color: var(--muted); }
@media (min-width: 1100px) { .art-embed-sagd, .art-embed-pumpjack { width: min(1000px, calc(100vw - 340px)); } }
.ao-page .art-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-left: 6px solid #f2b705; border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.art-card strong { font: 750 1.2rem/1.2 var(--display); font-stretch: 108%; }
.art-card span:last-child { color: var(--muted); font-size: 0.95rem; }

.art-sources ol { font: 400 0.82rem/1.55 var(--mono); color: var(--muted); padding-left: 2.4em; }
.art-sources li { word-break: break-word; scroll-margin-top: 24px; }
.art-sources li:target { background: color-mix(in srgb, var(--ochre) 18%, transparent); color: var(--ink); }
.art-foot { max-width: 1180px; margin: 64px auto 0; padding-top: 18px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "toc" "body"; padding-top: 28px; }
  .art-toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); margin-bottom: 8px; }
  .art-toc details:not([open]) summary { padding-bottom: 0; }
  .art-body { font-size: 1.05rem; }
}

/* library */
.lib { max-width: 1180px; margin-inline: auto; padding-top: 40px; display: flex; flex-direction: column; gap: 32px; }
.lib-head { display: flex; flex-direction: column; gap: 14px; }
.lib-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-stretch: 115%; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.ao-page .lib-list a { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.lib-list a:hover { border-color: var(--ink); }
.lib-list strong { font: 800 1.35rem/1.15 var(--display); font-stretch: 110%; text-wrap: balance; }
.lib-desc { color: var(--muted); font-size: 0.98rem; }
.lib-meta { margin-top: auto; font-size: 0.78rem; color: var(--muted); }
.verify { font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; background: color-mix(in srgb, var(--flare) 20%, transparent); color: var(--flare); border-radius: 3px; padding: 2px 5px; }

/* ---------- reading experience (js/article.js) ---------- */
.art-toc { top: calc(env(safe-area-inset-top, 0px) + var(--ao-header-h, 58px) + 16px); max-height: calc(100vh - var(--ao-header-h, 58px) - 40px); }
.art-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; background: var(--ochre); transform-origin: 0 50%; transform: scaleX(0); z-index: 70; pointer-events: none; }
.art-body h2 { position: relative; }
.ao-page .art-anchor { margin-left: 10px; font: 500 0.7em/1 var(--mono); color: var(--line); text-decoration: none; opacity: 0; transition: opacity .15s; }
.art-body h2:hover .art-anchor, .ao-page .art-anchor:focus { opacity: 1; color: var(--muted); }
@media (hover: none) { .ao-page .art-anchor { opacity: 1; } }
.art-body .gl { border-bottom: 1.5px dotted color-mix(in srgb, var(--ochre) 70%, transparent); cursor: help; }
.art-body .gl:hover, .art-body .gl:focus-visible { background: color-mix(in srgb, var(--ochre) 14%, transparent); outline: none; }
.art-pop {
  position: absolute; z-index: 75; width: min(360px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.2); padding: 12px 14px; font: 400 0.9rem/1.5 var(--body);
}
.art-pop-k { font: 500 0.7rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ochre); }
.art-pop strong { font: 700 1rem/1.2 var(--display); }
.ao-page .art-pop a { font: 600 0.8rem/1 var(--mono); color: var(--accent); text-decoration: none; }
.ao-page .art-back { display: inline-block; margin-left: 8px; font: 600 0.75rem/1 var(--mono); color: var(--accent); text-decoration: none; }
.art-bar { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); transform: translate(-50%, 140%); z-index: 65; display: none; gap: 6px; transition: transform .25s ease; width: min(560px, calc(100% - 24px)); }
.art-bar.is-on { transform: translate(-50%, 0); }
.art-bar button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; box-shadow: 0 8px 20px rgba(0,0,0,.18); cursor: pointer; }
.art-bar-toc { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 16px; text-align: left; }
.art-bar-now { font: 600 0.9rem/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-bar-top { width: 44px; font: 600 1.1rem/1 var(--mono); }
.art-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); z-index: 66; width: min(560px, calc(100% - 24px)); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.25); padding: 10px 14px; }
.art-sheet ol { list-style: none; margin: 0; padding: 0; }
.ao-page .art-sheet a { display: block; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 600 0.95rem/1.3 var(--display); }
.ao-page .art-sheet a.is-here { color: var(--ochre); }
@media (max-width: 900px) {
  .art-bar { display: flex; }
  .art-toc { display: none; }
}
@media (prefers-reduced-motion: reduce) { .art-bar { transition: none; } }

/* ---------- library ---------- */
.lib-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lib-tools .ao-input { max-width: 340px; }
.lib-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.lib-path { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--ground); }
.lib-path h3 { font-size: 1.1rem; }
.lib-path ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
.lib-empty { color: var(--muted); }
.lib-std { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px 28px; }
.lib-std div { display: flex; flex-direction: column; gap: 4px; }
.lib-std strong { font: 700 1rem/1.3 var(--display); }
.lib-std p { font-size: 0.95rem; color: var(--muted); }
.art-trust { margin-top: 3em !important; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem; }
.art-head .ao-crumb { margin-bottom: 4px; }
.art-toc > .ao-eyebrow { padding-bottom: 8px; }

/* per-guide quiz */
.art-quiz { display: flex; flex-direction: column; gap: 14px; }
.art-quiz > * + * { margin-top: 0; }
@media (min-width: 1100px) { .art-embed-well { width: min(900px, calc(100vw - 340px)); } }

/* body rhythm: `.ao-page p { margin: 0 }` in ao.css outranked `.art-body > * + *`,
   so paragraphs inside guides had no spacing. Restate the rhythm with matching weight. */
.ao-page .art-body > * + * { margin-top: 1.1em; }
.ao-page .art-body h2 { margin-top: 2.4em; }
.ao-page .art-body h3 { margin-top: 1.8em; }
.ao-page .art-body h2 + *, .ao-page .art-body h3 + * { margin-top: 0.7em; }
.ao-page .art-body > .art-embed { margin-block: 2em; }
.ao-page .art-body > .art-facts + * { margin-top: 1.6em; }
.ao-page .art-body .art-quiz > * + * { margin-top: 0; }
