/* =========================================================
   Gregor Barcal – Stylesheet
   Schwarz, Weiß und ein Blau (#00a1cf) – wie die alte Seite, nur luftiger und responsive.
   ========================================================= */

/* ---------- Selbst gehostete Schriften (SIL Open Font License) ----------
   Inter (rsms.me/inter) und Space Grotesk (Florian Karsten) – keine Verbindung zu Google Fonts. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/SpaceGrotesk-Medium.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/SpaceGrotesk-Bold.woff2") format("woff2"); }

:root {
  --ink: #000000;
  --ink-soft: #2a2a2a;
  --muted: #6b6b6b;
  --paper: #ffffff;
  --cream: #f4f5f7;          /* heller Grund für Abschnitte (Name aus dem Admin-CSS beibehalten) */
  --cream-deep: #e9ebee;
  --line: #e3e5e8;
  --grey: #8d8d8d;
  --accent: #00a1cf;         /* das Blau der alten Seite */
  --accent-dark: #0083a9;
  --accent-soft: #e5f6fb;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --container: 1100px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  /* Mehrschichtiger Verlauf im Blau der Akzentschrift: drei weiche Lichtflecken auf einem hellen Blau-Weiß-Verlauf.
     Bleibt beim Scrollen stehen (fixed), damit er auf langen Seiten nicht wegscrollt. */
  background:
    radial-gradient(1000px 760px at 88% -6%, rgba(0, 161, 207, .42), rgba(0, 161, 207, 0) 62%),
    radial-gradient(760px 640px at -6% 38%, rgba(0, 161, 207, .22), rgba(0, 161, 207, 0) 60%),
    radial-gradient(900px 700px at 96% 104%, rgba(0, 131, 169, .28), rgba(0, 131, 169, 0) 60%),
    linear-gradient(170deg, #f7fcfe 0%, #edf7fb 45%, #e3f2f8 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; }
/* Invertierung beim Überfahren wie auf der alten Seite (nur im öffentlichen Teil, nicht im Admin) */
main:not(.admin-main) a:hover, main:not(.admin-main) a:focus-visible, .site-footer a:hover, .site-footer a:focus-visible { color: #fff; background: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .6em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
@media (min-width: 768px) { .container { width: min(100% - 3rem, var(--container)); } }
.skip-link { position: absolute; left: 1rem; top: -100px; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 999; }
.skip-link:focus { top: 1rem; }

/* ---------- Claim-Balken: weiße Schrift auf schwarzen Balken, Akzentwort blau ---------- */
/* Jede Zeile ist ein eigener, leicht abgerundeter Balken mit Schatten; die Zeilenhöhe lässt einen kleinen Abstand dazwischen
   (Schrift-Inhaltshöhe ~1.28em + Innenabstand), die nächste Zeile überdeckt keine Unterlängen (g, p, y) */
.claim { margin: 0 0 1.25rem; line-height: 1.5; }
.claim-text {
  display: inline;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 5.6vw, 4rem);   /* Handy: mind. 1.7rem; lange Wörter dürfen dort umbrechen (hyphens) */
  letter-spacing: -0.02em;
  -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere;   /* lange Wortspiele („Lesensabschnittspartner“) dürfen am Handy umbrechen */
  color: #fff; background: var(--ink);
  padding: 0.05em 0.22em;
  border-radius: 0.16em;
  box-shadow: 0 6px 18px rgba(0, 20, 40, .18);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.claim .akzent { color: var(--accent); font-style: normal; }
.claim-hero { cursor: pointer; user-select: none; -webkit-user-select: none; }
.claim-hero .claim-text { transition: opacity .45s ease; }
.claim-hero .claim-text.is-out { opacity: 0; }
/* Schreibmaschine: blinkender Cursor im Balken */
.claim-cursor { display: inline-block; width: .08em; height: .9em; background: var(--accent); vertical-align: -0.08em; margin-left: .06em; animation: claim-blink 1s steps(1) infinite; }
.claim-cursor.tippt { animation: none; }
@keyframes claim-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

h1.claim { font-size: inherit; font-weight: inherit; }
/* Startseite: am Handy 1.75rem – „Lesensabschnittspartner“ passt bei 375 px gerade noch in eine Zeile */
.claim-hero .claim-text { font-size: clamp(1.75rem, 4.2vw, 3.3rem); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(0, 161, 207, .18);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1.5rem; }
.brand { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.brand strong { font-weight: 700; margin-left: .28em; }
.brand:hover, .brand:focus-visible { background: transparent; color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: .75rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.site-nav a { color: var(--ink); padding: .25rem .75rem; border-radius: 999px; transition: background .2s ease, color .2s ease; }
.site-nav a:hover, .site-nav a:focus-visible { color: #fff; background: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"]:hover { color: #fff; }
.nav-sep { color: var(--grey); font-weight: 500; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius-sm);
}
.nav-toggle-bar { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem;
    transform-origin: top; transform: scaleY(0); opacity: 0; pointer-events: none;
    transition: transform .2s ease, opacity .2s ease; box-shadow: var(--shadow);
  }
  .site-nav.is-open { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  .site-nav a { padding: .9rem .25rem; border-bottom: 1px solid var(--line); font-size: 1.15rem; border-radius: 0; }
  .nav-sep { display: none; }
}

/* ---------- Startseite: Hero ---------- */
.hero { padding-block: 2rem 1rem; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
.hero-media { order: 2; }
.hero-copy { order: 1; }
/* freigestelltes Porträt (PNG mit Transparenz) – steht direkt auf dem Verlauf, weicher Schatten statt Rahmen */
.profil { width: min(60%, 240px); height: auto; aspect-ratio: 195 / 324; object-fit: contain; object-position: bottom; filter: drop-shadow(0 14px 24px rgba(0, 60, 80, .22)); }
.intro { font-size: 1.15rem; line-height: 1.55; max-width: 34rem; }
.intro p { margin-bottom: .75em; }
@media (min-width: 768px) {
  .hero { padding-block: 3rem 1.5rem; }
  .hero-grid { grid-template-columns: 240px 1fr; gap: 3rem; align-items: center; }
  .hero-media { order: 1; }
  .hero-copy { order: 2; }
  .profil { width: 100%; }
  .intro { font-size: 1.25rem; }
}
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 280px 1fr; } }

/* ---------- Abschnitte ---------- */
.section { padding-block: 2.5rem; }
@media (min-width: 768px) { .section { padding-block: 3.5rem; } }
.section-soft { background: rgba(255, 255, 255, .55); border-top: 1px solid rgba(0, 161, 207, .18); border-bottom: 1px solid rgba(0, 161, 207, .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.section-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); font-weight: 600; margin-bottom: 1.25rem; display: flex; align-items: center; gap: .75rem; }
.section-title::before { content: ""; width: 2rem; height: 3px; background: var(--accent); }

/* ---------- Kacheln ---------- */
.kacheln { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
.kachel { display: block; margin: 0; position: relative; overflow: hidden; background: rgba(255, 255, 255, .88); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease; }
/* Nur verlinkte Kacheln reagieren auf die Maus – Kacheln ohne Link sollen nicht klickbar wirken */
a.kachel:hover, a.kachel:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 60, 80, .12); }
.kachel img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.kachel:hover img, a.kachel:focus-visible img { transform: scale(1.04); }
.kachel-titel { position: absolute; left: -9999px; }   /* nur für Screenreader; Titel steht im title-Attribut */
.kacheln-home .kachel { aspect-ratio: 1; border: 1px solid rgba(255,255,255,.9); padding: 3%; }
.kacheln-home .kachel img { object-fit: contain; }
a.kachel.kachel:hover { border-color: var(--accent); }
@media (min-width: 640px) { .kacheln-home { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
@media (min-width: 1000px) { .kacheln-home { gap: 1.25rem; } }

.kacheln-logos { gap: .75rem; }
.kacheln-logos .kachel { aspect-ratio: 3 / 2; border: 1px solid rgba(255,255,255,.9); padding: 12%; display: flex; align-items: center; justify-content: center; }
.kacheln-logos .kachel img { object-fit: contain; width: 100%; height: 100%; }
@media (min-width: 640px) { .kacheln-logos { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 900px) { .kacheln-logos { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Kontakt ---------- */
.kontakt-text { font-size: 1.1rem; line-height: 1.7; }
.kontakt-text p:last-child { margin: 0; }

/* ---------- Unterseiten ---------- */
.page-head { padding-block: 2rem 0; }
@media (min-width: 768px) { .page-head { padding-block: 3rem 0; } }
.page-head .claim { margin-bottom: 0; }
.intro-text { max-width: 44rem; font-size: 1.15rem; margin-bottom: 2rem; }
/* Text auf Unterseiten linksbündig zur Balken-Überschrift, nur die Zeilenlänge ist begrenzt */
.page .rich, .page .lead, .page .page-title, .page .crumbs { max-width: 760px; }
.page-title { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: .5rem; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.crumbs a { color: var(--muted); }
.rich h2 { font-size: 1.3rem; margin-top: 2rem; }
.rich ul, .rich ol { padding-left: 1.4rem; }
.rich li { margin-bottom: .4em; }
.rich a { font-weight: 500; }
.back { display: inline-block; font-weight: 600; margin-top: 1rem; }

/* ---------- Knowhow-Liste ---------- */
.knowhow-liste { list-style: none; margin: 0; padding: 0; max-width: 800px; }
.knowhow-eintrag { padding: 1.4rem 0; border-bottom: 1px solid rgba(0, 0, 0, .18); }
.knowhow-eintrag:first-child { padding-top: 0; }
.knowhow-eintrag:last-child { border-bottom: 0; }
.knowhow-eintrag h2 { font-size: 1.15rem; margin-bottom: .35rem; }
.knowhow-eintrag h2 a { color: var(--ink); }
.knowhow-eintrag h2 a:hover { color: #fff; }
.teaser { margin-bottom: .5rem; color: var(--ink-soft); }
.knowhow-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; font-weight: 600; }
.knowhow-links .extern { font-weight: 500; color: var(--muted); font-size: .95rem; }
.knowhow-links .extern:hover { color: #fff; }

/* ---------- Galerie (Knowhow-Detail) ---------- */
.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin: 2rem 0; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery-item { display: block; position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--cream-deep); border-radius: var(--radius-sm); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.gallery-item:hover { background: var(--cream-deep); }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.05); }
.gallery-item::after {
  content: attr(data-caption); position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem .6rem .5rem;
  font-size: .8rem; line-height: 1.3; color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  opacity: 0; transition: opacity .25s ease;
}
.gallery-item:hover::after, .gallery-item:focus-visible::after { opacity: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.94);
  display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; padding: 1rem;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: 82vh; width: auto; margin-inline: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox figcaption { color: #ddd; margin-top: .9rem; font-size: .95rem; }
.lightbox button {
  background: rgba(255,255,255,.12); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.8rem; line-height: 1; cursor: pointer; display: grid; place-items: center; justify-self: center;
}
.lightbox button:hover { background: var(--accent); }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 1fr; }
  .lightbox-prev, .lightbox-next { position: absolute; bottom: 1rem; }
  .lightbox-prev { left: 1rem; } .lightbox-next { right: 1rem; }
  .lightbox img { max-height: 70vh; }
}

/* ---------- Fußzeile ---------- */
.site-footer { border-top: 1px solid rgba(0, 161, 207, .18); padding-block: 1.75rem 2.5rem; margin-top: 1rem; font-size: .95rem; background: rgba(255,255,255,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1.25rem 2rem; }
.copyright { margin: 0 0 .4rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: #fff; }
.social-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { display: inline-block; background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .9rem; padding: .35em .95em; border-radius: 999px; transition: background .2s ease, transform .15s ease; }
.pill:hover, .pill:focus-visible { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .claim-hero .claim-text, .kachel, .kachel img, .gallery-item img, .site-nav, .nav-toggle-bar { transition: none; }
  .claim-cursor { animation: none; }
}
