/* =========================================================
   Chicago X-Ray Recycling — B.W. Recycling, Inc.
   Shared stylesheet for home-template.html + inner-template.html
   Concept: radiology lightbox — developed-film blue field,
   the quote form is the illuminated viewer panel.
   ========================================================= */

:root {
  --film: #10263b;          /* developed film base */
  --film-2: #1a3756;        /* lighter film tone */
  --film-line: rgba(220, 233, 243, 0.08);
  --glow: #e9f2f8;          /* lightbox white */
  --glow-dim: #b9cddd;      /* text on film */
  --paper: #f4f7f9;         /* page background */
  --white: #ffffff;
  --ink: #15202b;           /* body text */
  --ink-soft: #4a5a69;
  --line: #d6dfe7;
  --silver: #8fa1b1;
  --safelight: #e39b2d;     /* darkroom safelight amber — CTAs */
  --safelight-hover: #f0ad45;
  --safelight-ink: #1d1304;
  --focus: #3d8bd9;

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  --step-4: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-sm: 4px;
  --radius: 10px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { 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(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--film-2); text-underline-offset: 3px; }
a:hover { color: var(--film); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 85%;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--white); padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: var(--radius-sm);
  font: 700 var(--step-0)/1 var(--font-display); font-stretch: 90%;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease;
}
.btn-amber { background: var(--safelight); color: var(--safelight-ink); }
.btn-amber:hover { background: var(--safelight-hover); color: var(--safelight-ink); }
.btn-ghost { background: transparent; color: var(--glow); box-shadow: inset 0 0 0 2px rgba(233,242,248,.35); }
.btn-ghost:hover { color: var(--white); box-shadow: inset 0 0 0 2px var(--glow); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { background: var(--film); color: var(--glow); position: relative; z-index: 20; }
.header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--glow); text-decoration: none; }
.brand-mark {
  width: 40px; height: 48px; flex: none; border-radius: 3px;
  background: linear-gradient(160deg, #2b5277, var(--film-2));
  box-shadow: inset 0 0 0 1.5px rgba(233,242,248,.5);
  position: relative; overflow: hidden;
}
/* film-sheet corner notch, the orientation mark on real X-ray film */
.brand-mark::after {
  content: ""; position: absolute; top: 5px; right: 5px;
  width: 9px; height: 5px; border-radius: 0 0 0 5px; background: var(--film);
}
.brand-mark::before {
  content: ""; position: absolute; left: 9px; right: 9px; top: 14px; bottom: 10px;
  border-radius: 40% 40% 30% 30%; border: 2px solid rgba(233,242,248,.75);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 800 1.2rem var(--font-display); font-stretch: 80%; color: var(--white); }
.brand-sub { font-size: .8rem; color: var(--glow-dim); }
.header-phone {
  display: flex; flex-direction: column; align-items: flex-end;
  color: var(--glow); text-decoration: none; line-height: 1.2;
}
.header-phone small { font-size: .78rem; color: var(--glow-dim); }
.header-phone strong { font: 800 1.35rem var(--font-display); font-stretch: 85%; color: var(--white); }
.header-phone:hover strong { color: var(--safelight); }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--glow);
  padding: 10px; min-width: 44px; min-height: 44px; cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

.main-nav { border-top: 1px solid var(--film-line); }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 2px 4px;
}
.main-nav a {
  display: block; padding: 12px 9px; color: var(--glow-dim);
  text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--white); }
.main-nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--safelight); }

