/* =========================================================
   Fugentechnik Schell – _inc/style.css (sauber & mobil stabil)
   ========================================================= */

/* Base / Reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

:root{
  --brand: #0c3b5e;
  --brand2: #0a3d62;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --wrap: 1100px;
  --radius: 16px;
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: #fff;
}

/* Wrap */
.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header{
  background: var(--brand);
  color: #fff;
}
.site-title{
  display: block;
  text-align: center;
  font-weight: 800;
  font-size: 2.2rem;
  padding: 1rem 0 .5rem;
  letter-spacing: .2px;
}
.site-nav{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem 1rem;
  padding: .75rem 0 1rem;
}
.site-nav a{
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
}
.site-nav a:hover{ text-decoration: underline; }
.site-nav a.active{
  text-decoration: underline;
  font-weight: 800;
}

/* Main */
main{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1rem;
}
h1, h2{ color: var(--brand); line-height: 1.2; }
h1{ margin: 0 0 1rem; }
h2{ margin: 2rem 0 .6rem; }
p{ max-width: 75ch; color: var(--text); }
a{ color: var(--brand); }
a:hover{ text-decoration: underline; }

/* Hero */
.hero{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 2rem 1rem;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(10,61,98,.90) 0%, rgba(10,61,98,.90) 60%, rgba(10,61,98,.0) 60%),
    url("../_pic/20260107-103920.jpg") center/cover no-repeat;
}
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(12,59,94,.35);
}
.hero > div{
  position: relative;
  z-index: 1;
  max-width: 75ch;
}
.hero h1{ color:#fff; margin:0 0 .5rem; }
.hero p{ color:#fff; margin:0; opacity:.95; }

/* CTA */
.cta{
  display:inline-block;
  padding: .65rem 1.1rem;
  border-radius: 10px;
  background:#fff;
  color: var(--brand);
  text-decoration:none;
  font-weight: 800;
}
.cta:hover{ background:#eef2f7; }

/* Referenzen Grid */
.ref-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.ref-item{
  display:block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

.ref-item img{
  width:100%;
  aspect-ratio: 4 / 3;   /* verhindert Riesenhöhe */
  object-fit: cover;     /* schöne, einheitliche Kacheln */
  background: #f1f5f9;
}

.ref-cap{
  display:block;
  padding: 10px 12px;
  font-size: .95rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* Vorher/Nachher Split */
.ref-split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 10px;
}
.ref-sub{ margin: 8px 0 6px; color: var(--text); }

.tag-vorher .ref-cap::before{
  content:"Vorher · ";
  font-weight: 800;
  color:#9a3412;
}
.tag-nachher .ref-cap::before{
  content:"Nachher · ";
  font-weight: 800;
  color:#166534;
}

/* Footer */
footer{
  background:#f3f4f6;
  padding: 2rem 1rem;
  margin-top: 3rem;
}
footer p{ margin:0; color:#111; }

/* Lightbox (für script.js) */
.lb{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.lb.is-open{ display:block; }
.lb__backdrop{
  position:absolute;
  inset:0;
  background: rgba(2,6,23,.75);
}
.lb__panel{
  position: relative;
  width: min(1100px, calc(100% - 24px));
  height: min(86vh, 820px);
  margin: 7vh auto 0;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.lb__figure{
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  margin: 0;
}
.lb__figure img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b1220;
}
.lb__cap{
  padding: 10px 14px;
  color: rgba(255,255,255,.9);
  font-size: .95rem;
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}
.lb__close{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.lb__nav{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color:#fff;
  font-size: 34px;
  cursor:pointer;
}
.lb__prev{ left: 10px; }
.lb__next{ right: 10px; }

/* Responsive */
@media (max-width: 900px){
  .ref-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref-split{ grid-template-columns: 1fr; }
}
@media (max-width: 520px){
  .site-title{ font-size: 1.75rem; }
  /* Handy: 2 Spalten -> Bilder wirken NICHT riesig */
  .ref-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb__panel{ height: 88vh; margin-top: 6vh; }
}
@media (max-width: 360px){
  .ref-grid{ grid-template-columns: 1fr; }
}
/* ===== MOBILE FIX: Referenzen ===== */
@media (max-width: 768px) {

  .referenzen-hero,
  .page-hero {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 24px 16px;
    box-sizing: border-box;
  }

  .referenzen-hero h1,
  .page-hero h1 {
    font-size: 1.8rem;
    text-align: center;
  }

  .referenzen-hero p,
  .page-hero p {
    text-align: center;
    font-size: 1rem;
  }

  /* Bilder direkt darunter sauber anschließen */
  .gallery img,
  .referenzen img {
    width: 100%;
    height: auto;
    display: block;
  }
}
