/* =========================================================================
   Ruf:Zu — shared theme
   Design tokens, base typography, and the site-wide chrome shared by every
   page: the orange info topbar, the sticky nav header, and the contact +
   footer block. Page-specific styles live in each page's own stylesheet.
   ========================================================================= */

:root {
  /* Brand palette */
  --orange: #ED9110;          /* primary            */
  --orange-2: #F4A62C;        /* secondary / hover  */
  --orange-light: #F7B861;
  --orange-dark: #C9760A;

  /* Text & surfaces */
  --text: #424243;            /* body               */
  --heading: #000000;         /* headings (h1–h4)   */
  --text-muted: #6b6b6c;      /* subtext            */
  --text-brown: #4A3208;      /* nav + footer text  */
  --bg: #ffffff;
  --bg-alt: #f2f4f5;
  --border: #dadfe0;

  /* Sunken / panel surfaces (kept as tokens so they flip in dark mode) */
  --panel-brown: #4A3208;     /* dark hero + stops CTA panels          */
  --surface-sunken: #e7ebec;  /* .section-gray blocks                  */
  --surface-panel: #edf0f1;   /* icon circles, table headers, rowhead  */
  --surface-stripe: #f7f8f9;  /* zebra-striped table rows              */
  --on-panel: #ffffff;        /* text on the dark brown panels         */

  /* Header metrics */
  --topbar-h: 38px;
  --nav-h: 100px;
  --nav-h-sticky: 64px;

  --shadow-sm: 0 2px 10px rgba(66, 66, 67, 0.06);
  --shadow-header: 0 3px 5px -1px rgba(0, 0, 0, 0.1), 0 2px 1px -1px rgba(0, 0, 0, 0.05);

  /* Fonts — only Oswald is web-loaded (used on headings + the phone number);
     everything else uses the system UI stack, exactly as the site rendered
     before. */
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Oswald", "Roboto", system-ui, sans-serif;

  --maxw: 1140px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Reserve space for the fixed .site-header (topbar + nav). On scroll the
     header shrinks, but the reserved height only needs to match its full
     initial size so content clears it at the top of the page. */
  padding-top: calc(var(--topbar-h) + var(--nav-h));
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

a { color: var(--orange); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--heading);
  margin: 0 0 0.6em;
}

