/* ==========================================================================
   Rangger Schlosserei & Maschinenbau – Stylesheet
   ========================================================================== */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }

/* ---------- Design-Tokens ---------- */
:root {
  --c-primary: #18316e;        /* Logo-Dunkelblau */
  --c-primary-dark: #102350;
  --c-accent: #0099e1;         /* Akzent aus der alten Seite – nur dekorativ / auf Dunkel */
  --c-accent-text: #006fa3;    /* Akzent als Textfarbe auf Hell (AA) */
  --c-steel: #6b7280;
  --c-steel-light: #d7dbe0;
  --c-text: #1f2933;
  --c-text-muted: #4b5563;
  --c-surface: #ffffff;
  --c-surface-alt: #f7f7f5;
  --c-on-dark: #ffffff;
  --c-on-dark-muted: #c9d3e6;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 2px rgb(16 35 80 / .06), 0 8px 24px rgb(16 35 80 / .08);
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --space-section: clamp(3.5rem, 8vw, 6.5rem);
  --header-h: 72px;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 1.125rem; line-height: 1.6; color: var(--c-text); background: var(--c-surface); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; color: var(--c-primary); font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--c-primary); text-underline-offset: .18em; }
a:hover { color: var(--c-accent-text); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; border-radius: 2px; }
address { font-style: normal; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--c-primary); color: #fff; padding: .6rem 1rem; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; color: #fff; }

