/* ================= Base / Reset ================= */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #111;
  background: #fff;
}

/* ================= Variables ================= */

:root {
  --max-width: 1080px;
  --padding: 24px;

  --color-text: #111;
  --color-muted: #555;
  --color-line: #e6e6e6;
}

/* ================= Typography ================= */

h1, h2, h3 {
  font-weight: 600;
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero-title {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.18;
  letter-spacing: -0.005em;
}

h2 {
  font-size: 18px;
}

p {
  margin: 0;
  color: var(--color-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ================= Layout ================= */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--padding) 64px;
}

/* ================= Header ================= */

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px var(--padding);

  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;

  border-bottom: 1px solid var(--color-line);
}

.brand {
  font-weight: 600;
}

/* Navigation */

.nav {
  display: flex;
  gap: 16px;
}

.nav a {
  color: var(--color-muted);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--color-text);
}

/* Language switch (CV-style) */

.lang {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--color-muted);
}

.lang a {
  color: inherit;
}

.lang a:hover {
  text-decoration: underline;
}

.lang a[aria-current="true"] {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ================= Hero ================= */

.hero {
  margin-bottom: 36px;
}

.lede {
  max-width: 68ch;
  font-size: 18px;
  line-height: 1.6;
}

/* ================= Portrait ================= */

.portrait {
  margin: 0 0 36px;
}

.portrait-figure {
  margin: 0;
  width: 240px; /* Desktop: klein */
}

.portrait-box {
  width: 100%;
  height: 240px;         /* macht die Box sicher quadratisch */
  border: 1px solid var(--color-line);
  border-radius: 16px;
  overflow: hidden;
  background: #fafafa;
}

.portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* quadratischer Zuschnitt */
  object-position: 50% 50%; /* Fokus nach oben (Gesicht) */
  display: block;
}


/* ================= Sections ================= */

.section-title {
  margin: 32px 0 14px;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ================= Media (Works / Images) ================= */

figure { 
  margin: 0; /* verhindert die automatische Einrückung */
}

figcaption {
  margin-left: 0;
}

.media {
  margin: 0;
  max-width: 72ch;
}

.media img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: #fafafa;
}

.media-caption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-muted);
}

/* --- Optional: Caption nur bei Hover/Fokus zeigen --- */

.media--credit-hover .media-caption {
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.media--credit-hover:hover .media-caption,
.media--credit-hover:focus-within .media-caption {
  opacity: 1;
  transform: translateY(0);
}

/* Touch-Geräte: Caption standardmäßig sichtbar (weil Hover nicht zuverlässig) */
@media (hover: none) {
  .media--credit-hover .media-caption {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

/* ================= Grid / Cards ================= */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--color-line);
  border-radius: 16px;
  min-width: 0;
}

.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  text-decoration: none;
  min-width: 0;
}

.thumb {
  aspect-ratio: 16 / 10;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  box-sizing: border-box;
  background: #fafafa;
}

.thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card h3 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.card p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* ================= Current ================= */

.current ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 32px 0 24px;
}

.current li + li {
  margin-top: 8px;
}

.current em {
  font-style: italic;
}

/* ================= Works Index ================= */

.works-index {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.works-index .work-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
}

.works-index .work-item + .work-item {
  margin-top: 20px;
}

.works-index .work-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  background: #fafafa;
}

.works-index .work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.works-index .work-text {
  min-width: 0;
}

.works-index .work-text a {
  display: inline-block;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.works-index .work-text span {
  display: block;
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .works-index .work-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }

  .works-index .work-thumb {
    width: 48px;
    height: 48px;
  }
}

/* ================= CV ================= */

.block {
  border-top: 1px solid var(--color-line);
  padding-top: 20px;
  margin-top: 32px;
}

.cv-list {
  display: grid;
  gap: 12px;
}

.cv-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
}

.cv-year {
  color: var(--color-muted);
  font-size: 13px;
}

/* ================= Footer ================= */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px var(--padding);
  border-top: 1px solid var(--color-line);
  font-size: 14px;
  color: var(--color-muted);
}

/* ================= Responsive ================= */

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .portrait-figure {
  width: 100%;
  max-width: 320px;
  }

  .portrait-box {
  height: 320px; /* bleibt quadratisch */
  }
}

/* ================= Accessibility ================= */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: #000;
  color: #fff;
  z-index: 9999;
}

.skip-link:focus {
  left: var(--padding);
  top: 12px;
}

/* ================= Text Links ================= */

.text-link {
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.05em;
}

.text-link:hover {
  border-bottom-width: 2px;
}

/* ================= Media ================= */

.media-video {
  width: 100%;
  height: auto;
  display: block;
}

/* ================= Presentation Links ================= */

.presentation-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.presentation-thumb {
  display: inline-block;
  width: 72px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  flex: 0 0 auto;
}

.presentation-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.presentation-linktext {
  display: inline-block;
}

@media (max-width: 480px) {
  .presentation-thumb {
    width: 56px;
  }
}

/* ================= Pairings (Symbiotic Wood) ================= */

#thumbGrid .pair-thumb {
  height: auto;            /* wichtig: nicht fix */
  margin: 0;               /* Grid übernimmt das Spacing */
  border-radius: 12px;
  overflow: visible;
}

#thumbGrid .pair-thumb .thumb-title {
  padding-bottom: 4px;     /* verhindert descender-clipping in Firefox */
}

/* Mobile: 2 Spalten, Titel sichtbar */
@media (max-width: 560px) {
  #thumbGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Documentation helper link */
.doc-link {
  margin: 0 0 24px;
  font-size: 14px;
}
