/* ══════════════════════════════════════════════════
   recycler-manual.css
   Recycler manual — document layout
   Implements Figma node 66:310 (07 · Manual Content · Materials)
   Requires design-tokens.css
   ══════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   Layout — sidebar rail + document sheets
   ══════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}

.layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 24px;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: 24px clamp(16px, 2vw, 32px) 56px;
  transition:
    grid-template-columns 180ms ease,
    gap 180ms ease;
}

.nav-collapsed .layout {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}

/* ── Sidebar ── */
.nav-rail {
  position: sticky;
  top: 106px;
  align-self: start;
  max-height: calc(100vh - 130px);
  transition: opacity 160ms ease, transform 180ms ease;
}

.sidebar {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    padding 180ms ease,
    border-color 180ms ease;
}

.sidebar-title {
  margin: 2px 8px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 200px);
  overflow: auto;
}

.nav-collapsed .sidebar {
  visibility: hidden;
  overflow: hidden;
  padding: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-16px);
}

.sidebar-links a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-heading);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.sidebar-links a:hover,
.sidebar-links a:focus-visible {
  background: var(--card);
  color: var(--teal);
  outline: none;
}

.sidebar-links a.active {
  background: var(--teal);
  color: #fff;
}

/* ── Nav toggle ── */
.nav-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--teal);
  background: var(--card);
  color: var(--teal);
  outline: none;
}

.nav-toggle:active {
  transform: translateY(1px);
}

.nav-toggle-icon {
  font-size: 24px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
}

/* ══════════════════════════════════════════════════
   Document sheet — Figma frame 66:310 (1920 × 1080)
   ══════════════════════════════════════════════════ */
.frames {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.doc-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-margin-top: 106px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  box-shadow: var(--shadow-sheet);
}

/* ── Document · Header (66:311) ──
   px 96 · pt 62 · pb 32 · gap 16 ── */
.doc-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(28px, 3.2vw, 62px) var(--gutter) clamp(20px, 1.7vw, 32px);
}

/* Document title (66:314) — Inter Bold 48 / 58 · #122630 */
.doc-title {
  max-width: 24ch;
  color: var(--ink);
  font-size: clamp(28px, 2.5vw, 48px);
  font-weight: 700;
  line-height: 1.21;
}

/* Document intro (66:315) — Inter Regular 21 / 32 · #586674 */
.doc-intro {
  max-width: 105ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.1vw, 21px);
  font-weight: 400;
  line-height: 1.52;
}

/* ── Document · Content (66:316) ──
   px 96 · gap 28 · video-led 30 / 70 split ── */
.doc-content {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  gap: 28px;
  padding: 0 var(--gutter);
}

.doc-content--single {
  grid-template-columns: minmax(0, 1fr);
}

/* Document · Explanation (66:317) — column gap 18 */
.doc-explanation {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* Document · Visual (66:318) — column gap 16 */
.doc-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ══════════════════════════════════════════════════
   Feature card (66:319) — bg #f6f9fa · border #d6dfe5
   radius 16 · px 28 · py 24 · gap 12
   ══════════════════════════════════════════════════ */
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px clamp(18px, 1.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

/* Feature card heading (66:320) — bg #fff · radius 8 · px12 py8 · gap 14 */
.feature-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--r-heading);
  background: var(--panel);
}

/* Number badge (66:321) — bg #005d67 · radius 9 · px11 py8 · 15px Bold */
.feature-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: var(--r-badge);
  background: var(--teal);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
}

/* Feature card title (66:323) — Inter Bold 22 / 28 · #122630 */
.feature-card__heading h3 {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(17px, 1.15vw, 22px);
  font-weight: 700;
  line-height: 1.28;
}

/* Feature card body (66:324) — Inter Regular 17 / 26 · #586674 */
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 0.9vw, 17px);
  font-weight: 400;
  line-height: 1.53;
}

/* ══════════════════════════════════════════════════
   Media placeholder (66:337) — bg #f0f6fa · border #d6dfe5
   radius 16 · px 32 · py 28
   ══════════════════════════════════════════════════ */
.media-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 28px clamp(16px, 1.7vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--media);
}

.media-frame video,
.media-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #dfe9ef;
}

.media-frame figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

