/*
  STORAX Boden GmbH — site.css
  Single stylesheet for the whole site. Mobile-first, no dependencies.

  Colour source: assets/img/logo.gif (navy script, lime-green bar, grey bar).
  Contrast ratios checked against WCAG AA (4.5:1 normal text, 3:1 large text/UI):
    --color-navy      (#1f3c88) on white  : 10.2:1
    --color-navy-dark (#14295a) on white  : 14.1:1
    --color-green     (#4d7318) on white  :  5.6:1  (accessible text variant of the logo green)
    --color-grey-900  (#222226) on white  : 15.9:1
    --color-grey-700  (#4b5563) on white  :  7.6:1
    --color-red       (#9f0408) on white  :  8.4:1  (matches the original inline "highlight" red)
    white on --color-navy                 : 10.2:1
    white on --color-green-dark (#3c5813) :  6.9:1
  --color-lime (#8dc63f), the bright logo green, is used only for decoration
  (borders, subtle backgrounds, focus rings) — never as text on white.
*/

:root {
  --color-navy: #1f3c88;
  --color-navy-dark: #14295a;
  --color-lime: #8dc63f;
  --color-green: #4d7318;      /* accessible text/link variant of the logo green */
  --color-green-dark: #3c5813; /* for white text on green backgrounds */
  --color-grey-900: #222226;
  --color-grey-700: #4b5563;
  --color-grey-400: #7b828c; /* >= 3:1 auf Weiß für Formularrahmen */
  --color-grey-200: #e2e5e9;
  --color-grey-100: #f1f2f4;
  --color-red: #9f0408;
  --color-bg: #f6f7f4;
  --color-white: #ffffff;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --content-max: 1200px;
  --radius: 6px;
  --gap: 1.5rem;
  --focus-ring: 3px solid var(--color-navy); /* 10:1 auf Hell; auf dunklen Flächen lime, s. u. */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%; /* 1rem = 16px */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-grey-900);
  background: var(--color-bg);
}

img, picture, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--color-navy-dark);
  margin: 1.5em 0 0.6em;
}
h1 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.2rem); margin-top: 0; }
h2 { font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.6rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a {
  color: var(--color-green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: var(--color-navy); }
a:visited { color: var(--color-navy); }

ul, ol { padding-left: 1.3em; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Auf dunklem Grund (Navy-Menü, Footer) den hellen Logo-Grünton als Fokusrahmen */
.main-nav :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--color-lime);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--color-navy);
  color: #fff;
  padding: 0.6em 1em;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 1000;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}

.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;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--color-white);
  border-bottom: 4px solid var(--color-lime);
}

.site-header__bar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo img {
  height: 56px;
  width: auto;
}
@media (min-width: 60em) {
  .site-header__logo img { height: 80px; }
}

.site-header__image {
  position: relative;
  background: var(--color-grey-100);
}
.site-header__image img {
  width: 100%;
  height: clamp(90px, 22vw, 210px);
  object-fit: cover;
}

/* ---------- Navigation ---------- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--color-navy);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 0.6em 0.9em;
  font-size: 1rem;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--color-navy-dark); }
.nav-toggle-icon {
  width: 1.2em;
  height: 1.2em;
  position: relative;
  display: inline-block;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after,
.nav-toggle-icon span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
}
.nav-toggle-icon::before { top: 2px; }
.nav-toggle-icon span { top: 50%; margin-top: -1px; }
.nav-toggle-icon::after { bottom: 2px; }

.main-nav {
  background: var(--color-navy);
}
.main-nav__list {
  max-width: var(--content-max);
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: none;
  flex-direction: column;
}
.main-nav__list.is-open { display: flex; }
.main-nav__list a {
  display: block;
  padding: 0.85em 1rem;
  color: #fff;
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.main-nav__list a:hover,
.main-nav__list a:focus-visible {
  background: var(--color-navy-dark);
}
.main-nav__list a[aria-current="page"] {
  background: var(--color-lime);
  color: var(--color-navy-dark);
  font-weight: 700;
}

@media (min-width: 60em) {
  .nav-toggle { display: none; }
  .main-nav__list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .main-nav__list a {
    border-top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
  }
}

/* Sub-navigation for sections with child pages */
.subnav {
  background: var(--color-grey-100);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  padding: 0.75em 1em;
  margin: 0 0 1.5em;
}
.subnav__label {
  font-weight: 700;
  color: var(--color-navy-dark);
  margin-right: 0.5em;
}
.subnav ul {
  list-style: none;
  margin: 0.4em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.2em;
}
.subnav a { text-decoration: none; }
.subnav a[aria-current="page"] {
  font-weight: 700;
  color: var(--color-navy-dark);
  text-decoration: underline;
}

