/* Theme Pack: rolladenbau
   Business-Layout für Rollladenbau Huber
   - Blaue Farbakzente wie auf der Original-Website
   - Klare Typografie
*/

:root{
  --bg: #ffffff;
  --card: #ffffff;

  --text: #0b0d10;
  --muted: #3b4048;

  --border: #e5e7eb;
  --shadow: 0 16px 44px rgba(0,0,0,.10);

  /* Blaue Farbakzente passend zum Business-Style */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.14);

  --radius: 12px;
  --container: 1200px;

  /* Verlauf oben links */
  --grad-0: rgba(37, 99, 235, .20);
  --grad-1: rgba(37, 99, 235, .10);
  --grad-2: rgba(255, 255, 255, 0);
}

/* Dark Mode */
[data-theme="dark"]{
  --bg:#0b0c10;
  --card:#111317;

  --text:#e9e9ea;
  --muted:#b4b6bb;

  --border:#22252b;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.45);

  --accent:#3b82f6;
  --accent-hover:#2563eb;
  --accent-soft: rgba(59, 130, 246, 0.14);

  --grad-0: rgba(59, 130, 246, .20);
  --grad-1: rgba(59, 130, 246, .10);
  --grad-2: rgba(11, 12, 16, 0);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg:#0b0c10;
    --card:#111317;

    --text:#e9e9ea;
    --muted:#b4b6bb;

    --border:#22252b;
    --shadow: 0 14px 32px rgba(0, 0, 0, 0.45);

    --accent:#3b82f6;
    --accent-hover:#2563eb;
    --accent-soft: rgba(59, 130, 246, 0.14);

    --grad-0: rgba(59, 130, 246, .20);
    --grad-1: rgba(59, 130, 246, .10);
    --grad-2: rgba(11, 12, 16, 0);
  }
}

/* ============================================
   ROLLADENBAU THEME - EIGENER HEADER/FOOTER
   ============================================ */

/* Eigener Header (wird von theme.js eingesetzt) */
.rb-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

html[data-theme="dark"] .rb-header {
  background: linear-gradient(180deg, #0b0c10 0%, #111317 100%);
}

.rb-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.rb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

/* LOGO GRÖßE BEGRENZEN */
.rb-brand img {
  height: 48px !important;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.rb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.rb-brand-text strong {
  font-size: 1.1rem;
  color: var(--text);
}

.rb-brand-text span {
  font-size: 0.85rem;
  color: var(--muted);
}

.rb-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rb-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  transition: all 0.2s;
}

.rb-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rb-pill.rb-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.rb-pill.rb-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Footer Bar */
.rb-footbar {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 0;
  margin-top: auto;
}

.rb-foot-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.rb-foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.rb-foot-links a {
  color: #e2e8f0;
  text-decoration: none;
}

.rb-foot-links a:hover {
  color: var(--accent);
}

.rb-sep {
  color: #475569;
}

/* Default Header/Footer ausblenden wenn Theme aktiv */
.theme-replace-chrome .site-header,
.theme-replace-chrome .site-footer {
  display: none !important;
}

/* ============================================
   STANDARD CMS STYLES
   ============================================ */

/* Header Styling (Fallback) */
.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .site-header {
  background: linear-gradient(180deg, #0b0c10 0%, #111317 100%);
}

.brand img {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

/* Logo-Wrapper für Verlauf */
.logo-wrap {
  display: inline-flex;
  position: relative;
  overflow: visible;
}

/* Sicherstellen dass Header den Verlauf nicht abschneidet */
.site-header,
.header-inner,
.brand,
.rb-header,
.rb-inner,
.rb-brand {
  overflow: visible;
}

/* Logo im Dark Mode besser sichtbar machen - sanfter Verlauf NUR unter Logo */
html[data-theme="dark"] .logo-wrap::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -10px;
  right: -25px;
  bottom: -15px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.5) 45%, rgba(255,255,255,0) 75%);
  z-index: 0;
  pointer-events: none;
}
html[data-theme="dark"] .logo-wrap img {
  position: relative;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .logo-wrap::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -10px;
    right: -25px;
    bottom: -15px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.5) 45%, rgba(255,255,255,0) 75%);
    z-index: 0;
    pointer-events: none;
  }
  html[data-theme="auto"] .logo-wrap img {
    position: relative;
    z-index: 1;
  }
}

