/*
Theme Name: Throughput Control
Theme URI: https://waterbottlingproductionline.com/
Author: Allot Tech (Suzhou) Co., Ltd.
Description: A production-line performance and operational-readiness theme for WaterBottlingProductionLine.com.
Version: 2.0.1
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: throughput-control
*/

:root {
  --ink: #102326;
  --muted: #536568;
  --paper: #f4f1e8;
  --white: #fffdf7;
  --panel: #e8ece5;
  --cyan: #1ecad3;
  --orange: #ff6b35;
  --lime: #c8f169;
  --navy: #062d33;
  --line: #b9c5bf;
  --shadow: 8px 8px 0 #102326;
  --radius: 18px;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .06;
  background-size: 28px 28px;
  background-image: linear-gradient(#102326 1px, transparent 1px), linear-gradient(90deg, #102326 1px, transparent 1px);
  z-index: -1;
}
a { color: var(--navy); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #006b72; }
img { max-width: 100%; height: auto; }
p, li, h1, h2, h3, a { overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; transform: translateY(-150%); z-index: 1000; background: var(--white); padding: 10px 14px; }
.skip-link:focus { transform: none; }
.site-shell { width: var(--shell); margin-inline: auto; }
.site-shell--narrow { width: min(820px, calc(100% - 40px)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 90; border-bottom: 2px solid var(--ink); background: rgba(244,241,232,.96); backdrop-filter: blur(10px); }
.header-bar { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -.02em; }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid var(--ink); background: var(--lime); box-shadow: 4px 4px 0 var(--ink); font: 900 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.brand__text small { display: block; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 750; }
.site-nav a:hover { color: #007b82; }
.site-nav a.button, .site-nav a.button:hover { color: var(--white); }
.language-switcher { position: relative; flex: 0 0 auto; }
.language-switcher summary { cursor: pointer; padding: 8px 10px; border: 2px solid var(--ink); background: var(--white); font-size: 13px; font-weight: 800; list-style: none; }
.language-switcher summary::-webkit-details-marker { display: none; }
.language-menu { position: absolute; inset: calc(100% + 8px) 0 auto auto; z-index: 110; display: grid; grid-template-columns: repeat(2,minmax(140px,1fr)); width: 360px; max-height: 70vh; overflow: auto; padding: 12px; border: 2px solid var(--ink); background: var(--white); box-shadow: 5px 5px 0 var(--ink); }
.language-menu a { padding: 8px 10px; color: var(--ink); text-decoration: none; font-size: 13px; }
.language-menu a:hover { background: var(--lime); }
.nav-toggle { display: none; margin-left: auto; border: 2px solid var(--ink); background: var(--white); padding: 8px 12px; font-weight: 800; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border: 2px solid var(--ink); border-radius: 0; background: var(--ink); color: white; text-decoration: none; font-weight: 800; box-shadow: 4px 4px 0 var(--orange); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { color: white; transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--orange); }
.button--light { background: var(--white); color: var(--ink); box-shadow: 4px 4px 0 var(--cyan); }
.button--light:hover { color: var(--ink); }
.button--ghost { background: transparent; color: var(--ink); box-shadow: none; }
.button--ghost:hover { color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.button--small { min-height: 40px; padding: 8px 13px; font-size: 14px; }

.hero { border-bottom: 2px solid var(--ink); background: var(--navy); color: white; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(340px,.8fr); min-height: 670px; }
.hero__copy { padding: 90px 70px 70px 0; align-self: center; }
.eyebrow { margin: 0 0 12px; color: #05737a; font: 850 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .13em; text-transform: uppercase; }
.hero .eyebrow { color: var(--lime); }
h1, h2, h3 { margin: 0 0 .55em; line-height: 1.06; letter-spacing: -.035em; }
h1 { max-width: 890px; font-size: clamp(46px, 6.4vw, 88px); }
h2 { font-size: clamp(34px, 4vw, 58px); }
h3 { font-size: clamp(22px, 2.2vw, 30px); }
p { margin: 0 0 1.1em; }
.hero__lede { max-width: 760px; color: #d3e5df; font-size: clamp(18px, 2vw, 23px); }
.hero__actions, .section-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__board { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 48px 0 48px 48px; border-left: 2px solid rgba(255,255,255,.25); }
.hero__board::after { content: ""; position: absolute; left: 0; top: 51%; width: 48px; height: 2px; background: var(--cyan); }
.board-label { color: var(--cyan); font: 800 12px/1.3 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.signal-card { padding: 18px 18px 16px; border: 1px solid #6f8884; background: #0d3b40; }
.signal-card strong { display: block; margin-bottom: 4px; font: 850 18px/1.25 ui-monospace, monospace; }
.signal-card span { color: #c2d2ce; font-size: 14px; }
.signal-card::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(200,241,105,.12); }
.hero__equation { margin-top: 12px; padding-top: 18px; border-top: 1px dashed #77908b; color: var(--white); font: 800 15px/1.5 ui-monospace, monospace; }

.metric-strip { border-bottom: 2px solid var(--ink); background: var(--lime); }
.metric-strip__grid { display: grid; grid-template-columns: repeat(3,1fr); }
.metric { padding: 22px 26px; border-right: 2px solid var(--ink); }
.metric:last-child { border-right: 0; }
.metric b { display: block; font: 900 24px/1.2 ui-monospace, monospace; }
.metric span { font-size: 14px; }

.section { padding: 96px 0; border-bottom: 2px solid var(--ink); }
.section--white { background: var(--white); }
.section--dark { background: var(--ink); color: white; }
.section--cyan { background: var(--cyan); }
.section--lime { background: var(--lime); }
.section--compact { padding: 62px 0; }
.section__head { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.45fr); align-items: end; gap: 40px; margin-bottom: 46px; }
.section__head p:last-child { color: var(--muted); }
.section--dark .section__head p:last-child { color: #b9cbc7; }
.answer-block { padding: 30px; border-left: 8px solid var(--orange); background: var(--white); font-size: 20px; }
.breadcrumb { padding: 18px 0; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: inherit; }
.page-hero { padding: 76px 0 64px; border-block: 2px solid var(--ink); background: var(--white); }
.page-hero__grid { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 70px; align-items: end; }
.page-hero h1 { max-width: 930px; font-size: clamp(44px,6vw,78px); }
.page-hero__summary { max-width: 760px; color: var(--muted); font-size: 20px; }
.page-hero__stamp { padding: 22px; border: 2px solid var(--ink); background: var(--lime); box-shadow: var(--shadow); font: 750 13px/1.6 ui-monospace, monospace; }

.flow-map { display: grid; grid-template-columns: repeat(5,1fr); gap: 18px; align-items: stretch; }
.flow-node { position: relative; min-height: 205px; padding: 20px; border: 2px solid var(--ink); background: var(--white); }
.flow-node::after { content: "→"; position: absolute; right: -22px; top: 42%; z-index: 2; color: var(--orange); font: 900 28px/1 monospace; }
.flow-node:nth-child(5n)::after, .flow-node:last-child::after { display: none; }
.flow-node__id { display: block; margin-bottom: 32px; color: #007d84; font: 900 12px/1 ui-monospace, monospace; }
.flow-node h3 { font-size: 20px; }
.flow-node dl { margin: 16px 0 0; font-size: 13px; }
.flow-node dt { color: var(--muted); }
.flow-node dd { margin: 0 0 8px; font-weight: 750; }

.loss-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.loss-item { min-height: 160px; padding: 24px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--paper); }
.loss-item b { display: block; color: var(--orange); font: 900 13px/1.2 ui-monospace, monospace; }
.loss-item span { display: block; margin-top: 14px; font-weight: 720; }

.card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.card { padding: 28px; border: 2px solid var(--ink); background: var(--white); }
.card--shadow { box-shadow: var(--shadow); }
.card__index { display: inline-grid; place-items: center; width: 42px; height: 42px; margin-bottom: 34px; border: 2px solid var(--ink); background: var(--cyan); font: 900 15px/1 monospace; }
.card ul, .content-section ul { padding-left: 20px; }

.streams { display: grid; gap: 14px; }
.stream { display: grid; grid-template-columns: 160px 1fr 220px; align-items: center; gap: 18px; padding: 16px 20px; border: 2px solid currentColor; }
.stream b { font: 850 14px/1.3 ui-monospace, monospace; text-transform: uppercase; }
.stream__rail { height: 10px; background: currentColor; position: relative; }
.stream__rail::after { content: ""; position: absolute; right: -1px; top: -7px; border-width: 12px 0 12px 18px; border-style: solid; border-color: transparent transparent transparent currentColor; }
.stream--water { color: #007f88; }
.stream--bottle { color: #8b5a00; }
.stream--pack { color: #8a2c15; }
.stream--utility { color: #4b5a57; }
.stream--control { color: #5632a8; border-style: dashed; }

.architecture-table { width: 100%; border-collapse: collapse; background: var(--white); }
.architecture-table th, .architecture-table td { padding: 18px; border: 2px solid var(--ink); text-align: left; vertical-align: top; }
.architecture-table th { background: var(--ink); color: white; font: 800 13px/1.4 ui-monospace, monospace; text-transform: uppercase; }
.architecture-table tbody th { background: var(--lime); color: var(--ink); }
.table-scroll { overflow-x: auto; }

.changeover-track { display: grid; grid-template-columns: repeat(5,1fr); gap: 0; border: 2px solid var(--ink); }
.changeover-step { padding: 22px; border-right: 2px solid var(--ink); background: var(--white); }
.changeover-step:last-child { border-right: 0; }
.changeover-step b { display: block; margin-bottom: 18px; color: #007d84; font: 900 12px/1 monospace; }

.checklist { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px 30px; padding: 0; list-style: none; }
.checklist li { padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); position: relative; }
.checklist li::before { content: "□"; position: absolute; left: 0; top: 10px; color: var(--orange); font-size: 24px; }

.reference-media { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.reference-media img { width: 100%; border: 2px solid var(--ink); background: white; box-shadow: var(--shadow); }
.caption { color: var(--muted); font-size: 13px; }

.tool-panel { padding: 34px; border: 2px solid var(--ink); background: var(--white); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.field { display: grid; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label, .field__label { font-weight: 800; font-size: 14px; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 13px; border: 2px solid var(--ink); border-radius: 0; background: #fffef9; color: var(--ink); }
.field textarea { min-height: 130px; resize: vertical; }
.field input:invalid:not(:placeholder-shown) { border-color: #b82c00; }
.tool-result { margin-top: 28px; padding: 24px; border: 2px solid var(--ink); background: #eafaff; }
.tool-result[hidden] { display: none; }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.result-metric { padding: 16px; border: 1px solid var(--ink); background: white; }
.result-metric b { display: block; font: 900 23px/1.2 ui-monospace, monospace; }
.result-metric span { font-size: 12px; }
.disclaimer { margin-top: 20px; padding: 16px; border-left: 5px solid var(--orange); background: #fff4ed; color: #593023; font-size: 13px; }
.wizard-step[hidden] { display: none; }
.wizard-progress { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-bottom: 28px; }
.wizard-progress span { height: 8px; background: var(--panel); border: 1px solid var(--ink); }
.wizard-progress span.is-active { background: var(--lime); }
.choice-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--ink); }

.content-section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.content-section__grid { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 60px; }
.content-section__body { max-width: 790px; }
.content-section__body p { color: #31474a; }
.contents-rail { padding: 24px; border: 2px solid var(--ink); background: var(--lime); }
.contents-rail ol { margin: 0; padding-left: 22px; }
.contents-rail li { margin: 7px 0; }
.faq-list { display: grid; gap: 12px; }
.faq-list details { border: 2px solid var(--ink); background: var(--white); }
.faq-list summary { cursor: pointer; padding: 18px 22px; font-weight: 820; }
.faq-list details p { padding: 0 22px 20px; margin: 0; color: var(--muted); }

.notice { margin: 18px 0; padding: 16px 20px; border: 2px solid var(--ink); background: var(--lime); font-weight: 750; }
.notice--error { background: #ffe3d9; }
.hp-field { position: absolute !important; left: -9999px !important; }
.form-consent { display: flex; gap: 10px; align-items: flex-start; }
.form-consent input { width: auto; min-height: 0; margin-top: 7px; }

.cta-band { padding: 68px 0; border-bottom: 2px solid var(--ink); background: var(--orange); }
.cta-band__grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.cta-band h2 { max-width: 850px; margin: 0; }

.site-footer { background: var(--ink); color: #d7e1de; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 50px; padding: 72px 0 50px; }
.site-footer h2, .site-footer h3 { color: white; }
.site-footer a { color: #d7e1de; }
.footer-links { display: grid; gap: 9px; }
.footer-legal { padding: 22px 0; border-top: 1px solid #4b5d59; font-size: 13px; }
.footer-languages { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 18px 0; border-top: 1px solid #4b5d59; font-size: 13px; }
.footer-languages span { color: var(--lime); font-weight: 800; }
.related-pages__link { color: inherit; display: flex; min-height: 9rem; text-decoration: none; justify-content: space-between; gap: 1rem; align-items: flex-end; }
.related-pages__link:hover { border-color: var(--cyan); transform: translateY(-2px); }
.related-pages__link h3 { margin: 0; }
.related-pages__link span { color: var(--cyan-dark); font-size: 1.6rem; line-height: 1; }
.whatsapp-float { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; padding: 12px 15px; border: 2px solid var(--ink); background: var(--lime); color: var(--ink); font-weight: 850; text-decoration: none; box-shadow: 4px 4px 0 var(--ink); }

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .site-nav { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .language-menu { inset-inline: auto 0; }
html[dir="rtl"] .answer-block { border-left: 0; border-right: 8px solid var(--orange); }
html[dir="rtl"] .card ul, html[dir="rtl"] .content-section ul, html[dir="rtl"] .contents-rail ol { padding-left: 0; padding-right: 20px; }
html[dir="rtl"] .checklist li { padding-left: 0; padding-right: 34px; }
html[dir="rtl"] .checklist li::before { left: auto; right: 0; }
html[dir="rtl"] .whatsapp-float { right: auto; left: 18px; }

@media (max-width: 980px) {
  .hero__grid, .page-hero__grid, .section__head, .content-section__grid, .reference-media, .cta-band__grid { grid-template-columns: 1fr; }
  .hero__copy { padding: 72px 0 40px; }
  .hero__board { padding: 40px 0 64px; border-left: 0; border-top: 1px solid #68817d; }
  .hero__board::after { display: none; }
  .flow-map { grid-template-columns: repeat(2,1fr); }
  .flow-node:nth-child(5n)::after { display: block; }
  .flow-node:nth-child(2n)::after, .flow-node:last-child::after { display: none; }
  .loss-grid, .card-grid { grid-template-columns: repeat(2,1fr); }
  .changeover-track { grid-template-columns: 1fr; }
  .changeover-step { border-right: 0; border-bottom: 2px solid var(--ink); }
  .changeover-step:last-child { border-bottom: 0; }
  .site-nav { display: none; position: absolute; inset: 76px 0 auto; padding: 22px; border-bottom: 2px solid var(--ink); background: var(--paper); flex-direction: column; align-items: flex-start; }
  .site-nav.is-open { display: flex; }
  .nav-toggle { display: block; }
  .language-switcher { margin-left: 0; }
  .language-menu { position: fixed; inset: 76px 14px auto; width: auto; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  :root { --shell: min(100% - 28px, 1180px); }
  body { font-size: 16px; }
  .brand__text { font-size: 14px; }
  .brand__text small { display: none; }
  .hero__grid { min-height: auto; }
  .hero__copy { padding-top: 56px; }
  h1 { font-size: clamp(42px,13vw,64px); }
  .section { padding: 68px 0; }
  .metric-strip__grid, .flow-map, .loss-grid, .card-grid, .form-grid, .result-grid, .checklist, .footer-grid { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 2px solid var(--ink); }
  .metric:last-child { border-bottom: 0; }
  .flow-node::after { display: none !important; }
  .stream { grid-template-columns: 1fr; }
  .stream__rail { width: calc(100% - 18px); }
  .tool-panel { padding: 22px; box-shadow: 5px 5px 0 var(--ink); }
  .page-hero__stamp { box-shadow: 5px 5px 0 var(--ink); }
  .cta-band__grid { align-items: start; }
  .whatsapp-float { right: 10px; bottom: 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