/* ══════════════════════════════════════════════════
   Important note (66:341) — bg #fff2e5 · border #f5b873
   radius 12 · px 20 · py 17 · gap 6
   ══════════════════════════════════════════════════ */
.doc-note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 17px 20px;
  border: 1px solid var(--warn-line);
  border-radius: var(--r-note);
  background: var(--warn-bg);
}

/* warn label (66:343) — 14px Bold · #b8470d · px14 py8 */
.doc-note__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--warn-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Important note body (66:344) — Inter Regular 16 / 24 · #122630 */
.doc-note p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

/* Codex note (2026-08-06): Materials workflow guide and video placeholder; real media is supplied separately. */
.workflow-guide,
.workflow-scenarios {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

.workflow-guide > h3,
.scenario-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.workflow-impact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workflow-impact,
.scenario-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.workflow-impact h4 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.workflow-impact p,
.scenario-card p,
.media-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.workflow-scenarios {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Codex note (2026-08-06): Keep the EDM impact screenshots responsive inside their matching website explanation cards. */
.scenario-card__image {
  display: block;
  width: 100%;
  height: auto;
  margin-top: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Codex note (2026-08-06): On wide screens, preserve the scenario headings on one line while giving the attached UI captures more usable width. */
@media (min-width: 1100px) {
  .scenario-card {
    padding: 10px;
  }

  .scenario-card h3 {
    font-size: 16px;
    white-space: nowrap;
  }
}

.media-frame__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.media-frame__caption > span:first-child {
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.media-frame__caption strong {
  color: var(--ink);
}

.media-frame--placeholder {
  min-height: 210px;
}

.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 510px;
  text-align: center;
}

.media-placeholder__eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.media-placeholder strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

/* ══════════════════════════════════════════════════
   Document · Footer (66:345)
   px 96 · pt 18 · pb 28 · Inter SemiBold 14 · #586674
   ══════════════════════════════════════════════════ */
.doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 18px var(--gutter) 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
}

.doc-footer span {
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════
   Cover (page 1) — dark variant of the document sheet
   ══════════════════════════════════════════════════ */
.doc-page--cover {
  border-color: var(--ink);
  background: var(--ink);
}

.doc-page--cover .doc-header {
  gap: 20px;
  padding-bottom: clamp(40px, 5vw, 96px);
}

.doc-page--cover .doc-tag {
  background: var(--teal);
}

.doc-page--cover .doc-title {
  max-width: 20ch;
  color: #fff;
  font-size: clamp(34px, 3.6vw, 68px);
  line-height: 1.14;
}

.doc-page--cover .doc-intro {
  color: rgba(255, 255, 255, 0.66);
}

.doc-page--cover .doc-footer {
  margin: 0 var(--gutter);
  padding-left: 0;
  padding-right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.55);
}

/* ══════════════════════════════════════════════════
   Quick guide grid (page 2)
   ══════════════════════════════════════════════════ */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.doc-grid .feature-card {
  height: 100%;
}

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */
@media (max-width: 1279px) {
  .doc-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-title {
    max-width: none;
  }

  .workflow-impact-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .layout {
    display: block;
    padding: 18px;
  }

  .nav-rail {
    position: fixed;
    inset: 82px 0 0;
    z-index: 40;
    max-height: none;
    background: rgba(18, 38, 48, 0.24);
    backdrop-filter: blur(4px);
  }

  .nav-collapsed .nav-rail {
    display: none;
  }

  .sidebar {
    width: min(300px, calc(100vw - 48px));
    height: 100%;
    max-height: none;
    overflow: auto;
    padding: 18px;
    border-width: 0 1px 0 0;
    border-radius: 0;
    box-shadow: 0 24px 60px rgba(18, 38, 48, 0.3);
    transform: none;
  }

  .sidebar-links {
    max-height: 100%;
  }

  .nav-collapsed .sidebar {
    display: flex;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 12px;
    padding: 12px 16px;
  }

  .eyebrow {
    display: none;
  }

  .frames {
    gap: 18px;
  }

  .doc-page {
    border-radius: var(--r-note);
  }

  .doc-header {
    padding-top: 24px;
  }

  .doc-note p {
    font-size: 15px;
  }

  .doc-footer {
    font-size: 12px;
  }
}
