/* CLAUDE: ======================================================================
   COMPONENTS.CSS – Wiederverwendbare UI-Komponenten Teil 1
   Buttons, Cards, Forms
   Ziel: ≤200 Zeilen
   ====================================================================== */

/* CLAUDE: ======================================================================
   6.1 BUTTONS
   ====================================================================== */

/* CLAUDE: .btn – Basis-Styles für alle Buttons (Padding, Border-Radius, Transition) */
/* CLAUDE: Ändern: Für rechteckige Buttons border-radius: 0; setzen */
.btn {
  display: inline-block;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: clamp(0.9375rem, 1.2vw, 1rem); /* 15–16px */
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
}

/* CLAUDE: Button Focus – Box-Shadow Focus-Ring für Tastatur-Navigation */
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* CLAUDE: Button Active – transform scale(0.98) für Klick-Feedback */
.btn:active {
  transform: scale(0.98);
}

/* CLAUDE: .btn-primary – Haupt-CTA (Gold-Hintergrund, White-Text) */
/* CLAUDE: Ändern: Für andere Primärfarbe background-color auf var(--color-brown) setzen */
.btn-primary {
  color: #fff;
  background-color: var(--color-gold);
  border-color: var(--color-gold);
}

/* CLAUDE: Button Primary Hover – Gold-Hover (10% heller) */
.btn-primary:hover {
  color: #fff;
  background-color: var(--color-gold-hover);
  border-color: var(--color-gold-hover);
}

/* CLAUDE: Button Primary Active – Gold-Active (15% dunkler) */
.btn-primary:active {
  background-color: var(--color-gold-active);
  border-color: var(--color-gold-active);
}

/* CLAUDE: .btn-secondary – Sekundär-Button (Brown-Hintergrund, White-Text) */
/* CLAUDE: Ändern: Für andere Sekundärfarbe background-color auf var(--color-umber) setzen */
.btn-secondary {
  color: #fff;
  background-color: var(--color-brown);
  border-color: var(--color-brown);
}

/* CLAUDE: Button Secondary Hover – Brown-Hover (10% heller) */
.btn-secondary:hover {
  color: #fff;
  background-color: var(--color-brown-hover);
  border-color: var(--color-brown-hover);
}

/* CLAUDE: Button Secondary Active – Umber (noch dunkler) */
.btn-secondary:active {
  background-color: var(--color-umber);
  border-color: var(--color-umber);
}

/* CLAUDE: .btn-outline – Outline-Button (transparenter Hintergrund, Gold-Border) */
/* CLAUDE: Ändern: Für andere Border-Farbe border-color auf var(--color-brown) setzen */
.btn-outline {
  color: var(--color-gold);
  background-color: transparent;
  border-color: var(--color-gold);
}

/* CLAUDE: Button Outline Hover – invertiert (Gold-Hintergrund, White-Text) */
.btn-outline:hover {
  color: #fff;
  background-color: var(--color-gold);
  border-color: var(--color-gold);
}

/* CLAUDE: Button Outline Active – Gold-Active */
.btn-outline:active {
  background-color: var(--color-gold-active);
  border-color: var(--color-gold-active);
}

/* CLAUDE: .btn-text – Text-Button (kein Hintergrund, kein Border, nur Underline) */
/* CLAUDE: Ändern: Für andere Text-Farbe color auf var(--color-umber) setzen */
.btn-text {
  color: var(--color-brown);
  background-color: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: var(--space-xs) var(--space-sm);
}

/* CLAUDE: Button Text Hover – color Gold, dickere Underline */
.btn-text:hover {
  color: var(--color-gold);
  text-decoration-thickness: 2px;
}

/* CLAUDE: .btn-sm – Kleiner Button (kleineres Padding, Font-Size) */
/* CLAUDE: Ändern: Für noch kleinere Buttons padding auf var(--space-xs) reduzieren */
.btn-sm {
  font-size: clamp(0.8125rem, 1vw, 0.875rem); /* 13–14px */
  padding: var(--space-xs) var(--space-md);
}

/* CLAUDE: .btn-lg – Großer Button (größeres Padding, Font-Size) */
/* CLAUDE: Ändern: Für noch größere Buttons padding auf var(--space-md) var(--space-2xl) setzen */
.btn-lg {
  font-size: clamp(1.125rem, 1.5vw, 1.25rem); /* 18–20px */
  padding: var(--space-md) var(--space-xl);
}

/* CLAUDE: .btn-block – Volle Breite (100%) */
/* CLAUDE: Ändern: Für zentrierten Text text-align: center; belassen */
.btn-block {
  display: block;
  width: 100%;
}

/* CLAUDE: .btn:disabled – Deaktivierter Button (grau, kein Pointer) */
/* CLAUDE: Ändern: Für andere Disabled-Farbe opacity auf 0.4 reduzieren */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* CLAUDE: ======================================================================
   6.2 CARDS
   ====================================================================== */

