/* Shared additions: topic pages, resources, guide extras (changelog, deep-dive links, per-section sources). */

/* Compact hero for topic pages */
.page-hero{padding:46px 0 0;max-width:980px}
.page-hero h1{font-size:clamp(42px,5vw,70px);line-height:1.04;letter-spacing:-.05em;margin:10px 0 22px;text-wrap:balance}
.page-hero .hero-summary{font-size:clamp(20px,2vw,24px);line-height:1.4;max-width:820px;margin-bottom:20px}
.page-hero .meta{margin-bottom:18px}
.page-hero .meta a{color:var(--muted)}
.page-hero .article-tools{justify-content:flex-start;border-bottom:1px solid #d9d8d1}
.crumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:4px 0;margin:0;padding:0;font-size:14px;color:var(--muted)}
.crumbs li+li:before{content:'/';margin:0 9px;color:#b7b4ab}
.crumbs a{color:var(--muted);text-decoration:none}
.crumbs a:hover{color:var(--accent);text-decoration:underline}
.page-disclaimer{margin:0 0 6px}
.subpage .chapter:first-of-type{padding-top:10px}

/* Related pages */
.related{margin-top:56px;padding-top:30px;border-top:1px solid var(--line)}
.related h2{font-size:36px;margin:0 0 20px}
.related ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.related a{display:block;height:100%;padding:20px 22px;border:1px solid var(--line);border-radius:8px;text-decoration:none;background:#fff;transition:border-color .15s,transform .15s}
.related a:hover{border-color:var(--accent);transform:translateY(-1px)}
.related strong{display:block;font-family:var(--serif);font-weight:500;font-size:23px;letter-spacing:-.03em;line-height:1.15;margin-bottom:8px}
.related span{display:block;font-size:15px;line-height:1.5;color:var(--muted)}

/* Change log (guide + topic pages) */
.changelog{margin-top:44px;border-top:1px solid var(--line);padding-top:16px;font-size:16px;line-height:1.6}
.changelog summary{cursor:pointer;font-family:Poppins,system-ui,sans-serif;font-weight:500;font-size:15px;color:var(--ink);list-style:none;display:flex;align-items:center;gap:10px}
.changelog summary::-webkit-details-marker{display:none}
.changelog summary:after{content:'+';font-size:20px;line-height:1;color:var(--accent)}
.changelog[open] summary:after{content:'–'}
.changelog ol{list-style:none;margin:16px 0 0;padding:0}
.changelog li{padding:10px 0;border-top:1px dashed var(--line);color:var(--text)}
.changelog time{display:block;font-size:14px;color:var(--muted);font-weight:600}

/* Guide: deep-dive link and per-section sources */
.deep-dive{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:28px 0 8px;padding:18px 22px;border-left:3px solid var(--accent);background:var(--blue-wash);border-radius:0 8px 8px 0;text-decoration:none;color:var(--ink)}
.deep-dive span{font-size:17px;line-height:1.45}
.deep-dive strong{display:block;font-family:var(--serif);font-weight:500;font-size:22px;letter-spacing:-.03em;line-height:1.2}
.deep-dive svg{color:var(--accent);width:22px;height:22px}
.deep-dive:hover{background:#dfe9f8;color:var(--ink)}
.section-sources{margin:22px 0 0;font-size:14.5px;line-height:1.6;color:var(--muted)}
.section-sources strong{color:var(--muted);font-weight:600}
.section-sources a{color:var(--muted)}
.section-sources a:hover{color:var(--accent)}
.side-links{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.side-links h2{font-size:22px;margin:0 0 10px}
.side-links ul{list-style:none;margin:0;padding:0}
.side-links a{display:block;padding:6px 0;font-size:15px;line-height:1.4;text-decoration:none;color:var(--text)}
.side-links a:hover{color:var(--accent)}
.footer-topics{max-width:520px}
.footer-topics a{font-size:15px}
.hero .updated-badge{display:inline-block}

/* Resource tools (printable sheets) */
.sheet{background:#fff;border:1px solid var(--line);border-radius:8px;padding:22px;margin:24px 0}
.sheet table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.4}
.sheet th,.sheet td{border:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
.sheet th{background:var(--sand);color:var(--ink);font-weight:600}
.sheet input[type=text],.sheet textarea,.sheet select{width:100%;font:inherit;border:0;background:transparent;padding:2px 0;color:var(--ink);resize:vertical}
.sheet input[type=text]:focus,.sheet textarea:focus{outline:2px solid var(--accent);outline-offset:2px}
.checklist{list-style:none;padding:0;margin:0}
.checklist li{display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-bottom:1px dashed var(--line)}
.checklist input[type=checkbox]{width:20px;height:20px;margin-top:5px;flex:none;accent-color:var(--accent)}
.sheet-actions{display:flex;flex-wrap:wrap;gap:12px;margin:18px 0}
.btn-ghost{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:10px 18px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--ink);font:500 15px/1.3 Poppins,system-ui,sans-serif;cursor:pointer}
.btn-ghost:hover{border-color:var(--accent);color:var(--accent)}

@media(max-width:900px){.page-hero{padding-top:30px}.related ul{grid-template-columns:1fr}}
@media(max-width:760px){.page-hero h1{font-size:clamp(36px,9.5vw,52px)}.deep-dive{padding:16px 18px}.deep-dive strong{font-size:20px}.sheet{padding:14px}.sheet table{font-size:14px}}
@media print{
  .site-header,.mobile-cta,.sidebar,.site-footer,.article-tools,.related,.sheet-actions,.page-disclaimer,.deep-dive svg{display:none!important}
  .page-hero{padding-top:0}.page-hero h1{font-size:26pt}
  .resource-page .chapter:not(.print-keep){display:none}
  .resource-page .page-sources,.resource-page .changelog{display:none}
  .sheet{border:0;padding:0}.sheet th,.sheet td{border-color:#999}
  .changelog[open] ol{display:block}
}

/* Diagrams */
.figure{margin:30px 0;padding:22px 22px 16px;background:#fff;border:1px solid var(--line);border-radius:10px}
.figure figcaption{margin-top:12px;font-size:15px;line-height:1.5;color:var(--muted)}
.figure figcaption strong{color:var(--ink)}
.figure-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.figure-scroll svg{display:block;width:100%;height:auto;min-width:520px}
.chart text{font-family:Arial,Helvetica,sans-serif;fill:var(--text)}
.phases{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;gap:10px;align-items:stretch}
.phase{border-radius:9px;padding:16px 16px 14px;background:var(--sand);display:flex;flex-direction:column;gap:6px}
.phase .num{font:600 13px/1 Poppins,system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}
.phase h4{margin:0;font-size:24px;letter-spacing:-.03em}
.phase .time{font:600 15px/1.3 Poppins,system-ui,sans-serif;color:var(--ink)}
.phase p{margin:0;font-size:15.5px;line-height:1.45}
.phase.p2{background:var(--blue-wash)}
.phase.p3{background:#e9f2ea}
.phase-arrow{align-self:center;color:var(--accent);font-size:26px;line-height:1}
.overlap{display:grid;grid-template-columns:1fr 1.1fr 1fr;gap:0;align-items:stretch}
.overlap>div{padding:18px 18px 16px}
.overlap h4{margin:0 0 10px;font-size:22px;letter-spacing:-.03em}
.overlap ul{margin:0;padding-left:18px;font-size:15.5px;line-height:1.45}
.overlap li+li{margin-top:6px}
.ov-a{background:var(--blue-wash);border-radius:60px 0 0 60px;padding-left:30px!important}
.ov-mid{background:linear-gradient(90deg,#dfe6f6,#efe3d3);text-align:left}
.ov-b{background:#f6ead9;border-radius:0 60px 60px 0;padding-right:30px!important}
@media(max-width:1180px){
  .overlap{grid-template-columns:1fr}.ov-a,.ov-b{padding-left:18px!important;padding-right:18px!important}.ov-a{border-radius:12px 12px 0 0}.ov-b{border-radius:0 0 12px 12px}.ov-mid{background:linear-gradient(180deg,#dfe6f6,#efe3d3)}
}
@media(max-width:760px){
  .figure{padding:16px 14px 12px}
  .phases{grid-template-columns:1fr}.phase-arrow{transform:rotate(90deg);justify-self:center}
  .overlap{grid-template-columns:1fr}.ov-a,.ov-b{border-radius:12px;padding-left:18px!important;padding-right:18px!important}.ov-a{border-radius:12px 12px 0 0}.ov-b{border-radius:0 0 12px 12px}
}
@media print{.figure{break-inside:avoid}.figure-scroll svg{min-width:0}}
