/* Hodnik ličnosti: the look of the original "Hodnik historije" (warm walls, gold frames) in the fonts of this site (EB Garamond, Inter), scoped to this page.
   The scene is drawn by hodnik.js; this file styles what lies over it: the title, the arrows, the hint, the Gallery / List switch, the list and the dialog. */

.hodnik-page {
  --wall: #FFF9EC; --page: #FFF9EF; --ink: #3A3550; --ink-60: rgba(58, 53, 80, .6); --ink-35: rgba(58, 53, 80, .35);
  --h-serif: var(--serif); --h-mono: var(--sans); --h-cond: var(--serif);
  --u: min(calc(100vw / 1440), calc(100vh / 900)); --w: calc(100vw / 1440);
  height: 100%; overflow: hidden; background: var(--wall); color: var(--ink);
}
@media (max-width: 819px), (orientation: portrait) and (max-width: 1100px), (orientation: landscape) and (max-height: 500px) {
  .hodnik-page { --u: 1px; --w: 1px; }
}
html:has(.hodnik-page) { height: 100%; overflow: hidden; }
:where(.hodnik-page) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.hodnik-page [hidden] { display: none !important; }

#hod { position: fixed; inset: 0; background: var(--wall); color: var(--ink); }

/* the scene */
.gallery-host { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.gallery-host.grabbing { cursor: grabbing; }
.gallery-host.pointer { cursor: pointer; }
.canvas-mount { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s ease; }
.canvas-mount.ready { opacity: 1; }
.canvas-mount canvas { display: block; }
.veil { position: absolute; inset: 0; background: var(--wall); pointer-events: none; opacity: 1; transition: opacity 900ms ease-out; z-index: 2; }
.veil.faded { opacity: 0; }
.open-pill { position: fixed; z-index: 12; background: #1e1b2b; color: #fff; font-family: var(--h-mono); font-size: max(11px, calc(10 * var(--u))); letter-spacing: .14em; line-height: 1; text-transform: uppercase; padding: calc(7 * var(--u)) calc(13 * var(--u)); border-radius: 99px; white-space: nowrap; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.open-pill.visible { opacity: 1; }

/* over the scene */
.gui { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: 1; visibility: visible; transition: opacity .3s ease, visibility .3s ease; }
.gui.hidden { opacity: 0; visibility: hidden; }
.gui button { pointer-events: auto; }
.gui.hidden button { pointer-events: none; }
.mask { display: block; overflow: hidden; }
.rise { display: block; transform: translateY(105%); }
.gui.intro-done .rise { animation: maskRise 1000ms cubic-bezier(.2, .7, .2, 1) calc(250ms + var(--mi) * 60ms) both; }
@keyframes maskRise { from { transform: translateY(105%); } to { transform: translateY(0); } }

.arrows { position: absolute; left: calc(27 * var(--u)); top: calc(262 * var(--u)); display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.arrow-btn { width: max(24px, calc(50 * var(--u))); height: max(24px, calc(50 * var(--u))); border: 1.5px solid var(--ink); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: transparent; transition: background .25s ease, color .25s ease; }
.arrow-btn:hover { background: var(--ink); color: var(--wall); }
.arrow-svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }

.hint { position: absolute; right: calc(27 * var(--u)); bottom: calc(38 * var(--u)); text-align: right; font-family: var(--h-mono); font-size: max(11px, calc(10 * var(--u))); letter-spacing: .12em; line-height: 1.65; text-transform: uppercase; }


.caption { position: absolute; left: calc(25 * var(--u)); right: calc(25 * var(--u)); bottom: calc(30 * var(--u)); }
.kicker-mask { width: max-content; margin: 0 0 calc(10 * var(--u)) calc(3 * var(--u)); }
.kicker { font-family: var(--h-mono); font-size: max(11px, calc(11.5 * var(--u))); letter-spacing: .14em; text-transform: uppercase; }
.headline-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: calc(28 * var(--u)); }
.headline { margin: 0; font-family: var(--h-cond); font-weight: 500; font-size: calc(150 * var(--u)); line-height: .9; letter-spacing: -.015em; white-space: nowrap; }
/* room above the capitals for the accent of Ć, which the mask would otherwise cut off */
.headline .mask { padding-top: .22em; margin-top: -.22em; }
@media (min-width: 820px) and (max-aspect-ratio: 1/1) { .headline { font-size: calc(124 * var(--u)); } }
/* the English title is longer: smaller, so it stays clear of the switch on the right */
html[lang="en"] .headline { font-size: calc(128 * var(--u)); }

/* the list */
.list-section { position: fixed; inset: 0; z-index: 14; background: var(--page); overflow-y: auto; overflow-x: hidden; padding: calc(110 * var(--w)) calc(48 * var(--w)) calc(80 * var(--w)); opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; }
.list-section.open { opacity: 1; pointer-events: auto; visibility: visible; }
.list-header { margin-bottom: calc(36 * var(--w)); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.list-heading { margin: 0; font-family: var(--h-cond); font-weight: 500; font-size: calc(44 * var(--w)); line-height: 1; }
.list-cat + .list-cat { margin-top: calc(64 * var(--w)); }
.list-cat-h { margin: 0 0 calc(24 * var(--w)); padding-top: calc(14 * var(--w)); border-top: 1px solid var(--ink-35); font-family: var(--h-serif); font-weight: 500; font-size: max(22px, calc(30 * var(--w))); line-height: 1.1; }
.list-cat-h span { margin-left: .5em; font-family: var(--h-mono); font-size: max(11px, calc(11 * var(--w))); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-60); vertical-align: middle; }
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(190 * var(--w)), 1fr)); column-gap: calc(48 * var(--w)); row-gap: calc(46 * var(--w)); }
.list-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
/* a 4:5 room for each portrait; the portrait is shrunk to fit, never enlarged */
/* the same gold frame as on the walls, as large as the portrait itself; the portraits stand on one line, so the names below line up */
.hodnik-page { --frame: #D3AA72; --frame-w: 5px; --frame-shadow: 0 14px 28px rgba(120, 90, 50, .24); }
.list-img-wrap { display: flex; align-items: flex-end; justify-content: center; width: 100%; aspect-ratio: 4 / 5; margin-bottom: calc(16 * var(--w)); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.list-card:hover .list-img-wrap { transform: translateY(calc(-4 * var(--w))); }
.list-img { display: block; max-width: calc(100% - 2 * var(--frame-w)); max-height: calc(100% - 2 * var(--frame-w)); width: auto; height: auto; border: var(--frame-w) solid var(--frame); box-shadow: var(--frame-shadow); }
.mono { display: flex; align-items: center; justify-content: center; font-family: var(--h-serif); font-weight: 500; color: rgba(58, 53, 80, .72); }
.list-img.mono { box-sizing: border-box; max-width: 100%; max-height: 100%; height: 100%; aspect-ratio: 3 / 4; background: #F6EAD8; font-size: max(40px, calc(64 * var(--w))); }
.list-title { font-family: var(--h-serif); font-weight: 500; font-size: max(15px, calc(17 * var(--w))); line-height: 1.2; }
.list-artist { font-family: var(--h-serif); font-style: italic; font-size: max(13px, calc(14.5 * var(--w))); color: var(--ink-60); margin-top: calc(2 * var(--w)); }

/* the closing note under the list */
.lic-note { max-width: 40rem; margin-top: calc(80 * var(--w)); padding-top: calc(28 * var(--w)); border-top: 1px solid var(--ink-35); }
.lic-note h2 { margin: 0; font-family: var(--h-serif); font-weight: 500; font-size: max(26px, calc(36 * var(--w))); line-height: 1.1; }
.lic-note p { margin: .7rem 0 0; color: var(--ink-60); }
.lic-mail { display: inline-flex; align-items: center; min-height: 46px; margin-top: 1.2rem; padding: 0 22px; border-radius: 99px; background: var(--ink); color: var(--wall); font-family: var(--h-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }

/* one photograph, opened */
#lb { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 72px calc(48 * var(--w)) 48px; border: 0; background: var(--page); color: var(--ink); overflow: hidden; }
#lb::backdrop { background: rgba(58, 53, 80, .35); }
#lb[open] { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.lb-ph { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
/* never larger than the photograph itself: the natural size, only shrunk to fit */
.lb-ph img { max-width: 100%; max-height: 100%; width: auto; height: auto; border: 8px solid var(--frame); box-shadow: 0 24px 60px rgba(120, 90, 50, .26); }
.lb-txt { max-height: 100%; overflow-y: auto; }
.lb-mono { width: min(360px, 70%); aspect-ratio: 3 / 4; background: #F6EAD8; border: 8px solid var(--frame); box-shadow: 0 24px 60px rgba(120, 90, 50, .26); font-size: clamp(5rem, 10vw, 9rem); }
.lb-cat { margin: 0 0 14px; font-family: var(--h-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-60); }
#lb h2 { margin: 0; font-family: var(--h-cond); font-weight: 500; font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: .98; }
.lb-role { margin: 12px 0 0; font-family: var(--h-serif); font-style: italic; font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.3; }
.lb-tag { display: inline-block; margin: 16px 0 0; padding: .3rem .8rem; border: 1px solid var(--ink); border-radius: 99px; font-family: var(--h-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; }
.lb-tag.origin, .lb-tag.linked { border-color: var(--ink-35); color: var(--ink-60); }
.lb-text { margin: 22px 0 0; font-size: 1.02rem; line-height: 1.7; max-width: 34em; }
.lb-src { display: inline-block; margin-top: 18px; font-size: .8rem; color: var(--ink-60); text-underline-offset: 3px; }
.lb-src:visited { color: var(--ink-60); }
.lb-src:hover { color: var(--ink); }
.lb-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ink-35); }
.lb-nav button { min-height: 44px; padding: 0 16px; border: 1px solid var(--ink-35); border-radius: 99px; font-family: var(--h-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; transition: border-color .2s ease, background .2s ease; }
.lb-nav button:hover { border-color: var(--ink); }
.lb-x { position: absolute; top: 18px; right: calc(48 * var(--w)); min-height: 44px; padding: 0 14px; border-radius: 99px; font-family: var(--h-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.lb-x:hover { text-decoration: underline; }
#lb :focus-visible, .hodnik-page :focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }

@media (max-width: 819px), (orientation: portrait) and (max-width: 1100px), (orientation: landscape) and (max-height: 500px) {
  .hint { top: 76px; left: 16px; right: 16px; bottom: auto; text-align: left; font-size: 11px; }
  .caption { left: 14px; right: 14px; bottom: 100px; }
  .kicker-mask { margin: 0 0 8px 0; }
  .kicker { font-size: 11px; }
  .headline-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .headline { font-size: min(17vw, 15vh); white-space: normal; line-height: .88; }
  html[lang="en"] .headline { font-size: min(14vw, 13vh); }
  .arrows { left: 16px; bottom: 24px; top: auto; flex-direction: row; gap: 8px; }
  .arrow-btn { width: 44px; height: 44px; }
  .arrow-svg { width: 18px; height: 18px; }
  .list-section { padding: 84px 16px 60px; }
  .list-header { margin-bottom: 24px; }
  .list-heading { font-size: 28px; }
  .list-cards { grid-template-columns: repeat(2, 1fr); column-gap: 16px; row-gap: 28px; }
  .list-cat + .list-cat { margin-top: 44px; }
  .list-cat-h { margin-bottom: 18px; padding-top: 12px; }
  .hodnik-page { --frame-w: 4px; }
  .list-img-wrap { margin-bottom: 12px; }
  .list-title { font-size: 15px; }
  .list-artist { font-size: 13px; }
  .lic-note { margin-top: 56px; padding-top: 24px; }
  #lb[open] { display: block; overflow-y: auto; padding: 64px 20px 40px; }
  .lb-ph { height: auto; }
  .lb-ph img { max-height: 62svh; border-width: 6px; }
  .lb-txt { overflow: visible; }
  .lb-mono { width: min(240px, 60vw); margin: 0 auto; }
  .lb-cat { margin: 22px 0 10px; }
  .lb-x { right: 12px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hint { display: none; }
  .caption { bottom: 18px; }
  .headline { font-size: min(11vw, 24vh); white-space: nowrap; }
  .arrows { left: auto; right: 16px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { transform: none; }
  .gui.intro-done .rise { animation: none; }
  .veil, .canvas-mount, .gui { transition: none; }
}
