/* TheArtifact.Si app — one-screen home (fits 1440×900 without page scroll), paper/gold theme from the guide. */
html,body{height:100%;overflow:hidden}
body{display:flex;flex-direction:column;height:100vh}
.top{flex:0 0 auto;padding:8px 24px;gap:18px}
.logo{height:72px}
.brand h1{font-size:34px;white-space:nowrap}
.tag{font-size:16px}
.authors{font-size:14px}
.paper-actions{margin-left:auto;display:flex;align-items:center;gap:10px;flex-wrap:nowrap;justify-content:flex-end}
.brand{min-width:0}
.tag{white-space:nowrap}
.status{margin-left:10px;white-space:nowrap}
.btn-dl{background:var(--gold);color:#fff;border-radius:8px;padding:8px 14px;font-size:15px;white-space:nowrap}
.btn-dl:hover{text-decoration:none;background:#9a7209}
.btn-dl.small{padding:5px 10px;font-size:14px}
.btn-link{border:1px solid var(--gold2);border-radius:8px;padding:6px 10px;font-size:14px;color:#6b5a2a;background:#fffdf5;white-space:nowrap}
.btn-link small{font-size:11px;color:#8a7434}

main{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1.45fr) minmax(420px,1fr);gap:18px;padding:14px 24px 12px}
.stage-wrap{display:flex;flex-direction:column;min-height:0;align-items:center;justify-content:center}
.stage{width:auto;height:auto;max-width:100%;max-height:calc(100% - 58px);aspect-ratio:16/9;flex:0 1 auto}
@supports (width:1cqw){ .stage-wrap{container-type:size} .stage{width:min(100cqw, calc((100cqh - 58px) * 16 / 9))} }
.stage-caption{flex:0 0 auto}
.footer-line{margin:6px 0 0;padding:0;font-style:italic;color:#6b5a2a;text-align:center;font-size:15px}

.panel{min-height:0;overflow:hidden;padding:12px 16px}
.tabpane{min-height:0}
.tabpane.active{display:flex;flex-direction:column;flex:1 1 auto;overflow:hidden}
.panel{display:flex;flex-direction:column}
#pane-walk .steps{overflow:auto;flex:1 1 auto;min-height:0;padding-right:4px}
#pane-ask{overflow:auto}
.answer{overflow:auto}
.answer p{white-space:pre-wrap}
.answer-src{font-size:13px;color:#8a7434;margin-top:6px}
.thinking-wait{opacity:.7;font-style:italic}

.pdf-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex:0 0 auto}
.pdf-toolbar button{border:1px solid var(--gold2);background:#fffdf5;color:#6b5a2a;border-radius:6px;padding:2px 10px;font-size:18px}
.pdf-spacer{flex:1}
#pdfPageLabel{font-size:14px;color:#6b5a2a;min-width:80px;text-align:center}
.pdf-view{position:relative;flex:1 1 auto;min-height:0;overflow:auto;background:#efe9d8;border:1px solid var(--line);border-radius:8px;display:flex;justify-content:center;align-items:flex-start;padding:8px}
#pdfCanvas{display:block;background:#fff;box-shadow:0 2px 12px rgba(0,0,0,.18);max-width:100%}
.pdf-loading{position:absolute;top:14px;left:50%;transform:translateX(-50%);background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:999px;padding:4px 12px;font-size:13px;color:#6b5a2a}
.pdf-note{flex:0 0 auto;margin:8px 0 0;font-size:11.5px;color:#6b5a2a;text-align:center;line-height:1.35}
@media (max-width:980px){html,body{overflow:auto;height:auto}body{height:auto}main{grid-template-columns:1fr}.stage{width:100%}}
/* header: keep brand text clear of the action buttons */
.top{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center}
.brand{padding-right:6px}
.tag{font-size:15px}
.paper-actions{margin-left:0;justify-self:end}
.status{margin-left:0}
.authors{white-space:nowrap}

/* Paper tab: give the preview more width, still one screen */
body.is-paper-tab main{grid-template-columns:minmax(320px,1fr) minmax(400px,1.08fr)}
body.is-paper-tab .stage{max-height:calc(100% - 58px)}
body.is-paper-tab .pdf-view{padding:10px}
body.is-paper-tab #pdfCanvas{max-width:none}

/* Full-width / expand overlay: fit-to-width, zoom, pages. Does not change the one-screen home. */
.pdf-modal{position:fixed;inset:0;z-index:80;background:#2a261c;display:flex;flex-direction:column}
.pdf-modal[hidden]{display:none}
.pdf-modal-chrome{flex:0 0 auto;background:#fbfaf6;border-bottom:2px solid var(--gold2);padding:8px 18px 10px}
.pdf-modal-title{margin:0 0 6px;font-size:20px;color:#1a1a1a}
.pdf-modal .modal-tools{margin:0}
.pdf-modal-view{flex:1 1 auto;min-height:0;overflow:auto;background:#3a3426;display:flex;justify-content:center;align-items:flex-start;padding:16px 20px 24px}
#pdfModalCanvas{display:block;background:#fff;box-shadow:0 8px 40px rgba(0,0,0,.45)}
#pdfZoomLabel{font-size:14px;color:#6b5a2a;min-width:72px;text-align:center}
#pdfExpand{padding:4px 10px;cursor:pointer;font:inherit;font-size:14px}
body.modal-open{overflow:hidden}

/* Question box at the top of the right panel, answer directly under it */
.ask-top{flex:0 0 auto;margin-bottom:10px}
.ask-top .ask-row{display:flex;gap:8px;align-items:stretch}
.attach-btn{display:inline-flex;align-items:center;border:1px solid var(--gold2);border-radius:8px;padding:6px 12px;font-size:14px;color:#6b5a2a;background:#fffdf5;cursor:pointer;white-space:nowrap}
.attach-btn:hover{background:#f7efd8}
.attach-chip{display:inline-flex;align-items:center;gap:6px;margin-top:6px;border:1px solid var(--line);border-radius:999px;padding:2px 10px;font-size:12.5px;color:#6b5a2a;background:#fffdf5;max-width:100%}
.attach-chip[hidden]{display:none}
.attach-chip button{border:none;background:none;cursor:pointer;color:#8a7434;font-size:12px;padding:0 2px}
.ask-top .answer{margin-top:8px;max-height:34vh;overflow:auto}
.ask-top .answer[hidden]{display:none}
.answer-q{margin:4px 0 0;font-size:12.5px;color:#6b5a2a;font-style:italic}
.answer-meta{align-items:center;gap:10px}
.answer-meta #backToPaper{margin-left:auto}
.btn-link.small{padding:3px 8px;font-size:12.5px}

/* Smaller caption under the video and smaller answer text */
.stage-caption{font-size:12px}
.footer-line{font-size:12px}
.answer p{font-size:14.5px;line-height:1.4}
.answer-src{font-size:12px}

/* Asking: hide the left video, give the Q&A (right panel) full width */
body.is-asking main{grid-template-columns:minmax(0,1fr)}
body.is-asking .stage-wrap{display:none}
body.is-asking .ask-top .answer{max-height:46vh}

/* Fine-art listing under the paper: typographic line plus mailto inquiry and a free PDF download.
   No card checkout and no bookstore link. */
.art-listing{flex:0 0 auto;margin:4px 0 0;padding:5px 2px 0;border-top:1px solid var(--gold2);display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 10px}
.art-listing-copy{margin:0;font-size:12px;line-height:1.35;color:#5a4a22;text-align:center;font-style:italic;flex:1 1 16em}
/* About the original: heading stays visible; the long provenance text scrolls inside the panel. */
.art-about{flex:1 1 100%;min-width:0;max-height:230px;margin:4px 0 0;border:1px solid var(--gold2);border-radius:8px;background:#fffdf5;display:flex;flex-direction:column;min-height:0;text-align:left}
.art-about-title{flex:0 0 auto;margin:0;padding:5px 10px 4px;border-bottom:1px solid var(--gold2);font-size:12px;font-weight:700;font-style:normal;letter-spacing:.04em;color:#6b4a12;background:#fbf6e8;border-radius:8px 8px 0 0}
.art-about-scroll{flex:1 1 auto;min-height:0;overflow:auto;padding:8px 10px}
.art-about-body{margin:calc(-1.35em - 8px) 0 0;font:inherit;font-size:11px;line-height:1.35;color:#5a4a22;white-space:pre-wrap;font-style:normal} /* first line is the heading, already shown in the sticky title */


.art-listing-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 8px}
.art-buy{white-space:normal;text-align:center;line-height:1.25;max-width:22em;padding:5px 10px;font-size:12.5px;font-style:normal}
.art-pdf-free{white-space:nowrap;font-style:normal}
.pdf-note{margin:4px 0 0}

@media (max-width:1320px),(max-height:820px){
  .top{padding:6px 16px;gap:10px}
  .logo{height:56px}
  .brand h1{font-size:26px}
  .tag{font-size:12.5px}
  .authors{font-size:12px}
  .paper-actions{gap:6px}
  .btn-dl{padding:6px 10px;font-size:13px}
  .btn-link{padding:5px 8px;font-size:12.5px}
  .btn-link small{display:none} /* keep the DOI button short so the brand line is not clipped */
  .status{padding:4px 10px;font-size:13px}
  main{padding:8px 16px 6px;gap:12px}
  .art-listing{font-size:11.5px;padding-top:3px;margin-top:3px;gap:4px 8px}
  .art-listing-copy{font-size:11.5px}
  .art-buy{font-size:11.5px;padding:4px 8px;max-width:24em}
  .art-about{max-height:170px}
  .art-about-body{font-size:10.5px;line-height:1.35}
}