/* ---------- Lightbox hero (home) ---------- */
.lightbox {
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(120,170,215,.22), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--film-line) calc(25% - 1px) 25%),
    var(--film);
  color: var(--glow);
}
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-top: clamp(36px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 80px);
}
.hero h1 {
  font-size: var(--step-4); font-weight: 800; font-stretch: 78%;
  color: var(--white); max-width: 14ch; margin-bottom: .35em;
}
.hero-lead { font-size: var(--step-1); color: var(--glow-dim); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.hero-facts {
  list-style: none; margin: 0; padding: 24px 0 0;
  border-top: 1px solid rgba(233,242,248,.18);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.hero-facts strong {
  display: block; font: 700 var(--step-1) var(--font-display); font-stretch: 85%;
  color: var(--white); margin-bottom: 2px;
}
.hero-facts span { font-size: var(--step--1); color: var(--glow-dim); line-height: 1.45; display: block; }

/* ---------- The viewer panel (form card) — the signature element ---------- */
.viewer {
  background: var(--glow);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 30px 26px 24px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.6),
    0 0 60px rgba(170, 210, 240, .35),
    0 24px 50px rgba(5, 15, 25, .45);
}
/* film clip at the top of the viewer */
.viewer::before {
  content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 16px; border-radius: 4px;
  background: linear-gradient(#c9d4dd, #9aabb9);
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.viewer h2 { font-size: var(--step-2); margin-bottom: .25em; color: var(--film); }
.viewer .form-note { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 18px; }
.viewer-phone { margin: 14px 0 0; text-align: center; font-size: var(--step--1); color: var(--ink-soft); }
.viewer-phone a { font-weight: 700; color: var(--film); }

/* ---------- Forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.field label .req { color: #b2462b; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid #b9c6d2; border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink);
  font: 400 1rem var(--font-body);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(61,139,217,.25);
}
.field-help { font-size: .8rem; margin-top: 4px; display: inline-block; }
.hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

/* form_type switch — body[data-form="pickup"] shows the pick-up form */
.form-pickup { display: none; }
body[data-form="pickup"] .form-pickup { display: block; }
body[data-form="pickup"] .form-quote { display: none; }

/* ---------- Home sections ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head p { color: var(--ink-soft); font-size: var(--step-1); }

.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px;
}
.steps li { counter-increment: step; position: relative; padding-top: 58px; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--film); color: var(--white);
  font: 800 1.15rem var(--font-display);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 21px; left: 54px; right: -16px;
  height: 2px; background: var(--line);
}
.steps p { color: var(--ink-soft); margin: 0; }

.film-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--film); }
.film-type { padding: 24px 24px 8px 0; }
.film-type + .film-type { padding-left: 24px; border-left: 1px solid var(--line); }
.film-type p { color: var(--ink-soft); }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--film); border-radius: var(--radius-sm); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.counties { columns: 3 180px; column-gap: 28px; margin: 0; padding: 0; list-style: none; }
.counties li { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid var(--line); }
.counties a { font-weight: 600; text-decoration: none; }

.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer; padding: 18px 36px 18px 0; position: relative; list-style: none;
  font: 700 var(--step-1) var(--font-display); font-stretch: 88%;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px;
  border-right: 2px solid var(--film); border-bottom: 2px solid var(--film);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s ease;
}
.faq-list details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-list details p { color: var(--ink-soft); max-width: 70ch; }

/* ---------- Inner page header ---------- */
.page-head { padding: clamp(28px, 4vw, 48px) 0 clamp(30px, 4vw, 52px); }
.breadcrumb { font-size: var(--step--1); margin-bottom: 14px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--silver); }
.breadcrumb a { color: var(--glow-dim); }
.breadcrumb [aria-current] { color: var(--white); }
.page-head h1 {
  font-size: var(--step-4); font-weight: 800; font-stretch: 80%;
  color: var(--white); max-width: 22ch; margin: 0;
}
.page-intro { color: var(--glow-dim); font-size: var(--step-1); max-width: 60ch; margin: 14px 0 0; }
.page-intro:empty { display: none; }

/* ---------- Inner layout: content + right form ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 5vw, 64px);
  align-items: start; padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(48px, 7vw, 88px);
}
.layout .viewer { margin-top: calc(-1 * clamp(64px, 8vw, 110px)); }
.sidebar { position: sticky; top: 20px; }
.sidebar-badge { display: flex; gap: 14px; align-items: center; margin-top: 20px; font-size: var(--step--1); color: var(--ink-soft); }
.sidebar-badge img { width: 72px; flex: none; }

/* rich content from {{content}} */
.prose { max-width: 72ch; }
.prose > :first-child, .prose > figure.is-empty + * { margin-top: 0; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--film-2); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--white); font-family: var(--font-display); font-stretch: 88%; }
.prose .county-list { columns: 3 160px; column-gap: 24px; padding-left: 0; list-style: none; font-size: .95rem; }
.prose .county-list li { margin: 0 0 .3em; }
.prose blockquote { margin: 0 0 1.2em; padding: 14px 18px; border-left: 4px solid var(--safelight); background: var(--white); }

.figure-lead { margin: 0 0 28px; }
.figure-lead img, .gallery img { border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--white); width: 100%; }
.figure-lead figcaption, .gallery figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 32px 0 0; }
.gallery figure { margin: 0; }

/* hide image / video slots whose param is empty */
figure:has(img[src=""]), figure.is-empty, .video-block.is-empty { display: none; }
.gallery:not(:has(figure:not(.is-empty))) { display: none; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--film); color: var(--glow); }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-top: 40px; padding-bottom: 40px;
}
.cta-inner h2 { color: var(--white); margin: 0 0 .2em; }
.cta-inner p { color: var(--glow-dim); margin: 0; max-width: 56ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: #0b1b2b; color: var(--glow-dim); font-size: .92rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px;
  padding-top: 48px; padding-bottom: 32px;
}
.site-footer h3 { color: var(--white); font-size: 1rem; margin-bottom: .8em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--glow-dim); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--film-line); padding-top: 18px; padding-bottom: 24px; font-size: .82rem; }

/* ---------- Mobile call bar ---------- */
.mobile-bar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1fr) 360px; }
  .layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(2)::after { display: none; }
}

@media (max-width: 1100px) and (min-width: 861px) {
  .main-nav a { padding: 12px 6px; font-size: .84rem; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .header-phone { display: none; }
  .main-nav { display: none; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding-bottom: 10px; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--film-line); }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--film-line); box-shadow: inset 4px 0 0 var(--safelight); padding-left: 12px; }

  .hero, .layout, .split { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: none; }
  .layout .viewer { margin-top: 0; }
  .sidebar { position: static; }
  .film-types { grid-template-columns: minmax(0, 1fr); }
  .film-type, .film-type + .film-type { padding: 20px 0 4px; border-left: 0; }
  .film-type + .film-type { border-top: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }

  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--film); box-shadow: 0 -6px 20px rgba(0,0,0,.25);
  }
  body { padding-bottom: 68px; }
}

@media (max-width: 560px) {
  .hero-facts { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li::after { display: none; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .viewer { padding: 26px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}