/* Bauklempnerei Triebel – Modernes Design, Markenfarben beibehalten */

:root {
  --color-primary: #35b5eb;
  --color-primary-dark: #0968a1;
  --color-accent: #d14a89;
  --color-accent-light: #ed6d8e;
  --color-text: #333333;
  --color-text-muted: #555555;
  --color-heading: #3a3a3a;
  --color-white: #ffffff;
  --color-footer: #1e171f;
  --color-border: #e7e7e7;
  --gradient-bg: linear-gradient(180deg, #ffffff 0%, #35b5eb 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-lg: 16px;
  --header-height: 110px;
  --header-height-scrolled: 68px;
  --logo-height: 80px;
  --logo-height-scrolled: 46px;
  --font-heading: 'Raleway', 'Segoe UI', sans-serif;
  --font-body: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.3s ease;
  --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.7;
  background: var(--gradient-bg);
  background-attachment: fixed;
  min-height: 100vh;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.loaded .animate-in {
  animation: fadeInUp 0.75s var(--transition-slow) both;
}

body.loaded .animate-in-delay-1 { animation-delay: 0.1s; }
body.loaded .animate-in-delay-2 { animation-delay: 0.2s; }
body.loaded .animate-in-delay-3 { animation-delay: 0.3s; }
body.loaded .animate-in-delay-4 { animation-delay: 0.4s; }
body.loaded .animate-in-delay-5 { animation-delay: 0.5s; }

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.3;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
  transition: height var(--transition-slow), box-shadow var(--transition-slow), padding var(--transition-slow);
}

.site-header.scrolled {
  height: var(--header-height-scrolled);
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
  transition: height var(--transition-slow);
}

.logo {
  display: flex;
  align-items: center;
  transition: transform var(--transition-slow);
}

.logo img {
  height: var(--logo-height);
  width: auto;
  transition: height var(--transition-slow);
}

.site-header.scrolled .logo img {
  height: var(--logo-height-scrolled);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.main-nav a {
  display: block;
  padding: 0.55rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-heading);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition), font-size var(--transition-slow), padding var(--transition-slow);
}

.site-header.scrolled .main-nav a {
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-heading);
  transition: var(--transition);
}

/* Hero Slider */
.hero {
  margin-top: var(--header-height);
  position: relative;
  overflow: hidden;
  height: clamp(320px, 55vh, 560px);
}

.hero-slider {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  overflow: hidden;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  position: absolute;
  width: 100%;
  height: calc(100% + 35%);
  top: -17%;
  left: 0;
  object-fit: cover;
}

.hero-overlay {
  display: none;
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-content-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.65rem 1.25rem;
  border-radius: 0;
  border: none;
  box-shadow: none;
  pointer-events: auto;
}

body:not(.loaded) .hero-content-box {
  opacity: 0;
}

body.loaded .hero-content-box {
  animation: heroBoxIn 0.25s ease both;
}

body.loaded .hero-content h1,
body.loaded .hero-content .subtitle {
  animation: heroTextIn 0.32s ease 0.05s both;
}

@keyframes heroBoxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content h1 {
  color: var(--color-white);
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.25rem;
}

.hero-content .subtitle {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
  margin: 0;
}

.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition);
}

.hero-dot.active {
  background: var(--color-white);
}

/* Page Header (subpages) */
.page-header {
  margin-top: var(--header-height);
  position: relative;
  overflow: hidden;
  padding: 3rem 0;
  text-align: center;
  color: var(--color-white);
}

.page-header-bg {
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 160%;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  will-change: transform;
  z-index: 0;
}

.page-header-content {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  color: var(--color-white);
}

.page-header .breadcrumb {
  margin-top: 0.5rem;
  opacity: 0.85;
  font-size: 0.9rem;
}

.page-header .breadcrumb a {
  color: var(--color-white);
  text-decoration: underline;
}

.page-header .breadcrumb a:hover {
  color: rgba(255, 255, 255, 0.8);
}

body:not(.loaded) .page-header--enter .page-header-bg,
body:not(.loaded) .page-header--enter .page-header-content {
  opacity: 0;
}

