/* ==========================================================================================================
   The Gallery (TripPhotos board) and a photograph opened (PhotoViewer board) — 2026-10-02
   ==========================================================================================================
   Drawn by 70-folio-gallery.js and, for the viewer, 35-markup-journal.js with 06-expenses.js. Type on the scale of
   2026-10-01: 24 / 16 / 14 / 12 / 10. */

/* ---- the Gallery ------------------------------------------------------------------------------------------- */
.folio.fg-page .pgstack-body { background: var(--fo-paper); }
.folio .fg { padding: 0 0 24px; }
/* The album's words, chips and buttons are the system's (60-folio.css, 2026-10-20); its classes are hooks. */

/* All · Favourites, and Search · Select */
.folio .fg-head { padding: 14px var(--fo-gutter) 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.folio .fg-filters { display: flex; gap: 3px; }
.folio .fg-acts { display: flex; gap: 16px; }
.folio .fg-head__n { font-size: 14px; font-weight: 500; }

/* The first visit says once what a photograph opened is for. */
.folio .fg-hint { margin: 12px var(--fo-gutter) 0; padding: 10px 12px; background: var(--fo-band); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; line-height: 1.45; }
.folio .fg-hint .fg-word { flex: none; }
/* The photographs Boswell matched to plans by where they were taken (70-folio-gallery.js fgMatchesHTML). */
.folio .fg-match { margin: 12px var(--fo-gutter) 0; padding: 12px; border: 1px dashed var(--fo-hair-firm); display: flex; flex-direction: column; gap: 10px; }
.folio .fg-match__head { margin: 0; font-size: 12px; line-height: 1.45; color: var(--fo-graphite); }
.folio .fg-match__row { display: flex; align-items: center; gap: 10px; }
.folio .fg-match__thumbs { display: flex; flex: none; }
.folio .fg-match__thumbs img { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--fo-paper); margin-left: -10px; }
.folio .fg-match__thumbs img:first-child { margin-left: 0; }
.folio .fg-match__what { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.folio .fg-match__name { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folio .fg-match__what .fo-quiet { font-size: 12px; }
.folio .fg-match .fg-word { flex: none; }
.folio .fg-match__acts { display: flex; gap: 8px; }

/* The wall: three columns; a captioned photograph is a polaroid. */
.folio .fg-wall { margin: 8px var(--fo-gutter) 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; align-items: start; }
.folio .fg-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.folio .fg-tile { position: relative; display: flex; flex-direction: column; cursor: pointer; outline-offset: 2px; }
.folio .fg-tile.is-polaroid { padding: 5px 5px 0; background: var(--fo-card); box-shadow: 0 0 0 1px rgba(26,22,20,0.08), 0 6px 14px -8px rgba(26,22,20,0.35); }
.folio .fg-pic { width: 100%; }
.folio .fg-pic img { position: absolute; inset: 0; }
.folio .fg-mark { background: var(--fo-band); color: inherit; padding: 0 1px; box-shadow: inset 0 -1px 0 var(--fo-ink); }
.folio .fg-why { margin: 14px var(--fo-gutter) 0; font-size: 12px; line-height: 1.5; }
.folio .fg-cap { padding: 7px 2px 9px; font-family: var(--fo-serif); font-style: italic; font-size: 12px; line-height: 1.25; color: var(--fo-ink); overflow-wrap: anywhere; }
.folio .fg-bare { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--fo-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fo-graphite); }
.folio .fg-heart { position: absolute; top: 0; right: 0; width: 32px; height: 32px; padding: 5px 6px 0 0; box-sizing: border-box; display: flex; justify-content: flex-end; align-items: flex-start; border: none; background: transparent; color: var(--fo-card); cursor: pointer; filter: drop-shadow(0 1px 1px rgba(26,22,20,0.35)); }
.folio .fg-heart svg { fill: none; }
.folio .fg-heart.is-fav svg { fill: currentColor; }
.folio .fg-vid { position: absolute; left: 6px; bottom: 6px; height: 20px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; background: rgba(26,22,20,0.72); font-family: var(--fo-mono); font-size: 10px; color: var(--fo-card); }
.folio .fg-tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; box-sizing: border-box; border: 1.5px solid var(--fo-card); background: rgba(26,22,20,0.25); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--fo-card); }
.folio .fg-tick.is-on { background: var(--fo-ink); }
.folio .fg-tick.is-on::after { content: '✓'; }

