/* Innogrators Bildarchiv — built on the homepage design system.
   Single light visual world by brand decision: no dark-mode variant.
   Tokens mirror src/styles/tokens.css; never hardcode these values below. */

/* Manrope, self-hosted like on the main site. Copy the five woff2 files from
   the homepage repo into assets/fonts/ — the stack falls back gracefully. */
@font-face { font-family: Manrope; src: url("fonts/manrope-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url("fonts/manrope-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url("fonts/manrope-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url("fonts/manrope-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Manrope; src: url("fonts/manrope-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --page-bg: #F1F0EE;
  --white: #FFFFFF;
  --cream: #FFEECF;
  --pale-yellow: #FFF9D1;
  --soft-yellow: #FFE78E;
  --primary-yellow: #FFC900;
  --accent-amber: #FFA700;
  --gold-2: #746200;
  --muted-gold: #947400;
  --olive-deep: #413300;
  --black: #000000;
  --ink: #1F1F1F;
  --ink-2: #272624;
  --gray-rule: #DCDAD5;
  --gray-soft: #E6E5E2;
  --text-mute: #504E4E;

  --r-section: 20px;
  --r-panel: 16px;
  --r-card: 12px;
  --r-button: 8px;
  --r-pill: 50px;

  --gutter: clamp(20px, 1.15vw, 36px);
  --frame-max: clamp(1600px, 95vw, 2520px);
  --content-pad-x: clamp(22px, 5vw, 160px);

  --shadow-card: 0 1px 0 rgba(0,0,0,0.04), 0 12px 32px -16px rgba(31,38,135,0.08);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);

  --font: Manrope, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.1; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
::selection { background: var(--primary-yellow); color: var(--black); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Every panel shares one left/right edge, as on the homepage. */
.frame { width: min(100% - var(--gutter) * 2, var(--frame-max)); margin-inline: auto; }

/* ---------------- login ---------------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: var(--gutter); }
.login {
  background: var(--white);
  border-radius: var(--r-section);
  box-shadow: var(--shadow-card);
  padding: 40px 36px 32px;
  width: min(400px, 100%);
  display: flex; flex-direction: column; gap: 16px;
}
.login h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; }
.login .eyebrow { margin-bottom: -8px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 500; color: var(--text-mute); }
.login input {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--page-bg);
  border: 1.5px solid var(--gray-rule); border-radius: var(--r-button); padding: 12px 14px;
}
.login input:focus-visible { border-color: var(--ink); }
.error { color: #8C2F1E; font-size: 16px; margin: 0; font-weight: 500; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-size: 18px; font-weight: 600; line-height: 1.2;
  padding: 14px 18px; border-radius: var(--r-button);
  border: 0; cursor: pointer; text-decoration: none;
  transition: background-color .25s ease, color .25s ease, transform .2s ease, border-color .25s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary-yellow); color: var(--black); }
.btn-primary:hover { background: var(--soft-yellow); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--black); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(31,31,31,0.22); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(31,31,31,0.45); }
.btn-sm { font-size: 15.5px; padding: 10px 14px; }
.link-text { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; font-size: 16px; }
.link-text:hover { color: var(--gold-2); }

/* ---------------- eyebrow + pills ---------------- */
.eyebrow {
  text-transform: uppercase; font-size: 14px; font-weight: 500;
  letter-spacing: 0.11em; color: var(--muted-gold); margin: 0;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill); font-size: 14px; font-weight: 600;
  padding: 5px 12px; background: var(--white); border: 1px solid var(--gray-rule); color: var(--ink);
}
.pill-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-yellow); }
.pill-on-dark {
  background: rgba(16,14,10,0.14); backdrop-filter: blur(8px);
  color: var(--white); border: 1px solid rgba(255,255,255,0.34);
}

/* ---------------- header ---------------- */
.site-header { margin: 14px auto; }
.header-bar {
  background: var(--white); border-radius: var(--r-panel); box-shadow: var(--shadow-card);
  padding: 20px 28px; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center;
}
.header-bar h1 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -0.01em; }
.header-copy { display: flex; flex-direction: column; gap: 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 16px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.stats b { color: var(--ink); font-weight: 700; }
.spacer { flex: 1 1 auto; }

/* ---------------- toolbar ---------------- */
.bar {
  position: sticky; top: 14px; z-index: 20; margin: 14px auto;
  background: var(--white); border-radius: var(--r-panel); box-shadow: var(--shadow-card);
  padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.bar input[type="search"], .bar select {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--page-bg);
  border: 1.5px solid var(--gray-rule); border-radius: var(--r-button); padding: 11px 14px;
}
.bar input[type="search"] { flex: 1 1 320px; min-width: 240px; }
.bar select { max-width: 300px; }
.seg { display: flex; border-radius: var(--r-button); overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--gray-rule); }
.seg button {
  font: inherit; font-size: 16px; font-weight: 600; border: 0; padding: 11px 16px;
  cursor: pointer; background: transparent; color: var(--text-mute);
  transition: background-color .25s ease, color .25s ease;
}
.seg button[aria-pressed="true"] { background: var(--primary-yellow); color: var(--black); }
.count { margin-left: auto; font-size: 16px; color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* ---------------- grid ---------------- */
.grid {
  display: grid; gap: 16px; margin: 0 auto 40px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  overflow: hidden; display: flex; flex-direction: column;
  cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; border: 0;
  transition: box-shadow .3s ease, transform .3s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 20px 40px -18px rgba(31,38,135,.18); }
.card:active { transform: scale(0.985); }
.thumb { position: relative; aspect-ratio: 3 / 2; background: var(--gray-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pill-on-dark { position: absolute; left: 10px; bottom: 10px; font-size: 12.5px; padding: 4px 10px; }
.meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.rec { font-size: 14px; color: var(--text-mute); display: flex; gap: 10px; font-variant-numeric: tabular-nums; }
.desc { font-size: 16px; line-height: 1.45; }
.chip-cat { font-size: 13.5px; font-weight: 600; color: var(--olive-deep); background: var(--pale-yellow); border-radius: var(--r-pill); padding: 4px 11px; align-self: flex-start; }
.sentinel { height: 40px; }
.empty { padding: 70px 0; text-align: center; color: var(--text-mute); font-size: 18px; }

/* ---------------- detail ---------------- */
dialog {
  border: 0; border-radius: var(--r-section); padding: 0; background: var(--white); color: var(--ink);
  max-width: 1020px; width: calc(100vw - 40px); box-shadow: 0 24px 64px -24px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(31,31,31,.55); }
.dlg { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); }
.dlg-media { background: var(--ink-2); display: grid; place-items: center; }
.dlg-media img, .dlg-media video { width: 100%; max-height: 66vh; object-fit: contain; display: block; }
.dlg-body > .eyebrow:first-child { padding-right: 120px; }  /* clear the close button */
.dlg-body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 80vh; }
.dlg-body h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.005em; }
.kvs { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; font-size: 15px; margin: 0; }
.kvs dt { color: var(--text-mute); font-weight: 500; }
.kvs dd { margin: 0; word-break: break-word; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .pill { cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.chips .pill:hover { background: var(--pale-yellow); border-color: var(--primary-yellow); }
.close {
  position: absolute; top: 14px; right: 16px; z-index: 2; cursor: pointer;
  border: 0; border-radius: var(--r-pill); padding: 8px 16px; font: inherit; font-size: 15px; font-weight: 600;
  background: rgba(16,14,10,0.5); backdrop-filter: blur(8px); color: var(--white);
}
.close:hover { background: rgba(16,14,10,0.72); }

/* ---------------- reveal ---------------- */
html.js [data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal] {
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 90ms);
}
/* Must match the hiding rule's specificity, or the hidden state wins and the grid
   stays blank with the content sitting right there in the DOM. */
html.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 760px) { .dlg { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .header-bar { padding: 18px 20px; }
  .bar { padding: 12px 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 480px) { body { hyphens: auto; overflow-wrap: break-word; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js [data-reveal], html.js [data-reveal].is-in { opacity: 1; transform: none; }
  .card:hover, .btn:hover, .btn:active, .card:active { transform: none; }
}

/* Break-glass password login, tucked away when SSO is the normal route. */
.fallback { border-top: 1px solid var(--gray-rule); padding-top: 14px; margin-top: 2px; }
.fallback summary { cursor: pointer; font-size: 15px; color: var(--text-mute); font-weight: 500; list-style: none; }
.fallback summary::-webkit-details-marker { display: none; }
.fallback summary::before { content: "▸ "; }
.fallback[open] summary::before { content: "▾ "; }
.fallback summary:hover { color: var(--ink); }
.pw-form { display: flex; flex-direction: column; gap: 13px; margin-top: 14px; }