body.loaded .page-header--enter .page-header-bg {
  animation: fadeIn 0.32s ease both;
}

body.loaded .page-header--enter .page-header-content {
  animation: pageHeaderContentIn 0.42s ease 0.04s both;
}

@keyframes pageHeaderContentIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body:not(.loaded) .main-content--sub {
  opacity: 0;
}

body.loaded .main-content--sub {
  animation: fadeInUp 0.85s ease 0.28s both;
}

/* Main Content */
.main-content {
  padding: 3rem 0 4rem;
}

.content-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
}

.content-card h2 {
  color: var(--color-primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-primary);
  display: inline-block;
}

/* Home: Welcome Section */
.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
}

.welcome-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #f8fbfd;
}

.welcome-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.welcome-text .badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.welcome-text p {
  margin-bottom: 1rem;
  text-align: justify;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}

.stat-item {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--color-primary);
}

.stat-item .number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.stat-item .label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-primary);
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.service-card h3 {
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.service-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--color-white);
  font-size: 1.25rem;
}

/* Leistungen List */
.leistungen-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

.leistungen-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fbfd;
  border-radius: var(--radius);
  border-left: 3px solid var(--color-primary);
}

.leistungen-list li::before {
  content: '✓';
  color: var(--color-accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* References Grid */
.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.reference-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.reference-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.reference-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.reference-card .ref-body {
  padding: 1.25rem;
}

.reference-card h3 {
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.reference-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.contact-grid .content-card,
.contact-grid .map-container {
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-item:last-child {
  margin-bottom: 0;
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.contact-info-item h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #e8f4fa;
  position: relative;
}

.map-body {
  flex: 1;
  position: relative;
  min-height: 0;
}

.map-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-consent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  height: 100%;
  min-height: 280px;
  gap: 1rem;
}

.map-consent.hidden {
  display: none;
}

.map-legal {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  max-width: 420px;
  line-height: 1.6;
}

.map-legal a {
  text-decoration: underline;
}

.map-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.map-footer {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  background: #f8fbfd;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.map-external-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-accent-light);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Legal Pages */
.legal-content h2 {
  color: var(--color-primary-dark);
  margin: 2rem 0 1rem;
  font-size: 1.25rem;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  margin-bottom: 0.75rem;
}

.legal-content ul {
  padding-left: 1.5rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: var(--color-white);
  padding: 3rem;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-top: 2rem;
}

.cta-section h2 {
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

.cta-section p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
  background: var(--color-footer);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h3 {
  color: var(--color-white);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.5rem;
}

.footer-grid a {
  color: rgba(255, 255, 255, 0.75);
}

.footer-grid a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  z-index: 900;
  transition: background var(--transition), transform var(--transition);
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
}

/* Section Title */
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.section-title .divider {
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.section-title p {
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
}

/* Responsive */
@media (min-width: 901px) {
  .contact-grid .content-card,
  .contact-grid .map-container {
    min-height: 520px;
  }
}

@media (max-width: 900px) {
  .welcome-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid .content-card,
  .contact-grid .map-container {
    min-height: auto;
    height: auto;
  }

  .map-body {
    min-height: 300px;
  }

  .map-consent {
    min-height: 300px;
    padding: 1.5rem 1rem;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero {
    height: clamp(160px, 27.5vh, 280px);
  }

  .hero-slider {
    height: 100%;
  }

  .hero-slide img {
    height: calc(100% + 20%);
    top: -10%;
    object-fit: cover;
    object-position: center 35%;
  }

  .hero-content {
    padding: 0;
  }

  .hero-content-box {
    padding: 0.75rem 0.75rem;
  }

  .hero-content h1 {
    font-size: clamp(1rem, 4.5vw, 1.35rem);
    margin-bottom: 0.15rem;
  }

  .hero-content .subtitle {
    font-size: 0.8rem;
  }

  .hero-dots {
    bottom: 0.5rem;
  }

  .hero-dot {
    width: 8px;
    height: 8px;
  }
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
    pointer-events: none;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav a {
    padding: 0.75rem 1rem;
  }

  .references-grid {
    grid-template-columns: 1fr;
  }
}
