/* =========================================================
   JERRY GROSCHKE – STYLE.CSS (CLEAN + FIXED HEADER SWITCH)
   ========================================================= */

/* =========================
   1) BASIS / 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;

  /* Standard: 3 Spalten */
  --grid-cols: 3;

  /* Breite, damit Karten + Gaps exakt passen */
  --grid-max-width: calc(
    (var(--grid-cols) * var(--card-max)) +
    ((var(--grid-cols) - 1) * var(--grid-gap))
  );

  /* 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 */
  --auftrag-img-w: 856px;
  --auftrag-img-h: 470px;
  --auftrag-panel-pad: 18px;

  /* Panelbreite rechts: innen 856px möglich */
  --auftrag-col-max: calc(var(--auftrag-img-w) + (var(--auftrag-panel-pad) * 2));

  /* Inlay Desktopbreite */
  --inlay-w: 260px;
}

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; }

/* =========================
   2) 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;
}

/* Desktop: Tagline + Brand nebeneinander */
.brand-group{
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

/* Tagline */
.tagline{
  font-family: "Swanky and Moo Moo", cursive;
  color: rgba(255,255,255,0.92);

  font-size: clamp(27px, 6vw, 36px);
  line-height: 1.15;
  letter-spacing: 0.04em;

  /* Desktop: kein Umbruch */
  white-space: nowrap;
}

/* Brand */
.brand{
  font-family: "Quicksand", sans-serif;
  color: #fff;
  text-decoration: none;
  font-weight: 200;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

/* Desktop Menü: NIE umbrechen */
.nav{
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0; /* verhindert „reinquetschen/überblenden“ kurz vorm Breakpoint */
}

.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;
}

/* =========================
   3) MAIN / HEADLINES
   ========================= */
main{ padding: 20px 20px 80px; }

/* Gallery Header kompakt */
.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);
}

.muted{ margin: 10px 0 0; opacity: 0.85; }

/* =========================
   4) GALERIE GRID (index.html)
   ========================= */
.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);
  }
}

.card:active .thumb img{ transform: none; }

.title{
  text-align: center;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* =========================
   5) PAGE / PANELS / CONTENT
   ========================= */
.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);
}

/* mehr Luft in Panels für Rechtstexte */
.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;
}

/* =========================
   6) BUTTONS / CTA
   ========================= */
.cta-row{
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;   /* kein Umbruch mehr */
  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); }

.bullets{ margin: 10px 0 0; padding-left: 18px; }
.bullets li{ margin: 6px 0; }

/* =========================
   7) VIEWER (Detailseiten)
   ========================= */
.viewer{
  width: min(var(--viewer-max), 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.viewer-topbar{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-gallery{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.viewer-controls{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: 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;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.viewer-controls button:hover{ background: var(--soft-2); }
.viewer-controls button:disabled{ opacity: 0.4; cursor: not-allowed; }

.viewer-counter{
  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;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.viewer-frame{
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.viewer-frame img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

/* =========================
   8) KONTAKT – Layout + Swap-Gallery
   ========================= */
.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);
}

.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; }

/* Formular */
.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;
  color: var(--ink);
  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;
}

/* =========================
   9) WORKSHOP – Layout
   ========================= */
.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;
}

/* =========================
   10) AUFTRÄGE – Layout
   ========================= */
.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;
  gap: 18px;
  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;
}

/* 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) INLAY (Aufträge)
   ========================= */
.inlay-wrap{
  display: grid;
  grid-template-columns: 1fr var(--inlay-w);
  gap: 24px;
  align-items: start;
}

.inlay-side img{
  width: 100%;
  display: block;
  border-radius: 12px;
}

/* =========================
   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
   ========================= */

/* 3 -> 2 Spalten */
@media (max-width: 1200px){
  :root{ --grid-cols: 2; }
}

/* HEADER früher umschalten, damit NICHTS überblendet */
@media (max-width: 1020px){
  .header-inner{
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 18px 16px;
  }

  .brand-group{
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .tagline{ white-space: normal; }

  .nav{
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;     /* Mobile: darf umbrechen */
    white-space: normal;
    gap: 16px;
  }
}

/* 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%; }

  /* Inlay mobile: untereinander */
  .inlay-wrap{
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* 2 -> 1 Spalte + generelle Mobile-Abstände */
@media (max-width: 640px){
  :root{ --grid-cols: 1; }

  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-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 Controls */
@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;
  }

  .contact-thumbs{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px){
  .btn-text{ display: none; }
  .viewer-counter{ min-width: 48px; }
}
