/* Ανοιχτή Ψηφιακή Βιβλιοθήκη: styles.
   Earth and stone palette (handoff §7), museum-collection layout, plain CSS.
   Sections: 1 tokens · 2 base · 3 header/footer · 4 components · 5 home · 6 folder/grid · 7 item · 8 viewers · 9 map · 10 pages · 11 motion/a11y */

/* ---------- 1. tokens ---------- */
:root {
  --bg: #F7F4EF;
  --paper: #FCFAF6;
  --surface: #EFE9E1;
  --sand: #D9CBB8;
  --brown: #5B4A3A;
  --brown-deep: #3E3228;
  --ink: #2A231D;
  --muted: #6E6152;            /* secondary text: 5.5:1 on --bg, 5.0:1 on --surface */
  --stone: #9C8F80;            /* borders, icons, decoration only (2.9:1) */
  --line: #E4DACD;
  --line-strong: #CDBFAD;
  --stage: #E9E2D8;
  --stage-dark: #1E1A16;
  --white: #FFFDF9;
  --focus: #5B4A3A;

  /* type colours: only dots, badges, map marks */
  --c-text: #7A5C3E; --c-document: #8C6B3F; --c-photo: #A87718; --c-drawing: #2F5D8A; --c-geo: #3D7A45;
  --c-pointcloud: #6A4C9C; --c-model: #9A3D66; --c-video: #1F7672; --c-audio: #A4452C; --c-table: #56708A;
  --c-link: #5B6B2E; --c-other: #8A8075;

  --serif: 'Noto Serif Display', 'GFS Didot', Georgia, 'Times New Roman', serif;
  --sans: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --page: 90rem;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgb(60 45 30 / .06), 0 8px 24px rgb(60 45 30 / .10);
  --shadow-lift: 0 2px 4px rgb(60 45 30 / .06), 0 14px 34px rgb(60 45 30 / .16);
  --t: 200ms cubic-bezier(.2, .6, .2, 1);
  --row: 12.5rem;              /* justified grid row height */
  --header-h: 4.25rem;
}

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: clamp(100%, 0.92rem + 0.22vw, 118.75%);    /* 16 px on phones → 19 px at 1920 */
  -webkit-text-size-adjust: 100%;
  font-synthesis: none;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font: 400 1rem/1.65 var(--sans);
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--brown); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--brown-deep); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--brown-deep); margin: 0; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 1.35rem + 2.3vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.45rem, 1.15rem + 1vw, 2.05rem); line-height: 1.15; }
h3 { font-size: 1.2rem; line-height: 1.25; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sand); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--brown); color: var(--white); padding: .6rem 1rem; border-radius: var(--radius-s); }
.skip:focus { top: 1rem; }
.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.noscript { padding: 2rem; text-align: center; }

