/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --bg: #2f2f2f;
  --bg-2: #252525;
  --text: #f2f2f2;
  --muted: rgba(255, 255, 255, .7);
  --line: rgba(255, 255, 255, .18);
  --header-h: 120px;
  --maxw: 1200px;
}

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

html {
  height: 100%;
  /* iOS Fix for full height */
  height: -webkit-fill-available;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  
  /* Flex Layout for Sticky Footer */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  
  padding-bottom: 40px; 
  
  /* Prevent horizontal scroll on mobile swipe */
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

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

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.site-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-2);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

/* -- Top Bar (Logo + Socials) -- */
.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 18px 10px;
}

.header-left, 
.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  text-align: center;
}

.brand-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo img {
  width: auto;
  height: auto;
  max-width: 540px;
  max-height: 120px;
}

.brand-sub {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: .35em;
  color: var(--muted);
}

/* -- Social Icons -- */
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  opacity: .7;
  transition: opacity .3s ease;
  text-decoration: none;
}

.social:hover { opacity: 1; }

.social img {
  width: 100%;
  height: 100%;
}

/* -- Bottom Bar (Navigation) -- */
.header-bottom {
  border-top: 1px solid var(--line);
  padding: 10px 0 14px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 26px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
  color: var(--text);
  border-bottom-color: var(--line);
}

.nav-link.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 800;
}

/* -- Burger Menu (Hidden on Desktop) -- */
.burger {
  display: none;
  background: transparent;
  border: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  position: relative;
  font-size: 0;
}

.burger span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 28px; }

/* =========================================
   3. MAIN LAYOUT & HERO (FIXED)
   ========================================= */
.site-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--bg);
  position: relative;
  /* Fix layout for iframes to fill space */
  display: flex;
  flex-direction: column;
}

.content-frame {
  width: 100%;
  flex: 1; /* Ensures iframe fills the container */
  border: 0;
  display: block;
}

/* Page Layout (inside iframes or main content) */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  width: 100%;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
}

/* This fixes the "Footer 80%" issue by forcing image to cover the container */
.hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) contrast(1);
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
  z-index: 1;
}

/* =========================================
    Shop-Seite
   ========================================= */
.shop-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh; /* Füllt den Großteil des iFrames */
    padding: 20px;
}

.shop-hero-button {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 400px;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.shop-hero-button:hover {
    transform: scale(1.02);
}

.shop-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6); /* Macht das Bild dunkler, damit man den Text besser liest */
    transition: filter 0.3s ease;
}

.shop-hero-button:hover .shop-bg {
    filter: brightness(0.8);
}

.shop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shop-overlay span {
    color: #ffffff;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    border: 2px solid #ffffff;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .shop-overlay span {
        font-size: 1.2rem;
        padding: 10px 20px;
    }
}

/* =========================================
   4. PORTFOLIO & GALLERY
   ========================================= */
body.portfolio-page {
  align-items: center;
  justify-content: center;
}

.portfolio {
  padding: 40px;
  width: 100%;
}

.portfolio-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.category-card {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  text-decoration: none;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.category-card span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.25);
  transition: background 0.4s ease;
  z-index: 2;
}

.category-card:hover img { transform: scale(1.05); }
.category-card:hover span { background: rgba(0,0,0,0.45); }

/* -- Main Gallery Grid (Desktop) -- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.gallery img {
  height: 400px;
  width: auto;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.gallery .thumb img:hover {
  transform: scale(1.05);
}

.page-footer {
  /* Fixierte Positionierung */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  
  /* Maße */
  height: 40px;
  
  /* Styling & Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: var(--bg);       /* Wichtig: Überdeckt den scrollenden Inhalt */
  border-top: 1px solid var(--line); /* Schicke Trennlinie */
  z-index: 40;                 /* Liegt über Bildern, aber unter dem Header (50) */
  
  /* Text */
  color: rgba(255, 255, 255, .5);
  font-size: 10px;
  letter-spacing: .1em;
}

/* =========================================
   5. LIGHTBOX
   ========================================= */
.lb-clone {
  position: fixed;
  left: 0; top: 0;
  width: 10px; height: 10px;
  object-fit: contain;
  z-index: 10000;
  will-change: transform;
  transform-origin: top left;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 9998;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 95vw;
  max-height: 95vh;
  display: block;
  opacity: 0;
  transition: opacity .12s ease;
}

.lightbox.is-ready .lightbox__img {
  opacity: 1;
}

.lightbox__close,
.lightbox__nav {
  position: fixed;
  border: 0;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  opacity: .85;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 26px;
  z-index: 10001;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

.lightbox__nav:hover, .lightbox__close:hover { opacity: 1; }
.lightbox__nav:active { transform: translateY(-50%) scale(.98); }

.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }

/* =========================================
   6. DESKTOP ENHANCEMENTS (Min-width: 769px)
   ========================================= */
@media (min-width: 769px) {
  .social {
    width: 42px;
    height: 42px;
  }
  .social img {
    width: 26px;
    height: 26px;
  }
}

/* =========================================
   7. MOBILE & TABLET (Max-width: 768px)
   ========================================= */
@media (max-width: 768px) {
  
  /* -- Header Layout Change -- */
  .header-top {
    grid-template-columns: auto 1fr auto; 
    padding: 18px 14px 10px;
  }

  .header-left {
    justify-content: flex-start;
    gap: 14px;
  }

  .header-right {
    justify-content: flex-end;
  }

  .brand-logo img {
    width: min(58vw, 320px);
    max-height: 80px;
  }

  /* -- Navigation (Burger Menu) -- */
  .header-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 0;
  }

  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 12px 0 18px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }

  .nav[data-open="true"] {
    display: flex;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    font-size: 18px;
    letter-spacing: 0.18em;
    padding: 10px 12px;
  }

  /* -- Page & Typography -- */
  .page h1 {
    font-size: 32px !important;
  }

  .page hr {
    margin-bottom: 12px;
  }

  .portfolio {
    padding-top: 16px;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* -- Gallery Masonry (Mobile) -- */
  .gallery {
    display: block;
    column-count: 2;
    column-gap: 12px;
  }

  .gallery > img, 
  .gallery .thumb {
    break-inside: avoid;
    margin-bottom: 12px;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* Reset desktop fixed height */
  .gallery img {
    height: auto;
  }

  /* -- Portfolio Categories Stack -- */
  .portfolio-categories {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2rem 1rem;
  }

  /* -- Lightbox Adjustments -- */
  .lightbox__nav { width: 50px; height: 50px; }
  .lightbox__nav--prev { left: 10px; }
  .lightbox__nav--next { right: 10px; }
}

/* --- 3. Speziell für Mobile noch flacher --- */
@media (max-width: 768px) {
  body {
    padding-bottom: 35px;
  }
  .page-footer {
    height: 35px;
    font-size: 9px;
  }
}