/* ===========================================================================
   Freight Barometer - editorial terminal
   Broadsheet authority (serif display, hairline rules) meets a data terminal
   (monospaced tabular figures, a single steel-blue accent).
   West Coast Media Solutions Inc.
   =========================================================================== */

:root {
  --paper:    #F4F1EA;
  --paper-2:  #ECE7DC;
  --card:     #FBF9F4;
  --ink:      #1B1A17;
  --ink-2:    #4A4843;
  --ink-3:    #847F74;
  --line:     rgba(27, 26, 23, 0.12);
  --line-2:   rgba(27, 26, 23, 0.24);
  --steel:    #1F3B57;
  --steel-2:  #2E5577;
  --up:       #4F6B2C;
  --down:     #A0392A;
  --amber:    #A86C16;
  --maxw:     1180px;
  --gap:      clamp(1rem, 2.4vw, 1.75rem);
  --serif:    'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:     'Spline Sans', system-ui, sans-serif;
  --mono:     'Spline Sans Mono', ui-monospace, 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
}

a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); }

/* ---- small-caps mono label, the terminal voice -------------------------- */
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

/* ---- masthead ----------------------------------------------------------- */
.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 1.4rem 0 0.9rem;
}
.masthead .wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0;
}
.brand .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-2);
  margin-top: 0.3rem;
}
.masthead-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}
.masthead-meta .date { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.masthead-meta .seedflag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--amber); border: 1px solid var(--amber); border-radius: 3px; padding: 2px 6px; align-self: flex-end;
}
.subnav {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.subnav .wrap { display: flex; gap: 1.4rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.subnav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2);
}
.subnav a:hover { color: var(--steel); text-decoration: none; }

/* ---- staggered load ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(8px); animation: rise 0.6s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* ---- signal front page -------------------------------------------------- */
.signal {
  padding: clamp(1.6rem, 4vw, 2.8rem) 0;
  border-bottom: 1px solid var(--line);
}
.signal-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.signal-verdict .state-line { display: flex; align-items: center; gap: 0.7rem; margin: 0.4rem 0 0.2rem; }
.state-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.signal-verdict h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 0;
}
.signal-verdict .rationale {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0.9rem 0 0;
}
.signal-state-expanding  .state-dot, .badge-expanding  { background: var(--up); }
.signal-state-tightening .state-dot, .badge-tightening { background: var(--up); }
.signal-state-neutral    .state-dot, .badge-neutral    { background: var(--ink-3); }
.signal-state-loosening  .state-dot, .badge-loosening  { background: var(--amber); }
.signal-state-contracting .state-dot, .badge-contracting { background: var(--down); }

.signal-meter { }
.baro-dial-wrap { max-width: 380px; }
.baro-dial { width: 100%; height: auto; display: block; }
.baro-dial text { font-family: var(--mono); }
.baro-edge { font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--ink-3); }
.baro-score { font-size: 21px; font-weight: 500; fill: var(--ink); letter-spacing: -0.01em; }
.drivers { margin-top: 1.3rem; border-top: 1px solid var(--line); padding-top: 0.9rem; }
.drivers .kicker { display: block; margin-bottom: 0.6rem; }
.driver-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; border-bottom: 1px dotted var(--line);
}
.driver-row span:first-child { font-size: 13px; color: var(--ink-2); }
.driver-val { font-family: var(--mono); font-size: 13px; font-weight: 500; }

/* ---- KPI strip ---------------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.kpi {
  padding: 1.1rem var(--gap) 1.1rem;
  border-right: 1px solid var(--line);
  position: relative;
}
.kpi:last-child { border-right: none; }
.kpi .label { display: block; }
.kpi .value {
  font-family: var(--mono); font-weight: 500; font-size: 1.9rem; line-height: 1.1;
  margin: 0.45rem 0 0.2rem; letter-spacing: -0.02em;
}
.kpi .delta { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.kpi .delta.up { color: var(--up); }
.kpi .delta.down { color: var(--down); }
.kpi .delta.flat { color: var(--ink-3); }
.kpi .asof { font-family: var(--mono); font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.kpi .spark { position: absolute; right: var(--gap); bottom: 1.1rem; width: 64px; height: 22px; opacity: 0.65; }
.kpi .stale-tag { font-family: var(--mono); font-size: 9px; color: var(--amber); letter-spacing: 0.1em; }

/* ---- generic section ---------------------------------------------------- */
section.band { padding: clamp(2rem, 5vw, 3.2rem) 0; border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 1.4rem; }
.section-head h3 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  letter-spacing: -0.01em; margin: 0.3rem 0 0;
}
.section-head p { color: var(--ink-2); margin: 0.5rem 0 0; max-width: 62ch; }

