/* ============================================================
   STYLE.CSS – Struktur
   ============================================================
   01 Base/Reset + Variablen
   02 Header / Navigation
   03 Main + Headlines
   04 Galerie Grid (Index)
   05 Content Pages (Impressum/Datenschutz)
   06 Buttons / CTA
   07 Viewer (Detailseiten) + Mobile Topbar
   08 Kontakt (Text links, Bilder rechts)
   09 Kontakt Formular
   10 Aufträge (Text links, Bilder rechts)
   11 Workshop (Text links, Bilder rechts)
   12 Footer
   13 Responsive Breakpoints
   ============================================================ */


/* ============================================================
   01 Base / Reset
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

:root{
  --bg: #f8ebdd;
  --ink: #111;
  --brand: #977b6b;
  --paper: #ffffff;

  /* Galerie */
  --card-max: 620px;
  --grid-gap: 24px;
  --grid-gap-mobile: 20px;

  --grid-cols: 3;

  --grid-max-width: calc(
    (var(--grid-cols) * var(--card-max)) +
    ((var(--grid-cols) - 1) * var(--grid-gap))
  );

  /* Detailseiten-Viewer */
  --viewer-max: 1000px;

  /* Innenrahmen in Galerie-Thumbnails */
  --frame: 5px;

  /* UI */
  --radius: 14px;
  --line: rgba(0,0,0,0.10);
  --soft: rgba(255,255,255,0.55);
  --soft-2: rgba(255,255,255,0.80);

  /* Aufträge/Kontakt/Workshop Bildgröße */
  --auftrag-img-w: 856px;
  --auftrag-img-h: 470px;
  --auftrag-panel-pad: 18px;

  /* Panelbreite rechts so, dass INNEN genau 856px möglich sind */
  --auftrag-col-max: calc(var(--auftrag-img-w) + (var(--auftrag-panel-pad) * 2));
}

body{
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
}

/* Sicherheitsnetz: Bilder können immer schrumpfen */
img{
  max-width: 100%;
  height: auto;
  display: block;
}


/* ============================================================
   02 Header
   ============================================================ */