/* boot */
.boot { min-height: 70vh; display: grid; place-content: center; gap: 1.25rem; text-align: center; }
.boot-mark { font: 500 1.6rem/1 var(--serif); color: var(--brown); }
.boot-line { width: 10rem; height: 2px; background: var(--line); position: relative; overflow: hidden; margin: auto; }
.boot-line::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--brown); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- 3. header & footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgb(247 244 239 / .92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--brown-deep); margin-right: auto; min-width: 0; }
.brand-mark { width: 2.1rem; height: 2.1rem; border-radius: 9px; background: var(--brown); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 1.45rem; height: 1.45rem; }
.brand-text { font: 500 1.15rem/1.1 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; font: 400 .72rem/1.3 var(--sans); color: var(--muted); letter-spacing: .01em; }
.nav { display: flex; gap: .25rem; }
.nav a { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .95rem; white-space: nowrap; transition: background var(--t); }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--brown-deep); font-weight: 600; }
.header-search { position: relative; }
.header-search input {
  width: 15rem; padding: .55rem .9rem .55rem 2.4rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--paper); transition: border-color var(--t), width var(--t);
}
.header-search input:focus { border-color: var(--brown); outline: none; box-shadow: 0 0 0 3px rgb(91 74 58 / .15); }
.header-search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* transparent header on the home hero */
body.is-home .site-header { position: absolute; left: 0; right: 0; background: linear-gradient(rgb(20 16 12 / .55), rgb(20 16 12 / 0)); border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.is-home .brand, body.is-home .brand-text small, body.is-home .nav a { color: var(--white); }
body.is-home .brand-text small { opacity: .85; }
body.is-home .brand-mark { background: rgb(255 253 249 / .16); box-shadow: inset 0 0 0 1px rgb(255 253 249 / .35); }
body.is-home .nav a:hover { background: rgb(255 253 249 / .14); }
body.is-home .header-search { display: none; }

@media (max-width: 78rem) {
  .header-search input { width: 11rem; }
  .brand-text small { display: none; }
}
@media (max-width: 60rem) {
  .header-inner { flex-wrap: wrap; gap: .35rem 1rem; padding-block: .6rem; }
  .nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -.6rem; padding-bottom: .1rem; }
  .nav::-webkit-scrollbar { display: none; }
  .header-search input { width: 11rem; }
}
@media (max-width: 30rem) {
  .header-inner { column-gap: .6rem; }
  .brand { gap: .55rem; }
  .brand-text { font-size: 1.02rem; }
  .brand-text small { display: none; }
  .header-search input { width: 2.6rem; padding-right: 0; color: transparent; cursor: pointer; }
  .header-search input:focus { width: 11rem; color: var(--ink); cursor: text; }
}

.site-footer { margin-top: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; padding-block: 2rem 2.4rem; }
.footer-inner a { color: var(--muted); }
.footer-title { font: 500 1.05rem/1.3 var(--serif); color: var(--brown-deep); margin-bottom: .3rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: flex-start; }
.footer-about { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: flex-start; max-width: 52rem; }
.footer-logo-link { flex: none; line-height: 0; }
.footer-logo { height: 41px; width: auto; }
.footer-programme { max-width: 40rem; margin: .1rem 0 .35rem; font-size: .84rem; line-height: 1.45; }
.footer-funders { flex-basis: 100%; display: grid; gap: .8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.footer-funders-text { margin: 0; font-size: .84rem; }
.footer-funders-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2.4rem; }
.footer-funders-logos a { line-height: 0; }
.footer-funders-logos img { width: auto; max-width: 100%; }

