/* Schrift: LensGrotesk direkt von der Website (/setup/fonts/), keine eigene Kopie im Doku-Ordner */
/* CapCorn Dokumentation – gemeinsames Stylesheet (Bildschirm + Druck/PDF)
   Farben und Schrift wie www.capcorn.at. Neue Dokumente brauchen nur die Klassen unten. */

@font-face { font-family: 'LensGrotesk'; src: url('/setup/fonts/LensGrotesk-Light.woff2') format('woff2'), url('/setup/fonts/LensGrotesk-Light.woff') format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'LensGrotesk'; src: url('/setup/fonts/LensGrotesk-Book.woff2') format('woff2'), url('/setup/fonts/LensGrotesk-Book.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'LensGrotesk'; src: url('/setup/fonts/LensGrotesk-Medium.woff2') format('woff2'), url('/setup/fonts/LensGrotesk-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }

:root {
  /* aus capcorn.at */
  --blue: #2c48e1;
  --black: #111111;
  --grey: #808080;
  --lightgrey: #f0f0f0;
  --darkwhite: #f8f8f8;
  --white: #ffffff;
  /* Doku-Ergaenzungen, vom CI-Blau abgeleitet */
  --deepblue: #1b2b8f;
  --bluemist: #eef1fd;
  --bluerule: #d6dcf7;
  --text: #22252e;
  --muted: #5d6272;

  --navh: 70px;
  --content: 760px;
  --gutter: 25px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--navh) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: 'LensGrotesk', sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

/* ---------- Navigation (wie capcorn.at) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--navh);
  background: var(--white);
  border-bottom: 1px solid var(--lightgrey);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 75px;
  font-weight: 400; font-size: 16px; color: var(--black);
}
.nav-logo { color: var(--blue); display: flex; align-items: center; }
.nav-logo svg { height: 20px; width: auto; display: block; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--black); }
.nav-links a:hover { color: var(--blue); text-decoration: none; }
.nav-links .btn-print {
  font: inherit; cursor: pointer;
  background: none; border: 1px solid var(--blue); color: var(--blue);
  padding: 6px 16px; border-radius: 999px; white-space: nowrap;
}
.nav-links .btn-print:hover { background: var(--blue); color: var(--white); }

/* ---------- Hero (blaue Flaeche wie die Sektionen der Website) ---------- */
.hero {
  background: var(--blue);
  color: var(--white);
  padding: calc(var(--navh) + 90px) 75px 80px;
}
.hero-inner { max-width: 1180px; margin: 0 auto; }
/* Hero, Inhalt und Footer teilen dieselbe linke Achse */
.hero .rubrik { font-size: 18px; font-weight: 400; margin: 0 0 18px; opacity: .85; }
.hero .rubrik a { color: inherit; }
.hero h1 {
  font-weight: 400;
  font-size: 3.6em;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0;
  max-width: 15ch;
}
.hero .unterzeile { font-size: 1.3em; font-weight: 300; margin: 22px 0 0; max-width: 40ch; }
.hero .stand { font-size: 15px; margin: 36px 0 0; opacity: .8; }

/* ---------- Seitenlayout: Inhaltsverzeichnis + Inhalt ---------- */
.layout {
  max-width: 1330px;
  margin: 0 auto;
  padding: 75px 75px 100px;
  display: grid;
  grid-template-columns: 240px minmax(0, var(--content));
  gap: 80px;
}
.toc { position: sticky; top: calc(var(--navh) + 30px); align-self: start; font-size: 15px; font-weight: 400; }
.toc p { margin: 0 0 12px; color: var(--grey); font-weight: 400; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--lightgrey); }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; color: var(--muted); border-left: 2px solid transparent; line-height: 1.35; }
.toc a:hover { color: var(--blue); text-decoration: none; }
.toc a.aktiv { color: var(--blue); border-left-color: var(--blue); }

.inhalt { min-width: 0; }
.inhalt > :first-child { margin-top: 0; }
h2 {
  font-weight: 400;
  font-size: 1.85em;
  line-height: 1.2;
  color: var(--blue);
  margin: 72px 0 18px;
  letter-spacing: -0.005em;
}
h3 { font-weight: 500; font-size: 1.1em; color: var(--deepblue); margin: 40px 0 12px; }
p { margin: 0 0 16px; }
.lead { font-size: 1.22em; line-height: 1.5; color: var(--black); }
strong { font-weight: 500; }
em { font-style: normal; color: var(--black); font-weight: 400; } /* UI-Begriffe, bewusst nicht blau (sonst mit Links verwechselbar) */
ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin: 0 0 7px; }
li::marker { color: var(--blue); }

