/* Raumpartner Heib – kleine Ergänzungen zum Tailwind-Play-Setup */

/* ===== Selbst gehostete Schriften (kein Google-Connect zur Laufzeit) ===== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/barlow-condensed-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/barlow-condensed-700.woff2') format('woff2');
}

/* ===== Farb- & Oberflächen-Variablen (RGB-Triplets für Tailwind-Opacity) =====
   Akzentfarbe wird vom Farbwechsler, Hell/Dunkel von main.js (Klasse "dark"
   auf <html>) zur Laufzeit umgeschrieben. */
:root {
  --accent-rgb: 203 96 44;        /* #CB602C Terracotta (Standard) */
  --accent-dark-rgb: 168 77 32;   /* #A84D20 */
  --accent-light-rgb: 224 138 90; /* #E08A5A */

  --page-rgb: 242 239 231;        /* Seiten-Hintergrund hell */
  --page-dark-rgb: 232 227 214;   /* Sekundär-Hintergrund hell */
  --surface-rgb: 255 255 255;     /* Karten/Formulare hell */
  --ink-rgb: 44 30 24;            /* Fließtext hell */
  --muted-rgb: 106 97 93;         /* gedämpfter Text hell */
}
html.dark {
  --page-rgb: 20 17 15;
  --page-dark-rgb: 30 25 22;
  --surface-rgb: 38 32 28;
  --ink-rgb: 240 235 227;
  --muted-rgb: 176 165 158;
}

html { font-size: 17px; scroll-behavior: smooth; }

/* Sanfter Übergang bei Farbwechsel & Hell/Dunkel-Umschaltung */
body, .bg-surface, .bg-page, .bg-page-dark, #site-header, header, footer {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.nav-link {
  color: rgb(var(--ink-rgb));
  position: relative;
  transition: color .2s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 2px; width: 0;
  background: rgb(var(--accent-rgb));
  transition: width .25s ease;
}
.nav-link:hover { color: rgb(var(--accent-rgb)); }
.nav-link:hover::after { width: 100%; }

/* Header transparent über Hero, opak beim Scrollen */
#site-header.scrolled {
  background: rgb(var(--page-rgb));
  box-shadow: 0 1px 0 rgba(44,30,24,.08);
}
/* Wenn Header transparent (Hero oben) → helles Logo + helle Links auf dunklem Hero. */
#site-header.transparent .nav-link { color: #F2EFE7; }
#site-header.transparent .nav-link:hover { color: rgb(var(--accent-light-rgb)); }
#site-header.transparent .logo-dark { display: none; }
#site-header.transparent .logo-light { display: block; }
#site-header.transparent #burger,
#site-header.transparent #mode-toggle { color: #F2EFE7; border-color: rgba(242,239,231,.35); }

/* dezente Holzstruktur als Sektionstrenner optional nutzbar */
.wood-divider {
  background: url("../img/wood-texture.svg") repeat-x center / auto 100%;
  height: 8px; opacity: .5;
}

/* ===== Gradient-Buttons (CTA/Primärbuttons) ===== */
.btn-gradient {
  background-image: linear-gradient(
    135deg,
    rgb(var(--accent-dark-rgb)) 0%,
    rgb(var(--accent-rgb)) 55%,
    rgb(var(--accent-light-rgb)) 100%
  );
  background-size: 160% 160%;
  background-position: 0% 50%;
}
.btn-gradient:hover {
  filter: brightness(1.06) saturate(1.05);
  transform: translateY(-1px);
  background-position: 100% 50%;
}

/* ===== Dunkel-/Hellmodus-Toggle ===== */
#mode-toggle .mode-icon-sun,
#mode-toggle .mode-icon-moon { transition: opacity .2s ease, transform .3s ease; }
html.dark #mode-toggle .mode-icon-sun { display: none; }
html.dark #mode-toggle .mode-icon-moon { display: block; }
#mode-toggle .mode-icon-moon { display: none; }

/* ===== Farbwechsler (Theme-Switcher) ===== */
#theme-switcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  font-family: 'Inter', system-ui, sans-serif;
}
#theme-switcher .ts-toggle {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background-image: linear-gradient(135deg, rgb(var(--accent-dark-rgb)), rgb(var(--accent-rgb)), rgb(var(--accent-light-rgb)));
  border: 3px solid rgb(var(--surface-rgb));
  box-shadow: 0 6px 20px rgba(44,30,24,.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}
#theme-switcher .ts-toggle:hover { transform: scale(1.06) rotate(8deg); }
#theme-switcher .ts-toggle svg { width: 20px; height: 20px; color: #fff; }

#theme-switcher .ts-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: 232px;
  background: rgb(var(--surface-rgb));
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(44,30,24,.25);
  padding: 14px;
  opacity: 0;
  transform: translateY(8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#theme-switcher.open .ts-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#theme-switcher .ts-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgb(var(--muted-rgb));
  margin-bottom: 10px;
}
#theme-switcher .ts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
#theme-switcher .ts-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9999px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform .15s ease;
}
#theme-switcher .ts-swatch:hover { transform: scale(1.12) rotate(-6deg); }
#theme-switcher .ts-swatch.active {
  border-color: rgb(var(--ink-rgb));
  box-shadow: 0 0 0 2px rgb(var(--surface-rgb)) inset;
}