/* «Σχετικά» */
.about { max-width: 52rem; }
.about-section { margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.about-section h2 { font: 500 1.35rem/1.25 var(--serif); color: var(--brown-deep); margin: 0 0 .7rem; }
.about-section p { max-width: 44rem; }
.about-facts { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .45rem 1.4rem; margin: .4rem 0 0; }
.about-facts dt { color: var(--muted); }
.about-facts dd { margin: 0; }
.about-list { margin: .9rem 0 0; padding-left: 1.1rem; columns: 2 20rem; column-gap: 2rem; }
.about-list li { break-inside: avoid; margin: 0 0 .35rem; }
@media (max-width: 30rem) { .about-facts { grid-template-columns: 1fr; gap: .1rem; } .about-facts dd { margin-bottom: .5rem; } }

/* ---------- 4. components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.75rem; padding: .55rem 1.15rem; border-radius: 999px;
  border: 1px solid var(--brown); background: var(--brown); color: var(--white);
  text-decoration: none; font-weight: 500; line-height: 1.2; transition: background var(--t), transform var(--t), box-shadow var(--t);
}
.btn:hover { background: var(--brown-deep); color: var(--white); }
.btn.ghost { background: transparent; color: var(--brown-deep); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface); border-color: var(--brown); }
.btn.light { background: var(--white); color: var(--brown-deep); border-color: var(--white); }
.btn.light:hover { background: var(--surface); }
.btn.small { min-height: 2.25rem; padding: .35rem .9rem; font-size: .9rem; }
.btn .sub { font-weight: 400; opacity: .78; font-size: .88em; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid rgb(255 253 249 / .25); background: rgb(30 26 22 / .55); color: var(--white);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background var(--t);
}
.icon-btn:hover { background: rgb(30 26 22 / .8); }
.icon-btn.light { background: rgb(255 253 249 / .9); color: var(--brown-deep); border-color: var(--line); }
.icon-btn.light:hover { background: var(--white); }

.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; letter-spacing: .02em; color: var(--muted); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--c, var(--stone)); flex: none; }
.badge { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .55rem; border-radius: 999px; background: var(--surface); color: var(--brown-deep); font-size: .85rem; border: 1px solid var(--line); }
.badge .icon { color: var(--c, var(--brown)); width: 1.05em; height: 1.05em; }
.sample-tag { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: .85rem; text-decoration: none; background: var(--paper); }
.sample-tag:hover { color: var(--brown-deep); border-color: var(--brown); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem; font-size: .88rem; color: var(--muted); margin: 0 0 .8rem; padding: 0; list-style: none; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brown-deep); text-decoration: underline; }
.crumbs li + li::before { content: '/'; margin-right: .35rem; color: var(--stone); }

.section { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head a { font-size: .95rem; white-space: nowrap; }
.page-head { padding-top: clamp(1.5rem, 4vw, 2.75rem); margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.page-head .lead { color: var(--muted); max-width: 46rem; margin: .6rem 0 0; font-size: 1.05rem; }
.page-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); font-size: .92rem; margin-top: .8rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.4rem; padding: .35rem .95rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: .92rem;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.chip:hover { border-color: var(--brown); }
.chip[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: var(--white); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--white); }
.chip .n { color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: clamp(2.5rem, 8vw, 5rem) 1rem; color: var(--muted); }
.empty h2 { margin-bottom: .5rem; }
.empty .icon { width: 2.4rem; height: 2.4rem; margin: 0 auto 1rem; color: var(--stone); }

.loading { display: grid; place-items: center; gap: .8rem; color: var(--muted); font-size: .92rem; padding: 2rem; text-align: center; }
.loading .bar { width: min(14rem, 60%); height: 2px; background: rgb(156 143 128 / .35); position: relative; overflow: hidden; border-radius: 2px; }
.loading .bar i { position: absolute; inset: 0; width: var(--p, 35%); background: currentColor; transition: width 150ms; }
.loading.indeterminate .bar i { animation: slide 1.1s ease-in-out infinite; }

/* credit line */
.credit { font-size: .88rem; color: var(--muted); line-height: 1.55; }
.credit a { color: var(--muted); }
.credit a:hover { color: var(--brown-deep); }

/* ---------- 5. home ---------- */
.hero { position: relative; min-height: min(92vh, 58rem); display: flex; align-items: flex-end; color: var(--white); background: var(--stage-dark); overflow: hidden; isolation: isolate; }
.hero img.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: heroIn 1.2s ease both; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(20 16 12 / .15) 0%, rgb(20 16 12 / 0) 30%, rgb(20 16 12 / .35) 58%, rgb(20 16 12 / .82) 100%); }
@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.hero-inner { padding-block: 8rem clamp(2.5rem, 7vw, 5rem); width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.hero h1 { color: var(--white); font-size: clamp(2.6rem, 1.4rem + 5.2vw, 5.6rem); font-weight: 500; letter-spacing: -.015em; max-width: 18ch; text-wrap: balance; text-shadow: 0 2px 30px rgb(0 0 0 / .25); }
.hero .sub { font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem); max-width: 38rem; margin: 1rem 0 2rem; color: rgb(255 253 249 / .92); }
.hero-search { display: flex; max-width: 40rem; background: var(--white); border-radius: 999px; box-shadow: 0 10px 40px rgb(0 0 0 / .25); padding: .35rem .35rem .35rem 1.3rem; align-items: center; gap: .6rem; }
.hero-search .icon { color: var(--muted); }
.hero-search input { flex: 1; border: 0; background: transparent; padding: .7rem 0; font-size: 1.08rem; min-width: 0; color: var(--ink); outline: none; }
.hero-search:focus-within { box-shadow: 0 10px 40px rgb(0 0 0 / .25), 0 0 0 3px rgb(255 253 249 / .6); }
.hero-caption { position: absolute; right: var(--gutter); bottom: 1rem; font-size: .78rem; color: rgb(255 253 249 / .75); max-width: 40ch; text-align: right; }
.hero-caption a { color: inherit; }

