/* ============================================================================
   Refinery Overview — stylesheet for the reference build.
   Framework-free. No Divi, no React, no build step.

   This is the production-candidate CSS. In WordPress it can be enqueued as-is
   (wp_enqueue_style) or pasted into the page template. All design tokens live
   in :root so brand tweaks are one-line changes. See DATA-MODEL.md / README.md.
   ============================================================================ */

:root {
  /* Brand palette — sampled from the GAS logo + refinery hi-fi */
  --ro-bg: #ffffff;
  --ro-ink: #0f172a;
  --ro-ink-soft: #475569;
  --ro-muted: #94a3b8;
  --ro-line: #e2e8f0;
  --ro-line-soft: #f1f5f9;
  --ro-fill-soft: #f8fafc;
  --ro-fill: #eef2f7;
  --ro-accent: #1d8fd9;          /* brand blue */
  --ro-accent-deep: #5e2c91;     /* brand purple */
  --ro-navy: #0c1e35;
  --ro-hero-navy: #0e1424;
  --ro-hero-line: #1c2540;
  --ro-gradient: linear-gradient(120deg, #1d8fd9 0%, #5e2c91 100%);
  --ro-gradient-soft: linear-gradient(120deg, #e8f3fb 0%, #f5edfa 100%);

  /* Type */
  --ro-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ro-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Stream accent dots */
  --ro-stream-gas: var(--ro-accent);
  --ro-stream-fuels: var(--ro-accent-deep);
  --ro-stream-distillate: var(--ro-navy);

  /* Deterministic palette for arbitrary (non-refinery) stream names. app.js
     assigns these by column order for any stream not in the fixed Gas/Fuels/
     Distillate map, so multi-page markets (energy, chemical, etc.) get distinct
     column dots without hardcoding each stream name. First three mirror the
     refinery accents; the last two extend the brand palette for markets with
     more streams. */
  --ro-stream-1: var(--ro-accent);
  --ro-stream-2: var(--ro-accent-deep);
  --ro-stream-3: var(--ro-navy);
  --ro-stream-4: #0f9d8f;   /* brand teal */
  --ro-stream-5: #d97706;   /* brand amber */

  --ro-radius: 12px;
  --ro-radius-lg: 20px;
  --ro-maxw: 1200px;
}

/* ---- Reset-ish, scoped to the component root -------------------------------- */
.ro-root *, .ro-root *::before, .ro-root *::after { box-sizing: border-box; }
.ro-root {
  font-family: var(--ro-sans);
  color: var(--ro-ink);
  background: var(--ro-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ro-root img { display: block; max-width: 100%; }
.ro-root button { font-family: inherit; }

/* Width container — the real theme may already constrain this; if so, drop it. */
.ro-wrap { max-width: var(--ro-maxw); margin: 0 auto; padding: 0 24px 56px; }

/* ---- Page intro ------------------------------------------------------------- */
.ro-intro { max-width: 760px; padding: 36px 0 8px; }
.ro-kicker {
  font-family: var(--ro-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ro-accent); font-weight: 600; margin-bottom: 12px;
}
.ro-intro h1 {
  font-size: 36px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em;
  margin: 0; color: var(--ro-ink);
}
.ro-intro p {
  font-size: 15px; color: var(--ro-ink-soft); margin: 14px 0 0; line-height: 1.6; max-width: 680px;
}

/* ---- Flagship hero ---------------------------------------------------------- */
.ro-hero {
  margin-top: 20px; padding: 40px 36px; border-radius: var(--ro-radius-lg);
  background: var(--ro-hero-navy); border: 1px solid var(--ro-hero-line);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  position: relative; overflow: hidden; color: #fff;
}
.ro-hero__topbar { position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--ro-gradient); z-index: 2; }
.ro-hero__watermark {
  position: absolute; inset: 0; background-repeat: no-repeat;
  background-position: 102% center; background-size: auto 220%;
  opacity: 0.07; pointer-events: none; z-index: 0;
}
.ro-hero__body { position: relative; z-index: 1; }
.ro-hero__tags { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ro-hero__flag {
  font-family: var(--ro-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #5cb1ec; padding: 5px 10px;
  background: rgba(92,177,236,0.12); border-radius: 4px;
}
.ro-hero__sub { font-family: var(--ro-mono); font-size: 11px; color: rgba(255,255,255,0.55); }
.ro-hero h2 { font-size: 44px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 0; color: #fff; }
.ro-hero__tagline { font-size: 15px; color: #c2cbe1; margin-top: 14px; line-height: 1.6; max-width: 540px; }
.ro-hero__stats { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.ro-stat__val { font-size: 22px; font-weight: 700; color: #fff; }
.ro-stat__lab {
  font-family: var(--ro-mono); font-size: 10px; color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px;
}
.ro-stat__div { width: 1px; height: 30px; background: rgba(255,255,255,0.15); }
.ro-hero__badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 22px; }
.ro-hero__actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.ro-hero__mark { position: relative; z-index: 1; height: 200px; display: flex; align-items: center; justify-content: center; }
.ro-hero__mark img { height: 100%; width: auto; filter: drop-shadow(0 12px 40px rgba(29,143,217,0.4)); }

/* Buttons */
.ro-btn {
  display: inline-block; padding: 12px 24px; border-radius: 999px; font-size: 13px;
  font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.ro-btn--primary { background: var(--ro-gradient); color: #fff; box-shadow: 0 8px 20px -8px rgba(94,44,145,0.5); }
.ro-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(94,44,145,0.6); }
.ro-btn--ghost-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); }
.ro-btn--ghost-dark:hover { background: rgba(255,255,255,0.08); }

/* ---- Filter bar ------------------------------------------------------------- */
.ro-filters {
  margin-top: 22px; padding: 14px 18px; background: var(--ro-bg);
  border: 1px solid var(--ro-line); border-radius: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ro-filters__label {
  font-family: var(--ro-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ro-muted); margin-right: 4px;
}
.ro-facet { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ro-facet__name {
  color: var(--ro-muted); font-family: var(--ro-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ro-chip-btn {
  padding: 6px 11px; background: var(--ro-fill-soft); color: var(--ro-ink);
  border: 1px solid var(--ro-line); border-radius: 999px;
  font-family: var(--ro-mono); font-size: 11px; font-weight: 600; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.ro-chip-btn:hover { border-color: var(--ro-accent); }
.ro-chip-btn[aria-pressed="true"] { background: var(--ro-ink); color: #fff; border-color: var(--ro-ink); }
.ro-chip-btn.is-component[aria-pressed="true"] { background: var(--ro-accent); border-color: var(--ro-accent); }
.ro-filters__break { flex-basis: 100%; height: 0; }
.ro-clear {
  padding: 6px 12px; background: transparent; border: none; cursor: pointer; font-weight: 600;
  font-family: var(--ro-mono); font-size: 11px; color: var(--ro-accent);
}
.ro-filters__hint { font-family: var(--ro-mono); font-size: 10px; color: var(--ro-muted); margin-left: 4px; }

/* ---- Component "show all" expander ------------------------------------------ */
/* Toggle button that reveals every catalogue component beyond the curated row.
   Deliberately styled apart from .ro-chip-btn (dashed, accent text) so it reads
   as an action, not a filter value, and so it is skipped by the chip-sync loop. */
.ro-comp-toggle {
  padding: 6px 11px; margin-left: 2px; background: transparent; color: var(--ro-accent);
  border: 1px dashed var(--ro-line); border-radius: 999px; cursor: pointer;
  font-family: var(--ro-mono); font-size: 11px; font-weight: 600; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.ro-comp-toggle:hover { border-color: var(--ro-accent); background: var(--ro-fill-soft); }
.ro-comp-toggle[aria-expanded="true"] { color: var(--ro-ink-soft); }

/* The extra-chip tray. Collapsed by default: it carries no chrome and flows
   inline after the curated row, and CSS hides every chip that is NOT active — so
   an active extra filter always stays visible even when the tray is "closed".
   Expanded (.is-open): a full-width panel showing the whole set of extra chips. */
.ro-comp-extra { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ro-comp-extra:not(.is-open) .ro-chip-btn[aria-pressed="false"] { display: none; }
.ro-comp-extra.is-open {
  flex-basis: 100%; gap: 6px; margin-top: 10px; padding: 12px 14px;
  background: var(--ro-fill-soft); border: 1px solid var(--ro-line); border-radius: 12px;
}

/* Standards tray reuses .ro-comp-extra chrome but lays its chips out in labelled
   family groups (ASTM / ISO / EN / ...). Collapsed it behaves exactly like the
   component tray: the group wrappers dissolve (display:contents), subheadings
   hide, and only the active (pressed) chip stays visible inline so a live filter
   is never hidden. Expanded it becomes a vertical stack of family groups. */
.ro-std-extra.is-open { flex-direction: column; align-items: stretch; gap: 12px; }
.ro-std-extra.is-open .ro-std-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ro-std-group__name {
  flex-basis: 100%; font-family: var(--ro-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ro-muted);
}
.ro-comp-extra:not(.is-open) .ro-std-group { display: contents; }
.ro-comp-extra:not(.is-open) .ro-std-group__name { display: none; }

/* ---- Method search banner --------------------------------------------------- */
.ro-method {
  display: flex; align-items: center; gap: 14px; margin-top: 24px;
  padding: 14px 20px; border-radius: var(--ro-radius);
  background: var(--ro-navy); color: #fff; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ro-method:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(12,30,53,0.7); }
.ro-method__icon { font-size: 18px; }
.ro-method__title { font-size: 13px; font-weight: 600; }
.ro-method__sub { font-family: var(--ro-mono); font-size: 10px; opacity: 0.7; margin-top: 2px; letter-spacing: 0.04em; }
.ro-method__cta {
  font-family: var(--ro-mono); font-size: 11px; padding: 6px 12px;
  background: rgba(255,255,255,0.12); border-radius: 999px; letter-spacing: 0.06em;
}

/* ---- Stream grid ------------------------------------------------------------ */
/* Adaptive columns: app.js sets --ro-stream-count on .ro-grid to the number of
   streams it rendered, so the grid width follows the actual stream count.
   3 streams (refinery/chemical) => repeat(3,1fr), identical to the old fixed
   grid. 2 streams (energy) => two equal full-width columns, no empty third.
   The fallback (3) keeps behaviour sane if the JS ever fails to set the var. */
.ro-grid { display: grid; grid-template-columns: repeat(var(--ro-stream-count, 3), 1fr); gap: 28px; margin-top: 24px; }
/* 1 stream (environment/catalysis): a single full-width card looks stretched,
   so present it as one centered column capped to a comfortable reading width
   instead of spanning the full ~1250px content column. */
.ro-grid[data-streams="1"] {
  grid-template-columns: minmax(0, 600px);
  justify-content: center;
}
.ro-col__head {
  display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px;
  margin-bottom: 16px; border-bottom: 2px solid var(--ro-ink);
}
.ro-col__dot { width: 8px; height: 8px; border-radius: 999px; }
.ro-col__title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.ro-col__count { font-family: var(--ro-mono); font-size: 11px; color: var(--ro-muted); margin-left: auto; }
.ro-col__cards { display: flex; flex-direction: column; gap: 12px; }
.ro-col__empty {
  font-family: var(--ro-mono); font-size: 12px; color: var(--ro-muted);
  padding: 18px; border: 1px dashed var(--ro-line); border-radius: var(--ro-radius); text-align: center;
}

/* ---- Card ------------------------------------------------------------------- */
.ro-card {
  position: relative; overflow: hidden; cursor: pointer; text-decoration: none; color: inherit;
  background: var(--ro-bg); border: 1px solid var(--ro-line); border-radius: var(--ro-radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.ro-card:hover {
  transform: translateY(-3px); border-color: var(--ro-accent);
  box-shadow: 0 14px 30px -14px rgba(29,143,217,0.35), 0 2px 6px rgba(15,23,42,0.06);
}
.ro-card__mark {
  position: absolute; right: -50px; top: 50%; transform: translateY(-50%);
  height: 220%; opacity: 0.022; pointer-events: none;
}
.ro-card__photo { overflow: hidden; border-radius: var(--ro-radius); background: #fff; }
.ro-card__photo img, .ro-card__photo .ro-ph { transition: transform 0.4s ease; }
.ro-card:hover .ro-card__photo img, .ro-card:hover .ro-card__photo .ro-ph { transform: scale(1.04); }
.ro-card__platform { font-family: var(--ro-mono); font-size: 10px; color: var(--ro-muted); letter-spacing: 0.04em; }
.ro-card__name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.ro-card__tagline { font-size: 12px; color: var(--ro-ink-soft); line-height: 1.5; }
.ro-card__row { display: flex; flex-wrap: wrap; gap: 4px; }
.ro-card__view-wrap { margin-top: auto; padding-top: 4px; display: flex; }
.ro-card[data-align="right"] .ro-card__view-wrap { justify-content: flex-end; }
.ro-card[data-align="left"] .ro-card__view-wrap { justify-content: flex-start; }
.ro-card__view {
  font-family: var(--ro-mono); font-size: 10px; font-weight: 600; padding: 5px 12px;
  border-radius: 999px; color: var(--ro-accent); background: var(--ro-fill-soft);
  border: 1px solid var(--ro-line); letter-spacing: 0.04em; text-transform: uppercase;
  display: inline-block; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.ro-card:hover .ro-card__view { background: var(--ro-accent); color: #fff; border-color: var(--ro-accent); }

/* Badges + chips */
.ro-badge {
  font-family: var(--ro-mono); font-size: 11px; font-weight: 600; padding: 4px 8px;
  border-radius: 5px; background: var(--ro-fill-soft); color: var(--ro-ink-soft);
  letter-spacing: 0.02em; white-space: nowrap;
}
.ro-badge--primary { background: var(--ro-accent); color: #fff; }
.ro-badge--dark { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); }
.ro-badge--dark.ro-badge--primary { background: var(--ro-accent); color: #fff; }
.ro-cchip {
  font-family: var(--ro-mono); font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: transparent; color: var(--ro-ink-soft); border: 1px solid var(--ro-line); white-space: nowrap;
}
/* The trailing "+N" component chip is a real <button> (tap/click/keyboard toggle
   for the inline expand). Reuses .ro-cchip look; add only the interactive bits. */
.ro-cchip--toggle {
  cursor: pointer; line-height: inherit;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.ro-cchip--toggle:hover { border-color: var(--ro-accent); color: var(--ro-accent); }
.ro-cchip--toggle:focus-visible { outline: 2px solid var(--ro-accent); outline-offset: 1px; }
.ro-cchip--toggle[aria-expanded="true"] { background: var(--ro-fill-soft); color: var(--ro-accent); border-color: var(--ro-accent); }

/* Hardware photo placeholder (used until a real image URL is present) */
.ro-ph {
  position: relative; border-radius: var(--ro-radius); overflow: hidden;
  background: linear-gradient(135deg, #eef2f7 0%, #d9e2ec 100%);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.04);
}
.ro-ph::before {
  content: ""; position: absolute; inset: 20% 22%; border-radius: 6px;
  background: rgba(15,23,42,0.06); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 6px 24px rgba(15,23,42,0.08);
}
.ro-ph__label {
  position: absolute; left: 12px; bottom: 10px; font-family: var(--ro-mono); font-size: 10px;
  letter-spacing: 0.05em; color: rgba(15,23,42,0.45); text-transform: uppercase;
}

/* ---- Theme-chrome stand-ins (NOT part of the template — see README) --------- */
.ro-chrome { opacity: 0.5; }
.ro-chrome--breadcrumb {
  font-family: var(--ro-mono); font-size: 11px; color: var(--ro-muted);
  padding: 14px 0; border-bottom: 1px dashed var(--ro-line-soft);
  display: flex; align-items: center; gap: 8px;
}
.ro-chrome--cta {
  margin-top: 28px; padding: 18px 22px; border-radius: 16px; background: var(--ro-gradient);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
}

/* ---- Responsive ------------------------------------------------------------- */
@media (max-width: 1080px) {
  /* Collapse every market (any stream count) to a single stacked column, as
     before. The [data-streams="1"] selector is repeated here so its higher
     specificity does not keep the 600px desktop cap active on mobile. */
  .ro-grid, .ro-grid[data-streams="1"] { grid-template-columns: 1fr; justify-content: stretch; }
  .ro-hero { grid-template-columns: 1fr; gap: 28px; }
  .ro-hero__mark { height: 140px; }
}
@media (max-width: 640px) {
  .ro-intro h1 { font-size: 28px; }
  .ro-hero { padding: 28px 22px; }
  .ro-hero h2 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .ro-card, .ro-btn, .ro-method, .ro-card__photo img, .ro-card__photo .ro-ph { transition: none !important; }
}

/* ============================================================================
   Theme integration — gassite.com Divi, all GAS Overview pages
   ----------------------------------------------------------------------------
   These rules reach OUTSIDE .ro-root to adapt the Divi default template. They
   are page-scoped via body.gas-overview-page (added by the mu-plugin's
   body_class filter to any page whose content carries the [gas_overview]
   shortcode) AND this stylesheet only loads on shortcode pages, so they cannot
   affect other pages. This replaces the earlier body.page-id-34777 scoping so
   every overview page (refinery + energy/chemical/environment/catalysis + any
   future page) gets the same adaptations with no per-page-id rule.

   Fixes:
   1. Divi's default template prints the post title as <h1 class="entry-title
      main_title">Refinery</h1> directly inside <article> (no meta wrapper).
      That gave the page TWO H1s (theme title + our shortcode intro H1) and a
      duplicate "Refinery" heading. Hide it so the shortcode intro is the single,
      first H1 (matches approved design 07). The H1 has no wrapping container,
      so display:none removes its height entirely with no empty band left.
   2. The fixed Divi header (#main-header, position:fixed, ~79px tall) would
      overlap the top of the content. Pad #main-content just enough to clear it
      (~90px); the intro's own top padding (.ro-intro, 36px) sits below that, so
      the intro H1 lands a comfortable distance under the menu with no large gap.
   3. Divi's default template reserves a right-sidebar gutter (#left-area is
      ~77% wide), boxing the overview at ~928px inside a 1250px content column.
      This page has no sidebar, so reclaim the full column. width:100% needs
      !important to beat Divi's percentage-width rule.
   4. Divi's style.css sets `h1, h2, h3, h4, h5 { color: #000 !important; }`.
      That !important beats our `.ro-hero h2 { color:#fff }` regardless of
      specificity, rendering the flagship hero heading black-on-navy (unreadable).
      Re-assert white with a page-scoped !important so we win the cascade without
      touching the theme's global H2 color anywhere else. Only the hero H2 is a
      heading element inside the dark panel; all other hero text uses non-heading
      tags and is unaffected.
   ============================================================================ */
body.gas-overview-page .entry-title.main_title { display: none; }
body.gas-overview-page #main-content { padding-top: 90px; }
body.gas-overview-page #left-area { width: 100% !important; }
body.gas-overview-page #sidebar { display: none; }
body.gas-overview-page .ro-wrap { max-width: 100%; }
body.gas-overview-page .ro-hero h2 { color: #fff !important; }