h2 { font-size: 2rem; letter-spacing: 0.02em; }
h3 { font-size: 1.5rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 1.5rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 1em 2em;
  border: 0;
  border-radius: 0.3em;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible { background: var(--orange-2); }

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-ghost {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible { background: var(--text); color: #fff; }

/* =========================================================================
   Topbar
   ========================================================================= */
.topbar {
  background: var(--orange);
  color: #fff;
  font-size: 1rem;
  line-height: var(--topbar-h);
  height: var(--topbar-h);
  overflow: hidden;
  transition: height 0.3s cubic-bezier(.78,.13,.15,.86);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

.topbar p { margin: 0; white-space: nowrap; }

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.topbar a:hover { color: #f2f4f5; }
.topbar svg { width: 0.95em; height: 0.95em; fill: currentColor; }

/* =========================================================================
   Sticky nav header
   ========================================================================= */
.site-header {
  /* Fixed (not sticky): sticky is repositioned on the main thread each scroll
     step, so it lags/wiggles during fast fling-scrolls on mobile. Fixed lives
     on the compositor and stays rock-solid. The header is out of flow, so the
     body reserves its height via padding-top (see the `body` rule). */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow-header);
}

.nav-inner {
  display: flex;
  align-items: center;
  max-width: var(--maxw);
  height: var(--nav-h);
  margin: 0 auto;
  padding-inline: 1.5rem;
  transition: height 0.3s cubic-bezier(.78,.13,.15,.86);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  /* The artwork carries a little more visual weight at its top edge. */
  transform: translateY(4px);
}

.site-logo img {
  height: 45px;
  width: auto;
  transition: height 0.3s cubic-bezier(.78,.13,.15,.86);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.main-nav a {
  position: relative;
  padding: 0 16px;
  color: var(--text-brown);
  font-size: 18px;
  white-space: nowrap;
  text-decoration: none;
  line-height: var(--nav-h);
  transition: color 0.2s ease, line-height 0.3s cubic-bezier(.78,.13,.15,.86);
}

/* Animated underline — slides up and fades in on hover only.
   Anchored to the link's vertical centre so it tracks the text as the
   nav shrinks on scroll. */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(50% + 0.75em);
  height: 2px;
  border-radius: 2px;
  background: var(--orange-2);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.active { color: var(--orange-2); }

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.btn-buchen { margin-left: 20px; white-space: nowrap; }

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-brown);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Scrolled / sticky state: hide topbar, shrink header */
.site-header.scrolled .topbar { height: 0; }
.site-header.scrolled .nav-inner { height: var(--nav-h-sticky); }
.site-header.scrolled .main-nav a { line-height: var(--nav-h-sticky); }
.site-header.scrolled .site-logo img { height: 35px; }

/* =========================================================================
   Contact block  ("Sie erreichen uns unter")  — shared by all pages
   ========================================================================= */
.contact {
  text-align: center;
  padding: 3rem 1.5rem 1rem;
}

.contact h2 {
  font-size: 2.25rem;
  margin-bottom: 0.4em;
}

.contact h2 a {
  color: var(--orange);
  text-decoration: none;
}

.contact h2 a:hover { color: var(--orange-2); }

.contact p { margin: 0; color: var(--text); }

/* down-arrow divider */
.contact-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0 1.5rem;
}

.contact-divider::before,
.contact-divider::after {
  content: "";
  width: 15%;
  max-width: 90px;
  height: 1px;
  background: var(--border);
}

.contact-divider svg {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0 1rem;
  fill: var(--border);
}

/* social icons */
.socials {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 0 0 2.5rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  transition: color 0.2s ease, transform 0.2s ease;
}

.socials a:hover,
.socials a:focus-visible { color: var(--orange-2); transform: translateY(-2px); }

.socials svg { width: 44px; height: 44px; fill: currentColor; }

/* =========================================================================
   Footer  (company line + legal links) — shared by all pages
   ========================================================================= */
.site-footer {
  padding: 0.75rem 1.5rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-brown);
}

.site-footer p { margin: 0.4em 0; }
.site-footer b { font-weight: 700; }

.site-footer a { color: var(--orange); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* the compact stacked footer is shown only on small screens */
.footer-compact { display: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 899px) {
  .topbar { display: none; }

  /* Topbar is hidden here, so the fixed header is just the 64px nav. */
  body { padding-top: 64px; }

  .nav-inner { height: 64px; }

  .nav-toggle { display: flex; }

  .btn-buchen { display: none; }

  /* nav collapses into a dropdown panel */
  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    box-shadow: var(--shadow-header);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.open { max-height: 80vh; }

  .main-nav a {
    padding: 0 1.5rem;
    line-height: 3rem;
    border-top: 1px solid var(--border);
  }

  /* Logo stays a fixed size on mobile — no shrink-on-scroll */
  .site-header.scrolled .site-logo img { height: 45px; }

  /* Animated hover underline is desktop-only */
  .main-nav a::after { display: none; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

  .footer-full { display: none; }
  .footer-compact { display: block; }
}

/* =========================================================================
   Dark mode — shared surface tokens
   ========================================================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #232324;
    --bg-alt: #2b2b2c;
    --text: #ececed;
    --heading: #ffffff;
    --text-muted: #b0b0b1;
    --text-brown: #e7e2d8;
    --border: #3d3d3e;

    /* Keep the CTA panels dark; darken the sunken/panel/stripe surfaces so
       the (now light) text stays readable on top of them. */
    --panel-brown: #2f2410;
    --surface-sunken: #1c1c1d;
    --surface-panel: #303032;
    --surface-stripe: #292a2b;
  }

  /* Dark header + a hairline so it separates from page content on scroll */
  .site-header {
    background: #232324;
    box-shadow: 0 1px 0 var(--border), var(--shadow-header);
  }
  .nav-toggle span { background: var(--text); }

  /* Keep the ghost button's hover state readable in dark mode. */
  .btn-ghost { background: var(--surface-panel); color: var(--text); }
  .btn-ghost:hover,
  .btn-ghost:focus-visible { background: #fff; color: #232324; }
}