.intro { display: grid; gap: 1.5rem 3rem; grid-template-columns: 1fr; padding-top: clamp(2rem, 5vw, 3.5rem); }
.intro p.lead { font: 400 clamp(1.2rem, 1rem + .8vw, 1.6rem)/1.45 var(--serif); color: var(--brown-deep); margin: .8rem 0 0; max-width: 48rem; text-wrap: pretty; }
.stats { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-self: end; }
.stat b { display: block; font: 500 clamp(1.8rem, 1.4rem + 1.2vw, 2.6rem)/1 var(--serif); color: var(--brown-deep); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; }
@media (min-width: 64rem) { .intro { grid-template-columns: 1.6fr 1fr; } }

.tiles { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.75rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.tile { text-decoration: none; color: inherit; display: block; }
.tile-media { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface); position: relative; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms cubic-bezier(.2, .6, .2, 1), opacity 250ms; }
.tile:hover .tile-media img { transform: scale(1.035); }
.tile-media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--stone); }
.tile-media .ph .icon { width: 3rem; height: 3rem; stroke-width: 1.2; }
.tile h3 { margin-top: .85rem; font-size: clamp(1.2rem, 1.05rem + .45vw, 1.5rem); transition: color var(--t); }
.tile:hover h3 { color: var(--brown); }
.tile .count { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.tiles.small .tile-media { aspect-ratio: 3 / 2; }
.tiles.small h3 { font-size: 1.12rem; }

.types { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.type-card {
  display: flex; align-items: center; gap: .9rem; padding: .95rem 1.1rem; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.type-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.type-card .ti { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, var(--white)); color: var(--c); flex: none; }
.type-card .ti .icon { width: 1.3rem; height: 1.3rem; }
.type-card b { display: block; font-weight: 600; font-size: .98rem; line-height: 1.25; }
.type-card span { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

.feature { display: grid; gap: 0; border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--surface); grid-template-columns: 1fr; text-decoration: none; color: inherit; border: 1px solid var(--line); }
.feature-text { padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; gap: .8rem; }
.feature-text p { color: var(--muted); margin: 0; max-width: 34rem; }
.feature-art { min-height: 16rem; background: #E6DED2; position: relative; }
.feature-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-width: 48rem) { .feature { grid-template-columns: 1fr 1.2fr; } }
.feature:hover h2 { color: var(--brown); }


/* ---------- 6. folder & justified grid ---------- */
.jgrid { display: flex; flex-wrap: wrap; gap: clamp(.9rem, 1.6vw, 1.4rem) clamp(.75rem, 1.4vw, 1.25rem); }
.jgrid::after { content: ''; flex-grow: 1e4; }
.card {
  --r: 1.3;
  flex: var(--r) 1 calc(var(--r) * var(--row));
  min-width: min(100%, 9.5rem);
  max-width: calc(var(--r) * var(--row) * 1.9);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.card-media { aspect-ratio: var(--r); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); position: relative; transition: box-shadow var(--t), transform var(--t); }
.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 250ms, transform 600ms cubic-bezier(.2, .6, .2, 1); }
.card-media img.in { opacity: 1; }
.card:hover .card-media { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card-media .ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, var(--paper), var(--surface)); color: var(--c, var(--stone)); }
.card-media .ph .icon { width: 2.6rem; height: 2.6rem; stroke-width: 1.25; }
.card-media .ph .ext { position: absolute; bottom: .6rem; left: .7rem; font-size: .72rem; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card-media .flag { position: absolute; top: .55rem; left: .55rem; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 999px; background: rgb(30 26 22 / .62); color: var(--white); font-size: .74rem; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.card-media .flag .icon { width: .95rem; height: .95rem; }
.card-media svg.track { position: absolute; inset: 12%; width: 76%; height: 76%; }
.card-body { padding: .6rem .1rem 0; }
.card-title { font-size: .98rem; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); transition: color var(--t); }
.card:hover .card-title { color: var(--brown); }
.card-meta { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .82rem; margin-top: .25rem; white-space: nowrap; overflow: hidden; }
.card-meta .sep { color: var(--stone); }
@media (max-width: 40rem) { :root { --row: 8.6rem; } .card-title { font-size: .92rem; } }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(11rem, 14rem); gap: 1rem; overflow-x: auto; padding-bottom: .8rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.strip .card { flex: none; max-width: none; scroll-snap-align: start; }
.strip .card-media { aspect-ratio: 4 / 3; }

/* ---------- 7. item page ---------- */
.stage-wrap { background: var(--stage); border-bottom: 1px solid var(--line); }
.stage-wrap.dark { background: var(--stage-dark); border-color: #000; }
.stage { position: relative; height: clamp(20rem, 74vh, 60rem); width: min(100%, 120rem); margin-inline: auto; }
.stage.auto { height: auto; min-height: 12rem; }
.stage-tools { position: absolute; top: .8rem; right: .8rem; z-index: 20; display: flex; gap: .5rem; }
.item-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 15; }
.item-nav.prev { left: .8rem; } .item-nav.next { right: .8rem; }
.stage:fullscreen { height: 100vh; background: var(--stage-dark); }
.stage-wrap:not(.dark) .stage:fullscreen { background: var(--stage); }

.item-body { display: grid; gap: 2rem 4rem; grid-template-columns: 1fr; padding-top: clamp(1.5rem, 3.5vw, 2.5rem); }
@media (min-width: 64rem) { .item-body { grid-template-columns: minmax(0, 1fr) 21rem; } }
.item-main h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem); text-wrap: balance; }
.item-main .badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.item-main .credit-block { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 44rem; }
.credit-block .orig { font-style: italic; color: var(--ink); }
.item-aside { display: flex; flex-direction: column; gap: 1.5rem; }
.details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.2rem; font-size: .93rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-variant-numeric: tabular-nums; }
.downloads { display: flex; flex-direction: column; gap: .5rem; }
.downloads .btn { justify-content: flex-start; }
.downloads .btn .sub { margin-left: auto; padding-left: .8rem; }
.aside-title { font: 600 .8rem/1.2 var(--sans); letter-spacing: .04em; color: var(--muted); margin: 0 0 .6rem; }
.minimap { height: 10rem; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.transcript { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); max-height: 34rem; overflow: auto; white-space: pre-wrap; font-size: .98rem; line-height: 1.75; }