code {
  font-family: Consolas, 'Cascadia Mono', 'SF Mono', monospace;
  font-size: 0.84em;
  background: var(--bluemist);
  color: var(--deepblue);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
td code { white-space: normal; overflow-wrap: anywhere; }
pre {
  background: var(--darkwhite);
  border-left: 3px solid var(--blue);
  padding: 18px 20px;
  margin: 12px 0 22px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
pre code { background: none; padding: 0; color: var(--black); white-space: pre; font-size: inherit; }

.hinweis {
  border-left: 3px solid var(--blue);
  background: var(--bluemist);
  padding: 16px 20px;
  margin: 18px 0 24px;
}
.hinweis p:last-child { margin-bottom: 0; }

.tabelle { overflow-x: auto; margin: 10px 0 26px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; font-weight: 400; }
th {
  text-align: left; font-weight: 500; color: var(--deepblue);
  background: var(--bluemist);
  padding: 10px 12px;
  border-bottom: 2px solid var(--blue);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--bluerule); vertical-align: top; }

figure { margin: 18px 0 26px; }
figure img { max-width: 100%; width: 560px; border: 1px solid var(--bluerule); display: block; }
figure svg { width: 100%; height: auto; display: block; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; font-weight: 400; }

.checkliste { list-style: none; padding-left: 0; }
.checkliste li { position: relative; padding-left: 32px; margin-bottom: 11px; }
.checkliste li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 17px; height: 17px;
  border: 1.5px solid var(--blue); border-radius: 3px;
}

/* ---------- Uebersichtsseite ---------- */
.dokliste { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--bluerule); }
.dokliste li { margin: 0; border-bottom: 1px solid var(--bluerule); }
.dokliste a { display: grid; grid-template-columns: 1fr auto; gap: 6px 30px; padding: 26px 0; color: var(--text); }
.dokliste a:hover { text-decoration: none; }
.dokliste a:hover .titel { color: var(--blue); }
.dokliste .titel { font-size: 1.45em; font-weight: 400; color: var(--black); }
.dokliste .beschreibung { grid-column: 1; color: var(--muted); }
.dokliste .meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 15px; color: var(--muted); font-weight: 400; white-space: nowrap; }

/* ---------- Footer (wie capcorn.at) ---------- */
.footer {
  background: var(--blue); color: var(--white);
  padding: 75px;
  font-size: 16px;
}
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 60px; align-items: flex-start; flex-wrap: wrap; }
.footer-logo { color: var(--white); }
.footer-logo svg { height: 22px; width: auto; display: block; }
.footer p { margin: 0; line-height: 1.7; }
.footer a { color: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .nav { padding: 0 50px; }
  .hero { padding-left: 50px; padding-right: 50px; }
  .layout { padding-left: 50px; padding-right: 50px; gap: 50px; grid-template-columns: 210px minmax(0, 1fr); }
  .footer { padding: 60px 50px; }
}
@media (max-width: 959px) {
  :root { --navh: 60px; }
  .nav { padding: 0 var(--gutter); }
  .nav-logo svg { height: 18px; }
  .hero { padding: calc(var(--navh) + 50px) var(--gutter) 50px; }
  .hero h1 { font-size: 2.4em; }
  .layout { display: block; padding: 40px var(--gutter) 70px; }
  .toc { position: static; margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--lightgrey); }
  h2 { font-size: 1.55em; margin-top: 56px; }
  .footer { padding: 50px var(--gutter); }
  .dokliste a { grid-template-columns: 1fr; }
  .dokliste .meta { grid-column: 1; grid-row: auto; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav-links .nur-desktop, .nav-links .btn-print { display: none; }
  .nav-logo svg { height: 16px; }
  .hero h1 { font-size: 2em; }
}

