/* ── portfolio.css ── */

/* ── Header ── */
.portfolio-header {
  padding: 72px var(--page-pad) 56px;
  background: var(--beige-light);
}
.portfolio-header__title {
  font-family: var(--display);
  font-weight: 700; font-style: italic;
  font-size: clamp(48px, 7vw, 100px);
  line-height: 0.98; color: var(--dark-brown); letter-spacing: -0.02em;
}

/* ── Kategorie-Tabs (Ebene 1) ── */
.portfolio-cats {
  background: var(--white);
  padding: 24px var(--page-pad);
  display: flex; gap: 8px; flex-wrap: wrap;
  border-bottom: 0.5px solid rgba(58,36,21,0.12);
  position: sticky;
  top: 61px;
  z-index: 100;
}

.cat-btn {
  font-family: var(--heading);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 20px; background: none;
  border: 0.5px solid rgba(58,36,21,0.22);
  color: var(--brown-mid); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.cat-btn:hover,
.cat-btn--active {
  background: var(--dark-brown); color: var(--beige-light);
  border-color: var(--dark-brown);
}

/* ── Album-Raster (Ebene 2) ── */
.album-view {
  background: var(--white);
  padding: 40px var(--page-pad) 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  min-height: 320px;
}

.album-tile {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.album-tile__img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--beige);
}
.album-tile__img img,
.album-tile__img .photo-placeholder {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.album-tile:hover .album-tile__img img,
.album-tile:hover .album-tile__img .photo-placeholder {
  transform: scale(1.04);
}

.album-tile__label {
  font-family: var(--heading);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark-brown);
}

/* ── Leerer Zustand ── */
.portfolio-empty {
  grid-column: 1 / -1;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--brown-light);
  align-self: center;
  justify-self: center;
  padding: 60px 0;
}

/* ── Foto-Ansicht (Ebene 3) ── */
.photo-view {
  background: var(--white);
  min-height: 60vh;
}
.photo-view.hidden,
.album-view.hidden { display: none; }

.photo-view__header {
  padding: 24px var(--page-pad) 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 0.5px solid rgba(58,36,21,0.12);
  background: var(--white);
  position: sticky;
  top: 61px;
  z-index: 100;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--heading);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-mid);
  background: none;
  border: 0.5px solid rgba(58,36,21,0.22);
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.back-btn:hover { background: var(--dark-brown); color: var(--beige-light); border-color: var(--dark-brown); }
.back-btn__arrow { font-size: 14px; }

.photo-view__title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--dark-brown);
  letter-spacing: 0.01em;
}

/* ── Foto-Raster (Masonry) ── */
.photo-grid {
  padding: 24px var(--page-pad) 80px;
  columns: 3;
  column-gap: 10px;
}

.portfolio-item {
  break-inside: avoid;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: zoom-in;
}
.portfolio-item img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.portfolio-item:nth-child(3n+1) img { height: 360px; }
.portfolio-item:nth-child(3n+2) img { height: 280px; }
.portfolio-item:hover img { transform: scale(1.03); }

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(24,14,6,0.95);
  align-items: center;
  justify-content: center;
}
.lightbox--open { display: flex; }

.lightbox__img-wrap {
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  display: block;
  transition: opacity 0.15s ease;
}

.lightbox__close {
  position: fixed;
  top: 20px; right: 24px;
  background: none; border: none;
  color: rgba(245,240,232,0.6);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color 0.2s;
  z-index: 10;
}
.lightbox__close:hover { color: var(--beige-light); }

.lightbox__nav {
  background: none; border: none;
  color: rgba(245,240,232,0.5);
  font-size: 48px;
  cursor: pointer;
  padding: 16px 20px;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
  user-select: none;
}
.lightbox__nav:hover { color: var(--beige-light); }

.lightbox__counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--heading);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(245,240,232,0.45);
}

@media (max-width: 560px) {
  .lightbox__img-wrap { max-width: calc(100vw - 80px); }
  .lightbox__nav { font-size: 36px; padding: 12px; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .album-view {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }
  .photo-grid { columns: 2; }
}

@media (max-width: 560px) {
  .portfolio-cats { padding: 16px var(--page-pad); gap: 6px; }
  .cat-btn { font-size: 10px; padding: 7px 14px; }
  .album-view {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 24px var(--page-pad) 60px;
  }
  .photo-grid { columns: 1; }
  .photo-view__header { flex-wrap: wrap; gap: 12px; }
}