/* Search */
.folio .fg-find { padding: 14px var(--fo-gutter) 0; display: flex; align-items: center; gap: 14px; }
.folio .fg-find .fo-search { flex: 1; min-width: 0; }
.folio .fg-chips { padding: 12px var(--fo-gutter) 0; display: flex; gap: 6px; flex-wrap: wrap; }
.folio .fg-count { padding: 14px var(--fo-gutter) 0; display: flex; justify-content: space-between; gap: 12px; }
.folio .fg-count + .fg-wall { margin-top: 10px; }
.folio .fg-said { margin: 18px var(--fo-gutter) 0; }
.folio .fg-none { margin: 40px var(--fo-gutter) 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.folio .fg-none__say { font-family: var(--fo-serif); font-style: italic; font-size: 16px; line-height: 1.35; color: var(--fo-ink); }
.folio .fg-none .fg-word { margin-top: 4px; }

/* Nothing yet: the waterfall's shapes in dashes, fading out; breathing while the album is read. */
.folio .fg-ghost { margin: 24px var(--fo-gutter) 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; align-items: start; -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); }
.folio .fg-ghost .fg-col { gap: 4px; }
.folio .fg-ghost span { display: block; border: 1px dashed rgba(26,22,20,0.22); }
.folio .fg-ghost.is-breathing { animation: fo-breathe 1.6s ease-in-out infinite; }
.folio .fg-empty { margin: 20px var(--fo-gutter) 0; display: flex; flex-direction: column; gap: 8px; }

