/* Documentary publication styles.
   Isolated from the existing blog and project styles. */

.documentary-page {
  --doc-ink: #171717;
  --doc-muted: #676767;
  --doc-line: #e4e4e4;
  --doc-accent: #345b70;
  --doc-soft: #f5f7f8;

  margin: 0;
  background: #fff;
  color: var(--doc-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.75;
}

.documentary-page * {
  box-sizing: border-box;
}

.doc-shell {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.doc-site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: .88rem;
  margin-bottom: 56px;
}

.doc-site-nav a,
.doc-byline a,
.doc-footer a {
  color: inherit;
  text-underline-offset: 4px;
}

.doc-header {
  max-width: 780px;
  margin-bottom: 30px;
}

.doc-eyebrow {
  margin: 0 0 12px;
  color: var(--doc-muted);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.doc-header h1 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.doc-subtitle {
  color: var(--doc-muted);
  font-size: clamp(1.08rem, 2.5vw, 1.4rem);
  line-height: 1.5;
}

.doc-byline {
  font-size: .88rem;
  color: var(--doc-muted);
}

.doc-draft {
  padding: 12px 16px;
  background: #fff8e9;
  border: 1px solid #e8d9b7;
  font-size: .85rem;
  margin-bottom: 30px;
}

.doc-featured {
  margin: 0 0 32px;
}

.doc-featured img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
}

.doc-reader-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-block: 1px solid var(--doc-line);
  padding: 14px 0;
}

.doc-reader-nav a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
  color: var(--doc-muted);
  font-size: .8rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 5px;
}

.doc-reader-nav a[data-open="true"] {
  color: var(--doc-accent);
  background: var(--doc-soft);
}

.doc-step {
  font-size: 1.2rem;
  font-weight: 700;
}

.doc-reading-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 0;
}

.doc-reading-controls button {
  border: 0;
  background: transparent;
  color: var(--doc-muted);
  font: inherit;
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.doc-part {
  border-bottom: 1px solid var(--doc-line);
  scroll-margin-top: 24px;
}

.doc-part summary {
  position: relative;
  padding: 25px 36px 25px 0;
  cursor: pointer;
  list-style: none;
}

.doc-part summary::-webkit-details-marker {
  display: none;
}

.doc-part summary::after {
  content: "+";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--doc-accent);
}

.doc-part[open] > summary::after {
  content: "\2212";
}

.doc-part-number {
  display: block;
  font-size: .73rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--doc-muted);
  margin-bottom: 6px;
}

.doc-part-title {
  display: block;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.2;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.doc-part-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 34px;
  font-size: 1.075rem;
}

.doc-part-content > p {
  margin: 0 0 1.4em;
}

.doc-transition {
  margin: 40px 0 8px;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: var(--doc-soft);
}

.doc-transition h3 {
  line-height: 1.3;
  font-size: 1.4rem;
  margin: 8px 0 12px;
}

.doc-transition p {
  font-size: .95rem;
}

.doc-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--doc-accent);
  color: white;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: 13px 18px;
  border-radius: 5px;
}

.doc-button:hover {
  background: #244657;
}

.doc-footer {
  padding-top: 36px;
  font-size: .88rem;
  color: var(--doc-muted);
}

.documentary-page :focus-visible {
  outline: 2px solid var(--doc-accent);
  outline-offset: 5px;
}

@media (max-width: 600px) {
  .doc-shell {
    width: calc(100% - 32px);
    padding-top: 20px;
  }

  .doc-site-nav {
    margin-bottom: 32px;
    gap: 12px;
  }

  .doc-reader-nav {
    gap: 3px;
  }

  .doc-reader-nav a {
    padding: 7px 4px;
    font-size: .7rem;
  }

  .doc-part-content {
    font-size: 1rem;
  }

  .doc-featured img {
    max-height: 340px;
  }

  .doc-transition {
    margin-top: 28px;
  }
}

@media print {
  .doc-site-nav,
  .doc-reading-controls,
  .doc-reader-nav,
  .doc-transition {
    display: none;
  }
}

/* Sprint 2 editorial blocks */
.doc-part > summary { max-width:720px; margin-inline:auto; }
.doc-part:not([open]) > summary .doc-part-title { font-size:clamp(1.1rem,3vw,1.45rem); }
.doc-scene { font-size:clamp(1.35rem,3vw,1.8rem); line-height:1.25; margin:2.1em 0 .8em; }
.doc-photo { margin:2rem 0; }
.doc-photo img { display:block; width:100%; height:auto; border-radius:6px; }
.doc-photo figcaption,.doc-source { font-size:.82rem; color:var(--doc-muted); line-height:1.5; margin-top:.6rem; }
.doc-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:2rem 0; }
.doc-gallery .doc-photo { margin:0; }
.doc-quote { border-left:3px solid var(--doc-accent); margin:1.8rem 0; padding:.3rem 1.2rem; font-size:1.16rem; }
.doc-comparison { margin:2rem 0; padding:1.4rem; border:1px solid var(--doc-line); border-radius:8px; }
.doc-comparison figcaption { font-weight:700; }
.doc-money { display:grid; gap:.2rem; margin:1rem 0; }
.doc-money strong { font-size:1.35rem; font-variant-numeric:tabular-nums; }
.doc-money meter { width:100%; height:1rem; accent-color:var(--doc-accent); }
.doc-comparison p { font-size:.82rem; color:var(--doc-muted); }
.doc-timeline { padding-left:1.4rem; }
.doc-timeline li { padding:.6rem 0; border-bottom:1px solid var(--doc-line); }
.doc-timeline summary { padding:.4rem 2rem .4rem 0; }
.doc-timeline summary span { display:block; color:var(--doc-muted); font-size:.8rem; }
.doc-timeline summary strong { display:block; font-size:1rem; }
.doc-timeline p { margin:.6rem 0; }
@media(max-width:600px){ .doc-gallery{grid-template-columns:1fr;} }

