/* Custom styles that sit outside Tailwind: mobile menu, reveal animation, print. */

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-in-out;
}
.mobile-menu.open {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

/* Reveal on scroll (only when JS has run, so content never hides without it) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Illustrations (inlined SVG from src/img/illustrations) ---------- */
/* ILL-START: build.py also embeds this block in the standalone SVG files */
:root {
  --ill-line: #232a30;
  --ill-soft: #8e98a2;
  --ill-paper: #ffffff;
  --ill-shadow: rgba(14, 17, 20, 0.07);
  --alu-1: #eef1f3; --alu-2: #d3d9de; --alu-3: #aab4bc;
  --steel-1: #ffe066; --steel-2: #ffcc00; --steel-3: #a88400;
  --soil-1: #e9dcc4; --soil-2: #d9c29c; --soil-3: #bf9f73; --soil-line: #b8925f;
  --plate-1: #8e98a2; --plate-2: #66717c; --plate-3: #4a545e;
  --pipe: #8e98a2; --pipe-hi: #d9dde1; --pipe-o: #343c44; --collar: #66717c;
  --accent: #fdc130; --ink-2: #343c44;
}
.on-dark {
  --ill-line: #d9dde1;
  --ill-soft: #8e98a2;
  --ill-paper: #181d21;
  --ill-shadow: rgba(0, 0, 0, 0.35);
  --alu-1: #b7bec5; --alu-2: #8e98a2; --alu-3: #66717c;
  --soil-1: #2f2820; --soil-2: #463a2c; --soil-3: #5c4a36; --soil-line: #7c5c38;
  --pipe: #8e98a2; --pipe-hi: #d9dde1; --pipe-o: #0e1114; --collar: #66717c;
  --ink-2: #4a545e;
}
.ill .ill-svg { display: block; width: 100%; height: auto; }
.ill-svg .ln { stroke: var(--ill-line); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.ill-svg .fill-none { fill: none; }
.ill-svg .paper { fill: var(--ill-paper); }
.ill-svg .shadow { fill: var(--ill-shadow); }
.ill-svg .alu-1 { fill: var(--alu-1); } .ill-svg .alu-2 { fill: var(--alu-2); } .ill-svg .alu-3 { fill: var(--alu-3); }
.ill-svg .steel-1 { fill: var(--steel-1); } .ill-svg .steel-2 { fill: var(--steel-2); } .ill-svg .steel-3 { fill: var(--steel-3); }
.ill-svg .soil-1 { fill: var(--soil-1); } .ill-svg .soil-2 { fill: var(--soil-2); } .ill-svg .soil-3 { fill: var(--soil-3); }
.ill-svg .plate-1 { fill: var(--plate-1); } .ill-svg .plate-2 { fill: var(--plate-2); } .ill-svg .plate-3 { fill: var(--plate-3); }
.ill-svg .ink-2 { fill: var(--ink-2); }
.ill-svg .hivis, .ill-svg .accent { fill: var(--accent); }
.ill-svg .accent-ln { stroke: var(--accent); stroke-linecap: butt; }
.ill-svg .pipe { stroke: var(--pipe); fill: var(--pipe); stroke-linecap: round; }
.ill-svg rect.pipe { stroke: none; }
.ill-svg .pipe-o { stroke: var(--pipe-o); fill: var(--pipe-o); stroke-linecap: round; }
.ill-svg .pipe-hi { stroke: var(--pipe-hi); stroke-linecap: round; opacity: 0.8; }
.ill-svg .collar { stroke: var(--collar); fill: var(--collar); stroke-linecap: butt; }
.ill-svg .groove { stroke: var(--ill-line); stroke-width: 0.8; opacity: 0.35; }
.ill-svg .groove-strong { stroke: var(--ill-soft); stroke-width: 3; stroke-linecap: round; }
.ill-svg .rib { stroke: var(--steel-3); fill: none; stroke-linecap: round; }
.ill-svg .stone { fill: var(--soil-3); stroke: var(--ill-line); stroke-width: 0.7; }
.ill-svg .strata { fill: none; stroke: var(--soil-line); stroke-width: 1.2; stroke-dasharray: 6 6; opacity: 0.7; }
.ill-svg .soil-dot { fill: var(--soil-line); opacity: 0.45; }
.ill-svg .dim { stroke: var(--ill-soft); stroke-width: 1.3; fill: none; }
.ill-svg .check { fill: none; stroke: var(--ill-line); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ill-svg .hazard-fill { fill: var(--accent); opacity: 0.9; }
.ill-svg .ill-t { font: 600 14px Inter, system-ui, sans-serif; fill: var(--ill-line); letter-spacing: 0.02em; }
.ill-svg .ill-t-soft { fill: var(--ill-soft); font-weight: 500; font-size: 13px; }
.ill-svg .ill-t-dark { fill: #0e1114; }
/* ILL-END */

/* ---------- Home intro: keep the drawing in view beside long reviewed copy ---------- */
@media (min-width: 1024px) {
  .home-intro { align-items: start; }
  .home-intro-art { position: sticky; top: 7rem; }
}

/* ---------- Article figures, citations and sources (pipeline-generated HTML) ---------- */
/* Plain CSS rather than Tailwind: these classes come from content, not build.py templates. */
.content .editorial-insert { margin: 2rem 0; }
.content .editorial-insert > * + * { margin-top: 1rem; }

.content figure {
  margin: 1.75rem 0;
  padding: 1rem;
  border: 2px solid #0e1114;          /* ink-950 */
  border-radius: 0;
  background: #f4f5f3;                /* concrete-50 */
}
.content figure svg {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 29rem;
  margin: 0 auto;
}
.content figure svg.graph { width: min(100%, 32rem); max-height: none; }
.content figcaption {
  max-width: 44rem;
  margin: 0.85rem auto 0;
  padding-top: 0.65rem;
  border-top: 2px solid #0e1114;      /* ink-950 */
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #343c44;                     /* ink-700 */
}

/* Wide diagrams keep a readable label size and scroll sideways on small screens. */
.content .diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.content .diagram-scroll .custom-art { width: 100%; min-width: 36rem; max-height: none; }
@media (max-width: 639px) {
  .content .diagram-scroll svg.graph { width: 100%; min-width: 28rem; }
}

/* Edge shadows hint that a table or diagram scrolls; they vanish once it fits. */
.content .table-wrap,
.content .diagram-scroll {
  background:
    linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(14, 17, 20, 0.14), transparent) left / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(14, 17, 20, 0.14), transparent) right / 0.9rem 100% no-repeat scroll;
}
.content figure .diagram-scroll {
  background-color: #f4f5f3;
  background-image:
    linear-gradient(to right, #f4f5f3 30%, rgba(244, 245, 243, 0)),
    linear-gradient(to left, #f4f5f3 30%, rgba(244, 245, 243, 0)),
    radial-gradient(farthest-side at 0 50%, rgba(14, 17, 20, 0.14), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(14, 17, 20, 0.14), transparent);
}

/* Citation markers: small, unobtrusive, and a block of their own when they follow a table. */
.content sup { font-size: 0.7em; line-height: 0; white-space: normal; }
.content sup a { text-decoration: none; font-weight: 600; }
.content sup a:hover { text-decoration: underline; }
.content .table-wrap + sup { display: block; margin-top: 0.5rem; line-height: 1.4; }

/* Numbered source list at the end of an article. */
.content ol.sources { font-size: 0.9rem; }
.content ol.sources li { margin: 0.35rem 0; scroll-margin-top: 6rem; }
.content ol.sources li:target { background: #fff4bf; }   /* signal-100 */
.content ol.sources small { display: block; color: #66717c; }                  /* ink-500 */
.content ol.sources small:empty { display: none; }

@media print {
  header, footer, .no-print { display: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  body { color: #000; }
}
