/* WTL (Web Template Library) hub: shared look for every hub page (not the templates; each template has its own style).
   Layout concept: a photographer's lightbox. Sections are film rolls, every item is a numbered frame. */
:root {
  --bg: #eef1f4;          /* lightbox glow */
  --panel: #ffffff;       /* slide mount */
  --panel-2: #f6f8fa;
  --ink: #14171c;
  --ink-2: #5a6370;
  --line: #d4dae1;
  --pencil: #d2302a;      /* grease pencil red, the one accent */
  --pencil-soft: #d2302a1a;
  --amber: #b9741a;       /* film-edge print, used for small labels only */
  --shadow: 0 1px 0 #ffffff inset, 0 1px 2px #14171c14, 0 8px 24px -12px #14171c33;
  --display: "Trusted", "Arial Narrow", Impact, sans-serif;
  --body: "Trusted", "Helvetica Neue", Arial, sans-serif;
  --mono: "Trusted", ui-monospace, Menlo, monospace;
  --hand: "Trusted", "Marker Felt", cursive;
  --r: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120d0c; --panel: #1b1413; --panel-2: #221917; --ink: #f3e9e4; --ink-2: #ab9893;
    --line: #362a28; --pencil: #ff5245; --pencil-soft: #ff52451f; --amber: #e7a54a;
    --shadow: 0 1px 0 #ffffff0a inset, 0 10px 30px -14px #000000cc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #120d0c; --panel: #1b1413; --panel-2: #221917; --ink: #f3e9e4; --ink-2: #ab9893;
  --line: #362a28; --pencil: #ff5245; --pencil-soft: #ff52451f; --amber: #e7a54a;
  --shadow: 0 1px 0 #ffffff0a inset, 0 10px 30px -14px #000000cc;
  color-scheme: dark;
}

@font-face { font-family: "Trusted"; src: url("../fonts/Trusted.woff2") format("woff2"), url("../fonts/Trusted.woff") format("woff"); font-display: swap; }
/* code keeps the computer's own monospace font: Trusted is small caps, which hides upper/lower case */
pre, code, .code, textarea.code, kbd { font-family: ui-monospace, Menlo, Consolas, monospace; }
html { font-synthesis: none; }   /* Trusted has one weight; no fake bold */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--body); font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1320px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut-r); }

/* ---------- top bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 58px; position: relative; }
.mark { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.mark-logo { height: 26px; width: auto; display: block; }
.topbar .lang { margin-left: 0; }
/* search: a pill in the bar; the results open as a card under it (made in hub.js findSetup) */
.find-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 14px; min-width: 220px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: 14px; cursor: pointer; transition: border-color .2s, color .2s; }
.find-btn:hover, .find-btn[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.find-btn svg { width: 16px; height: 16px; flex: none; }
.find-btn .find-label { flex: 1; text-align: left; }
.find-btn kbd { font: 400 12px/1 var(--mono); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); }
@media (max-width: 700px) { .find-btn { min-width: 0; width: 40px; padding: 0; justify-content: center; } .find-btn .find-label, .find-btn kbd { display: none; } }
.find { position: absolute; top: calc(100% + 8px); right: var(--gut-r); width: min(460px, calc(100vw - 32px)); z-index: 30;
  padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -24px #0009; animation: nav-in .3s var(--ease); }
.find .search { display: block; }
.find-list { max-height: min(60vh, 520px); overflow-y: auto; margin-top: 8px; display: grid; gap: 2px; }
.find-head { font-size: 12px; color: var(--ink-2); padding: 10px 8px 4px; }
.find-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.find-row:hover, .find-row.on { background: var(--panel-2); }
.find-row img, .find-row i { width: 64px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 5px; flex: none; background: var(--line); }
.find-row span { display: grid; gap: 2px; min-width: 0; }
.find-row b { font-weight: 400; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-row small { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-more { display: block; margin-top: 6px; padding: 10px 8px; border-top: 1px solid var(--line); color: var(--pencil); text-decoration: none; font-size: 14px; }
.find-empty { margin: 0; padding: 14px 8px; color: var(--ink-2); font-size: 14px; }
/* hamburger: three lines that turn into an X; the menu opens as a card under it, on the right */
.menu-btn { width: 44px; height: 40px; flex: none; display: grid; place-content: center; gap: 5px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); cursor: pointer; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .35s var(--ease), opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav { display: none; position: absolute; top: calc(100% + 8px); right: var(--gut-r); width: min(320px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; gap: 2px;
  padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -24px #0009; }
.nav.open { display: flex; animation: nav-in .3s var(--ease); }
@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } }
.nav a, .nav button.navbtn {
  text-decoration: none; text-align: left; padding: 10px 14px; border-radius: 10px; font-size: 16px;
  border: 0; background: none; cursor: pointer; color: var(--ink); transition: background .2s;
}
.nav a:hover, .nav button.navbtn:hover { background: var(--panel-2); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav .theme-toggle { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 12px; }
.theme-toggle { display: flex; align-items: center; gap: 8px; }
.theme-toggle .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pencil); box-shadow: 0 0 10px var(--pencil); }

/* EN / FR switch: pixel-art look (stepped corners, pixel font, waving pixel flag) */
.lang { --px: 3px; display: inline-flex; flex: none; gap: 2px; padding: 2px; margin-left: 10px; background: var(--line);
  clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px))); }
.lang button { --px: 2px; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--ink-2); font: 400 12px/1 "Trusted", var(--mono); letter-spacing: .06em;
  clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px))); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang button:active { transform: translateY(1px); }
