/* Shared surfaces and type scale for the gallery and its reader. */
/* archive.css owns the original typography, masonry columns and two-panel reader. */
:root {--ui:var(--sans);--muted:var(--ink3)}
.hi {display:inline-block;width:18px;height:18px;flex:none;vertical-align:-.2em;fill:none;pointer-events:none}
nav a .hi {margin-inline-end:5px}
nav a[aria-current] {color:var(--accent);border-bottom-color:currentColor}
#author-library {margin-bottom:20px}
#author-select {display:inline-block;max-width:100%}
.image-recovery {position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:8px;background:#282a30;color:white;z-index:4}
[hidden] {display:none!important}
:where(a,button,input,summary):focus-visible {outline:3px solid #457adc!important;outline-offset:3px}
:where(button,summary,a) {touch-action:manipulation}
:where(button:not(:disabled),summary,a):active {opacity:.8}
button:disabled {cursor:not-allowed}
section>.wrap>.lead {margin:10px 0 24px;font-size:14px;line-height:1.7}
.gallery-tools,.gallery-search,.control,.page-controls,.result-line {display:flex;align-items:center}
.gallery-tools {gap:8px}
.gallery-search {gap:10px;max-width:540px;flex:1;min-width:0;border:1px solid var(--line2);border-radius:8px;padding:0 12px;color:var(--ink3)}
.gallery-search:focus-within {border-color:#5579ac;box-shadow:0 0 0 2px #5579ac25}
.gallery-search #libq {min-width:0;height:42px;padding:0;outline:0!important}
.control {font:500 14px var(--ui);min-height:44px;gap:7px;justify-content:center;color:var(--ink);border:1px solid var(--line2);background:white;border-radius:8px;padding:6px 14px;cursor:pointer}
.control:not(:disabled):hover {background:var(--paper2);border-color:var(--ink3)}
.control[aria-expanded=true] {background:var(--ink);color:white}
.control:disabled {opacity:.4}
.result-line {min-height:48px;justify-content:space-between;gap:8px}
.libcount {font-size:13px;letter-spacing:0}
.reset {border:0;background:transparent;cursor:pointer;color:var(--accent);min-height:40px;font:500 13px var(--ui)}
.reset:hover {text-decoration:underline}
.filter-panel {border:1px solid var(--line);border-radius:10px;padding:16px;margin-top:12px;background:var(--paper2)}
.filter-label {font-size:13px;font-weight:600;margin:0 0 6px}
.filter-panel .filters,.filter-panel #tfilters {margin-bottom:16px}
.filter-panel button {border-radius:6px}
.shot-options button:enabled:hover {box-shadow:inset 0 0 0 1px var(--ink3)}
.tag-guide {margin:0}
summary {list-style:none}
summary::-webkit-details-marker {display:none}
summary .hi {margin-right:6px;transition:transform .15s}
details[open]>summary .hi {transform:rotate(180deg)}
.item .t,.item .a {letter-spacing:0}
.cover-open {display:block;width:100%;height:100%;border:0;padding:0;background:var(--paper2);cursor:zoom-in}
.cover-open:focus-visible {outline-offset:-4px;position:relative;z-index:2}
.item .cap,.item .badge {pointer-events:none}
.item:focus-within .go {opacity:1}
.item .go .hi,.item .a .hi,.v-meta .hi {width:14px;height:14px}
.page-controls {justify-content:center;gap:18px;margin-top:28px;font-size:13px;color:var(--ink3)}
.empty-result {grid-column:1/-1;text-align:center;border:1px dashed var(--line2);border-radius:8px;padding:42px 16px}
.empty-result p {color:var(--ink3);margin:6px 0}
.lb .close,body.m .lb .close {display:grid;place-items:center;background:#26282d!important;color:white!important;border:1px solid #ffffff36;border-radius:50%;width:44px;height:44px;opacity:1}
.lb .close:hover,.lb .step:hover {filter:brightness(1.3)}
.lb .panel {scroll-padding-top:20px}
@media(max-width:760px){
  body.m nav.mnav a {display:flex;flex-direction:column;align-items:center}
  body.m nav.mnav a .hi {margin:0}
  .gallery-tools {scroll-margin-top:12px}
  .filter-panel {padding:12px}
  .filter-panel #tfilters {flex-wrap:wrap}
  .shot-row {grid-template-columns:1fr}
  .shot-options button,.tag-guide summary {min-height:40px}
  .gallery-search #libq {font-size:16px}
  .v-tip {display:none}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.gallery-tools {scroll-margin-top:72px}
.filter-panel #filters button,.filter-panel #tfilters button {font-size:13px!important}
.filter-panel #tfilters {flex-wrap:wrap}
.lb button:disabled {opacity:.35;cursor:not-allowed}
.pf-row .t,.chipx i {color:var(--ink3)}
.filter-done {margin:14px 0 0 auto;background:var(--ink);color:white}
.filter-done:not(:disabled):hover {background:#34373c}
.image-loading {position:absolute;top:50%;padding:6px 12px;border-radius:6px;background:#22252a;color:white;font-size:13px;pointer-events:none}
@media(max-width:760px){
  body.m .lb .step {display:grid!important;place-items:center;top:6px;width:44px;height:44px;transform:none;border-radius:6px;background:#303238;color:#fff}
  body.m .lb .step.prev {left:auto;right:114px}
  body.m .lb .step.next {right:64px}
  body.m .lb .tools2 {max-width:calc(100% - 172px);bottom:auto;left:10px;top:8px}
}

#library .library-modes { margin: 16px 0 20px; }
#author-select { margin: 0 12px 0 6px; }
#lbpanel .v-thumbs {
  flex: none;
  display: flex;
  overflow-x: auto;
  padding-bottom: 4px;
}
#lbpanel .v-thumb {
  flex: 0 0 54px;
  min-height: 0;
}
#lbpanel .v-thumb img {
  height: 64px;
}

#lbpanel .v-thumb b {
  left:2px;bottom:2px;padding:2px 4px;border-radius:3px;
  background:rgba(20,18,16,.78);color:white;font-size:11px;font-variant-numeric:tabular-nums;
}
#lbpanel .v-thumb.on {outline:2px solid var(--ink);outline-offset:-2px}
#lbpanel .v-idx {color:#6c655c;font-size:12px;letter-spacing:.06em;line-height:1.55}
@media(min-width:961px){#lbpanel .v-idx {padding-inline-end:44px}}
body.m #lbframe .lbl {font-size:15px!important;line-height:1.35!important}
body.m #lbframe.narrow-study .lbl {font-size:13px!important;max-width:62%!important}
@font-face {
  font-family: "XinyeArchive";
  src: url("_fonts/XinyeNian.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
.author-reader .lbl { font-family: "XinyeNian", "XinyeArchive", var(--hand); }

#field-studies {margin:1.8rem 0 3rem}
#field-studies select {max-width:100%;font:inherit;padding:.4rem .7rem;border:1px solid var(--line);border-radius:5px;background:white;color:inherit}
.field-profile {margin:1.5rem 0 2rem}
.field-profile > h3 {margin-bottom:.3rem}
.field-profile > p {max-width:70ch;line-height:1.8}
.study-grid {margin:1.1rem 0}
.study-reading,.field-notes p {margin:.35em 0 .65em;font-size:.93rem;line-height:1.7}
.study-reading a,.field-notes a,.field-profile > a {text-underline-offset:.2em}
.field-notes summary {cursor:pointer;padding:.7em 0}
.field-notes li {margin-bottom:.9em}
.field-compare {margin:1.5rem 0}
.field-compare details {border-bottom:1px solid var(--line);padding:.6rem 0}
.field-compare summary,.study-reading summary {cursor:pointer}
.field-compare p {max-width:68ch;line-height:1.7}

.field-pairs {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,34rem),1fr));gap:1.5rem}
.field-pair {border-top:1px solid var(--line);padding:1.2rem 0;margin-top:1rem;min-width:0}
.field-pair > small {color:var(--muted)}
.field-pair h4 {font-size:1.12rem;margin:.35rem 0}
.field-pair > p {max-width:65ch;line-height:1.75;margin:.4rem 0 .8rem}
.field-pair-photos {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;max-width:42rem}
.field-pair figure {margin:0;min-width:0}
.field-pair img {display:block;width:100%;height:clamp(9rem,17vw,14rem);object-fit:contain;background:var(--paper2)}
.field-pair figcaption {display:grid;gap:.18rem;margin-top:.4rem;font-size:.85rem;line-height:1.5}
.field-pair figcaption a {text-underline-offset:.18em}

.cross-studies {margin:2rem 0 3rem}
.cross-studies details {padding:.8rem 0;border-bottom:1px solid var(--line)}
.cross-studies summary {cursor:pointer;font-weight:600;line-height:1.6}
.cross-studies summary small {margin-inline-start:1em;color:var(--muted);font-weight:400}
.cross-studies details > p {line-height:1.7;margin:.7rem 0}
.cross-photos {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:1rem}
.cross-photos figure {min-width:0;margin:0}
.cross-photos img {display:block;width:100%;height:clamp(12rem,24vw,20rem);object-fit:contain;background:var(--paper2)}
.cross-photos figcaption {padding:.5rem 0;font-size:.9rem;line-height:1.65}
.cross-photos figcaption p {margin:.25rem 0}
.cross-photos figcaption a {text-underline-offset:.18em;margin-inline-end:.45em}
@media(max-width:600px){
  .cross-studies summary small {display:block;margin-inline-start:1.2rem}
  .cross-photos {grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}
  .cross-photos img {height:10rem}
}

/* Clip the moving photograph independently of navigation, annotations and tools. */
#lb .stage {min-width:0}
#photo-viewport {grid-template: minmax(0,1fr) / minmax(0,1fr);position:absolute;inset:32px 48px 66px;display:grid;place-items:center;overflow:hidden;touch-action:none;user-select:none}
#photo-motion {display:flex;align-items:center;justify-content:center;transform-origin:center}
#photo-viewport #lbframe {max-width:none;flex:none}
#photo-viewport #lbimg {position:absolute;left:50%;top:50%;max-width:none!important;max-height:none!important}
#photo-viewport[data-pan="true"] {cursor:grab}
#photo-viewport[data-pan="true"]:active {cursor:grabbing}
#lbtools.tools2 {left:50%;right:auto;top:auto;bottom:12px;transform:translateX(-50%);display:flex;align-items:center;gap:2px;max-width:calc(100% - 12px);width:max-content;flex-wrap:nowrap;background:#272624;border:1px solid #ffffff38;border-radius:12px;padding:3px}
#lb #lbtools button {border-radius:8px!important;background:transparent!important;color:#f6f4ef!important;border:0!important;white-space:nowrap;font:500 13px var(--sans);letter-spacing:0;padding:0 8px;min-width:34px;height:36px;line-height:1}
#lb #lbtools button:hover,#lb #lbtools button.on {background:#55534e!important}
#lb #lbtools button:disabled {opacity:.35}
#lb #photo-fit {font-variant-numeric:tabular-nums;min-width:46px}
#lbtools :is(#photo-left,#photo-right) .hi {width:17px;height:17px;vertical-align:middle}
#lbtools button:is(#photo-in,#photo-out) {font-size:19px}
#photo-feedback {position:absolute;bottom:65px;left:50%;transform:translateX(-50%);z-index:5;max-width:90%;width:max-content;background:#282624ed;color:white;border-radius:7px;padding:6px 12px;font-size:13px;text-align:center;pointer-events:none}
#photo-feedback:empty {display:none}
@media(max-width:960px){
  #lb .stage {height:52vh;height:52dvh;flex:none}
  #photo-viewport {inset:51px 8px 52px}
  #lb #lbtools {left:50%;bottom:4px;top:auto;max-width:calc(100% - 6px);gap:0}
  #lb #lbtools button {padding:0 6px;min-width:30px}
  #photo-feedback {bottom:49px}
}

/* In the stacked reader, reserve one row above the image for navigation. */
@media(max-width:960px){
  #lb #lbpanel {padding:20px clamp(16px,4vw,32px) 48px}
  #lb #lbclose,#lb .stage>.step {
    top:4px;width:44px;height:44px;display:grid;place-items:center;transform:none;
  }
  #lb #lbclose {right:8px}
  #lb .stage>.step.next {left:auto;right:58px}
  #lb .stage>.step.prev {left:auto;right:108px}
}

nav.toc a[aria-current="page"] {color:var(--accent)!important;box-shadow:inset 0 -2px var(--accent)}
@media(max-width:760px){
  body.m nav.toc {display:none}
  body.m nav.mnav a {color:#686157}
  body.m nav.mnav a[aria-current="page"] {color:var(--accent);background:var(--paper2);font-weight:600}
}

/* Keep annotations legible on white editorial credit cards. */
#lbframe .on-paper .lbl {
  color:#37322d!important;
  -webkit-text-stroke:0!important;
  text-shadow:0 0 3px #fff!important;
}

/* Photographer portfolios keep the preview frame and its overlay at identical dimensions. */
.portfolio-head {display:grid;grid-template-columns:minmax(13rem,.7fr) minmax(0,1.5fr);gap:clamp(1rem,4vw,4rem);align-items:start;padding:0 0 1.6rem;border-bottom:1px solid var(--line)}
.portfolio-head .pf-name h3 {margin:0}
.portfolio-count,.portfolio-sources,.portfolio-genome summary {font-size:.83rem;color:var(--ink3)}
.portfolio-count {margin-top:.55rem}
.portfolio-intro {max-width:74ch;font-size:.98rem;line-height:1.85}
.portfolio-sources {display:flex;flex-wrap:wrap;gap:.5rem 1.2rem;margin-top:.55rem}
.portfolio-sources a,.portfolio-detail a {color:inherit;text-underline-offset:.22em}
.portfolio-sources ul {padding-left:1.1rem}
.portfolio-genome {margin-top:.4rem}
.portfolio-intro summary,.portfolio-reading summary {cursor:pointer}
.portfolio-intro summary::after,.portfolio-reading summary::after {content:' ＋';font-size:.8em}
.portfolio-intro details[open]>summary::after,.portfolio-reading details[open]>summary::after {content:' －'}
.portfolio-intro dl,.portfolio-reading dl {margin:.7rem 0}
.portfolio-intro dt,.portfolio-reading dt {font-weight:600}
.portfolio-intro dd,.portfolio-reading dd {margin:0 0 .65rem}
.portfolio-layout {display:grid;grid-template-columns:minmax(11rem,.65fr) minmax(0,2.6fr);align-items:start;gap:clamp(1.2rem,2.5vw,3rem);padding-top:1.65rem}
.portfolio-list h4,.portfolio-reading h4,.portfolio-work-title {font-size:1rem;font-weight:650;line-height:1.5;margin:0 0 .85rem;color:var(--ink)}
.portfolio-items {max-height:76vh;overflow-y:auto;overscroll-behavior:contain}
.portfolio-row {display:flex;align-items:center;width:100%;gap:.7rem;border:0;border-bottom:1px solid var(--line);border-left:3px solid transparent;padding:.5rem .6rem;text-align:left;background:transparent;color:var(--ink2);font:inherit;cursor:pointer}
.portfolio-row img {width:2.7rem;height:3.3rem;object-fit:cover;background:var(--paper2)}
.portfolio-row span {font-size:.84rem;line-height:1.5;overflow-wrap:anywhere}
.portfolio-row.on {border-left-color:var(--accent);background:var(--paper2);color:var(--ink)}
.portfolio-row:hover,.portfolio-tools button:enabled:hover {background:var(--paper2)}
.portfolio-picker {display:none}
.portfolio-columns {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:clamp(1rem,2vw,2rem);align-items:start}
.portfolio-detail,.portfolio-photo,.portfolio-reading {min-width:0}
.portfolio-canvas {display:grid;place-items:center;min-height:8rem;background:#eeeae4}
.portfolio-stage {position:relative;max-width:100%;line-height:0}
.portfolio-stage>img {display:block;width:auto;height:auto;max-width:100%;max-height:68vh}
.portfolio-stage .lbl {font-family:"XinyeNian","XinyeArchive",var(--hand);line-height:1.35!important;font-size:clamp(14px,1.5vw,21px)!important}
.portfolio-stage .on-paper .lbl {color:#37322d!important;text-shadow:0 0 3px #fff!important}
.portfolio-tools {display:flex;align-items:center;gap:.32rem;margin:.5rem 0}
.portfolio-tools>span {color:var(--ink3);font-size:.8rem;font-variant-numeric:tabular-nums;margin-right:auto}
.portfolio-tools button {border:1px solid var(--line);padding:.28rem .55rem;background:transparent;color:var(--ink);border-radius:4px;min-height:36px;cursor:pointer;font:inherit;font-size:.8rem}
.portfolio-tools button[aria-pressed=true] {background:var(--ink);color:var(--paper)}
.portfolio-tools button:disabled {opacity:.42;cursor:default}
.portfolio-thumbs {display:flex;gap:.35rem;overflow-x:auto;padding:.1rem 0 .55rem}
.portfolio-thumbs .pf-thumb {flex:0 0 48px;min-height:0}
.portfolio-reading {font-size:.9rem;line-height:1.8;max-height:78vh;overflow-y:auto;overflow-wrap:anywhere}
.portfolio-reading strong {display:block;font-size:1.13rem;line-height:1.6}
.portfolio-reading p {margin:.55rem 0 1rem}
.portfolio-reading details {padding:.5rem 0;border-bottom:1px solid var(--line)}
.portfolio-reading>a {display:inline-block;margin:.8rem 0;color:var(--ink2)}
@media(max-width:980px) {
  .portfolio-layout {grid-template-columns:1fr}
  .portfolio-list {display:flex;align-items:center;flex-wrap:wrap;gap:.6rem}
  .portfolio-list h4 {margin:0}
  .portfolio-items {display:none}
  .portfolio-picker {display:block;width:min(100%,28rem);min-height:44px;padding:.5rem;color:var(--ink);background:var(--paper);border:1px solid var(--line);font:inherit;font-size:.9rem}
}
@media(max-width:680px) {
  .portfolio-head,.portfolio-columns {grid-template-columns:1fr}
  .portfolio-head {gap:.7rem}
  .portfolio-list {display:block}
  .portfolio-picker {margin-top:.4rem;width:100%}
  .portfolio-stage>img {max-height:63vh}
  .portfolio-reading {max-height:none;overflow:visible}
  .portfolio-tools button {min-height:44px}
  body.m .portfolio-thumbs .pf-thumb {min-height:44px}
}