/* ---------- Layout ---------- */
.layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gap) 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 60em) {
  .layout {
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    align-items: start;
  }
}

main { min-width: 0; overflow-wrap: break-word; }
main p { overflow-wrap: anywhere; }

.sidebar {
  min-width: 0;
  background: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  padding: 1rem;
}
.sidebar h2 { margin-top: 0; }

/* ---------- Components ---------- */

/* .media — image + text side by side, stacks on mobile (was textWithImage) */
.media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  margin: 1.5em 0;
}
.media__figure { margin: 0; }
.media__figure img { border-radius: var(--radius); }
.media__body { min-width: 0; }
.media__body :first-child { margin-top: 0; }

@media (min-width: 40em) {
  .media {
    grid-template-columns: minmax(140px, 260px) 1fr;
  }
  .media--right {
    grid-template-columns: 1fr minmax(140px, 260px);
  }
  .media--right .media__figure { order: 2; }
}

/* .figure / .figure--narrow — single images (was imageSubtitle) */
.figure {
  margin: 1.5em 0;
}
.figure img {
  border-radius: var(--radius);
}
.figure--narrow {
  max-width: 425px;
}
.figure figcaption {
  margin-top: 0.5em;
  color: var(--color-grey-700);
  font-size: 0.9rem;
}

/* .highlight — emphasised coloured text (was inline color rgb(159,4,8)) */
.highlight {
  color: var(--color-red);
}

/* .divider — was module-type-hr */
.divider {
  border: 0;
  border-top: 1px solid var(--color-grey-200);
  margin: 2em 0;
}

/* .gallery — sidebar reference gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 1em 0 0;
  padding: 0;
}
.gallery__item { margin: 0; }
.gallery__link {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-grey-100);
  border: 1px solid var(--color-grey-200);
}
.gallery__link img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  transition: transform 0.2s ease;
}
.gallery__link:hover img,
.gallery__link:focus-visible img {
  transform: scale(1.05);
}
.gallery__caption {
  display: block;
  font-size: 0.75rem;
  color: var(--color-grey-700);
  padding: 0.3em 0.1em 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* ---------- Forms ---------- */
form {
  margin: 1.5em 0;
}
.form-row {
  margin-bottom: 1.1em;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}
label {
  font-weight: 600;
  color: var(--color-navy-dark);
}
.required-marker {
  color: var(--color-red);
  margin-left: 0.15em;
}
input, textarea, select {
  font: inherit;
  padding: 0.7em 0.8em;
  border: 1px solid var(--color-grey-400);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-grey-900);
  min-height: 44px;
}
textarea { min-height: 8em; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}
input:user-invalid, textarea:user-invalid, select:user-invalid {
  border-color: var(--color-red);
}
.form-hint {
  font-size: 0.85rem;
  color: var(--color-grey-700);
}
.form-actions {
  margin-top: 1.5em;
}
button, .button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--color-navy);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 0.75em 1.4em;
  min-height: 44px;
  display: inline-block;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--color-navy-dark); }

/* ---------- Map ---------- */
.map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.5em 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-grey-200);
}
.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Download block ---------- */
.download {
  display: flex;
  align-items: center;
  gap: 0.9em;
  background: var(--color-grey-100);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  padding: 1em 1.2em;
  margin: 1.5em 0;
}
.download__icon {
  flex: none;
  width: 2em;
  height: 2em;
  color: var(--color-navy);
}
.download a { font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 1.5em 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30em;
}
th, td {
  text-align: left;
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--color-grey-200);
}
th {
  background: var(--color-grey-100);
  color: var(--color-navy-dark);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-navy-dark);
  color: #fff;
  margin-top: 2.5rem;
}
.site-footer a { color: #cfe6a8; }
.site-footer a:hover, .site-footer a:focus-visible { color: #fff; }
.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48em) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}
.site-footer__nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.2em;
}
.site-footer__contact address {
  font-style: normal;
  line-height: 1.7;
}
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  color: var(--color-grey-200);
}
.site-footer__legal .site-footer__inner {
  padding-top: 1rem;
  padding-bottom: 1rem;
  grid-template-columns: 1fr;
}

/* ---------- Lightbox (progressive enhancement, see site.js) ---------- */
dialog.lightbox {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(90vw, 1000px);
  max-height: 90vh;
  background: #000;
}
dialog.lightbox::backdrop {
  background: rgba(10, 12, 16, 0.85);
}
.lightbox__content {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.lightbox__content img {
  max-height: 75vh;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}
.lightbox__caption {
  color: #fff;
  padding: 0.8em 1em;
  font-size: 0.9rem;
}
.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 2.4em;
  height: 2.4em;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close { top: 0.6em; right: 0.6em; }
.lightbox__prev { left: 0.6em; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.6em; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover {
  background: var(--color-navy);
}