/* Sprint 3 plant explorer */
.doc-plant { margin: 2rem 0; border: 1px solid var(--doc-line); border-radius: 8px; background: var(--doc-soft); }
.doc-plant > summary, .doc-plant-stage > summary { cursor: pointer; padding: 1rem; font-weight: 700; }
.doc-plant-body { padding: 0 1rem 1rem; }
.doc-flow { display: grid; gap: .35rem; justify-items: center; text-align: center; margin: 1.25rem 0; }
.doc-flow a { display: block; color: var(--doc-accent); background: #fff; border: 1px solid #aec2cc; padding: .65rem .85rem; border-radius: 5px; font-size: .9rem; text-decoration: none; }
.doc-flow a:hover, .doc-flow a[aria-current=true] { background: var(--doc-accent); color: white; }
.doc-flow-branches { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; width: 100%; }
.doc-sludge-route { width: 100%; border-top: 1px dashed #9b805b; margin-top: .75rem; padding-top: .75rem; }
.doc-sludge-route p { font-size: .85rem; margin: 0 0 .5rem; }
.doc-sludge-route a { border-color: #9b805b; }
.doc-plant-stage { border-top: 1px solid var(--doc-line); scroll-margin-top: 1rem; }
.doc-plant-stage > p, .doc-plant-stage > figure { margin: 0 1rem 1rem; }
.doc-plant-stage .doc-photo img { max-height: 420px; object-fit: contain; }
@media(max-width:420px){ .doc-plant-body{padding:0 .65rem .65rem} .doc-flow-branches{gap:.35rem} .doc-flow a{padding:.5rem;font-size:.8rem} }

/* Sprint 4 photographic record and stakeholder relationships */
.doc-stakeholders,.doc-photo-group{border:1px solid var(--doc-line);border-radius:8px;margin:20px 0;background:#fff;overflow:clip}
.doc-stakeholders>summary,.doc-photo-group>summary{padding:15px 18px;font-size:1rem;font-weight:650;background:var(--doc-soft);cursor:pointer}
.doc-photo-group>summary span{display:block;font-size:.8rem;font-weight:400;color:var(--doc-muted)}
.doc-record-body{padding:18px}
.doc-record-body>p{font-size:.94rem}
.doc-role-map{display:grid;gap:9px;margin:20px 0;text-align:center}
.doc-role-node{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:12px 8px;border:1px solid #adc0ca;border-radius:6px;background:var(--doc-soft);color:var(--doc-accent);text-decoration:none;overflow-wrap:anywhere;line-height:1.35;font-size:.87rem}
.doc-role-node span{display:block;font-size:.76rem;margin-top:5px;color:var(--doc-muted)}
.doc-role-node[data-role-jump="clo"]{background:var(--doc-accent);color:white}
.doc-role-node[data-role-jump="clo"] span{color:white}
.doc-role-link{font-size:.76rem;color:var(--doc-muted);line-height:1.4}
.doc-role-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.doc-role-middle{grid-template-columns:repeat(3,minmax(0,1fr))}
.doc-role-detail{border-top:1px solid var(--doc-line);padding:9px 0;font-size:.94rem;scroll-margin-top:24px}
.doc-role-detail>summary{font-weight:600;cursor:pointer}
.doc-role-detail>p{margin:8px 0}
.doc-record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.doc-record-grid .doc-photo{margin:0;min-width:0}
.doc-record-grid .doc-photo img{width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;background:#f3f4f5}
.doc-record-grid .doc-photo figcaption{font-size:.82rem;line-height:1.45}
@media(max-width:520px){.doc-record-body{padding:12px}.doc-record-grid{grid-template-columns:1fr}.doc-role-middle{grid-template-columns:1fr}.doc-role-node{min-height:56px}}

/* Sprint 5 evidence register */
.doc-role-uncertain{border:1px dashed #9a8058;border-radius:6px;padding:10px;background:#faf8f4}.doc-role-uncertain p{font-size:.78rem;margin:5px 0;color:#66573d}.doc-role-uncertain .doc-role-node{border-style:dashed;border-color:#9a8058;background:white}
.doc-evidence-controls{margin:1rem 0;padding:1rem;background:var(--doc-soft);border-radius:6px}.doc-evidence-controls label{display:block;font-size:.85rem;margin-bottom:.7rem}.doc-evidence-controls input,.doc-evidence-controls select{display:block;width:100%;font:inherit;padding:.55rem;border:1px solid #aab9c0;border-radius:4px;background:white;color:var(--doc-ink)}.doc-evidence-entry{border-bottom:1px solid var(--doc-line);padding:12px 0;scroll-margin-top:24px}.doc-evidence-entry summary{cursor:pointer}.doc-evidence-entry summary span{display:block;font-size:.76rem;color:var(--doc-muted)}.doc-evidence-entry p{font-size:.9rem;margin:.6rem 0}.doc-source a,.doc-evidence-entry a{color:var(--doc-accent);text-underline-offset:3px}.doc-evidence-entry[hidden],.doc-evidence-controls[hidden]{display:none!important}
