summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/gipfel-cli/src/main.rs15
-rw-r--r--crates/gipfel-core/src/panorama.rs49
-rw-r--r--examples/Makefile95
-rwxr-xr-xexamples/gipfel2html173
-rw-r--r--examples/style.css203
5 files changed, 529 insertions, 6 deletions
diff --git a/crates/gipfel-cli/src/main.rs b/crates/gipfel-cli/src/main.rs
index f0690a8..06b1447 100644
--- a/crates/gipfel-cli/src/main.rs
+++ b/crates/gipfel-cli/src/main.rs
@@ -12,7 +12,7 @@ fn usage() {
\n\
commands:\n\
\x20 export-position <img> print position CSV line\n\
- \x20 export-hills <img> [-d <data>] [-e <hills>] export hill positions\n\
+ \x20 export-hills <img> [-d <data>] [-e <hills>] [-V <r>] export hill positions\n\
\x20 info <img> show parsed metadata\n\
\x20 stitch [-t out.tif [-4]] [-j out.jpg] [-w N]\n\
\x20 [-h N] [-r from,to] [-b] img... cylindrical panorama\n\
@@ -45,7 +45,7 @@ fn fmt_f(v: f64) -> String {
}
}
-fn export_hills(img: &str, data: &str, export_file: Option<&str>) -> i32 {
+fn export_hills(img: &str, data: &str, export_file: Option<&str>, vis: f64) -> i32 {
let Some((w, h)) = image_dimensions(img) else {
eprintln!("could not read image {}", img);
return 1;
@@ -61,7 +61,7 @@ fn export_hills(img: &str, data: &str, export_file: Option<&str>) -> i32 {
eprintln!("Could not load datafile {}: {}", data, e);
return 1;
}
- pan.set_height_dist_ratio(0.07); // C default "visibility"
+ pan.set_height_dist_ratio(vis); // "visibility" threshold, C default 0.07
if !have_info {
eprintln!("No gipfel info available for {}.", img);
@@ -328,9 +328,16 @@ fn main() {
let img = &args[2];
let mut data = "gipfel.dat".to_string();
let mut export_file: Option<String> = None;
+ let mut vis = 0.07;
let mut i = 3;
while i < args.len() {
match args[i].as_str() {
+ "-V" => {
+ if i + 1 < args.len() {
+ vis = args[i + 1].trim().parse().unwrap_or(0.07);
+ i += 1;
+ }
+ }
"-d" => {
if i + 1 < args.len() {
data = args[i + 1].clone();
@@ -347,7 +354,7 @@ fn main() {
}
i += 1;
}
- export_hills(img, &data, export_file.as_deref())
+ export_hills(img, &data, export_file.as_deref(), vis)
}
}
"info" => {
diff --git a/crates/gipfel-core/src/panorama.rs b/crates/gipfel-core/src/panorama.rs
index 9216037..b8ce342 100644
--- a/crates/gipfel-core/src/panorama.rs
+++ b/crates/gipfel-core/src/panorama.rs
@@ -404,7 +404,17 @@ impl Panorama {
}
pub fn is_visible(&self, alph: f64) -> bool {
- let mut center_dist = (alph - self.parms.a_center).abs();
+ // NaN or infinite azimuths (from user input or a diverged fit) must
+ // never count as visible; a NaN center used to make everything so.
+ if !alph.is_finite() || !self.parms.a_center.is_finite() {
+ return false;
+ }
+ // Wrap into [0, 2pi) before the fold: a_center may lie outside
+ // [-pi, pi] (user enters "400 deg", or a fit leaves it unnormalized).
+ // Without this, |alph - a_center| > 2pi turned the single fold below
+ // into a NEGATIVE distance, which passed every comparison and made
+ // hills behind the camera visible (GipfelFind.lean Finding 1).
+ let mut center_dist = (alph - self.parms.a_center).abs() % (2.0 * PI);
if center_dist > PI {
center_dist = 2.0 * PI - center_dist;
}
@@ -458,8 +468,13 @@ impl Panorama {
let mut rows = Vec::new();
for &i in &self.visible {
let m = &self.hills[i];
+ // restricted mode (-e, a curated list such as the photo
+ // index): export every listed entry inside the field of
+ // view. The prominence/occlusion heuristics are meant to
+ // thin out the full 21k peak database, not to second-guess
+ // an explicit list.
if m.flags & crate::hill::FLAG_DUPLIC != 0
- || m.flags & crate::hill::FLAG_HIDDEN != 0
+ || (!require_export && m.flags & crate::hill::FLAG_HIDDEN != 0)
|| (require_export && m.flags & crate::hill::FLAG_EXPORT == 0)
{
continue;
@@ -509,4 +524,34 @@ mod tests {
pan.max_view_angle = 80f64.to_radians();
assert!(!pan.is_visible(a70));
}
+
+ #[test]
+ fn out_of_range_center_angle_stays_safe() {
+ // GipfelFind.lean Finding 1: with |alph - a_center| > 2pi the single
+ // fold produced a negative "distance" that passed every comparison.
+ // Hill azimuths come from atan2, so alph is always in [-pi, pi].
+ let mut raw = Panorama::new();
+ raw.parms.a_center = 400f64.to_radians(); // e.g. left by a fit
+ assert!(!raw.is_visible(-std::f64::consts::PI)); // 220 deg off, behind
+
+ // the setter must agree with the equivalent in-range azimuth
+ let mut pan400 = Panorama::new();
+ pan400.set_center_angle(400.0); // "bearing + full turn" input slip
+ let mut pan40 = Panorama::new();
+ pan40.set_center_angle(40.0);
+ for d in -180..=180 {
+ let a = (d as f64).to_radians();
+ assert_eq!(pan400.is_visible(a), pan40.is_visible(a), "az {d}");
+ }
+
+ // NaN / infinite azimuths are not visible (Finding 1b)
+ assert!(!pan40.is_visible(f64::NAN));
+ assert!(!pan40.is_visible(f64::INFINITY));
+ assert!(!pan40.is_visible(f64::NEG_INFINITY));
+
+ // a NaN camera azimuth hides everything (was: everything visible)
+ let mut bad = Panorama::new();
+ bad.parms.a_center = f64::NAN;
+ assert!(!bad.is_visible(0.0));
+ }
}
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 0000000..624b464
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,95 @@
+# gipfelweb: static, CSS-only web galleries of gipfel-annotated
+# images. Port of the historical examples/ pipeline to the Rust
+# stack: gipfel-cli replaces the C binary, ImageMagick replaces
+# netpbm + jhead (convert preserves the gipfel comment and EXIF).
+#
+# usage: put annotated *.jpg files (optionally per-image %.opts with
+# extra gipfel-cli arguments and %.title with a display title) in a
+# directory and run
+#
+# make -f /path/to/gipfel/examples/Makefile gipfelweb
+#
+# variables:
+# GIPFEL_CLI path to the gipfel-cli binary
+# DATA hill database used for the peak view
+# GIPFEL2HTML html generator script
+# V visibility threshold for the peak view (lower shows
+# more, distant peaks; C default was 0.07)
+
+here := $(dir $(lastword $(MAKEFILE_LIST)))
+GIPFEL_CLI ?= $(abspath $(here)../target/release/gipfel-cli)
+DATA ?= $(abspath $(here)../gipfel.dat)
+GIPFEL2HTML ?= $(here)gipfel2html
+V ?= 0.05
+
+images := $(wildcard *.jpg)
+slides := $(addprefix gipfelweb/slides/, $(images))
+thumbs := $(addprefix gipfelweb/thumbs/, $(images))
+positions := $(addprefix gipfelweb/gipfel/, $(addsuffix .pos, $(basename $(images))))
+imgpos := $(addprefix gipfelweb/gipfel/, $(addsuffix .imgs, $(basename $(images))))
+hillpos := $(addprefix gipfelweb/gipfel/, $(addsuffix .hills, $(basename $(images))))
+html := $(addprefix gipfelweb/, $(addsuffix .html, $(basename $(images))))
+
+all:
+ echo "make gipfelweb - create a HTML based view of gipfel oriented"
+ echo "images in the current directory."
+
+gipfelweb: dirs style $(slides) $(thumbs) $(imgpos) $(hillpos) $(html) gipfelweb/index.html
+
+clean:
+ rm -rf gipfelweb/gipfel
+
+clobber:
+ rm -rf gipfelweb
+
+dirs:
+ mkdir -p gipfelweb/slides
+ mkdir -p gipfelweb/thumbs
+ mkdir -p gipfelweb/gipfel
+
+style: gipfelweb/style.css
+
+gipfelweb/style.css: $(here)style.css
+ cp $< $@
+
+# slides: web display size, capped at 6000 px on the long edge so
+# both normal photos and very wide stitched images keep a sane size
+gipfelweb/slides/%.jpg: %.jpg
+ convert $< -filter Lanczos -resize 6000x6000\> -quality 90 $@
+
+# thumbs: gallery cards and hover popups
+gipfelweb/thumbs/%.jpg: %.jpg
+ convert $< -filter Point -resize 480x480\> -quality 80 $@
+
+gipfelweb/gipfel/%.pos: %.jpg
+ $(GIPFEL_CLI) export-position $< > $@
+
+# photo cross-links: the position index holds only a handful of
+# entries, so disable the prominence filter entirely (-V 0); it is
+# meant for the 21k peak database, not for neighbouring photos
+#
+# per-image %.opts are appended after the standard flags, so they can
+# override -d/-V
+gipfelweb/gipfel/%.imgs: gipfelweb/slides/%.jpg %.opts gipfelweb/gipfel/index.gipfel
+ $(GIPFEL_CLI) export-hills $< -d $(DATA) -V 0 -e gipfelweb/gipfel/index.gipfel `cat $*.opts` > $@
+
+gipfelweb/gipfel/%.imgs: gipfelweb/slides/%.jpg gipfelweb/gipfel/index.gipfel
+ $(GIPFEL_CLI) export-hills $< -d $(DATA) -V 0 -e gipfelweb/gipfel/index.gipfel > $@
+
+gipfelweb/gipfel/%.hills: gipfelweb/slides/%.jpg %.opts
+ $(GIPFEL_CLI) export-hills $< -d $(DATA) -V $(V) `cat $*.opts` > $@
+
+gipfelweb/gipfel/%.hills: gipfelweb/slides/%.jpg
+ $(GIPFEL_CLI) export-hills $< -d $(DATA) -V $(V) > $@
+
+gipfelweb/gipfel/index.gipfel: $(positions)
+ cat $(positions) > gipfelweb/gipfel/index.gipfel
+
+gipfelweb/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.imgs gipfelweb/gipfel/%.hills %.title $(thumbs) gipfelweb/style.css
+ $(GIPFEL2HTML) page $* > $@
+
+gipfelweb/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.imgs gipfelweb/gipfel/%.hills $(thumbs) gipfelweb/style.css
+ $(GIPFEL2HTML) page $* > $@
+
+gipfelweb/index.html: $(thumbs) $(html)
+ $(GIPFEL2HTML) gallery $(basename $(images)) > $@
diff --git a/examples/gipfel2html b/examples/gipfel2html
new file mode 100755
index 0000000..ee69014
--- /dev/null
+++ b/examples/gipfel2html
@@ -0,0 +1,173 @@
+#!/bin/sh
+# gipfel2html — generate the modern, CSS-only gipfelweb pages.
+#
+# gipfel2html page <file> one image page (peaks + photos)
+# gipfel2html gallery <f1> <f2> thumbnail gallery index
+#
+# Markers are positioned in percent of the slide so the image can
+# scale freely (responsive default; a CSS-only checkbox switches to
+# full resolution with horizontal scrolling). Interaction is pure CSS:
+# hover for mouse, :focus-within for keyboard, :target for touch.
+
+set -e
+# awk must print dots as decimal separators regardless of locale
+LC_ALL=C
+export LC_ALL
+
+MODE="$1"
+
+AWK=awk
+
+# percent of slide dimension
+pct() { $AWK -v v="$1" -v m="$2" 'BEGIN { printf "%.2f", v * 100 / m }'; }
+
+# integer percent (for threshold comparisons)
+ipct() { $AWK -v v="$1" -v m="$2" 'BEGIN { printf "%d", v * 100 / m }'; }
+
+# meters -> "12.3 km" / "850 m"
+fmt_dist() {
+ $AWK -v d="$1" 'BEGIN { if (d >= 1000) printf "%.1f km", d / 1000; else printf "%.0f m", d }'
+}
+
+# edge classes so popups stay inside the image: below if near the top,
+# left/right aligned if near a horizontal edge
+edge_classes() {
+ xp="$1"; yp="$2"
+ cls=""
+ [ "$yp" -lt 25 ] && cls="below"
+ if [ "$xp" -lt 12 ]; then cls="$cls left"
+ elif [ "$xp" -gt 88 ]; then cls="$cls right"
+ fi
+ echo "$cls"
+}
+
+
+title_of() {
+ # display title for image base name $1: %.title file, else the name
+ if [ -e "$1.title" ]; then cat "$1.title"; else echo "$1"; fi
+}
+
+head() {
+ cat << EOF
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+<title>$1 — gipfel</title>
+<link rel="stylesheet" href="$2style.css" />
+</head>
+EOF
+}
+
+if [ "$MODE" = "gallery" ]; then
+ shift
+ head "gipfelweb" ""
+ cat << EOF
+<body>
+<header><h1>gipfelweb</h1></header>
+<main>
+<div class="gallery">
+EOF
+ for f in "$@"; do
+ echo "<a href=\"${f}.html\"><img src=\"thumbs/${f}.jpg\" alt=\"${f}\" loading=\"lazy\"><span class=\"t\">$(title_of "$f")</span></a>"
+ done
+ cat << EOF
+</div>
+</main>
+<footer>Created with <a href="https://flpsed.org/gipfel.html">gipfel</a></footer>
+</body>
+</html>
+EOF
+ exit 0
+fi
+
+# ---- one image page ----
+FILE="$2"
+SLIDE="gipfelweb/slides/${FILE}.jpg"
+HILLS="gipfelweb/gipfel/${FILE}.hills"
+IMGS="gipfelweb/gipfel/${FILE}.imgs"
+TITLE=$(title_of "$FILE")
+set -- $(identify -format "%w %h" "$SLIDE")
+W="$1" H="$2"
+
+head "$TITLE" ""
+cat << EOF
+<body>
+<header>
+<h1>${TITLE}</h1>
+<a href="index.html">&larr; Gallery</a>
+</header>
+<main>
+<input type="checkbox" id="t-peaks" class="tgl" checked />
+<label class="chip" for="t-peaks">Peaks</label>
+<input type="checkbox" id="t-photos" class="tgl" checked />
+<label class="chip" for="t-photos">Photos</label>
+<input type="checkbox" id="t-labels" class="tgl" />
+<label class="chip" for="t-labels">Labels</label>
+<input type="checkbox" id="t-full" class="tgl" />
+<label class="chip" for="t-full">Full resolution</label>
+<div class="pano-wrap">
+<div class="pano">
+<img class="slide" src="slides/${FILE}.jpg" alt="${TITLE}" />
+<ul class="markers">
+EOF
+
+# note: no `cmd | while` pipes here — the loop body increments the
+# marker counters and must run in the current shell
+if [ -e "$HILLS" ]; then
+ i=0
+ while IFS=" " read -r name height x y dist rest; do
+ case "$name" in \#*|"") continue ;; esac
+ xp=$(pct "$x" "$W"); yp=$(pct "$y" "$H")
+ cls=$(edge_classes "$(ipct "$x" "$W")" "$(ipct "$y" "$H")")
+ d=$(fmt_dist "$dist")
+ echo "<li class=\"mk peak $cls\" id=\"id_${i}\" style=\"--x:${xp}%;--y:${yp}%\"><a href=\"#id_${i}\" aria-label=\"${name}, ${height} m, distance ${d}\"><span class=\"dot\"></span><span class=\"pop label\">${name} &middot; ${height} m &middot; <span class=\"dist\">${d}</span></span></a></li>"
+ i=$((i + 1))
+ done < "$HILLS"
+fi
+
+if [ -e "$IMGS" ]; then
+ j=0
+ while IFS=" " read -r name height x y dist rest; do
+ case "$name" in \#*|"") continue ;; esac
+ [ "$name" = "${FILE}.jpg" ] && continue # no self links
+ xp=$(pct "$x" "$W"); yp=$(pct "$y" "$H")
+ cls=$(edge_classes "$(ipct "$x" "$W")" "$(ipct "$y" "$H")")
+ base="${name%.jpg}"
+ pt=$(title_of "$base")
+ d=$(fmt_dist "$dist")
+ echo "<li class=\"mk photo $cls\" id=\"pid_${j}\" style=\"--x:${xp}%;--y:${yp}%\"><a href=\"#pid_${j}\" aria-label=\"${pt}, distance ${d}\"><span class=\"dot\"></span><span class=\"pop thumb\"><img src=\"thumbs/${name}\" alt=\"${pt}\"><span class=\"cap\">${pt} &middot; <span class=\"dist\">${d}</span></span></span></a></li>"
+ j=$((j + 1))
+ done < "$IMGS"
+fi
+
+cat << EOF
+</ul>
+</div>
+</div>
+EOF
+
+# related images: other images in which this one also appears
+rel=$(awk -F'\t' -v n="${FILE}.jpg" '$1 == n { print FILENAME; exit }' \
+ gipfelweb/gipfel/*.imgs 2>/dev/null || true)
+if [ -n "$rel" ]; then
+ echo '<section class="related"><h2>Visible on these images</h2>'
+ for f in $rel; do
+ img=$(basename "${f%.imgs}")
+ [ "$img" = "$FILE" ] && continue
+ echo "<a href=\"${img}.html\"><img src=\"thumbs/${img}.jpg\" alt=\"${img}\" loading=\"lazy\"></a>"
+ done
+ echo '</section>'
+fi
+
+cat << EOF
+</main>
+<footer>
+Hover the markers for details &middot; on touch devices, tap them.
+<br />
+Created with <a href="https://flpsed.org/gipfel.html">gipfel</a>
+</footer>
+</body>
+</html>
+EOF
diff --git a/examples/style.css b/examples/style.css
new file mode 100644
index 0000000..946e83f
--- /dev/null
+++ b/examples/style.css
@@ -0,0 +1,203 @@
+/* gipfelweb stylesheet — modern, CSS-only interaction (no JavaScript).
+ Theme follows the system preference; markers are positioned in
+ percent of the slide so the image can scale freely. */
+
+:root {
+ --bg: #101014;
+ --panel: #1a1a21;
+ --text: #e8e8ee;
+ --muted: #9a9aa6;
+ --accent: #7aa2f7;
+ --chip: #24242e;
+ --chip-hover: #32323e;
+ --label-bg: rgba(16, 16, 20, 0.85);
+ --dot-peak: #ffd54a;
+ --dot-photo: #7ee787;
+ --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
+}
+@media (prefers-color-scheme: light) {
+ :root {
+ --bg: #f2f3f7;
+ --panel: #ffffff;
+ --text: #1d1d24;
+ --muted: #61616c;
+ --accent: #2b5fb8;
+ --chip: #e2e3ea;
+ --chip-hover: #d2d3dd;
+ --label-bg: rgba(255, 255, 255, 0.92);
+ --dot-peak: #d97706;
+ --dot-photo: #15803d;
+ --shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
+ }
+}
+
+* { box-sizing: border-box; }
+
+body {
+ margin: 0;
+ background: var(--bg);
+ color: var(--text);
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
+ line-height: 1.5;
+}
+
+header {
+ padding: 1rem 1.25rem 0.5rem;
+}
+header h1 {
+ margin: 0 0 0.5rem;
+ font-size: 1.35rem;
+ font-weight: 650;
+}
+header a { color: var(--accent); text-decoration: none; }
+header a:hover { text-decoration: underline; }
+
+/* ---- control chips (checkbox hack; inputs are visually hidden) ---- */
+main { padding: 0 1.25rem 1.25rem; }
+
+.tgl { position: absolute; opacity: 0; pointer-events: none; }
+.chip {
+ display: inline-block;
+ margin: 0 0.4rem 0.6rem 0;
+ padding: 0.3rem 0.8rem;
+ border-radius: 999px;
+ background: var(--chip);
+ color: var(--text);
+ font-size: 0.85rem;
+ cursor: pointer;
+ user-select: none;
+ transition: background 0.12s;
+}
+.chip:hover { background: var(--chip-hover); }
+.tgl:checked + .chip { background: var(--accent); color: #fff; }
+.tgl:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }
+
+/* ---- image view ---- */
+.pano-wrap {
+ background: var(--panel);
+ border-radius: 10px;
+ box-shadow: var(--shadow);
+ overflow: hidden;
+}
+.pano {
+ position: relative;
+ width: 100%;
+}
+.pano img.slide {
+ display: block;
+ width: 100%;
+ height: auto;
+}
+/* full resolution: natural width, horizontal scroll */
+#t-full:checked ~ .pano-wrap { overflow-x: auto; }
+#t-full:checked ~ .pano-wrap .pano { width: max-content; }
+#t-full:checked ~ .pano-wrap img.slide { width: auto; max-width: none; }
+
+ul.markers { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
+
+.mk { position: absolute; left: var(--x); top: var(--y); }
+.mk > a {
+ display: block;
+ position: static;
+ outline: none;
+}
+.dot {
+ display: block;
+ width: 10px;
+ height: 10px;
+ margin: -5px 0 0 -5px;
+ border-radius: 50%;
+ background: var(--dot-peak);
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
+ opacity: 0.45;
+ transition: opacity 0.12s;
+}
+.mk.photo .dot { background: var(--dot-photo); }
+.pano:hover .dot { opacity: 0.9; }
+.mk:hover .dot, .mk:focus-within .dot, .mk:target .dot { opacity: 1; }
+
+/* popups: hidden until hover / keyboard focus / tap (:target) */
+.pop {
+ position: absolute;
+ bottom: 14px;
+ left: 50%;
+ transform: translateX(-50%);
+ visibility: hidden;
+ opacity: 0;
+ transition: opacity 0.12s;
+ white-space: nowrap;
+ background: var(--label-bg);
+ color: var(--text);
+ border-radius: 8px;
+ padding: 0.25rem 0.6rem;
+ font-size: 0.82rem;
+ backdrop-filter: blur(4px);
+ box-shadow: var(--shadow);
+ z-index: 5;
+}
+/* generator adds .below/.left/.right so popups never leave the image */
+.mk.below .pop { bottom: auto; top: 14px; }
+.mk.left .pop { left: 0; transform: none; }
+.mk.right .pop { left: auto; right: 0; transform: none; }
+
+.mk:hover .pop, .mk:focus-within .pop, .mk:target .pop {
+ visibility: visible;
+ opacity: 1;
+}
+.pop .dist { color: var(--muted); }
+.pop.thumb {
+ padding: 0;
+ background: none;
+ border: 2px solid var(--label-bg);
+}
+.pop.thumb img { display: block; border-radius: 6px; max-width: 480px; }
+.pop.thumb .cap {
+ position: absolute;
+ left: 0; right: 0; bottom: 0;
+ margin: 0;
+ padding: 0.2rem 0.5rem;
+ font-size: 0.75rem;
+ background: var(--label-bg);
+ border-radius: 0 0 4px 4px;
+}
+
+/* view toggles */
+#t-peaks:not(:checked) ~ .pano-wrap .peak { display: none; }
+#t-photos:not(:checked) ~ .pano-wrap .photo { display: none; }
+#t-labels:checked ~ .pano-wrap .pop.label { visibility: visible; opacity: 1; }
+
+/* ---- cross links & footer ---- */
+.related { margin-top: 1.25rem; }
+.related h2 { font-size: 0.95rem; color: var(--muted); font-weight: 550; }
+.related a { display: inline-block; margin: 0 0.5rem 0.5rem 0; }
+.related img {
+ display: block;
+ border-radius: 6px;
+ max-width: 300px;
+ height: auto;
+ box-shadow: var(--shadow);
+}
+footer {
+ padding: 0.5rem 1.25rem 2rem;
+ color: var(--muted);
+ font-size: 0.8rem;
+}
+footer a { color: var(--accent); text-decoration: none; }
+
+/* ---- gallery index ---- */
+.gallery {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
+ gap: 1rem;
+}
+.gallery a {
+ display: block;
+ background: var(--panel);
+ border-radius: 10px;
+ overflow: hidden;
+ box-shadow: var(--shadow);
+ text-decoration: none;
+ color: var(--text);
+}
+.gallery img { display: block; width: 100%; height: auto; }
+.gallery .t { display: block; padding: 0.5rem 0.75rem; font-size: 0.9rem; }