.pxflag { width: 22.5px; height: 16.5px; flex: none; }
.pxflag .f1 { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .lang button:hover .pxflag .f0 { animation: px-a .5s steps(1) infinite; }
  .lang button:hover .pxflag .f1 { animation: px-b .5s steps(1) infinite; }
}
@keyframes px-a { 50% { visibility: hidden; } }
@keyframes px-b { 50% { visibility: visible; } }
@media (max-width: 560px) { .lang button { padding: 0 8px; } }

/* ---------- type ---------- */
.eyebrow { font: 500 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.display { font: 800 clamp(56px, 11vw, 168px)/1 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.h2 { font: 800 clamp(30px, 5vw, 60px)/1.05 var(--display); text-transform: uppercase; }
.h3 { font: 700 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 60ch; }
.hand { font-family: var(--hand); color: var(--pencil); font-size: 1.35em; line-height: 1; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); }

/* ---------- film roll section heads ---------- */
.roll { padding-block: 56px 24px; }
.roll-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: end; margin-bottom: 26px; }
.roll-head .rollno { font: 800 clamp(64px, 9vw, 120px)/.95 var(--display); color: var(--pencil); grid-row: span 2; }
.roll-head .lede { grid-column: 2; }
.sprockets {
  height: 18px; margin-block: 0 22px; border-block: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 0) ,
    repeating-linear-gradient(90deg, transparent 0 14px, var(--line) 14px 26px, transparent 26px 40px);
  -webkit-mask: linear-gradient(#000 0 0) center / 100% 8px no-repeat; mask: linear-gradient(#000 0 0) center / 100% 8px no-repeat;
  opacity: .9;
}
@media (max-width: 600px) { .roll-head { grid-template-columns: 1fr; } .roll-head .rollno { grid-row: auto; } .roll-head .lede { grid-column: 1; } }

/* ---------- frames (cards) ---------- */
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.frame {
  position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 10px 14px;
  box-shadow: var(--shadow); transition: transform .5s var(--ease), border-color .3s;
  min-width: 0;
}
.frame:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--pencil) 45%, var(--line)); }
.frame .shot { position: relative; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--panel-2); max-width: 100%; }
.frame .shot img, .frame .shot video { width: 100%; height: 100%; object-fit: cover; }
.frame .shot video { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.frame:hover .shot video.ready { opacity: 1; }
.frame .meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-inline: 4px; }
.frame .meta .h3 { font-size: 20px; min-width: 0; overflow-wrap: anywhere; }
.frame .fno { font: 500 11px/1 var(--mono); color: var(--amber); letter-spacing: .08em; white-space: nowrap; }
.frame .desc { padding-inline: 4px; font-size: 14px; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding-inline: 4px; }
.tag { font: 500 11px/1 var(--mono); letter-spacing: .04em; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: var(--panel-2); }
.tag.hot { color: var(--pencil); border-color: color-mix(in srgb, var(--pencil) 40%, var(--line)); background: var(--pencil-soft); }

/* grease-pencil circle for favourites */
/* favourite heart: a small frosted dot on the picture, shown on hover (always on touch screens and once circled) */
.fav { position: absolute; top: 18px; right: 18px; z-index: 2; width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid #ffffff38; background: #0c0a0a52; color: #fff; backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 4px 14px -6px #0008; transition: opacity .25s, transform .3s var(--ease), background .2s; }
.fav svg { width: 15px; height: 15px; stroke-width: 1.6; }
.fav:hover { transform: scale(1.08); background: #0c0a0a80; }
.fav[aria-pressed="true"] { background: #fff; border-color: #fff; }
.fav[aria-pressed="true"] svg path { fill: var(--pencil); stroke: var(--pencil); }
@media (hover: hover) and (pointer: fine) {
  .fav { opacity: 0; transform: scale(.9); }
  .frame:hover .fav, .item:hover .fav, .fav:focus-visible, .fav[aria-pressed="true"] { opacity: 1; transform: none; }
}
.frame.is-fav::after {
  content: ""; position: absolute; inset: -6px; border: 2.5px solid var(--pencil); border-radius: 46% 54% 50% 48% / 52% 46% 54% 48%;
  transform: rotate(-1.2deg); pointer-events: none; opacity: .85;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .3s var(--ease), background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.red { background: var(--pencil); border-color: var(--pencil); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; }
.field label { font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
textarea.input { resize: vertical; min-height: 80px; }
.search { position: relative; flex: 1 1 260px; }
.search .input { padding-left: 38px; border-radius: 999px; }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 13px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.note { border-left: 3px solid var(--pencil); padding: 12px 16px; background: var(--pencil-soft); border-radius: 0 8px 8px 0; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }

/* ---------- footer ---------- */
.foot { margin-top: 80px; border-top: 1px solid var(--line); padding-block: 28px 40px; font-size: 13px; color: var(--ink-2); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); translate: -50% 20px; opacity: 0; z-index: 90;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: .35s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- loupe cursor (mouse devices only, toggle in the bar) ---------- */
.loupe { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none; z-index: 100;
  border: 1.5px solid var(--pencil); transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s; mix-blend-mode: normal; }
.loupe::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--pencil); }
.loupe.big { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--pencil-soft); }
html.has-loupe, html.has-loupe a, html.has-loupe button { cursor: none; }
@media (hover: none), (pointer: coarse) { .loupe { display: none; } html.has-loupe, html.has-loupe a, html.has-loupe button { cursor: auto; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
