/* Thomas Kraller – Klavierbaumeister
   Mobile-first responsive stylesheet */

:root {
  --blue: #2a4f7d;
  --blue-dark: #1e3a5c;
  --blue-light: #3a6aa5;
  --wood: #a9743b;
  --ink: #1c2733;
  --muted: #5a6776;
  --paper: #ffffff;
  --paper-alt: #f3f5f8;
  --line: #dce2ea;
  --max: 1100px;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(30, 58, 92, .10);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; color: var(--blue-dark); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 .8em; }
h3 { font-size: 1.25rem; margin: 0 0 .5em; }

p { margin: 0 0 1em; }

a { color: var(--blue); }
a:hover { color: var(--blue-light); }

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

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

.sr-only {
  position: absolute; 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: -999px; top: 0; background: var(--blue); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; text-decoration: none; min-height: 44px;
  transition: background .15s, color .15s, transform .05s; border: 2px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--wood); color: #fff; }
.btn-primary:hover { background: #92622f; color: #fff; }
.btn-ghost { border-color: #fff; color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.brand-name { font-weight: 700; color: var(--blue-dark); font-size: 1.15rem; }
.brand-role { font-size: .8rem; color: var(--wood); letter-spacing: .04em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; }
.nav-menu {
  display: flex; gap: 8px; list-style: none; margin: 0; padding: 0;
}
.nav-menu a {
  display: block; padding: 10px 14px; text-decoration: none; color: var(--ink);
  font-weight: 600; border-radius: 8px; font-size: .98rem;
}
.nav-menu a:hover { background: var(--paper-alt); color: var(--blue); }

.nav-toggle {
  display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink);
  transition: transform .2s, opacity .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  background: linear-gradient(150deg, var(--blue-dark), var(--blue) 70%, var(--blue-light));
  color: #fff; padding: clamp(48px, 9vw, 100px) 0;
}
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: #cdddf0; margin: 0 0 .4em; }
.hero h1 { color: #fff; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); max-width: 640px; color: #e7eef6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.6em; }

/* Sections */
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section-alt { background: var(--paper-alt); }

/* Cards */
.cards { display: grid; gap: 22px; grid-template-columns: 1fr; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { color: var(--wood); }
.card-note { font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8em; }

/* Timeline */
.timeline { list-style: none; margin: 1em 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.2em 130px; }
.timeline .year {
  position: absolute; left: 0; top: 0; font-weight: 700; color: var(--wood);
  width: 110px;
}

/* Gallery */
.gallery-title { margin-top: 1.8em; }
/* Carousel: horizontal scroll-snap track, one image per view */
.carousel { position: relative; margin: 1.2em auto 0; max-width: 680px; }
.gallery {
  --per-view: 1;
  list-style: none; margin: 0; padding: 0; display: flex; gap: 0;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; border-radius: var(--radius);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery > li {
  flex: 0 0 100%;
  scroll-snap-align: center; min-width: 0;
}
.gallery-item {
  display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: none;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); line-height: 0;
}
.gallery-item img {
  width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block;
  transition: transform .25s;
}
.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.05); }
.gallery-item:focus-visible { outline: 3px solid var(--wood); outline-offset: 2px; }
.gallery figcaption { margin-top: .5em; font-size: .9rem; color: var(--muted); text-align: center; }

/* Carousel navigation buttons */
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--blue); color: #fff; font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: background .15s, opacity .15s;
}
.carousel-btn:hover { background: var(--blue-light); }
.carousel-btn:disabled { opacity: .3; cursor: default; }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-count {
  margin: .5em 0 0; text-align: center; font-size: .85rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* On portrait certificate carousels the figcaption shifts the centre up a little */
.gallery--portrait + .carousel-btn,
.carousel:has(.gallery--portrait) .carousel-btn { top: 42%; }

/* Portrait variant (certificates) */
.gallery--portrait .gallery-item img { aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.gallery--portrait .gallery-item:hover img,
.gallery--portrait .gallery-item:focus-visible img { transform: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center;
  justify-content: center; background: rgba(15, 23, 32, .92); padding: 4vw;
}
.lightbox[hidden] { display: none; }
.lb-image {
  max-width: min(92vw, 1100px); max-height: 86vh; border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.lightbox button {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
  cursor: pointer; border-radius: 50%; width: 52px; height: 52px; font-size: 2rem;
  line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox button:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* Leistung blocks: service text beside its image carousel */
.leistung + .leistung {
  margin-top: clamp(36px, 6vw, 64px);
  padding-top: clamp(36px, 6vw, 64px);
  border-top: 1px solid var(--line);
}
.leistung-text h3 { color: var(--wood); font-size: 1.4rem; }
.gallery-hint { font-size: .95rem; color: var(--muted); font-style: italic; }
.leistung--media .carousel { max-width: none; margin: .4em 0 0; }

@media (min-width: 820px) {
  .leistung--media {
    display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 44px; align-items: center;
  }
  .leistung--media .leistung-text { margin: 0; }
}

/* Contact */
.section-contact { background: var(--blue-dark); color: #eef3f9; }
.section-contact h2 { color: #fff; }
.section-contact a { color: #bcd4f0; }
.section-contact a:hover { color: #fff; }
.contact-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
.contact-details address { font-style: normal; line-height: 1.9; margin-bottom: 1.4em; }
.contact-map iframe {
  width: 100%; height: 320px; border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.map-link { margin-top: .6em; font-size: .95rem; }

/* Footer */
.site-footer { background: var(--ink); color: #c7cfd9; padding: 26px 0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer a { color: #c7cfd9; margin-left: 16px; }
.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { color: #fff; }

/* Legal pages */
.legal { padding: clamp(40px, 7vw, 72px) 0; }
.legal h1 { color: var(--blue-dark); }
.legal address { font-style: normal; }

/* Tablet+ */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px;
    box-shadow: var(--shadow); display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { padding: 14px; border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