/* ---------- 8. viewers ---------- */
.viewer { position: absolute; inset: 0; }
.viewer.center { display: grid; place-items: center; }
.viewer-img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; padding: clamp(.75rem, 2.5vw, 2rem); }
.viewer iframe { width: 100%; height: 100%; border: 0; background: var(--white); }
.viewer .overlay-msg { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); background: rgb(30 26 22 / .72); color: var(--white); padding: .4rem .9rem; border-radius: 999px; font-size: .82rem; pointer-events: none; transition: opacity 400ms; white-space: nowrap; }
.gate { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; color: inherit; }
.gate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; filter: blur(2px); }
.gate > div { position: relative; display: grid; gap: .9rem; justify-items: center; max-width: 28rem; }
.stage-wrap.dark .gate, .stage-wrap.dark .loading { color: rgb(255 253 249 / .85); }
.none-view { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; }
.none-view > div { display: grid; gap: .9rem; justify-items: center; max-width: 30rem; }
.none-view .big { width: 5rem; height: 5rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--c, var(--brown)); box-shadow: var(--shadow); }
.none-view .big .icon { width: 2.3rem; height: 2.3rem; stroke-width: 1.3; }

dialog.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgb(15 12 10 / .96); color: var(--white); }
dialog.lightbox::backdrop { background: rgb(15 12 10 / .9); }
dialog.lightbox .lb-scroll { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; }
dialog.lightbox img { max-width: 100%; max-height: 100vh; object-fit: contain; cursor: zoom-in; }
dialog.lightbox.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
dialog.lightbox .lb-close { position: fixed; top: 1rem; right: 1rem; }

