/* Crude Oil News: Eleventy B2B news template
   Palette: Ink #10222F, Slate #3E5361, Rule #CBD4DA, Mist #EEF2F4, Paper #FFFFFF,
            Flare #C23D08 (section markers, buttons), Seep #0F6A73 (links), Gauge #1F4E9C (sign-up) */

:root {
  --ink: #10222f;
  --slate: #3e5361;
  --rule: #cbd4da;
  --mist: #eef2f4;
  --tint: #e9f0fb;
  --paper: #ffffff;
  --flare: #c23d08;
  --seep: #0f6a73;
  --gauge: #1f4e9c;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1200px;
  --side: 300px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--seep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--flare); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--serif); line-height: 1.15; color: var(--ink); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; background: var(--paper); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; top: 8px; }
.sep { color: var(--rule); margin: 0 0.3em; }
.meta { margin: 0; font-size: 0.8125rem; color: var(--slate); }
.kicker { margin: 0 0 4px; font: 600 0.8125rem/1.2 var(--sans); color: var(--slate); }
.kicker a { color: var(--seep); text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.btn { display: inline-block; padding: 10px 18px; font: 600 0.9375rem var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--flare); color: #fff; }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-light:hover { background: var(--mist); color: var(--ink); }
.btn-blue { background: var(--gauge); color: #fff; }
.btn-blue:hover { background: var(--ink); color: #fff; }

/* Header */
.site-header { position: relative; background: var(--paper); border-bottom: 1px solid var(--rule); }
.utility { background: var(--ink); color: #c9d6dd; font-size: 0.8125rem; }
.utility-inner { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 12px; }
.utility a { color: #e6eef2; text-decoration: none; margin-left: 18px; }
.utility a:hover { text-decoration: underline; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.wordmark { text-decoration: none; color: var(--ink); display: block; }
.wordmark-name { display: block; font: 700 2.6rem/1 var(--serif); letter-spacing: -0.01em; }
.wordmark-tag { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--slate); }
.masthead-ad { flex: 0 1 728px; }
.nav-toggle, .search-link { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }

.primary { position: relative; border-top: 4px solid var(--flare); border-bottom: 1px solid var(--rule); background: var(--paper); }
.primary-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.primary ul { display: flex; flex-wrap: wrap; gap: 4px; }
.primary a { display: block; padding: 12px 14px; color: var(--ink); font-weight: 600; font-size: 0.9375rem; text-decoration: none; border-bottom: 3px solid transparent; }
.primary a:hover { border-bottom-color: var(--rule); color: var(--ink); }
.primary a[aria-current="page"] { border-bottom-color: var(--ink); }
.primary a[aria-expanded="true"] { background: var(--mist); border-bottom-color: var(--flare); }
.search input { width: 200px; padding: 8px 12px; border: 1px solid var(--slate); font: inherit; font-size: 0.9375rem; background: #fff; }

.mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--paper); border-bottom: 4px solid var(--ink); box-shadow: 0 14px 24px rgba(16, 34, 47, 0.18); }
.mega[hidden] { display: none; }
.mega-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; padding-top: 22px; padding-bottom: 26px; }
.mega-col h2 { font: 700 1rem/1.25 var(--sans); margin-bottom: 8px; }
.mega-col h2 a { color: var(--ink); text-decoration: none; padding: 0; font-size: inherit; border: 0; display: inline; }
.mega-col h2 a:hover { text-decoration: underline; }
.mega-col ul { display: block; }
.mega-col li a { display: inline-block; padding: 3px 0; font-size: 0.9375rem; font-weight: 400; color: var(--seep); border: 0; text-decoration: none; }
.mega-col li a:hover { color: var(--ink); text-decoration: underline; }

.markets { background: var(--mist); font-size: 0.8125rem; }
.markets-inner { display: flex; gap: 28px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; white-space: nowrap; }
.tick { display: inline-flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.tick-name { color: var(--slate); }
.tick-price { font-weight: 700; }
.tick-chg.up { color: #1a7a3f; }
.tick-chg.down { color: #b3261e; }

/* Layout bands: main column plus a 300px side column */
.band { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 32px; align-items: start; }
.band-side { display: grid; gap: 20px; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 32px; padding-top: 28px; padding-bottom: 40px; align-items: start; }
.page-side { position: sticky; top: 16px; }
.sidebar { display: grid; gap: 20px; }
.page-head { margin: 28px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.page-grid .page-head { margin-top: 0; }
.page-head h1 { font-size: 2.2rem; }
.page-head p { margin: 6px 0 0; color: var(--slate); }
.topic-row { margin-top: 36px; }
.home-top { margin-top: 28px; }
.topic-top, .topic-intro { margin-bottom: 28px; }

.section-head { margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.section-title { font-size: 1.4rem; padding-left: 12px; border-left: 5px solid var(--flare); line-height: 1.1; }
.section-title a { color: var(--ink); text-decoration: none; }
.section-title a:hover { text-decoration: underline; }

/* Story presentations */
.hero-media { display: block; aspect-ratio: 16 / 9; background: var(--mist); margin-bottom: 16px; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-title { font-size: 2.6rem; line-height: 1.08; margin: 4px 0 12px; letter-spacing: -0.01em; }
.hero-title a { color: var(--ink); text-decoration: none; }
.hero-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.hero-deck { font: 400 1.25rem/1.45 var(--serif); color: var(--slate); max-width: 62ch; }

.ph { display: block; width: 100%; height: 100%; background: #dfe6ea; }
.cards { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 20px; }
.cards-3 { --cols: 3; }
.cards-4 { --cols: 4; }
.cards-second { margin-top: 24px; }
.card-media { display: block; aspect-ratio: 3 / 2; background: var(--mist); overflow: hidden; margin-bottom: 10px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 1.15rem; line-height: 1.22; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }

.row { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.row:last-of-type { border-bottom: 0; }
.row-title { font-size: 1.45rem; margin-bottom: 6px; }
.row-title a { color: var(--ink); text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.row-deck { color: var(--slate); max-width: 68ch; margin-bottom: 6px; }

.latest { background: var(--mist); padding: 16px 18px; }
.latest-title { font: 700 1rem/1.2 var(--sans); padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid var(--ink); }
.latest li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.latest li:last-child { border-bottom: 0; padding-bottom: 0; }
.latest-link { display: block; font: 600 1.02rem/1.3 var(--serif); color: var(--ink); text-decoration: none; margin-bottom: 3px; }
.latest-link:hover { text-decoration: underline; }

.html-block { padding: 4px 0; max-width: 72ch; font: 400 1.1rem/1.6 var(--serif); }
.html-block p:last-child { margin-bottom: 0; }

.events-grid, .invest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.events, .invest { margin-top: 36px; }
.event, .invest-item { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; background: var(--paper); }
.event:hover, .invest-item:hover { border-color: var(--ink); }
.event-name, .invest-title { font: 600 1.2rem/1.2 var(--serif); }
.invest-item span:last-child { color: var(--slate); font-size: 0.9375rem; }

/* Ads */
.ad { text-align: center; }
.dim-m { display: none; }
.ad-label { display: block; font-size: 0.6875rem; color: var(--slate); margin-bottom: 4px; }
.ad-box { width: 100%; max-width: calc(var(--w) * 1px); aspect-ratio: var(--w) / var(--h); margin: 0 auto; display: grid; place-items: center; background: #e6ecef; color: var(--slate); font-size: 0.75rem; border: 1px dashed #9fb0ba; }
.ad-leaderboard, .ad-billboard { margin: 28px 0; }
.topic-row > .ad, .band-main > .ad { margin: 24px 0; }

/* Article */
.story { min-width: 0; }
.crumbs { font-size: 0.875rem; color: var(--slate); margin-bottom: 14px; }
.crumbs a { text-decoration: none; font-weight: 600; }
.story-title { font-size: 2.6rem; line-height: 1.08; letter-spacing: -0.01em; margin-bottom: 14px; }
.story-deck { font: 400 1.3rem/1.45 var(--serif); color: var(--slate); max-width: 62ch; }
.byline { font-size: 0.875rem; color: var(--slate); padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.byline span:first-child { color: var(--ink); font-weight: 600; }
.story-figure { margin: 0 0 20px; }
.story-figure figcaption { font-size: 0.8125rem; color: var(--slate); margin-top: 6px; }
.prose { font: 400 1.1875rem/1.7 var(--serif); max-width: 68ch; }
.prose h2 { font-size: 1.6rem; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 1.3rem; margin: 1.4em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 1em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.3em; }
.prose blockquote { margin: 1.5em 0; padding-left: 1em; border-left: 4px solid var(--flare); font-style: italic; }
.prose table { border-collapse: collapse; width: 100%; font: 0.9375rem var(--sans); margin: 1.5em 0; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 8px; text-align: left; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.topic-tags a { display: inline-block; padding: 4px 10px; border: 1px solid var(--rule); background: var(--mist); color: var(--ink); font-size: 0.875rem; text-decoration: none; }
.topic-tags a:hover { border-color: var(--ink); }
.story .topic-tags { margin-top: 24px; }
.share { display: flex; gap: 16px; align-items: center; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.share span { color: var(--slate); }
.share a { font-weight: 600; }

/* FAQ */
.faq { margin: 32px 0 8px; max-width: 72ch; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 14px 0; font: 600 1.1rem/1.3 var(--serif); }
.faq-a { padding: 0 0 14px; color: var(--slate); }

/* Topic index, pagination, search */
.topic-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.topic-list { columns: 2; }
.topic-list li { padding: 3px 0; break-inside: avoid; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.pager a { font-weight: 600; }
.empty { padding: 24px 0; color: var(--slate); }
.search-page { padding-bottom: 40px; }
.search-page { --pagefind-ui-primary: var(--ink); --pagefind-ui-border: var(--rule); --pagefind-ui-font: var(--sans); }

/* Resources and Events + newsletter */
.promo { margin-top: 48px; padding: 8px 0 48px; }
.promo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.promo-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 20px; border: 1px solid var(--rule); }
.promo-cover { aspect-ratio: 3 / 4; background: var(--mist); overflow: hidden; }
.promo-cover img { width: 100%; height: 100%; object-fit: cover; }
.promo-text h3 { font-size: 1.4rem; margin-bottom: 8px; }
.promo-text p { color: var(--slate); }
.promo-text .kicker { color: var(--seep); }
.promo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.promo-news { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--tint); }
.promo-news h3 { font-size: 1.4rem; }
.promo-news p { color: var(--slate); margin-bottom: 4px; }
.promo-news label { font-size: 0.8125rem; font-weight: 600; }
.promo-news input { padding: 11px 12px; border: 1px solid var(--slate); font: inherit; background: #fff; }
.promo-news .btn { align-self: flex-start; margin-top: 6px; }

/* Footer */
.site-footer { background: var(--ink); color: #c9d6dd; font-size: 0.9375rem; }
.site-footer a { color: #e6eef2; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.footer-name { font: 700 1.6rem var(--serif); color: #fff; margin-bottom: 8px; }
.footer-desc { max-width: 38ch; }
.site-footer h2 { font: 600 1rem var(--sans); color: #fff; margin-bottom: 10px; }
.site-footer li { margin-bottom: 6px; }
.footer-base { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; padding-bottom: 24px; font-size: 0.8125rem; }
.footer-base::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid #2b4152; }
.footer-base p { margin: 0; }
.social { display: flex; gap: 18px; }
.social li { margin: 0; }

/* Tablet */
@media (max-width: 960px) {
  .band, .page-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .page-side { position: static; }
  .band-side { grid-template-columns: minmax(0, 1fr); }
  .masthead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .masthead-ad { width: 100%; flex-basis: auto; }
  .mega-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-4 { --cols: 2; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .promo-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Phone: menu button, logo and search on one row, ad below; cards after the first become thumbnail rows */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .utility .today { display: none; }
  .utility-inner { justify-content: flex-end; }
  .masthead { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "menu logo search" "ad ad ad"; align-items: center; gap: 8px 4px; padding-top: 10px; padding-bottom: 12px; }
  .wordmark { grid-area: logo; text-align: center; }
  .wordmark-name { font-size: 1.7rem; }
  .wordmark-tag { display: none; }
  .nav-toggle { grid-area: menu; }
  .search-link { grid-area: search; display: flex; }
  .masthead-ad { grid-area: ad; }
  .js .nav-toggle { display: flex; }
  .js .primary { display: none; }
  .js .site-header.nav-open .primary { display: block; }
  .primary-inner { flex-direction: column; align-items: stretch; gap: 0; }
  .primary ul { flex-direction: column; gap: 0; }
  .primary a { padding: 14px 4px; border-bottom: 1px solid var(--rule); }
  .primary a[aria-current="page"] { border-bottom-color: var(--rule); box-shadow: inset 4px 0 0 var(--flare); padding-left: 12px; }
  .search { display: none; }
  .mega { position: static; box-shadow: none; border-bottom: 0; background: var(--mist); margin: 0 -16px; }
  .mega-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .mega-col li a { padding: 6px 0; }
  .markets-inner { gap: 20px; }

  .hero-title { font-size: 2rem; }
  .story-title { font-size: 2rem; }
  .page-head h1 { font-size: 1.8rem; }
  .cards, .cards-3, .cards-4 { --cols: 1; gap: 16px; }
  .cards-second { margin-top: 16px; }
  .cards > .card:not(:first-child) { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
  .cards > .card:not(:first-child) .card-media { aspect-ratio: 4 / 3; margin-bottom: 0; }
  .cards > .card:not(:first-child) .card-title { font-size: 1rem; }
  .topic-row { margin-top: 28px; }
  .events-grid, .invest-grid, .topic-index { grid-template-columns: minmax(0, 1fr); }
  .promo-card { grid-template-columns: minmax(0, 1fr); }
  .promo-cover { width: 160px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-base { flex-direction: column; align-items: flex-start; }
  .dim-d { display: none; }
  .dim-m { display: inline; }
  .ad-box { max-width: calc(var(--mw) * 1px); aspect-ratio: var(--mw) / var(--mh); }
}

@media print {
  .utility, .markets, .primary, .ad, .page-side, .promo, .site-footer, .share, .nav-toggle, .search-link { display: none; }
  .page-grid, .band { display: block; }
}
