/* Inner pages of rishabhramteke.github.io, in the survey-sheet world (tokens from sheet.css) */
.doc-page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem 2rem; flex-wrap: wrap; padding: .9rem var(--gutter); border-bottom: 1.5px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.bar-name { font: 600 1.4rem/1 var(--cond); color: var(--wine-deep); text-decoration: none; letter-spacing: .01em; }
.bar-name:hover { color: var(--wine); }
.bar-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }
.bar-nav a { font: 500 .98rem/1.6 var(--sans); text-decoration: none; color: var(--ink); padding-bottom: .1rem; border-bottom: 1.5px solid transparent; transition: border-color .2s var(--ease), color .2s var(--ease); }
.bar-nav a:hover { color: var(--wine); border-bottom-color: var(--wine); }
.bar-nav a[aria-current="page"] { color: var(--wine-deep); border-bottom-color: var(--wine-deep); }
.bar-gap { margin-left: 1.75rem; position: relative; }
.bar-gap::before { content: ""; position: absolute; left: -1.5rem; top: 15%; bottom: 15%; width: 1px; background: var(--rule-soft); }

/* ---------- Document ---------- */
.doc { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.doc-wide { max-width: 72rem; }
.doc-head { margin-bottom: 2rem; }
.doc-head h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); }
.doc-meta { margin: .9rem 0 0; font: italic 400 1.05rem/1.5 var(--serif); color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.doc-intro { margin-top: 1rem; max-width: 62ch; }
.doc-hero { margin: 0 0 2rem; }
.doc-hero img { width: 100%; height: auto; display: block; border: 1.5px solid var(--rule); }

/* ---------- Prose ---------- */
.prose { font: 400 1.125rem/1.65 var(--serif); color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose > p, .prose > ul, .prose > ol, .prose li { max-width: 68ch; }
.prose p + p { margin-top: 1em; }
.prose h2, .prose h3, .prose h4, .prose h5 { font-family: var(--cond); font-weight: 600; color: var(--wine-deep); line-height: 1.15; margin: 2.2em 0 .5em; letter-spacing: .01em; text-wrap: balance; }
.prose h2 { font-size: 1.9rem; } .prose h3 { font-size: 1.55rem; } .prose h4 { font-size: 1.3rem; } .prose h5 { font-size: 1.1rem; }
.prose a { color: var(--wine-deep); text-decoration: underline; text-decoration-color: rgba(138, 42, 61, .45); }
.prose a:hover { color: var(--wine); text-decoration-color: var(--wine); }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 1em 0; }
.prose li + li { margin-top: .35em; }
.prose ul li::marker { color: var(--wine); }
.prose blockquote { margin: 1.5em 0; padding: .1em 0 .1em 1.2em; border-left: 1px solid var(--wine); font-style: italic; color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--rule-soft); margin: 2.2em 0; }
.prose img { max-width: 100%; height: auto; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { margin-top: .5rem; font: italic 400 .92rem/1.4 var(--serif); color: var(--ink-2); }
.prose code { font: 400 .9em/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--paper-2); padding: .08em .3em; }
.prose pre { background: var(--paper-2); border: 1px solid var(--rule-soft); padding: 1rem 1.1rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose iframe { width: 100% !important; max-width: 100%; border: 1.5px solid var(--rule); background: #fff; display: block; }
.prose table { width: 100%; border-collapse: collapse; font: 400 1rem/1.45 var(--sans); font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: .55rem .9rem .55rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.prose th { font: 600 .78rem/1.3 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--wine); border-bottom: 1.5px solid var(--rule); }
.prose td:first-child { color: var(--ink-2); white-space: nowrap; }
.prose .table-wrapper { overflow-x: auto; }
/* helpers carried over from the old theme's content markup */
.prose .image { display: block; }
.prose .image img { display: block; width: 100%; height: auto; border: 1px solid var(--rule-soft); }
.prose .image.fit { margin: 1.6em 0; }
.prose .image.main { margin: 0 0 1.6em; }
.prose .image.right { float: right; width: min(40%, 16rem); margin: .3em 0 1em 1.6em; }
.prose .image.left { float: left; width: min(40%, 16rem); margin: .3em 1.6em 1em 0; }
.prose::after { content: ""; display: block; clear: both; }
.prose .actions { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.prose .actions.vertical { flex-direction: column; align-items: flex-start; }
.prose .actions li + li { margin-top: 0; }
.prose .button, .prose button { display: inline-block; font: 600 .95rem/1 var(--sans); text-decoration: none; color: var(--wine-deep); background: transparent; border: 1.5px solid var(--wine-deep); padding: .7rem 1.1rem; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease); }
.prose .button:hover { background: var(--wine-deep); color: var(--paper); }
.prose .button.special { background: var(--wine); border-color: var(--wine); color: var(--paper); }
.prose .button.special:hover { background: var(--wine-deep); border-color: var(--wine-deep); }
.prose .button.small { padding: .5rem .8rem; font-size: .85rem; }
.prose .button.fit { display: block; text-align: center; }
.prose .label { font: 600 .78rem/1.3 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--wine); }
.prose .row { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.prose .row > * { flex: 1 1 14rem; }

/* ---------- Entry lists (projects, publications, patents, blog) ---------- */
.entries { border-top: 1.5px solid var(--rule); }
.entry { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 1.6rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule-soft); align-items: start; }
.entry-noimg { grid-template-columns: minmax(0, 1fr); }
/* thumbnails are plates printed in the sheet's wine ink: pre-rendered files from tools/make_plates.py
   (no CSS filters or blend modes, which some browsers draw unreliably); the colour image shows on hover */
.entry-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--paper); border: 1px solid var(--rule-soft); overflow: hidden; }
.entry-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.entry-img .duo { transition: opacity .5s var(--ease), transform .6s var(--ease); }
.entry:hover .entry-img img { transform: scale(1.03); }
.entry:hover .entry-img .duo, .entry:focus-within .entry-img .duo { opacity: 0; }
.entry-meta { margin: .4rem 0 0; font: 600 .86rem/1.4 var(--cond); letter-spacing: .03em; color: var(--wine); font-variant-numeric: tabular-nums; }
.entry-meta span + span::before { content: "·"; margin: 0 .55em; color: var(--ink-2); }
.entry h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.15; }
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { text-decoration: underline; color: var(--wine-deep); }
.entry-desc { margin: .5rem 0 0; font: 400 1.02rem/1.5 var(--serif); color: var(--ink-2); max-width: 64ch; text-wrap: pretty; }