/* CLAUDE: .card – Basis-Styles für Cards (Hintergrund, Border, Shadow) */
/* CLAUDE: Ändern: Für flache Cards box-shadow: none; setzen */
.card {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

/* CLAUDE: Card Hover – Shadow-MD, leichtes Lift (translateY) */
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* CLAUDE: .card-image – Bild-Container oben in Card (aspect-ratio 16:9) */
/* CLAUDE: Ändern: Für andere Aspect-Ratio aspect-ratio: 4 / 3; setzen */
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* CLAUDE: Card-Image img – Bild füllt Container, object-fit: cover */
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

/* CLAUDE: Card Hover – Image Scale (1.05) für Zoom-Effekt */
.card:hover .card-image img {
  transform: scale(1.05);
}

/* CLAUDE: .card-body – Content-Container in Card (Padding) */
/* CLAUDE: Ändern: Für mehr Padding padding auf var(--space-xl) erhöhen */
.card-body {
  padding: var(--space-lg);
}

/* CLAUDE: .card-title – Überschrift in Card, Playfair Display */
/* CLAUDE: Ändern: Für Source Sans Pro font-family auf 'Source Sans Pro' setzen */
.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.25rem, 2vw, 1.5rem); /* 20–24px */
  font-weight: 600;
  color: var(--color-umber);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

/* CLAUDE: .card-text – Body-Text in Card, Source Sans Pro */
/* CLAUDE: Ändern: Für kleineren Text clamp(0.875rem, ..., 1rem) setzen */
.card-text {
  font-size: clamp(0.9375rem, 1.2vw, 1rem); /* 15–16px */
  color: var(--color-graphite);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

/* CLAUDE: .card-footer – Footer in Card (Border-Top, Meta-Infos) */
/* CLAUDE: Ändern: Für andere Border-Farbe border-top-color anpassen */
.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-color: var(--color-marble);
}

/* CLAUDE: .card-featured – Featured Card (Gold-Border, Gold-Badge) */
/* CLAUDE: Ändern: Für andere Featured-Farbe border-color auf var(--color-brown) setzen */
.card-featured {
  border: 2px solid var(--color-gold);
  position: relative;
}

/* CLAUDE: Featured-Badge – ::before Pseudo-Element oben rechts */
.card-featured::before {
  content: 'Featured';
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background-color: var(--color-gold);
  color: #fff;
  font-size: 0.75rem; /* 12px */
  font-weight: 600;
  text-transform: uppercase;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  z-index: 10;
}

/* CLAUDE: ======================================================================
   6.3 FORMS
   ====================================================================== */

/* CLAUDE: .form-group – Container für Label + Input (Margin-Bottom) */
/* CLAUDE: Ändern: Für andere Abstände margin-bottom auf var(--space-xl) erhöhen */
.form-group {
  margin-bottom: var(--space-lg);
}

/* CLAUDE: .form-label – Label für Inputs, Source Sans Pro SemiBold */
/* CLAUDE: Ändern: Für kleinere Labels font-size auf 0.875rem reduzieren */
.form-label {
  display: block;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1rem; /* 16px */
  font-weight: 600;
  color: var(--color-brown);
  margin-bottom: var(--space-xs);
  line-height: 1.5;
}

/* CLAUDE: .form-control – Basis-Styles für alle Form-Inputs */
/* CLAUDE: Ändern: Für andere Border-Farbe border-color anpassen */
.form-control {
  display: block;
  width: 100%;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: clamp(0.9375rem, 1.2vw, 1rem); /* 15–16px */
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-graphite);
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

/* CLAUDE: Form-Control Focus – Border Gold, Box-Shadow Focus-Ring */
.form-control:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: var(--focus-ring);
}

/* CLAUDE: Form-Control Disabled – grauer Hintergrund, kein Pointer */
.form-control:disabled {
  background-color: var(--color-marble);
  cursor: not-allowed;
  opacity: 0.6;
}

/* CLAUDE: textarea.form-control – min-height 120px, resize vertical */
/* CLAUDE: Ändern: Für höhere Textareas min-height auf 200px erhöhen */
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* CLAUDE: select.form-control – padding-right für Dropdown-Arrow */
/* CLAUDE: Ändern: Für Custom-Select-Arrow background-image verwenden */
select.form-control {
  padding-right: var(--space-xl);
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%237C4A21" d="M6 9L1 4h10z"/></svg>');
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  background-size: 12px;
}

/* CLAUDE: .form-check – Container für Checkbox/Radio + Label (Flexbox) */
/* CLAUDE: Ändern: Für andere Abstände gap auf var(--space-md) erhöhen */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* CLAUDE: .form-check-input – Checkbox/Radio-Input (größer, besser klickbar) */
.form-check-input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-gold);
}

/* CLAUDE: .form-check-label – Label für Checkbox/Radio (cursor pointer) */
.form-check-label {
  cursor: pointer;
  font-size: clamp(0.9375rem, 1.2vw, 1rem); /* 15–16px */
  color: var(--color-graphite);
  line-height: 1.5;
}

