/*
 * oilsignal.io/insights: overrides for the site's own base styles
 * (src/styles/base.css, tokens.css), which load on every page and are
 * written for the dark site. Loaded last: wordpress.css, the theme's osi.css
 * (copied unchanged from the OilSignal Insights WordPress theme 1.0.1), then
 * this file, on Insights pages only (vite.config.ts).
 */

:root {
  color-scheme: light;
}

html {
  background: #ffffff;
  /* WordPress jumps to #featured, #topics and #articles; it does not glide. */
  scroll-behavior: auto;
}

::selection {
  background: revert;
  color: revert;
}

p,
h1,
h2,
h3,
h4 {
  text-wrap: wrap;
}

/* The site gives every section with an id room for its own header. */
.osi-main section[id] {
  scroll-margin-top: 0;
}

/* Inside the article body, nested paragraphs and lists keep the browser's
   spacing and list markers, as on WordPress (the site resets them). */
.osi-article__body ul {
  list-style: disc;
}

.osi-article__body ol {
  list-style: decimal;
}

.osi-article__body > * :where(p, ul, ol, dl, dd, h1, h2, h3, h4) {
  margin: revert;
}

.osi-article__body img {
  display: inline;
}

/* A long source address wraps when it cannot fit on its line, so a phone
   does not scroll sideways (on WordPress it overflows the page). */
.osi-article__body {
  overflow-wrap: break-word;
}

/* Wide tables scroll sideways on narrow screens instead of widening the page
   (the wrapper is added when the article is read from WordPress). */
.osi-article__body .insights-table {
  max-width: 100%;
  overflow-x: auto;
}

/* WordPress centres a table in the reading column (it is a direct child of
   the constrained layout); inside the wrapper it needs the same margins. */
.osi-article__body .insights-table > table {
  margin-left: auto;
  margin-right: auto;
}

/* The breadcrumb in an article's head (ArticlePage.tsx), in the place and
   type of the theme's category line (.osi-article__cat): Home and Insights
   in the slate, then the topic as the category line showed it. */
.osi-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 0.7em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.osi-breadcrumb li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7em;
}

.osi-breadcrumb li + li::before {
  content: '/';
  color: var(--osi-slate);
  opacity: 0.5;
}

.osi-breadcrumb li.osi-breadcrumb__also::before {
  content: ',';
}

.osi-breadcrumb li:nth-child(-n + 2) a {
  color: var(--osi-slate);
}

.osi-breadcrumb a:hover,
.osi-breadcrumb a:focus-visible {
  text-decoration: underline;
}