.header{
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(151, 123, 107, 0.92);
  color: var(--bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.header-inner{
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 22px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.nav{
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link{
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
  letter-spacing: 0.03em;
  position: relative;
}

.nav-link:hover{ opacity: 1; }

.nav-link[aria-current="page"]{
  opacity: 1;
  font-weight: 600;
}

.nav-link[aria-current="page"]::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: currentColor;
  opacity: 0.8;
}


/* ============================================================
   03 Main + Headlines
   ============================================================ */
main{
  padding: 20px 20px 80px;
}

.gallery-header{
  padding: 18px 0 6px;
  text-align: center;
}

h1{
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.08em;
  color: var(--brand);
  text-align: center;
}

h2{
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
}


/* ============================================================
   04 Galerie Grid
   ============================================================ */
.grid{
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;

  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  justify-content: start;
}

.card{
  width: 100%;
  max-width: var(--card-max);
  display: block;
  text-decoration: none;
  color: inherit;
}

.card:focus-visible{
  outline: 2px solid rgba(151,123,107,0.7);
  outline-offset: 6px;
  border-radius: 6px;
}

.thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.thumb::after{
  content: "";
  position: absolute;
  inset: 0;
  border: var(--frame) solid var(--paper);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.card:hover .thumb::after,
.card:focus-visible .thumb::after{
  opacity: 1;
}

@media (hover: hover) and (pointer: fine){
  .card:hover .thumb img,
  .card:focus-visible .thumb img{
    transform: scale(1.15);
  }
}

.title{
  text-align: center;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
}


/* ============================================================
   05 Content Pages (Impressum / Datenschutz / etc.)
   ============================================================ */
.page{
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.page-center{ justify-items: center; }

.page-hero,
.panel{
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.25);
}

.panel h2{ margin-top: 28px; }
.panel h2:first-child{ margin-top: 0; }

.panel p{ margin-bottom: 18px; }

.page-hero-center{
  width: 100%;
  max-width: 980px;
}

.page-lead{
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  opacity: 0.92;
}

.muted{
  margin: 10px 0 0;
  opacity: 0.85;
}


/* ============================================================
   06 Buttons / CTA
   ============================================================ */
.cta-row{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.65);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.cta:hover{ background: rgba(255,255,255,0.90); }
.cta.secondary{ background: transparent; }
.cta.secondary:hover{ background: rgba(255,255,255,0.35); }


/* ============================================================
   07 Viewer (Detailseiten) – Topbar links/rechts bündig
   ------------------------------------------------------------
   Erwartetes HTML im Viewer:
   <div class="viewer">
     <div class="viewer-topbar">
       <a class="cta secondary viewer-gallery" ...>...</a>
       <div class="viewer-controls"> ... </div>
     </div>
     <div class="viewer-frame"> ... </div>
   </div>
   ============================================================ */
.viewer{
  width: min(var(--viewer-max), 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

/* Topbar: links Galerie, rechts Controls – 1 Zeile */
.viewer-topbar{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

/* Galerie-Link wie Button */
.viewer-gallery{
  border: 1px solid var(--line);
  background: var(--soft);
}

/* Controls rechts – immer nebeneinander */
.viewer-controls{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.viewer-controls button{
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.viewer-controls button:hover{ background: var(--soft-2); }

.viewer-controls button:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.viewer-counter{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: 0 10px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--soft);
  color: var(--brand);

  font-weight: 600;
  white-space: nowrap;
  min-width: 64px;
}

/* Bild */
.viewer-frame{
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.viewer-frame img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

/* Für sehr schmale Geräte: Text ausblenden, Pfeile bleiben */
.btn-icon{ display: inline-block; }
.btn-text{ display: inline-block; }


/* ============================================================
   08 Kontakt – Layout (Text links, Bilder rechts)
   ============================================================ */
.contact-layout{
  display: grid;
  gap: 40px;
  align-items: stretch;
  grid-template-columns: 1fr clamp(260px, 34vw, var(--auftrag-col-max));
}

.contact-left{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-right{
  padding: var(--auftrag-panel-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.25);
}

/* Gallery-Wrapper: Main + Thumbs bündig */
.contact-gallery{
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.contact-main{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f8;
}

.contact-thumbs{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.thumb-btn{
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
}

.thumb-btn img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f8;
  opacity: 0.9;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.thumb-btn:hover img{
  opacity: 1;
  transform: translateY(-1px);
}

.thumb-btn:focus-visible{
  outline: 2px solid rgba(151,123,107,0.7);
  outline-offset: 4px;
}

.thumb-btn.is-active img{ opacity: 1; }


/* ============================================================
   09 Kontakt – Formular
   ============================================================ */
.form-panel{ width: 100%; }
.form-wrap{ width: 100%; }

.form{
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field{ display: grid; gap: 6px; }

.field label{
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

.field input,
.field textarea{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  font: inherit;
  color: var(--ink);
  outline: none;
}

.field textarea{
  resize: vertical;
  min-height: 180px;
}

.field input:focus,
.field textarea:focus{
  border-color: rgba(151,123,107,0.55);
  box-shadow: 0 0 0 4px rgba(151,123,107,0.12);
}

.form-actions{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.form-hint{ opacity: 0.8; font-size: 14px; }

.form-legal{
  font-size: 14px;
  line-height: 1.6;
}

.brand-inline{
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.brand-inline:hover{ text-decoration: underline; }

.honeypot{
  position: absolute;
  left: -9999px;
  height: 1px;
  width: 1px;
  opacity: 0;
}


/* ============================================================
   10 Aufträge – Layout (Text links, Bilder rechts)
   ============================================================ */
.auftrag-layout{
  display: grid;
  gap: 40px;
  align-items: stretch;
  grid-template-columns: 1fr clamp(260px, 34vw, var(--auftrag-col-max));
}

.auftrag-left{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

.auftrag-right{
  padding: var(--auftrag-panel-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.25);
}

.auftrag-right-stack{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auftrag-right img{
  width: 100%;
  max-width: var(--auftrag-img-w);
  aspect-ratio: 856 / 470;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f8;
}

/* Aufträge: Steps */
.steps{
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.step{
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.22);
}

.step-title{
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
  margin-bottom: 4px;
}

.step-text{
  opacity: 0.88;
  line-height: 1.6;
}

.cta-panel .cta{ margin-top: 12px; }


/* ============================================================
   11 Workshop – Layout (Text links, Bilder rechts)
   ============================================================ */
.workshop-layout{
  display: grid;
  gap: 40px;
  align-items: stretch;
  grid-template-columns: 1fr clamp(260px, 34vw, var(--auftrag-col-max));
}

.workshop-left{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.workshop-right{
  padding: var(--auftrag-panel-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.25);
}

.workshop-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 22px;
  justify-items: start;
  align-content: start;
}

.workshop-grid img{
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f8;
}


/* ============================================================
   12 Footer
   ============================================================ */
.site-footer{
  background-color: rgba(151, 123, 107, 0.55);
  color: #fff;
  padding: 28px 20px;
  margin-top: 64px;
}

.footer-inner{
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a{
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
}
.footer-links a:hover{ opacity: 1; }


/* ============================================================
   13 Responsive
   ============================================================ */

/* Galerie: 3 → 2 Spalten */
@media (max-width: 1200px){
  :root{ --grid-cols: 2; }
}

/* Allgemeine Layout-Brüche (Kontakt/Workshop/Aufträge) */
@media (max-width: 980px){
  .workshop-layout,
  .contact-layout,
  .auftrag-layout{
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
  }

  .workshop-grid img,
  .auftrag-right img{
    max-width: 100%;
  }
}

/* Mobile */
@media (max-width: 640px){
  :root{ --grid-cols: 1; }

  .header-inner{
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    gap: 12px;
  }

  .nav{
    width: 100%;
    justify-content: center;
    gap: 16px;
  }

  main{ padding: 16px 16px 64px; }

  .gallery-header{ padding: 14px 0 6px; }

  h1{
    font-size: 28px;
    margin: 0 0 14px;
  }

  .grid{
    max-width: 100%;
    gap: var(--grid-gap-mobile);
    justify-content: center;
  }

  .page{ max-width: 100%; }

  .form-wrap{ max-width: 100%; }

  .form-grid{
    grid-template-columns: 1fr;
  }

  .site-footer{ padding: 22px 16px; }

  .footer-inner{
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}

/* Viewer Mobile: kompakter, weiterhin eine Zeile */
@media (max-width: 520px){
  .viewer-topbar{ gap: 8px; }
  .viewer-controls{ gap: 6px; }

  .viewer-controls button{
    padding: 6px 8px;
    font-size: 14px;
    line-height: 1;
  }

  .viewer-counter{
    height: 28px;
    padding: 0 8px;
    min-width: 52px;
    font-size: 14px;
    line-height: 1;
  }

  .viewer-gallery{
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1;
  }
}

/* Sehr schmal: Texte ausblenden, Pfeile bleiben */
@media (max-width: 420px){
  .btn-text{ display: none; }
  .viewer-counter{ min-width: 48px; }
}

/* Sehr klein: Kontakt thumbs 2er-grid */
@media (max-width: 520px){
  .contact-thumbs{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* ============================================================
   FIX: Aufträge – gleiche Box-Abstände wie Workshop
   ============================================================ */

/* 1) Aufträge-Content links als Stack mit definiertem Abstand */
.auftrag-left{
  display: flex;
  flex-direction: column;
  gap: 18px; /* <- Stellschraube: 16/18/20, je nach Geschmack */
}

/* 2) Damit der "Ablauf"-Block (Steps) nicht extra Luft addiert */
.steps{
  margin-top: 0; /* war vorher oft 14px -> macht Abstände uneinheitlich */
}

/* 3) Falls irgendwo Panels noch Default-Margins reinwerfen (sicher) */
.auftrag-left > *{
  margin: 0;
}
