/* ════════════════════════════════════════════════════
   OTTO BERNDT STEFFEN — styles.css
   Design-System: Gormley / Chipperfield
   #111 · #888 · #fff
   AkzidenzGroteskPro 400
════════════════════════════════════════════════════ */

/* Inter — kostenlos, legal, Google Fonts */

:root {
  --fg:        #111;
  --fg-mid:    #888;
  --fg-light:  #ccc;
  --bg:        #fff;
  --font:      'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --size-caption: 13px;
  --size-nav:     15px;
  --size-brand:   17px;
  --size-title:   22px;

  --page-margin:  clamp(20px, 2.5vw, 40px);
  --col-gap:      64px;
  --row-gap:      160px;
  --banner-h:     36px;
  --header-h:     clamp(52px, 3.8rem, 64px);
  --drawer-w:     300px;
  --cols:         5;
}

html { font-size: calc(0.7rem + 0.3vw); scroll-behavior: smooth; }

@media (max-width: 1200px) { :root { --cols: 4; --col-gap: 48px; --row-gap: 128px; } }
@media (max-width: 900px)  { :root { --cols: 3; --col-gap: 40px; --row-gap: 112px; } }
@media (max-width: 600px)  { :root { --cols: 2; --col-gap: 32px; --row-gap: 88px;  } }
@media (max-width: 400px)  { :root { --cols: 1; --col-gap: 0px;  --row-gap: 72px;  } }

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

body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.37;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img    { display: block; max-width: 100%; }
a      { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; padding: 0; color: inherit; }
*:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

/* ════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════ */
.site-header {
  position: fixed; top: var(--banner-h); left: 0; right: 0;
  height: var(--header-h); z-index: 210;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: transparent; }

.header-inner {
  display: flex; align-items: center; height: 100%;
  padding: 0 var(--page-margin); gap: 1.5em;
  width: 100%;
}

.brand-mark { flex-shrink: 0; display: flex; align-items: center; }
.brand-mark img { height: 28px; width: auto; opacity: .75; transition: opacity .2s; }
.brand-mark:hover img { opacity: 1; }

.brand {
  font-size: var(--size-brand); font-weight: 400;
  letter-spacing: .02em; color: var(--fg);
  white-space: nowrap; flex-shrink: 0;
}

.header-nav { display: flex; gap: 2em; margin-left: auto; }
.header-nav a {
  font-size: var(--size-nav); font-weight: 400;
  color: var(--fg-mid); letter-spacing: .02em; transition: color .15s;
}
.header-nav a:hover, .header-nav a.active { color: var(--fg); }

.hamburger {
  display: none;
  width: 24px; height: 14px;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}
.hamburger::before, .hamburger span, .hamburger::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 1.5px;
  background: var(--fg); transition: transform .25s, opacity .25s;
}
.hamburger::before { top: 0; }
.hamburger span    { top: 50%; transform: translateY(-50%); }
.hamburger::after  { bottom: 0; }
.hamburger[aria-expanded="true"]::before { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span    { opacity: 0; transform: translateY(-50%) scaleX(0); }
.hamburger[aria-expanded="true"]::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .header-nav  { display: none; }
  .hamburger   { display: flex; align-items: center; }
  .header-inner { justify-content: space-between; }
  .brand        { flex: 0 1 auto; }
}

/* ════════════════════════════════════════════════════
   DRAWER
════════════════════════════════════════════════════ */
.drawer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.drawer[aria-hidden="false"] { pointer-events: all; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(17,17,17,.3); opacity: 0; transition: opacity .3s; }
.drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; left: 0;
  width: var(--drawer-w); height: 100%;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1); overflow-y: auto;
}
.drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--page-margin); height: var(--header-h); flex-shrink: 0; }
.drawer-title { font-size: 13px; color: var(--fg-mid); letter-spacing: .05em; }
.drawer-close {
  font-size: 26px; color: var(--fg);
  transition: color .15s;
  padding: 14px;
  margin: -14px -14px -14px 0;
  cursor: pointer;
  line-height: 1;
}
.drawer-close:hover { opacity: .6; }
.drawer-nav { display: flex; flex-direction: column; padding: 32px var(--page-margin); }
.drawer-nav a { font-size: var(--size-nav); padding: .9em 0; letter-spacing: .02em; transition: color .15s; color: var(--fg-mid); }
.drawer-nav a:first-child { }
.drawer-nav a:hover, .drawer-nav a[aria-current] { color: var(--fg); }