/* Navigation */
.nav a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

/* Hero Section - KEIN Hintergrund auf dem Kästchen */
.hero {
  background: transparent;
}

/* Seiten-Hintergrund mit blauem Farbverlauf NUR auf Startseite (Light Mode) */
/* Explizit light gesetzt */
html[data-theme="light"][data-page="index"] body {
  background: 
    linear-gradient(135deg, 
      rgba(37, 99, 235, 0.08) 0%, 
      rgba(255, 255, 255, 0) 50%,
      rgba(37, 99, 235, 0.05) 100%),
    #ffffff !important;
  background-attachment: fixed, scroll;
}

/* Auto-Modus mit System-Lightmode */
@media (prefers-color-scheme: light) {
  html[data-theme="auto"][data-page="index"] body {
    background: 
      linear-gradient(135deg, 
        rgba(37, 99, 235, 0.08) 0%, 
        rgba(255, 255, 255, 0) 50%,
        rgba(37, 99, 235, 0.05) 100%),
      #ffffff !important;
    background-attachment: fixed, scroll;
  }
}

.hero .kicker {
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.875rem;
}

.hero h1 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

.hero .lead {
  color: var(--text);
}

.accent {
  color: var(--accent);
}

/* Cards */
.card {
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card .card-title {
  color: var(--text);
  font-weight: 600;
}

/* Buttons */
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button.ghost {
  color: var(--accent);
  border-color: var(--accent);
}

.button.ghost:hover {
  background: var(--accent-soft);
}

/* Leistungen Grid */
.leistungen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.leistung-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.leistung-card h3 {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* PLZ Check Section */
.plz-check {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.plz-check a {
  color: var(--accent);
  font-weight: 600;
}

/* Kontakt Section */
.kontakt-info {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 24px;
}

.kontakt-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kontakt-item a {
  color: var(--accent);
  font-weight: 500;
}

/* Impressum/Datenschutz */
.legal-section h2 {
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-section h3 {
  color: var(--muted);
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Template hooks */
.hero--classic .lead { max-width: 60ch; }
.section--classic { padding-top: 30px; padding-bottom: 30px; }

/* Responsive */
@media (max-width: 768px) {
  .rb-inner {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .rb-brand-text {
    display: none;
  }
  
  .rb-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .rb-foot-links {
    flex-direction: column;
    gap: 4px;
  }
  
  .rb-sep {
    display: none;
  }
}

/* ============================================
   DARKMODE FIX - WICHTIGE REGELN AM ENDE
   Diese Regeln überschreiben alle anderen
   ============================================ */

/* Expliziter Darkmode (manuell gesetzt) */
html[data-theme="dark"] body {
  background: #0b0c10 !important;
}

html[data-theme="dark"][data-page="index"] body {
  background: 
    linear-gradient(135deg, 
      rgba(59, 130, 246, 0.15) 0%, 
      rgba(11, 12, 16, 0) 50%,
      rgba(59, 130, 246, 0.08) 100%),
    #0b0c10 !important;
  background-attachment: fixed, scroll;
}

/* Auto-Modus mit System-Darkmode - WICHTIG: gleiche Regeln wie expliziter Darkmode! */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] body {
    background: #0b0c10 !important;
  }

  html[data-theme="auto"][data-page="index"] body {
    background: 
      linear-gradient(135deg, 
        rgba(59, 130, 246, 0.15) 0%, 
        rgba(11, 12, 16, 0) 50%,
        rgba(59, 130, 246, 0.08) 100%),
      #0b0c10 !important;
    background-attachment: fixed, scroll;
  }
}