.panel-grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.2rem 1.25rem 1.1rem;
}
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.2rem; }
.panel-title h4 { font-family: var(--sans); font-weight: 500; font-size: 1.02rem; margin: 0; }
.panel-title .now { font-family: var(--mono); font-size: 1.1rem; font-weight: 500; }
.panel .sub { font-size: 13px; color: var(--ink-2); margin: 0 0 0.8rem; }
.chart-box { position: relative; width: 100%; height: 240px; }
.chart-box.tall { height: 300px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.legend .swatch { width: 16px; height: 0; border-top-width: 3px; border-top-style: solid; }

.range-tabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden; }
.range-tabs button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 4px 10px;
  background: transparent; border: none; border-right: 1px solid var(--line); color: var(--ink-2); cursor: pointer;
}
.range-tabs button:last-child { border-right: none; }
.range-tabs button.active { background: var(--steel); color: #fff; }

/* ---- diesel + calculator ------------------------------------------------ */
.diesel-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gap); align-items: start; }
.regions { display: flex; flex-direction: column; gap: 10px; margin-top: 0.4rem; }
.region-row { display: grid; grid-template-columns: 120px 1fr 64px; align-items: center; gap: 10px; }
.region-row .rname { font-size: 13px; color: var(--ink-2); }
.region-bar { height: 10px; background: var(--paper-2); border-radius: 5px; overflow: hidden; }
.region-bar i { display: block; height: 100%; background: var(--amber); border-radius: 5px; }
.region-row .rval { font-family: var(--mono); font-size: 13px; font-weight: 500; text-align: right; }

/* ---- DAT spot trends table --------------------------------------------- */
.trend-group { margin-top: 1rem; }
.trend-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line-2); padding-bottom: 5px; margin-bottom: 2px;
}
.trend-head .trend-metric { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); font-weight: 500; }
.trend-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dotted var(--line);
}
.trend-row .trend-metric { font-size: 13px; color: var(--ink-2); }
.trend-cols { display: inline-flex; gap: 0; }
.trend-head .trend-cols span { width: 64px; text-align: right; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.trend-cols .trend-val { width: 64px; text-align: right; font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.trend-val.up { color: var(--up); }
.trend-val.down { color: var(--down); }
.trend-val.flat { color: var(--ink-3); }

.calc label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0.7rem 0 0.3rem; }
.calc input[type="number"] {
  width: 100%; font-family: var(--mono); font-size: 1rem; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 5px; background: var(--paper); color: var(--ink);
}
.calc input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(31,59,87,0.12); }
.calc-out {
  margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.9rem;
  display: flex; align-items: baseline; justify-content: space-between;
}
.calc-out .big { font-family: var(--mono); font-size: 1.8rem; font-weight: 500; }
.calc-note { font-size: 12px; color: var(--ink-3); margin-top: 0.6rem; }

/* ---- explainer ---------------------------------------------------------- */
.explainers { columns: 2; column-gap: var(--gap); }
.explainer { break-inside: avoid; margin-bottom: 1.3rem; border-top: 2px solid var(--ink); padding-top: 0.7rem; }
.explainer h4 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin: 0 0 0.4rem; }
.explainer p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* ---- advertise CTA ------------------------------------------------------ */
/* ---- advertise form (now inside the legal modal) ------------------------ */
.adv-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1rem; }
.adv-form .full { grid-column: 1 / -1; }
.adv-form input, .adv-form textarea {
  width: 100%; font-family: var(--sans); font-size: 0.95rem; padding: 11px 12px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 5px; color: var(--ink);
}
.adv-form input:focus, .adv-form textarea:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(31,59,87,0.12); }
.adv-form textarea { resize: vertical; min-height: 90px; }
.adv-form button {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: none; border-radius: 5px; padding: 12px 22px; cursor: pointer;
  justify-self: start;
}
.adv-form button:hover { background: #000; }
.form-status { font-family: var(--mono); font-size: 12px; margin-top: 0.4rem; grid-column: 1/-1; }
.form-status.ok { color: var(--up); }
.form-status.err { color: var(--down); }

/* ---- ad placements ------------------------------------------------------ */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 1.6rem auto; gap: 4px; cursor: pointer; text-decoration: none;
  background: repeating-linear-gradient(45deg, var(--paper-2), var(--paper-2) 10px, #E6E0D3 10px, #E6E0D3 20px);
  border: 1px dashed var(--line-2); border-radius: 6px;
  color: var(--ink-3); transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  text-align: center; box-sizing: border-box;
}
.ad-slot:hover { border-color: var(--steel); color: var(--steel); }
.ad-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); opacity: 0.7; }
.ad-dims { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.02em; }
.ad-cta  { font-family: var(--sans); font-size: 12px; color: var(--steel); font-weight: 500; }
/* standard IAB sizes, responsive: never exceed viewport, keep aspect where possible */
.ad-billboard  { width: 970px; max-width: 100%; height: 90px; }
.ad-leaderboard{ width: 728px; max-width: 100%; height: 90px; }
.ad-rect-row   { display: flex; justify-content: center; margin: 1.6rem 0; }
.ad-rect       { width: 300px; max-width: 100%; height: 250px; margin: 0; }
@media (max-width: 760px) {
  .ad-billboard, .ad-leaderboard { height: 70px; }
}

