/* dollsche.art – Galerie-Theme
   No inline styles anywhere: the CSP only allows style-src 'self'. */

:root {
  --bg: #f6f4f1;
  --fg: #1e1d1b;
  --muted: #6d6a65;
  --accent: #9a3b2a;
  --line: #dcd7d0;
  --card: #fff;
  --header-fg: #fff;
  --max: 1280px;
  --gap: clamp(.75rem, 2vw, 1.25rem);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.65 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--fg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

main.container { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--fg); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / Banner ---------- */

.site-header {
  position: relative;
  color: var(--header-fg);
  background: #2b2925;
  min-height: 9rem;
  display: flex;
  align-items: flex-end;
  z-index: 10;
}
.site-header--large { min-height: min(70vh, 38rem); }

.site-header__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
/* darken the image so the white text stays readable */
.site-header::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.15) 40%, rgba(0,0,0,.65));
  z-index: 1;
}

.site-header__inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--gap);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem 2rem;
}

.brand__name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600; line-height: 1.1;
  letter-spacing: .02em;
}
.site-header--large .brand__name { font-size: clamp(2.5rem, 8vw, 5rem); }
.brand__name a { color: inherit; text-decoration: none; }
.brand__tagline {
  margin: .35rem 0 0;
  font-size: clamp(.9rem, 1.6vw, 1.15rem);
  letter-spacing: .06em;
  opacity: .9;
}
.brand { text-shadow: 0 1px 12px rgba(0,0,0,.5); }

/* ---------- Navigation ---------- */

.site-nav { position: relative; }

.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }

.nav-list { display: flex; gap: .25rem 1.5rem; }
.nav-list > li { position: relative; }
.nav-list a {
  color: var(--header-fg);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: block;
  padding: .4rem 0;
  border-bottom: 2px solid transparent;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.nav-list > li > a:hover, .nav-list > li > a.active { border-bottom-color: currentColor; }

.has-sub > a::after { content: " \25BE"; font-size: .8em; }

/* dropdown */
.nav-sub {
  position: absolute; right: 0; top: 100%;
  min-width: 14rem;
  background: var(--card);
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  padding: .4rem 0;
  visibility: hidden; opacity: 0; transform: translateY(.25rem);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.has-sub:hover > .nav-sub,
.has-sub:focus-within > .nav-sub { visibility: visible; opacity: 1; transform: none; }
.nav-sub a {
  color: var(--fg); text-shadow: none;
  text-transform: none; letter-spacing: 0;
  padding: .45rem 1rem; border: 0;
}
.nav-sub a:hover, .nav-sub a.active { background: var(--bg); color: var(--accent); }

.nav-toggle { display: none; }

@media (max-width: 40rem) {
  .site-header__inner { align-items: flex-start; }
  .site-nav { width: 100%; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(0,0,0,.35); color: #fff;
    border: 1px solid rgba(255,255,255,.6); border-radius: 4px;
    padding: .45rem .8rem; font: inherit; cursor: pointer;
  }
  .nav-toggle__icon, .nav-toggle__icon::before, .nav-toggle__icon::after {
    display: block; width: 1.1rem; height: 2px; background: currentColor; position: relative;
  }
  .nav-toggle__icon::before, .nav-toggle__icon::after { content: ""; position: absolute; }
  .nav-toggle__icon::before { top: -6px; }
  .nav-toggle__icon::after { top: 6px; }

  .nav-list {
    flex-direction: column;
    background: var(--card); border-radius: 4px;
    padding: .5rem 1rem; margin-top: .5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
  }
  .js .nav-list { display: none; }
  .js .nav-toggle[aria-expanded="true"] + .nav-list { display: flex; }
  .nav-list a { color: var(--fg); text-shadow: none; }
  .nav-sub {
    position: static; visibility: visible; opacity: 1; transform: none;
    box-shadow: none; min-width: 0; padding: 0 0 .25rem 1rem; background: none;
  }
  .has-sub > a::after { content: ""; }
}

/* ---------- Page titles / text ---------- */

.page-title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 1rem; }
.page-intro { max-width: 46rem; margin-bottom: 1.5rem; }

.text-page { max-width: 46rem; }
.text-page h2 { margin-top: 2rem; }

/* filter links above the gallery */
.tag-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem; }
.tag-filter a, .tag {
  display: inline-block;
  padding: .2rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  font-size: .9rem;
}
.tag-filter a:hover, .tag-filter a.active, a.tag:hover {
  border-color: var(--accent); color: var(--accent);
}
.tag-filter a.active { background: var(--accent); color: #fff; }

/* ---------- Gallery ----------
   Justified rows: every image keeps its height, rows are filled left to
   right in date order; only a little is trimmed at the sides to close gaps. */

.gallery {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  gap: var(--gap);
  --row: clamp(11rem, 26vw, 17rem);
}
/* keeps the last row from stretching */
.gallery::after { content: ""; flex-grow: 999; }

.gallery__item { flex-grow: 1; }

.gallery__link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--card);
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  color: var(--fg); text-decoration: none;
}
.gallery__img {
  height: var(--row);
  width: 100%; min-width: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
/* intrinsic width at row height decides how wide an item starts */
.gallery__item { flex-basis: auto; max-width: 100%; }
.gallery__item img { width: auto; }
.gallery__noimg { display: block; height: var(--row); width: 12rem; background: var(--line); }

.gallery__caption {
  display: block;
  padding: .5rem .8rem;
  font-family: var(--serif);
  font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 0; min-width: 100%;
}
@media (hover: hover) {
  .gallery__link:hover .gallery__img { transform: scale(1.03); }
  .gallery__link:hover .gallery__caption { color: var(--accent); }
}
@media (max-width: 30rem) {
  .gallery { --row: auto; }
  .gallery__item { flex-basis: 100%; }
  .gallery__img, .gallery__item img { height: auto; width: 100%; }
}

.gallery__empty { color: var(--muted); }

/* ---------- Single work ---------- */

.werk {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr);
  gap: 1.5rem 2.5rem;
  align-items: start;
}
.werk__main { margin: 0; }
.werk__main img {
  max-height: 85vh; width: auto; margin: 0 auto;
  box-shadow: 0 2px 14px rgba(0,0,0,.12);
}
.werk__title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 .5rem; }
.werk__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  color: var(--muted); margin: 0 0 1.25rem;
}
.werk__meta .tags { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.werk__text { max-width: 40rem; }

.werk__more {
  grid-column: 1 / -1;
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--gap);
}
.werk__more img { width: 100%; border-radius: 3px; }

@media (max-width: 52rem) {
  .werk { grid-template-columns: 1fr; }
}

.werk-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem;
  margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.werk-nav a { text-decoration: none; }
.werk-nav__all { text-align: center; }
.werk-nav__next { text-align: right; }

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0; padding: 0; background: transparent;
  max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(10,10,10,.92); }
.lightbox__img { max-width: 92vw; max-height: 90vh; width: auto; height: auto; }
.lightbox button {
  position: absolute;
  background: none; border: 0; color: #fff;
  font-size: 2.75rem; line-height: 1; cursor: pointer;
  padding: .5rem 1rem; opacity: .8;
}
.lightbox button:hover { opacity: 1; }
.lightbox__close { top: .5rem; right: .5rem; }
.lightbox__prev { left: .25rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: .25rem; top: 50%; transform: translateY(-50%); }
.lightbox--single .lightbox__prev, .lightbox--single .lightbox__next { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding-top: 1.5rem; padding-bottom: 1.5rem;
}
.site-footer p { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