/* ---------- Druck / PDF ---------- */
@page {
  size: A4;
  margin: 20mm 0 20mm 0;
  @top-left { font-family: 'LensGrotesk', sans-serif; font-size: 7.5pt; color: #5d6272; vertical-align: bottom; padding-bottom: 4mm; padding-left: 20mm; }
  @top-right { font-family: 'LensGrotesk', sans-serif; font-size: 7.5pt; color: #5d6272; vertical-align: bottom; padding-bottom: 4mm; padding-right: 20mm; }
  @bottom-left { content: ''; width: 60mm; background-image: url('logo-blau.svg'); background-repeat: no-repeat; background-size: 24mm auto; background-position: 20mm center; }
  @bottom-center { content: "CapCorn Company Software GmbH, 5700 Zell am See"; white-space: nowrap; font-family: 'LensGrotesk', sans-serif; font-size: 7.5pt; color: #5d6272; vertical-align: middle; }
  @bottom-right { content: "Seite " counter(page) " von " counter(pages); font-family: 'LensGrotesk', sans-serif; font-size: 7.5pt; color: #5d6272; vertical-align: middle; padding-right: 20mm; width: 60mm; text-align: right; }
}
@page :first {
  margin-top: 0;
  @top-left { content: none; }
  @top-right { content: none; }
  @bottom-left { content: none; }
}
@media print {
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; scroll-padding-top: 0; }
  body { font-size: 9.6pt; line-height: 1.5; font-weight: 400; }
  .nav, .toc, .footer, .nur-bildschirm { display: none !important; }
  .hero { padding: 16mm 20mm 13mm; margin: 0 0 10mm; }
  .hero .rubrik { display: none; }
  .hero h1 { font-size: 30pt; font-weight: 300; max-width: 150mm; }
  .hero .unterzeile { font-size: 12pt; margin-top: 4mm; }
  .hero .stand { font-size: 8.5pt; margin-top: 6mm; }
  .hero .druck-logo { display: block !important; width: 46mm; color: var(--white); margin-bottom: 20mm; }
  .hero .druck-logo svg { width: 100%; height: auto; display: block; }
  .layout { display: block; padding: 0 20mm; max-width: none; }
  h2 { font-size: 15pt; font-weight: 500; margin: 9mm 0 3mm; break-after: avoid; }
  h3 { font-size: 10.8pt; margin: 6mm 0 2mm; break-after: avoid; }
  p { margin-bottom: 2.6mm; }
  .lead { font-size: 11pt; font-weight: 300; }
  li { margin-bottom: 1.2mm; }
  code { font-size: 8.4pt; }
  pre { font-size: 8pt; white-space: pre-wrap; padding: 3.5mm 4mm; break-inside: avoid; }
  pre code { white-space: pre-wrap; font-size: 8pt; }
  .hinweis { padding: 3mm 4mm; break-inside: avoid; }
  .tabelle { overflow: visible; }
  table { font-size: 8.6pt; }
  th, td { padding: 2mm 2.5mm; }
  tr, figure, .nobreak { break-inside: avoid; }
  figure img { width: 118mm; }
  figcaption { font-size: 8pt; }
  .checkliste li { padding-left: 7mm; break-inside: avoid; }
  .checkliste li::before { width: 3.4mm; height: 3.4mm; top: 0.9mm; }
  .druck-kontakt { display: flex !important; }
  a { color: var(--blue); }
}
.hero .druck-logo, .druck-kontakt { display: none; }
.druck-kontakt { margin-top: 9mm; padding-top: 4mm; border-top: 0.4mm solid var(--blue); gap: 12mm; align-items: flex-start; break-inside: avoid; }
.druck-kontakt .logo { width: 38mm; color: var(--blue); flex: none; padding-top: 1mm; }
.druck-kontakt .logo svg { width: 100%; height: auto; display: block; }
.druck-kontakt p { margin: 0; font-size: 8.8pt; line-height: 1.55; }

/* Einspaltige Seiten (z.B. Uebersicht) */
.layout-einspaltig { grid-template-columns: minmax(0, var(--content)); }

/* Footer bei kurzem Inhalt am unteren Bildschirmrand halten */
@media screen {
  body { min-height: 100vh; display: flex; flex-direction: column; }
  body > .layout { flex: 1 0 auto; width: 100%; }
}

/* Screenshots aus dem Wartungsportal: Originalgroesse, nie breiter als die Spalte */
figure.screenshot a { display: block; cursor: zoom-in; }
figure.screenshot img { width: 100%; max-width: none; height: auto; border: 1px solid var(--bluerule); border-radius: 4px; }
/* Ab 1280px laesst das Grid rechts neben der Textspalte 100px frei: Screenshots duerfen dort hineinragen,
   damit die kleine Schrift der Masken lesbar bleibt */
@media screen and (min-width: 1280px) { figure.screenshot { margin-right: -100px; } }
@media print { figure.screenshot img { width: 150mm; max-width: 100%; } }