/* CLAUDE: .form-error – Fehlermeldung unter Input (rot, klein) */
/* CLAUDE: Ändern: Für andere Fehlerfarbe color auf var(--color-warning) setzen */
.form-error {
  display: block;
  font-size: 0.875rem; /* 14px */
  color: var(--color-danger);
  margin-top: var(--space-xs);
  line-height: 1.5;
}

/* CLAUDE: .form-control.is-invalid – Input mit Fehler (roter Border) */
.form-control.is-invalid {
  border-color: var(--color-danger);
}

/* CLAUDE: .form-control.is-invalid:focus – Focus mit rotem Shadow */
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(139, 30, 30, 0.3);
}

/* CLAUDE: .form-control.is-valid – Input mit Success (grüner Border) */
/* CLAUDE: Ändern: Für andere Success-Farbe border-color anpassen */
.form-control.is-valid {
  border-color: var(--color-success);
}

/* CLAUDE: .form-control.is-valid:focus – Focus mit grünem Shadow */
.form-control.is-valid:focus {
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.3);
}

/* CLAUDE: ======================================================================
   PERFORMANCE-OPTIMIERUNG: BILDER MIT ASPECT-RATIO (CLS vermeiden)
   Erstellt: 28.10.2025 - verhindert Layout-Sprünge beim Laden
   ====================================================================== */

/* CLAUDE: Alle img-Elemente - width/height aus HTML nutzen für aspect-ratio */
/* CLAUDE: Browser berechnet automatisch aspect-ratio aus width/height Attributen */
/* CLAUDE: Verhindert CLS (Cumulative Layout Shift) während Bilder laden */
img {
  max-width: 100%; /* CLAUDE: Responsive - niemals breiter als Container */
  height: auto; /* CLAUDE: Höhe passt sich automatisch an Breite an */
  display: block; /* CLAUDE: Entfernt Whitespace unter Bildern */
  aspect-ratio: attr(width) / attr(height); /* CLAUDE: Zukunft: CSS attr() (noch nicht supported) */
}

/* CLAUDE: Picture-Element - für WebP-Fallback-Bilder */
picture {
  display: block; /* CLAUDE: Verhindert inline-spacing */
}

/* CLAUDE: Picture > img - gleiche Regeln wie standalone img */
picture img {
  width: 100%; /* CLAUDE: Füllt Picture-Container komplett aus */
  height: auto;
}

/* CLAUDE: .hero-image – Hero-Bild mit festem 21:9 Aspect-Ratio (Desktop) */
/* CLAUDE: Verhindert Layout-Shift bei Hero-Bildern (kritisch für LCP) */
.hero-image {
  aspect-ratio: 21 / 9; /* CLAUDE: Widescreen-Format (2.33:1) */
  object-fit: cover; /* CLAUDE: Beschneidet Bild, füllt Container */
  width: 100%;
}

/* CLAUDE: .hero-image – Responsive auf Mobile (16:9 statt 21:9) */
@media (max-width: 768px) {
  .hero-image {
    aspect-ratio: 16 / 9; /* CLAUDE: Standard-Format für Mobile */
  }
}

/* CLAUDE: .ddi-card__image – Card-Bilder mit festem 16:9 Aspect-Ratio */
/* CLAUDE: Verhindert unterschiedliche Card-Höhen durch unterschiedliche Bildformate */
.ddi-card__image,
.card-img-top {
  aspect-ratio: 16 / 9; /* CLAUDE: Standard-Format (1.78:1) */
  object-fit: cover; /* CLAUDE: Beschneidet Bild, füllt Container */
  width: 100%;
}

/* CLAUDE: .wp-post-image – Featured Images in Blog-Posts */
/* CLAUDE: Verhindert CLS bei Blog-Teasern */
.wp-post-image {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* CLAUDE: .objekt-card__image – Objekt-Cards mit 4:3 Aspect-Ratio */
/* CLAUDE: 4:3 besser für Immobilien-Fotos (Außenaufnahmen) */
.objekt-card__image {
  aspect-ratio: 4 / 3; /* CLAUDE: Klassisches Foto-Format (1.33:1) */
  object-fit: cover;
  width: 100%;
}

/* CLAUDE: .avatar – Runde Avatare mit festem 1:1 Aspect-Ratio */
.avatar {
  aspect-ratio: 1 / 1; /* CLAUDE: Quadratisch */
  object-fit: cover;
  border-radius: 50%; /* CLAUDE: Rund */
}

/* CLAUDE: .logo – Logo mit automatischem Aspect-Ratio (variabel) */
/* CLAUDE: Nutzt width/height aus HTML, kein festes Ratio */
.logo img,
.site-logo img {
  aspect-ratio: auto; /* CLAUDE: Behält Original-Proportionen */
  object-fit: contain; /* CLAUDE: Zeigt gesamtes Logo (kein Beschnitt) */
}