/* text */
.text-view { position: absolute; inset: 0; overflow: auto; padding: clamp(1.25rem, 4vw, 3rem); }
.text-view .paper { max-width: 46rem; margin: auto; background: var(--white); padding: clamp(1.5rem, 4vw, 3rem); border-radius: var(--radius); box-shadow: var(--shadow); white-space: pre-wrap; line-height: 1.8; }

/* dxf */
.dxf-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel { position: absolute; z-index: 12; background: rgb(252 250 246 / .96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .88rem; }
.layers { top: .8rem; left: .8rem; max-height: calc(100% - 1.6rem); width: min(17rem, calc(100% - 5rem)); display: flex; flex-direction: column; }
.layers header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.layers header button { border: 0; background: none; color: var(--brown); font-size: .82rem; padding: .2rem .3rem; }
.layers ul { list-style: none; margin: 0; padding: .4rem 0; overflow: auto; }
.layers label { display: flex; align-items: center; gap: .6rem; padding: .35rem .9rem; cursor: pointer; }
.layers label:hover { background: var(--surface); }
.layers input { accent-color: var(--brown); width: 1rem; height: 1rem; }
.layers .sw { width: .8rem; height: .8rem; border-radius: 3px; border: 1px solid rgb(0 0 0 / .15); flex: none; }
.layers.collapsed ul { display: none; }
@media (max-width: 40rem) { .layers { width: auto; max-width: calc(100% - 5rem); } }

/* geo / map viewers */
.geo-layout { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; }
.geo-map { position: relative; min-height: 0; }
.geo-panel { background: var(--paper); border-top: 1px solid var(--line); padding: .8rem clamp(1rem, 3vw, 2rem) 1rem; display: grid; gap: .6rem; }
.geo-stats { display: flex; flex-wrap: wrap; gap: .35rem 1.8rem; font-size: .92rem; }
.geo-stats b { font-weight: 600; font-variant-numeric: tabular-nums; }
.geo-stats span { color: var(--muted); margin-right: .3rem; }
.profile { width: 100%; height: 7.5rem; touch-action: none; cursor: crosshair; }
.opacity-ctl { position: absolute; z-index: 1000; left: .8rem; bottom: 1.8rem; display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; }
.opacity-ctl input { accent-color: var(--brown); width: 9rem; }
.map-note { position: absolute; z-index: 1000; left: 50%; top: .8rem; transform: translateX(-50%); padding: .45rem .9rem; font-size: .85rem; }

/* model / point cloud / pano / deep zoom */
model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: radial-gradient(ellipse at 50% 40%, #F3EEE7, #E3DBD0); --progress-bar-color: var(--brown); }
.stage-wrap.dark model-viewer { background: radial-gradient(ellipse at 50% 38%, #3A322B, #16130F); }
.ply-canvas { width: 100%; height: 100%; touch-action: none; }
.hint { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); display: inline-flex; gap: .6rem; align-items: center; padding: .45rem 1rem; border-radius: 999px; background: rgb(30 26 22 / .65); color: var(--white); font-size: .82rem; pointer-events: none; transition: opacity 600ms; white-space: nowrap; }
.pano-box { width: 100%; height: 100%; }
.pnlm-container { background: var(--stage-dark) !important; font-family: var(--sans) !important; }
.pnlm-load-box { background: rgb(30 26 22 / .8) !important; border-radius: var(--radius) !important; }
.osd { position: absolute; inset: 0; }
.zoom-tools { position: absolute; z-index: 20; left: .8rem; bottom: .8rem; display: flex; gap: .4rem; }

/* table */
.table-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--paper); }
.table-bar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.table-bar input { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); min-width: 14rem; }
.table-scroll { flex: 1; overflow: auto; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
table.data th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 600; padding: 0; border-bottom: 1px solid var(--line-strong); z-index: 1; white-space: nowrap; }
table.data th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: .35rem; width: 100%; padding: .6rem .85rem; cursor: pointer; }
table.data th button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
table.data th .icon { width: .9rem; height: .9rem; color: var(--stone); }
table.data th[aria-sort] .icon { color: var(--brown); }
table.data td { padding: .5rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:nth-child(even) td { background: rgb(239 233 225 / .45); }
table.data td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.geo-row { cursor: pointer; }
table.data tr.geo-row:hover td { background: var(--surface); }

/* gallery */
.gallery { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; }
.gallery-main { position: relative; min-height: 0; }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: clamp(.5rem, 2vw, 1.5rem); transition: opacity 220ms; }
.gallery-cap { position: absolute; left: 1rem; bottom: .8rem; color: rgb(255 253 249 / .9); font-size: .85rem; text-shadow: 0 1px 8px rgb(0 0 0 / .6); max-width: 70%; }
.gallery-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem .8rem; background: rgb(0 0 0 / .25); scrollbar-width: thin; }
.gallery-thumbs button { flex: none; width: 5.5rem; height: 3.8rem; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #000; opacity: .65; transition: opacity var(--t), border-color var(--t); }
.gallery-thumbs button[aria-current="true"] { border-color: var(--white); opacity: 1; }
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery .item-nav { top: calc(50% - 2.4rem); }

/* compare */
.compare { position: absolute; inset: 0; display: grid; place-items: center; padding: clamp(.5rem, 2vw, 1.5rem); }
.compare-box { position: relative; max-width: 100%; max-height: 100%; aspect-ratio: var(--ar); height: 100%; overflow: hidden; border-radius: var(--radius-s); user-select: none; }
.compare-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare-box .after { clip-path: inset(0 0 0 var(--pos)); }
.compare-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: var(--white); transform: translateX(-1px); box-shadow: 0 0 12px rgb(0 0 0 / .4); pointer-events: none; }
.compare-knob { position: absolute; top: 50%; left: var(--pos); transform: translate(-50%, -50%); width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--white); color: var(--brown-deep); display: grid; place-items: center; box-shadow: var(--shadow-lift); pointer-events: none; }
.compare-box input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare-box input[type=range]:focus-visible + .compare-knob { outline: 3px solid var(--white); outline-offset: 3px; }
.compare-label { position: absolute; top: .8rem; padding: .25rem .7rem; border-radius: 999px; background: rgb(30 26 22 / .65); color: var(--white); font-size: .8rem; pointer-events: none; }
.compare-label.b { left: .8rem; } .compare-label.a { right: .8rem; }