/* ---- advertise overlay: stats + copy ------------------------------------ */
.adv-lede { font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.adv-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem;
  margin: 1.4rem 0 1.6rem; padding: 1.2rem; background: var(--ink); border-radius: 8px;
}
.adv-stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.adv-stat-num { font-family: var(--serif); font-weight: 600; font-size: clamp(1.25rem, 2.2vw, 1.7rem); color: var(--paper); line-height: 1; }
.adv-stat-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: #B9B097; line-height: 1.3; }
@media (max-width: 620px) {
  .adv-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.75rem; }
}
.subscribe-band { background: var(--ink); color: var(--paper); padding: clamp(2.2rem, 5vw, 3.2rem) 0; }
.subscribe-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.subscribe-copy .kicker { color: #B9B097; }
.subscribe-copy h3 { font-family: var(--serif); font-weight: 600; color: var(--paper); font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0.3rem 0 0.5rem; letter-spacing: -0.01em; }
.subscribe-copy p { color: #D8D3C7; font-size: 14px; line-height: 1.6; margin: 0; max-width: 46ch; }
.subscribe-form { position: relative; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.subscribe-form input[type="email"] {
  flex: 1 1 220px; font-family: var(--sans); font-size: 0.95rem; padding: 12px 14px;
  background: #26241F; border: 1px solid #3A3730; border-radius: 5px; color: var(--paper);
}
.subscribe-form input[type="email"]::placeholder { color: #847F74; }
.subscribe-form input[type="email"]:focus { outline: none; border-color: var(--steel-2); box-shadow: 0 0 0 3px rgba(46,85,119,0.3); }
.subscribe-form button {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--paper); color: var(--ink); border: none; border-radius: 5px; padding: 12px 24px; cursor: pointer;
  transition: background 0.15s ease;
}
.subscribe-form button:hover { background: #fff; }
.subscribe-form .form-status { flex-basis: 100%; font-family: var(--mono); font-size: 12px; margin-top: 0.2rem; }
.subscribe-form .form-status.ok { color: #8FBF63; }
.subscribe-form .form-status.err { color: #E08A7C; }

/* ---- footer ------------------------------------------------------------- */
footer.site { padding: 2.4rem 0 2.8rem; }
footer.site .sources-full { max-width: none; }
footer.site .sources .kicker { display: block; margin-bottom: 0.7rem; }
footer.site .sources-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 2.4rem;
}
footer.site .sources-cols p {
  font-size: 12px; color: var(--ink-3); line-height: 1.65; margin: 0;
}
.colophon-bar {
  margin-top: 2.2rem; padding-top: 1.3rem; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); line-height: 1.7;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem;
}
.colophon-bar .legal-set { display: inline-flex; flex-wrap: wrap; gap: 0.4rem 1.35rem; }
.colophon-bar button {
  -webkit-appearance: none; appearance: none;
  font-family: var(--sans); font-size: 12.5px; font-weight: 400; letter-spacing: 0;
  color: var(--ink-2); background: none; background-color: transparent;
  border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0;
  line-height: inherit; cursor: pointer; transition: color 0.15s ease;
}
.colophon-bar button:hover { color: var(--steel); text-decoration: underline; text-underline-offset: 2px; }
.colophon-bar a { color: var(--ink-2); transition: color 0.15s ease; }
.colophon-bar a:hover { color: var(--steel); }
.colophon-bar .credit { color: var(--ink-3); }
.footer-sep { color: var(--line-2); padding: 0 0.15rem; }

/* ---- modal -------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(27,26,23,0.55);
  display: none; align-items: center; justify-content: center; padding: 1.2rem; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); max-width: 640px; width: 100%; max-height: 84vh; overflow-y: auto;
  border-radius: 8px; padding: 1.8rem 1.9rem; border: 1px solid var(--line-2);
}
.modal h3 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin: 0 0 0.8rem; }
.modal p, .modal li { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.modal .close {
  float: right; font-family: var(--mono); font-size: 18px; line-height: 1; background: none; border: none;
  cursor: pointer; color: var(--ink-2);
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  .signal-grid, .diesel-grid { grid-template-columns: 1fr; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .explainers { columns: 1; }
  .adv-form { grid-template-columns: 1fr; }
  .kpi { border-right: none; border-bottom: 1px solid var(--line); }
  footer.site .sources-cols { grid-template-columns: 1fr; gap: 0.7rem 0; }
  .subscribe-inner { grid-template-columns: 1fr; }
}