/* The foot: the order, From files and Upload; while selecting, the two things done to the picked. */
.folio .fg-foot[hidden] { display: none; }
.folio .fg-foot { flex: none; padding: 12px var(--fo-gutter) max(calc(env(safe-area-inset-bottom, 0px) + 8px), 30px); background: var(--fo-paper); border-top: 1px solid var(--fo-rule); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.folio .fg-ups { display: flex; gap: 8px; }
/* Selecting: the viewer's capsule, in the middle of the foot. */
.folio .fg-foot.is-selecting { justify-content: center; }
.folio .fg-tools { margin-top: 0; background: var(--fo-ink); }
.folio .fg-tools .fv-tool:disabled { color: rgba(253,252,250,0.35); cursor: default; }

/* ---- a photograph opened (PhotoViewer board) ---------------------------------------------------------------- */
.folio.fv-page, .folio.fv-page .pgstack-body { background: var(--fo-ink); }
.folio.fv-page > .pgstack-header { display: none; }
.folio.fv-page .pgstack-body { display: flex; flex-direction: column; overflow: hidden; }
.folio .fv { flex: 1; min-height: 0; display: flex; flex-direction: column; color: var(--fo-card); background: var(--fo-ink); }
.folio .fv-bar { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; height: 44px; padding: env(safe-area-inset-top, 0px) 20px 0; }
.folio .fv-bar__act { justify-self: start; }   /* .fo-bar__act on .fo-dark */
.folio .fv-bar__act.is-right { justify-self: end; }
.folio .fv-count { font-family: var(--fo-mono); font-size: 12px; color: var(--fo-card); }
.folio .fv-plate { position: relative; flex: 1; min-height: 0; margin-top: 18px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; touch-action: none; }
.folio .fv-plate .fullscreen-image { width: 100%; height: 100%; object-fit: contain; transition: opacity .2s; }
.folio .fv-plate .fullscreen-image.is-loading { opacity: 0; }
.folio .fv-plate .fs-plate-note { display: none; margin: 0; font-size: 12px; color: rgba(253,252,250,0.55); }
.folio .fv-plate.is-failed .fs-plate-note { display: block; }
.folio .fv-plate.is-failed #fullscreenImage { display: none !important; }

.folio .fv-foot { flex: none; padding: 20px 0 max(calc(env(safe-area-inset-bottom, 0px) + 8px), 28px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.folio .fv-cap { width: 100%; padding: 0 28px; box-sizing: border-box; display: flex; justify-content: center; }
.folio .fv-cap__words { max-width: 100%; font-family: var(--fo-serif); font-style: italic; font-size: 16px; line-height: 1.35; color: var(--fo-card); text-align: center; cursor: text; }
.folio .fv-cap__in { width: 220px; max-width: 100%; min-height: 26px; padding: 0 0 4px; border: none; border-bottom: 1px dashed rgba(253,252,250,0.35); border-radius: 0; background: transparent; box-shadow: none; outline: none; resize: none; overflow: hidden; font-family: var(--fo-serif); font-style: italic; font-size: 16px; line-height: 1.35; color: var(--fo-card); text-align: center; }
.folio .fv-cap__in::placeholder { color: rgba(253,252,250,0.4); opacity: 1; }
.folio .fv-cap__in:focus { border-bottom: 1px solid var(--fo-card); }   /* written in: the dashed line turns solid, as every field does (owner, 2026-10-23) */
.folio .fv-meta { padding: 0 28px; font-family: var(--fo-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(253,252,250,0.55); text-align: center; }
.folio .fv-meta:empty { display: none; }
.folio .fv-act { margin-top: 6px; padding: 0 28px; display: flex; gap: 8px; justify-content: center; align-items: baseline; font-size: 12px; color: rgba(253,252,250,0.7); }
.folio .fv-tools { margin-top: 18px; display: flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 9999px; background: rgba(26,22,20,0.72); border: 1px solid rgba(253,252,250,0.16); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6); }
.folio .fv-tool { width: 44px; height: 44px; padding: 0; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--fo-card); cursor: pointer; }
.folio .fv-tool.fs-fav.is-fav svg, .folio .fv-tool.fs-pin.is-pinned svg { fill: currentColor; }
.folio .fv-tool.fs-activity:not(.is-linked) { color: rgba(253,252,250,0.55); }
.folio .fv-tools__sep { width: 1px; height: 20px; margin: 0 2px; background: rgba(253,252,250,0.22); }
.folio .fv-strip { width: 100%; margin-top: 18px; padding: 0 16px; box-sizing: border-box; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.folio .fv-strip::-webkit-scrollbar { display: none; }
.folio .fv-strip .fs-thumb { flex: none; width: 44px; height: 44px; padding: 0; border: none; background: rgba(253,252,250,0.12); opacity: .55; cursor: pointer; overflow: hidden; }
.folio .fv-strip .fs-thumb.active { opacity: 1; outline: 2px solid var(--fo-card); outline-offset: -2px; }
.folio .fv-strip .fs-thumb img, .folio .fv-strip .fs-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.folio .fv-strip .fs-thumb img.is-failed { visibility: hidden; }

/* A diary photograph is not one of the journey's: Download alone. */
.folio .fv-foot.is-diary .fv-cap, .folio .fv-foot.is-diary .fv-meta, .folio .fv-foot.is-diary .fv-act, .folio .fv-foot.is-diary .fv-strip, .folio .fv-foot.is-diary .fv-tools__sep { display: none; }

/* Tapped, or zoomed: only the photograph. */
.folio .fv.is-bare .fv-bar, .folio .fv.is-bare .fv-foot { visibility: hidden; }
.folio .fv.is-bare .fv-bar { height: 0; }
.folio .fv.is-bare .fv-foot { position: absolute; }
.folio .fv.is-bare .fv-plate { margin-top: 0; }

/* ---- focus, where the ground is a photograph or the ink (focus audit) ---------------------------------------- */
/* A heart stands on a picture: two colours, so one of them shows whatever the picture is. */
.folio .fg-heart:focus-visible { outline: 2px solid var(--fo-ink); outline-offset: -2px; box-shadow: inset 0 0 0 4px var(--fo-card); }
.folio .fg-tile:focus-visible { outline: 2px solid var(--fo-ink); outline-offset: 2px; }
/* On the ink the mark is the card's white, drawn inside so no edge cuts it; a thumbnail adds the ink inside it. */
.folio .fv :focus-visible { outline: 2px solid var(--fo-card); outline-offset: -2px; }
.folio .fv .fv-cap__in:focus-visible { outline: none; }   /* the caption is a field: its line says it, not a white box round it (owner, 2026-10-23: 这个白框框很丑) */
.folio .fv .fs-thumb { position: relative; }
.folio .fv .fs-thumb:focus-visible { opacity: 1; }
/* Over the picture, not under it: an inset shadow paints beneath an img and would not show. */
.folio .fv .fs-thumb:focus-visible, .folio .fv .fv-plate:focus-visible { outline: none; }
.folio .fv .fs-thumb:focus-visible::after, .folio .fv .fv-plate:focus-visible::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--fo-card), inset 0 0 0 4px var(--fo-ink); pointer-events: none; }