/* ════════════════════════════════════════════════════
   FILTER BAR — Basis-Stile (Layout in work.html inline)
════════════════════════════════════════════════════ */
.filter-group { display: flex; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.filter-label { font-size: var(--size-caption); color: var(--fg-mid); letter-spacing: .06em; margin-right: 12px; white-space: nowrap; line-height: 2.2; }
.filter-btn { font-size: var(--size-caption); letter-spacing: .04em; color: var(--fg-mid); padding: 3px 9px; margin: 2px 1px; border: 1px solid transparent; cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap; background: none; line-height: 1.8; }
.filter-btn:hover  { color: var(--fg); }
.filter-btn.active { color: var(--fg); border-color: var(--fg); }
.filter-divider { display: none; }
.no-results { display: none; padding: 48px var(--page-margin); font-size: var(--size-caption); color: var(--fg-mid); }
.no-results.visible { display: block; }

/* ════════════════════════════════════════════════════
   WORKS GRID
════════════════════════════════════════════════════ */
.works-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
  padding: 32px var(--page-margin) 80px;
}

.work { display: flex; flex-direction: column; opacity: 0; animation: fadeIn .35s forwards; }
.work.hidden { display: none; }
.work:nth-child(1)  { animation-delay: .03s; }
.work:nth-child(2)  { animation-delay: .06s; }
.work:nth-child(3)  { animation-delay: .09s; }
.work:nth-child(4)  { animation-delay: .12s; }
.work:nth-child(5)  { animation-delay: .15s; }
.work:nth-child(6)  { animation-delay: .18s; }
.work:nth-child(7)  { animation-delay: .21s; }
.work:nth-child(8)  { animation-delay: .24s; }
.work:nth-child(9)  { animation-delay: .27s; }
.work:nth-child(10) { animation-delay: .30s; }
.work:nth-child(11) { animation-delay: .33s; }
.work:nth-child(12) { animation-delay: .36s; }
.work:nth-child(13) { animation-delay: .39s; }
.work:nth-child(14) { animation-delay: .42s; }
.work:nth-child(15) { animation-delay: .45s; }
.work:nth-child(16) { animation-delay: .48s; }
.work:nth-child(17) { animation-delay: .51s; }
.work:nth-child(18) { animation-delay: .54s; }
.work:nth-child(19) { animation-delay: .57s; }
.work:nth-child(20) { animation-delay: .60s; }

.work-link { display: block; }
.work-link:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

.work-frame {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: #f5f5f5; overflow: hidden;
}
.work-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center; transition: opacity .3s;
}

.work-caption { margin-top: 8px; }
.work-caption-title {
  display: block; font-size: 13px; font-weight: 400;
  color: var(--fg); line-height: 1.4;
}
.work-caption-year { display: none; }

/* ════════════════════════════════════════════════════
   SERIEN
════════════════════════════════════════════════════ */
.serie-block { padding: 40px var(--page-margin) 0; }
.serie-block + .serie-block { margin-top: 48px; padding-top: 48px; }
.serie-block-header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.serie-block-titel { font-size: 22px; font-weight: 400; letter-spacing: .01em; margin: 0; }
.serie-block-meta { font-size: 12px; color: var(--fg-mid); letter-spacing: .04em; }

/* ════════════════════════════════════════════════════
   VIEWER
════════════════════════════════════════════════════ */
.viewer {
  display: none; position: fixed;
  /* Unter Header+Banner — diese bleiben sichtbar */
  top: calc(var(--banner-h) + var(--header-h));
  left: 0; right: 0; bottom: 0;
  z-index: 190;
  background: #fff; overflow-y: auto; overscroll-behavior: contain;
}
.viewer[aria-hidden="false"] { display: flex; align-items: center; justify-content: center; }

.viewer-inner {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 80px 48px;   /* oben Platz für Kreuz */
  min-height: 100%; width: 100%;
  position: relative;
}