/* link */
.link-view { position: absolute; inset: 0; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); }
.link-card { display: grid; grid-template-columns: 1fr; max-width: 52rem; width: 100%; background: var(--white); border-radius: calc(var(--radius) + 4px); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; border: 1px solid var(--line); }
.link-card .lc-img { aspect-ratio: 16 / 9; background: var(--surface); display: grid; place-items: center; color: var(--c-link); }
.link-card .lc-img img { width: 100%; height: 100%; object-fit: cover; }
.link-card .lc-img .icon { width: 3.2rem; height: 3.2rem; stroke-width: 1.2; }
.link-card .lc-body { padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: .6rem; }
.link-card .domain { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .88rem; }
.link-card h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.8rem); }
.link-card:hover h2 { color: var(--brown); }
@media (min-width: 48rem) { .link-card { grid-template-columns: 1fr 1.1fr; } .link-card .lc-img { aspect-ratio: auto; min-height: 16rem; } }

/* audio */
.audio-view { position: absolute; inset: 0; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); }
.audio-card { width: min(100%, 40rem); display: grid; gap: 1.25rem; justify-items: center; text-align: center; }
.audio-art { width: 9rem; height: 9rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper); box-shadow: var(--shadow); color: var(--c-audio); overflow: hidden; }
.audio-art img { width: 100%; height: 100%; object-fit: cover; }
.audio-art .icon { width: 3.4rem; height: 3.4rem; stroke-width: 1.2; }
.audio-card audio { width: 100%; }
video.video { width: 100%; height: 100%; background: #000; }

/* ---------- 9. map page ---------- */
.map-page { position: relative; height: calc(100dvh - var(--header-h)); min-height: 28rem; }
.map-page .leaflet-container { position: absolute; inset: 0; }
.map-panel { position: absolute; z-index: 1000; top: 1rem; left: 1rem; width: min(22rem, calc(100% - 2rem)); padding: 1.1rem 1.2rem; }
.map-panel h1 { font-size: 1.6rem; }
.map-panel p { color: var(--muted); font-size: .88rem; margin: .4rem 0 .8rem; }
.map-panel .chips { margin: 0; gap: .4rem; }
.map-panel .chip { min-height: 2.1rem; font-size: .85rem; padding: .25rem .75rem; }
@media (max-width: 40rem) { .map-panel { top: auto; bottom: 1.6rem; } .map-panel p { display: none; } }
.leaflet-container { font-family: var(--sans); background: #E8E1D6; }
.leaflet-container a { color: var(--brown); }
.leaflet-tile-pane { filter: saturate(.82) sepia(.06); }
.leaflet-control-attribution { font-size: .68rem !important; background: rgb(252 250 246 / .85) !important; }
.leaflet-bar a, .leaflet-control-layers { border-color: var(--line) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.leaflet-popup-content { margin: .8rem .9rem; font: 400 .9rem/1.45 var(--sans); }
.pop { display: grid; gap: .5rem; width: 13rem; text-decoration: none; color: var(--ink); }
.pop img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.pop b { font-weight: 600; line-height: 1.3; }
.pop span { color: var(--muted); font-size: .82rem; }
.pop .pop-credit { font-size: .74rem; }
.pop .pop-credit a { color: var(--muted); }
.pm { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 1px 6px rgb(0 0 0 / .35); background: var(--surface) center / cover no-repeat; }
.pm.pt { width: 14px; height: 14px; background: var(--c, var(--brown)); }
.pm-start { width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 4px solid #2E7D32; box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.pm-end { width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 4px solid #B3261E; box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.pm-wpt { width: 10px; height: 10px; border-radius: 50%; background: var(--brown-deep); border: 2px solid var(--white); box-shadow: 0 1px 3px rgb(0 0 0 / .35); }
.leaflet-div-icon { background: none; border: 0; }

/* ---------- 10. search, sources, not found ---------- */
.search-big { display: flex; align-items: center; gap: .7rem; max-width: 44rem; padding: .35rem .5rem .35rem 1.2rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); margin-top: 1.2rem; }
.search-big:focus-within { border-color: var(--brown); box-shadow: 0 0 0 3px rgb(91 74 58 / .15); }
.search-big input { flex: 1; border: 0; outline: 0; padding: .65rem 0; font-size: 1.1rem; background: transparent; min-width: 0; }
.search-big .icon { color: var(--muted); }
.folder-list { display: grid; gap: .5rem; margin-bottom: 2rem; }
.folder-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: var(--radius-s); background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.folder-row:hover { border-color: var(--line-strong); color: var(--ink); }
.folder-row .icon { color: var(--brown); }
.folder-row small { color: var(--muted); margin-left: auto; white-space: nowrap; }

.src-group { margin-top: 2.25rem; }
.src-group h2 { display: flex; align-items: baseline; gap: .7rem; font-size: 1.45rem; margin-bottom: .8rem; }
.src-group h2 small { font: 400 .9rem var(--sans); color: var(--muted); }
.src-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.src-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; letter-spacing: .03em; padding: .4rem .6rem; border-bottom: 1px solid var(--line-strong); }
.src-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.src-table td:first-child a { font-weight: 500; }
@media (max-width: 40rem) { .src-table thead { display: none; } .src-table tr { display: grid; padding: .6rem 0; border-bottom: 1px solid var(--line); } .src-table td { border: 0; padding: .1rem 0; } }
.note-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; color: var(--muted); max-width: 52rem; }

/* ---------- 11. motion & accessibility ---------- */
.fade-in { animation: fadeIn 200ms ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media (hover: none) { .card:hover .card-media { transform: none; box-shadow: none; } .tile:hover .tile-media img { transform: none; } }
@media print { .site-header, .site-footer, .stage-tools { display: none; } }

/* phone refinements */
@media (max-width: 40rem) {
  .hero-caption { display: none; }
  .hero-search { padding-left: 1rem; }
  .hero-search .btn { display: none; }
}