/* ---------- Footer ---------- */
.foot { border-top: 1.5px solid var(--rule); padding: 1.6rem var(--gutter) 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; align-items: baseline; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.3rem; font-weight: 600; }
.foot-links a { text-decoration: underline; }
.foot-col { margin: 0; font: italic 400 .9rem/1.4 var(--serif); color: var(--ink-2); }

/* ---------- Project pages: facts strip and documents shown in the page ---------- */
.doc-facts { display: flex; flex-wrap: wrap; gap: .45rem 2.4rem; margin: 1.4rem 0 0; padding: .75rem 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.doc-facts div { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; }
.doc-facts dt { font: 600 .76rem/1.3 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--wine); }
.doc-facts dd { margin: 0; font: 500 1rem/1.45 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.doc-facts .sep { color: var(--ink-2); }
.doc-facts div.wide { flex-basis: 100%; display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: .15rem .8rem; }
@media (max-width: 560px) { .doc-facts div.wide { grid-template-columns: minmax(0, 1fr); } }
.doc-facts a, .docfile-meta a { color: var(--wine-deep); text-decoration: underline; text-decoration-color: rgba(138, 42, 61, .45); text-underline-offset: .18em; }
.doc-facts a:hover, .docfile-meta a:hover { color: var(--wine); text-decoration-color: var(--wine); }

/* pages with documents: text keeps the reading column, slide decks use the full width */
.doc-docs { max-width: 64rem; }
.doc-docs .doc-head, .doc-docs .doc-hero, .doc-docs .prose, .doc-docs .docs > h2, .doc-docs .docfile:not(.is-deck) { max-width: 42rem; margin-left: auto; margin-right: auto; }
.docs { margin-top: clamp(2.8rem, 6vw, 4rem); }
.docs > h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); padding-top: 1.5rem; border-top: 1.5px solid var(--rule); }
.docfile { margin: 1.5rem 0 0; scroll-margin-top: 5rem; }
.docfile + .docfile { margin-top: 3rem; }
.docfile-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1.2rem; padding-bottom: .55rem; margin-bottom: 1rem; border-bottom: 1px solid var(--rule-soft); }
.docfile-title { font: 600 1.3rem/1.2 var(--cond); color: var(--wine-deep); letter-spacing: .01em; }
.docfile-meta { font: 500 .92rem/1.4 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pdf-status { margin: 0; padding: 2.4rem 1rem; text-align: center; font: italic 400 1rem/1.5 var(--serif); color: var(--ink-2); background: var(--paper-2); border: 1px dashed var(--rule-soft); }

/* each page is a white sheet lying on the paper */
.pdf-sheet, .pdf-stage { position: relative; background: #fff; border: 1px solid var(--rule-soft); box-shadow: 0 1px 2px rgba(35, 21, 24, .06), 0 12px 28px -18px rgba(35, 21, 24, .35); overflow: hidden; }
.pdf-sheet:not(.is-drawn), .pdf-stage:not(.is-drawn) { background: var(--paper-2); }
.pdf-sheet canvas, .pdf-stage canvas { display: block; width: 100%; height: 100%; transition: opacity .25s var(--ease); }
.pdf-stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.pdf-page { margin: 0; }
.pdf-no { display: block; margin-top: .45rem; text-align: right; font: 600 .8rem/1 var(--cond); letter-spacing: .12em; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* slide decks: one slide at a time */
.pdf-stage { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pdf-stage:active { cursor: grabbing; }
.pdf-stage.is-loading canvas { opacity: .55; }
.pdf-stage:focus-visible, .pdf-btn:focus-visible, .code-file:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.pdf-ctrl { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin-top: 1rem; }
.pdf-btn { width: 2.75rem; height: 2.75rem; display: inline-grid; place-items: center; padding: 0; background: transparent; border: 1.5px solid var(--wine-deep); color: var(--wine-deep); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.pdf-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }
.pdf-btn:hover:not(:disabled) { background: var(--wine-deep); color: var(--paper); }
.pdf-btn:disabled { border-color: var(--rule-soft); color: var(--rule-soft); cursor: default; }
.pdf-count { min-width: 4.6rem; text-align: center; font: 600 1.05rem/1 var(--cond); letter-spacing: .08em; color: var(--wine-deep); font-variant-numeric: tabular-nums; }

/* code files as numbered lines */
.code-file { margin: 0; max-height: 34rem; overflow: auto; padding: 1rem 1.2rem 1rem .5rem; background: var(--paper-2); border: 1px solid var(--rule-soft); font: 400 .84rem/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); tab-size: 4; scrollbar-width: thin; scrollbar-color: rgba(138, 42, 61, .55) transparent; }
.code-file code { counter-reset: ln; white-space: pre; }
.code-file .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 2.4em; margin-right: 1.2em; text-align: right; color: var(--ink-2); user-select: none; -webkit-user-select: none; }

@media (max-width: 760px) {
  .bar { position: static; }
  .bar-nav ul { gap: .2rem 1rem; }
  .bar-gap { margin-left: 0; }
  .bar-gap::before { display: none; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
  .entry-img { aspect-ratio: 16 / 9; }
  .prose .image.right, .prose .image.left { float: none; width: 100%; margin: 1em 0; }
}
@media (prefers-reduced-motion: reduce) { .entry-img img, .entry-img .duo, .pdf-btn, .pdf-sheet canvas, .pdf-stage canvas { transition: none; } .entry:hover .entry-img img { transform: none; } }

/* ---------- Trip planning content inside a post (the Shikoku 88 page) ---------- */
.trip .lede { font-style: italic; color: var(--ink-2); }
.trip .card { background: #F6F7F4; border: 1px solid var(--rule-soft) !important; padding: 1rem 1.25rem; margin: 1.1rem 0; }
.trip .card > strong:first-child { font-family: var(--cond); font-size: 1.08rem; color: var(--wine-deep); }
.trip .grid { display: grid; gap: .8rem; }
.trip .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip .pref { padding: .9rem 1rem; margin: 0; }
.trip .pref .name { font: 600 1.2rem/1.15 var(--cond); color: var(--wine-deep); }
.trip .pref .theme { font-size: .92rem; font-style: italic; color: var(--ink-2); margin-top: .1rem; }
.trip .pref .stats { margin-top: .45rem; font: 500 .86rem/1.5 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trip .scroller { overflow-x: auto; }
.trip table { font-size: .92rem; }
.trip .rest, .trip .mid { color: var(--wine-deep); font-weight: 600; }
.trip .warn { color: var(--wine); font-weight: 600; }
.trip .note { font-style: italic; color: var(--ink-2); }
.trip .kicker { font: 600 .8rem/1.3 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--wine); }
.trip .pill { display: inline-block; padding: .05rem .45rem; border: 1.5px solid var(--wine-deep); font: 600 .76rem/1.3 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--wine-deep); }
.trip h3.as-h4 { font-size: 1.05rem; color: var(--wine); text-transform: uppercase; letter-spacing: .12em; }
.trip .legs { display: grid; margin: 1rem 0; border-top: 1.5px solid var(--rule); }
.trip .leg { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--rule-soft); }
.trip .leg .when { font: 600 .95rem/1.3 var(--cond); letter-spacing: .04em; color: var(--wine-deep); min-width: 7rem; font-variant-numeric: tabular-nums; }
.trip .leg .what { flex: 1 1 15rem; }
.trip .leg .tag { font: 600 .76rem/1.3 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--wine); }
.trip .footnote { margin-top: 3rem; padding-top: 1rem; border-top: 1.5px solid var(--rule); font: italic 400 .92rem/1.5 var(--serif); color: var(--ink-2); }

/* ---------- 3D models on a project page ---------- */
.doc-models { max-width: 64rem; }
.doc-models .doc-head, .doc-models .prose, .doc-models .models > h2 { max-width: 42rem; margin-left: auto; margin-right: auto; }
.models { margin-top: clamp(2.6rem, 6vw, 3.6rem); }
.models > h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); padding-top: 1.5rem; border-top: 1.5px solid var(--rule); }
.model { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: center; margin: 1.6rem 0 0; padding-bottom: 1.6rem; border-bottom: 1px solid var(--rule-soft); }
.mv { aspect-ratio: 4 / 3; background: var(--paper-2); border: 1px solid var(--rule-soft); cursor: grab; touch-action: none; display: grid; place-items: center; }
.mv:active { cursor: grabbing; }
.mv canvas { display: block; width: 100% !important; height: 100% !important; }
.mv-status { margin: 0; font: italic 400 1rem/1.4 var(--serif); color: var(--ink-2); padding: 1rem; text-align: center; }
.model-title { margin: 0; font: 600 1.4rem/1.15 var(--cond); color: var(--wine-deep); }
.model-about { margin: .6rem 0 0; font: 400 1.05rem/1.6 var(--serif); color: var(--ink); }
.model-print { margin: .7rem 0 0; font: 400 .98rem/1.55 var(--serif); color: var(--ink-2); }
.model-print span { font: 600 .78rem/1.3 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--wine); margin-right: .4rem; }
.model-dl { margin: 1rem 0 0; display: flex; align-items: center; gap: 1rem; }
.model-dl .dl { display: inline-block; font: 600 .95rem/1 var(--sans); text-decoration: none; color: var(--paper); background: var(--wine-deep); border: 1.5px solid var(--wine-deep); padding: .75rem 1.1rem; transition: background .2s var(--ease); }
.model-dl .dl:hover { background: var(--wine); border-color: var(--wine); }
.model-size { font: 600 .82rem/1.3 var(--cond); letter-spacing: .1em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .model { grid-template-columns: minmax(0, 1fr); } }