/* ===== Sofort-Kontakt-Widget ===== */
#quick-contact {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  font-family: 'Inter', system-ui, sans-serif;
}
#quick-contact .qc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 16px;
  border-radius: 9999px;
  background-image: linear-gradient(135deg, rgb(var(--accent-dark-rgb)), rgb(var(--accent-rgb)));
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  border: 3px solid rgb(var(--surface-rgb));
  box-shadow: 0 6px 20px rgba(44,30,24,.25);
  cursor: pointer;
  transition: transform .2s ease;
}
#quick-contact .qc-toggle:hover { transform: scale(1.04); }
#quick-contact .qc-toggle svg { width: 18px; height: 18px; }
#quick-contact .qc-panel {
  position: absolute;
  left: 0;
  bottom: 60px;
  width: 240px;
  background: rgb(var(--surface-rgb));
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(44,30,24,.25);
  padding: 16px;
  opacity: 0;
  transform: translateY(8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#quick-contact.open .qc-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#quick-contact .qc-title {
  font-size: .8rem;
  font-weight: 600;
  color: rgb(var(--ink-rgb));
  margin-bottom: 2px;
}
#quick-contact .qc-sub {
  font-size: .75rem;
  color: rgb(var(--muted-rgb));
  margin-bottom: 12px;
}
#quick-contact .qc-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: rgb(var(--ink-rgb));
  transition: background-color .15s ease;
}
#quick-contact .qc-action:hover { background: rgb(var(--page-rgb)); }
#quick-contact .qc-action svg { width: 18px; height: 18px; color: rgb(var(--accent-rgb)); flex-shrink: 0; }
#quick-contact .qc-action + .qc-action { margin-top: 2px; }

/* ===== Mobile-Menü: sanftes Slide/Fade ===== */
#mobile-menu {
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .38s cubic-bezier(.16,.84,.44,1), opacity .28s ease;
}
#mobile-menu.open { max-height: 680px; opacity: 1; }

.mob-head {
  margin: 12px 12px 2px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgb(var(--muted-rgb));
}

/* ===== Mega-Menü (Desktop) ===== */
.mega-item { position: relative; }
.mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.mega-trigger.nav-link::after { display: none; }
.mega-caret { width: 13px; height: 13px; transition: transform .25s ease; }
.mega-item:hover .mega-caret,
.mega-item:focus-within .mega-caret,
.mega-item.open .mega-caret { transform: rotate(180deg); }

.mega-panel {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  width: 560px;
  max-width: min(92vw, 620px);
  padding: 18px;
  background: rgb(var(--surface-rgb));
  border: 1px solid rgb(var(--ink-rgb) / .10);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(28,20,16,.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 60;
}
/* unsichtbare Brücke, damit der Hover zwischen Trigger und Panel nicht abreißt */
.mega-panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -18px;
  height: 18px;
}
.mega-item:hover .mega-panel,
.mega-item:focus-within .mega-panel,
.mega-item.open .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* rechtsbündige Variante (Panel würde sonst rechts aus dem Viewport laufen) */
.mega-right { left: auto; right: 0; transform: translateX(0) translateY(10px); }
.mega-item:hover .mega-right,
.mega-item:focus-within .mega-right,
.mega-item.open .mega-right { transform: translateX(0) translateY(0); }
.mega-wide { width: 640px; }

.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mega-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border-radius: 14px;
  color: rgb(var(--ink-rgb));
  transition: background-color .18s ease, transform .18s ease;
}
.mega-card:hover { background: rgb(var(--page-rgb)); transform: translateY(-2px); }
.mega-ic {
  display: inline-flex;
  width: 38px; height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgb(var(--accent-rgb) / .12);
  color: rgb(var(--accent-rgb));
}
.mega-ic svg { width: 20px; height: 20px; }
.mega-tt {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: rgb(var(--ink-rgb));
}
.mega-de { font-size: .82rem; line-height: 1.4; color: rgb(var(--muted-rgb)); }
.mega-foot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: rgb(var(--accent-rgb));
  transition: background-color .18s ease;
}
.mega-foot:hover { background: rgb(var(--accent-rgb) / .10); }

.mega-geo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
}
.mega-geo-head .mega-tt { font-size: 1rem; }
.mega-geo-all {
  font-size: .8rem;
  font-weight: 600;
  color: rgb(var(--accent-rgb));
  white-space: nowrap;
}
.mega-geo-all:hover { text-decoration: underline; }
.mega-geo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 8px; }
.mega-geo-grid a {
  padding: 8px 10px;
  border-radius: 9px;
  font-size: .85rem;
  font-weight: 500;
  color: rgb(var(--ink-rgb));
  transition: background-color .15s ease, color .15s ease;
}
.mega-geo-grid a:hover { background: rgb(var(--page-rgb)); color: rgb(var(--accent-rgb)); }

/* ===== Scroll-Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.16,.84,.44,1), transform .7s cubic-bezier(.16,.84,.44,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ===== Blog: Sidebar & Cards ===== */
.blog-search {
  transition: box-shadow .2s ease, border-color .2s ease;
}
.blog-search:focus-within {
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .15);
}
.blog-card { transition: transform .25s ease, box-shadow .25s ease; }
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(44,30,24,.14); }
mark.search-hit { background: rgb(var(--accent-light-rgb) / .4); color: inherit; border-radius: 3px; padding: 0 2px; }