/* Kreuz — absolut im viewer-inner, immer sichtbar */
.viewer-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 28px;
  color: #333;
  padding: 14px;
  transition: color .15s;
  z-index: 5;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 900px) {
  .viewer-close {
    top: 8px; right: 4px;
    font-size: 32px;
    padding: 16px;
    color: #111;
  }
}
.viewer-close:hover { color: #000; }

.viewer-block {
  display: inline-flex; flex-direction: column; align-items: stretch;
  max-width: calc(100vw - 180px); max-height: calc(100vh - 140px);
}

.viewer-stage {
  position: relative; display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 0;
}

.viewer-img {
  display: block; max-width: 100%; max-height: calc(100vh - 180px);
  width: auto; height: auto; object-fit: contain; transition: opacity .2s;
}
.viewer-img.loading { opacity: 0; }

.viewer-meta {
  flex-shrink: 0; padding-top: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.viewer-caption-title {
  font-size: 17px; font-weight: 400; letter-spacing: .01em;
  color: var(--fg); text-align: right;
}
.viewer-caption-sub {
  font-size: 13px; letter-spacing: .04em; color: var(--fg-mid); text-align: right;
  /* Material wird per JS nicht mehr angezeigt, Jahr bleibt */
}
.viewer-caption { display: none; }
.viewer-counter { display: none; }

.viewer-btn {
  position: fixed; top: 50%; transform: translateY(-50%);
  font-size: 40px; line-height: 1; color: #bbb;
  padding: 20px; transition: color .15s; z-index: 2;
}
.viewer-btn:hover { color: var(--fg); }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }

@media (max-width: 900px) {
  .viewer-btn   { font-size: 30px; padding: 12px; }
  .viewer-prev  { left: 4px; }
  .viewer-next  { right: 4px; }
  .viewer-inner { padding: 60px 52px 36px; }
  .viewer-block { max-width: calc(100vw - 110px); }
  .viewer-img   { max-height: calc(100vh - 160px); }
}

/* ════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════ */
.footer-mini { display: flex; gap: 2em; padding: 32px var(--page-margin); margin-top: 56px; }
.footer-mini a { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-mid); transition: color .15s; }
.footer-mini a:hover { color: var(--fg); }

/* ════════════════════════════════════════════════════
   TEXTSEITEN
════════════════════════════════════════════════════ */
.page-wrap, .legal-wrap, .vita-wrap, .kontakt-wrap {
  margin-top: calc(var(--banner-h) + var(--header-h));
  padding: 12px var(--page-margin) 100px;
  max-width: 680px;
  opacity: 0; animation: fadeIn .4s .05s forwards;
}

.page-wrap h1, .legal-wrap h1, .vita-wrap h1, .kontakt-wrap h1 {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .01em;
  margin-bottom: 48px;
  color: var(--fg);
}

.vita-page h1 {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .01em;
  margin-bottom: 24px;
  color: var(--fg);
  padding: 0 var(--page-margin);
}

.page-wrap h2, .legal-wrap h2, .vita-wrap h2 {
  font-size: 13px; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-mid); margin: 40px 0 14px;
  padding-bottom: 10px;
}
.page-wrap h2:first-of-type,
.legal-wrap h2:first-of-type,
.vita-wrap h2:first-of-type { margin-top: 0; }

.legal-wrap h3 {
  font-size: 13px; font-weight: 400; color: var(--fg-mid);
  margin: 28px 0 8px; letter-spacing: .04em;
}
.legal-divider { border: none; margin: 56px 0; }

.page-wrap p, .page-wrap address,
.legal-wrap p, .legal-wrap address {
  font-size: 15px; line-height: 1.75; font-style: normal;
  color: var(--fg); margin-bottom: 8px;
}
.legal-wrap a, .page-wrap a {
  color: var(--fg); border-bottom: 1px solid #ddd; transition: border-color .15s;
}
.legal-wrap a:hover, .page-wrap a:hover { border-color: var(--fg); }

/* ── Vita ── */
.vita-portrait {
  margin-bottom: 48px;
  /* Auf Mobile: volle Breite durch negativen Margin */
  margin-left: calc(-1 * var(--page-margin));
  margin-right: calc(-1 * var(--page-margin));
}
.vita-portrait img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Desktop: Bild begrenzen */
@media (min-width: 700px) {
  .vita-portrait {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 48px;
  }
  .vita-portrait img {
    max-width: 480px;
  }
}
.vita-section { margin-bottom: 48px; }
.vita-row {
  display: grid; grid-template-columns: 96px 1fr;
  gap: 2px 20px; margin-bottom: 6px;
  font-size: 15px; line-height: 1.6;
}
.vita-row-year, .vita-year { color: var(--fg-mid); white-space: nowrap; }
.vita-row-text { color: var(--fg); }
.vita-text     { font-size: 15px; line-height: 1.7; color: var(--fg); margin-bottom: 4px; }
.vita-materials { font-size: 15px; color: var(--fg-mid); line-height: 1.7; }

@media (max-width: 600px) { .vita-row { grid-template-columns: 72px 1fr; } }

/* ── Kontakt ── */
.kontakt-block {
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0 24px;
  align-items: start;
}
.kontakt-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-mid);
  padding-top: 2px;
  white-space: nowrap;
}
.kontakt-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--fg);
}
.kontakt-text a {
  color: var(--fg);
  border-bottom: 1px solid #ddd;
  transition: border-color .15s;
}
.kontakt-text a:hover { border-color: var(--fg); }

@media (max-width: 480px) {
  .kontakt-block {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
}

/* ════════════════════════════════════════════════════
   ANIMATION
════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