.eyebrow { font-size: .95rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent-text); margin-bottom: .5rem; }
.lead { font-size: 1.3rem; color: var(--c-text); }
.note { color: var(--c-text-muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.4rem;
  font: 600 1.05rem/1.2 var(--font); text-decoration: none; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-outline { border-color: var(--c-primary); color: var(--c-primary); background: transparent; }
.btn-outline:hover { background: var(--c-primary); color: #fff; }
.btn-light { background: #fff; color: var(--c-primary); }
.btn-light:hover { background: var(--c-surface-alt); color: var(--c-primary-dark); }
.btn-outline-light { border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--c-primary); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / .96); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--c-steel-light); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { display: block; flex: none; }
.brand img { width: auto; height: 44px; border-radius: 3px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.main-nav a { display: block; padding: .6rem .9rem; font-weight: 600; text-decoration: none; color: var(--c-text); border-radius: var(--radius); }
.main-nav a:hover, .main-nav a[aria-current="true"] { color: var(--c-primary); background: var(--c-surface-alt); }
.btn-call { margin-left: auto; }

.nav-toggle { display: none; margin-left: auto; width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 24px; height: 2px; background: var(--c-primary); margin: auto; position: relative; transition: transform .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; } .nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 899px) {
  .nav-toggle { display: block; order: 3; margin-left: 0; }
  .btn-call { order: 2; padding-inline: .9rem; }
  .main-nav { order: 4; flex-basis: 100%; display: none; padding-bottom: .75rem; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: .8rem .5rem; border-bottom: 1px solid var(--c-steel-light); border-radius: 0; }
  .header-inner { flex-wrap: wrap; padding-block: .6rem; min-height: 0; }
}
@media (max-width: 479px) {
  .brand img { height: 36px; }
  .btn-call span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .btn-call { width: 48px; padding: 0; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--c-surface-alt), var(--c-surface)); padding-block: clamp(2rem, 6vw, 5rem); }
.hero-inner { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero-media { margin: 0; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 45fr 55fr; }
}

/* ---------- Vertrauensleiste ---------- */
.trust { background: var(--c-primary); color: var(--c-on-dark); }
.trust-list { list-style: none; margin-block: 0; padding-block: 1.75rem; display: grid; gap: 1.25rem; grid-template-columns: repeat(2, 1fr); }
.trust-list li { display: flex; flex-direction: column; border-left: 3px solid var(--c-accent); padding-left: .9rem; }
.trust-list strong { font-size: 1.3rem; line-height: 1.2; }
.trust-list span { color: var(--c-on-dark-muted); }
@media (min-width: 900px) { .trust-list { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Sektionen ---------- */
.section { padding-block: var(--space-section); }
.section-alt { background: var(--c-surface-alt); }
.section-dark { background: var(--c-primary); color: var(--c-on-dark); }
.section-dark h2, .section-dark h3, .section-dark .lead { color: #fff; }
.section-dark .eyebrow { color: #8fd3f5; }
.section-dark a:not(.btn) { color: #fff; }
.section-dark a:not(.btn):hover { color: #bfe6fa; }

.intro-split { display: grid; gap: 2rem; align-items: start; }
.intro-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 40%; border-radius: var(--radius); box-shadow: var(--shadow); }
.intro-split-reverse .intro-img { aspect-ratio: auto; }
@media (min-width: 900px) {
  .intro-split { grid-template-columns: 1fr 320px; gap: 4rem; }
  .intro-img { aspect-ratio: 4 / 5; }
  .intro-split > div { max-width: 68ch; }
  .intro-split-reverse { grid-template-columns: 1fr 480px; align-items: center; }
}

/* ---------- Leistungs-Kacheln ---------- */
.cards { display: grid; gap: 1.5rem; margin-top: 3rem; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--c-surface); border: 1px solid var(--c-steel-light); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card .card-img-top { object-position: center 35%; }
.card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: .2rem; }
.card-sub { color: var(--c-accent-text); font-weight: 600; margin-bottom: 1rem; }
.card-body p { font-size: 1.05rem; }
.card-link { margin-top: auto; font-weight: 600; }
.card-link::after { content: " →"; }

/* ---------- Galerie ---------- */
.filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 2rem; }
.filter-btn { min-height: 44px; padding: .5rem 1.1rem; font: 600 1rem/1.2 var(--font); color: var(--c-primary); background: var(--c-surface);
  border: 2px solid var(--c-steel-light); border-radius: 999px; cursor: pointer; }
.filter-btn:hover { border-color: var(--c-primary); }
.filter-btn[aria-pressed="true"] { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 1rem; } .gallery .gallery-cat { display: block; } }
@media (min-width: 1024px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery li[hidden] { display: none; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: var(--c-steel-light); cursor: zoom-in; border-radius: var(--radius); overflow: hidden; position: relative; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease, opacity .3s; }
.gallery button:hover img { transform: scale(1.04); }
.gallery-cat { display: none; position: absolute; left: .5rem; bottom: .5rem; background: rgb(16 35 80 / .85); color: #fff; font-size: .8rem; font-weight: 600; padding: .15rem .5rem; border-radius: 3px; }
.gallery-placeholder { aspect-ratio: 4 / 3; border-radius: var(--radius); background: linear-gradient(90deg, #eceef1, #f6f7f8, #eceef1); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Lightbox ---------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(10 15 25 / .95); color: #fff; }
.lightbox::backdrop { background: rgb(10 15 25 / .9); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 1rem 1rem; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 9rem); object-fit: contain; border-radius: 3px; }
.lightbox figcaption { display: flex; gap: 1.5rem; justify-content: space-between; width: 100%; max-width: 1100px; padding: 1rem .25rem 0; font-size: 1.05rem; }
.lightbox-count { color: #c3c9d4; white-space: nowrap; }
.lb-btn { position: absolute; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgb(255 255 255 / .25); }
.lb-close { top: .75rem; right: .75rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: .75rem; } .lb-next { right: .75rem; }
@media (max-width: 639px) { .lb-prev, .lb-next { top: auto; bottom: 4.5rem; transform: none; } }

/* ---------- Unternehmen: Zeitleiste ---------- */
.timeline { list-style: none; margin: 1.5rem 0 0; padding: 0; border-left: 3px solid var(--c-steel-light); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.75rem; }
.timeline li::before { content: ""; position: absolute; left: -10px; top: .35rem; width: 17px; height: 17px; border-radius: 50%; background: var(--c-surface); border: 3px solid var(--c-accent); }
.timeline-year { display: block; font-size: 1.6rem; font-weight: 700; color: var(--c-primary); line-height: 1.2; }
.timeline p { margin: .2rem 0 0; }

/* ---------- Kontakt ---------- */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; } }
.contact-list dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.contact-list dt { color: var(--c-on-dark-muted); }
.contact-list dd { margin: 0; font-weight: 600; }
.contact-list p { margin-bottom: 1.25rem; }

.map-consent, .map iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); }
.map-consent { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 2rem;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .25); font-size: 1rem; }
.map-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-primary-dark); color: var(--c-on-dark-muted); padding-block: 2rem; font-size: 1rem; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: flex-end; }
.footer-inner p { margin: 0; }
.site-footer strong { color: #fff; }
.site-footer ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }

/* ---------- Rechtstexte (Impressum, Datenschutz) ---------- */
.legal { padding-block: clamp(2rem, 6vw, 4rem); }
.legal .container { max-width: 820px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.legal h3 { font-size: 1.15rem; margin-top: 1.5rem; color: var(--c-text); }
.legal p, .legal li { font-size: 1.05rem; }
