/*
 * Blumenkind Daycare Website - Main Stylesheet
 * "Classic Storybook" Design System
 * Mobile-first responsive approach
 */

/* CSS Imports */
@import url("responsive.css");
@import url("components.css");

/* === 1. CSS CUSTOM PROPERTIES (DESIGN TOKENS) === */
:root {
  /* New Color Palette - Selected by Design */
  --dark-slate-gray: #294145;
  --dark-slate-gray-2: #305d5c;
  --zomp: #659f8d;
  --cambridge-blue: #a6cdb6;
  --eggshell: #e9e7d1;
  --sunset: #fcd28c;
  --saffron: #f3c53d;
  --gamboge: #e99f33;
  --fire-engine-red: #cd242e;
  --lion: #bb9972;

  /* Semantic Color Mappings */
  --color-primary-mint: var(--cambridge-blue);
  --color-primary-pink: var(--eggshell);
  --color-primary-mint-darker: var(--zomp);
  --color-primary-pink-darker: var(--sunset);

  /* Updated Neutral Colors */
  --color-white: #ffffff;
  --color-cream: var(--eggshell);
  --color-soft-gray: #f5f5f5;
  --color-medium-gray: var(--lion);
  --color-dark-gray: var(--dark-slate-gray-2);
  --color-charcoal: var(--dark-slate-gray);

  /* New Accent Colors */
  --color-accent-yellow: var(--sunset);
  --color-accent-warm: var(--saffron);
  --color-accent-orange: var(--gamboge);
  --color-accent-red: var(--fire-engine-red);

  /* Typography Scale - Enhanced for better hierarchy */
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-base: 1.125rem; /* 18px - Increased from 16px for better readability */
  --font-size-lg: 1.25rem; /* 20px - Increased from 18px */
  --font-size-xl: 1.5rem; /* 24px - Increased from 20px */
  --font-size-2xl: 1.875rem; /* 30px - Increased from 24px */
  --font-size-3xl: 2.25rem; /* 36px - Increased from 30px */
  --font-size-4xl: 2.75rem; /* 44px - Increased from 36px */
  --font-size-5xl: 3.5rem; /* 56px - Increased from 48px */

  /* Spacing Scale */
  --space-xs: 0.25rem; /* 4px */
  --space-sm: 0.5rem; /* 8px */
  --space-md: 1rem; /* 16px */
  --space-lg: 1.5rem; /* 24px */
  --space-xl: 2rem; /* 32px */
  --space-2xl: 3rem; /* 48px */
  --space-3xl: 4rem; /* 64px */
  --space-4xl: 6rem; /* 96px */

  /* Border Radius */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 1rem; /* 16px */
  --radius-xl: 2rem; /* 32px */
  --radius-full: 50%;

  /* Shadows */
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* === 2. RESET & BASE STYLES === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-charcoal);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* German language support */
  font-feature-settings:
    "kern" 1,
    "liga" 1;
  text-rendering: optimizeLegibility;
}

/* === 3. TYPOGRAPHY SYSTEM === */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-md) 0;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-charcoal);
}

h1 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

p {
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-base);
  line-height: 1.6;
}

/* === 4. LAYOUT FOUNDATION === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header styles */
.site-header {
  background: transparent;
  padding: 0;
}

.site-header--minimal {
  height: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* Legal pages header styling */
.page-legal .site-header {
  background: var(--color-white);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-soft-gray);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.page-legal .site-title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.page-legal .site-title a {
  color: var(--color-charcoal);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-legal .site-title a:hover {
  color: var(--color-primary-mint-darker);
}

.page-legal .breadcrumb-navigation {
  margin-top: var(--space-sm);
}

.page-legal .breadcrumb {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-sm);
}

.page-legal .breadcrumb-item {
  display: flex;
  align-items: center;
}

.page-legal .breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin: 0 var(--space-xs);
  color: var(--color-medium-gray);
}

.page-legal .breadcrumb-item a {
  color: var(--color-primary-mint-darker);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-legal .breadcrumb-item a:hover {
  color: var(--color-charcoal);
  text-decoration: underline;
}

.page-legal .breadcrumb-item.active {
  color: var(--color-medium-gray);
  font-weight: 500;
}

.section {
  padding: var(--space-2xl) 0;
}

.section--compact {
  padding: var(--space-xl) 0;
}

/* === 5. UTILITY CLASSES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for accessibility - hidden by default, visible on focus */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-charcoal);
  color: var(--color-white);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 6px;
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-sm {
  margin-bottom: var(--space-sm);
}
.mb-md {
  margin-bottom: var(--space-md);
}
.mb-lg {
  margin-bottom: var(--space-lg);
}
.mb-xl {
  margin-bottom: var(--space-xl);
}

.mt-0 {
  margin-top: 0;
}
.mt-sm {
  margin-top: var(--space-sm);
}
.mt-md {
  margin-top: var(--space-md);
}
.mt-lg {
  margin-top: var(--space-lg);
}
.mt-xl {
  margin-top: var(--space-xl);
}

/* === 6. IMAGE OPTIMIZATION CLASSES === */
.img-responsive {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy loading implementation */
.img-lazy {
  opacity: 0;
  transform: scale(1.05);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  filter: blur(2px);
}

.img-lazy.loaded {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* Loading placeholder */
.img-lazy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    var(--color-soft-gray) 0%,
    var(--color-medium-gray) 50%,
    var(--color-soft-gray) 100%
  );
  background-size: 200% 100%;
  animation: loading-shimmer 2s infinite;
  border-radius: inherit;
}

.img-lazy.loaded::before {
  display: none;
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* WebP with JPEG fallback support */
.webp-container {
  position: relative;
  display: inline-block;
}

.webp-fallback {
  display: none;
}

.no-webp .webp-image {
  display: none;
}

.no-webp .webp-fallback {
  display: block;
}

/* Image aspect ratio containers */
.img-aspect-16-9 {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.img-aspect-4-3 {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
}

.img-aspect-1-1 {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 aspect ratio */
  overflow: hidden;
}

.img-aspect-16-9 img,
.img-aspect-4-3 img,
.img-aspect-1-1 img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Performance optimized images */
.img-optimized {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Hero image specific styles */
.hero-image-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.hero-image-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(208, 240, 192, 0.1),
    rgba(250, 218, 221, 0.1)
  );
  pointer-events: none;
}

/* === 7. HAND-DRAWN TEXTURE EFFECTS === */
.texture-soft {
  position: relative;
}

.texture-soft::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(
      circle at 20% 80%,
      rgba(208, 240, 192, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(250, 218, 221, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(230, 230, 250, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  border-radius: inherit;
}

.hand-drawn-border {
  border: 2px solid var(--color-primary-mint);
  border-radius: var(--radius-lg);
  position: relative;
}

.hand-drawn-border::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 1px solid var(--color-primary-pink);
  border-radius: var(--radius-lg);
  opacity: 0.6;
  transform: rotate(0.5deg);
  pointer-events: none;
}

/* Whimsical decorative elements */
.storybook-decoration {
  position: relative;
}

.storybook-decoration::before {
  content: "✨";
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: var(--font-size-lg);
  opacity: 0.7;
  animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.7;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
  }
}

/* SVG-friendly styling */
.svg-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

.svg-icon--small {
  width: 0.8em;
  height: 0.8em;
}

.svg-icon--large {
  width: 1.5em;
  height: 1.5em;
}

.svg-icon--colored-mint {
  fill: var(--color-primary-mint);
}

.svg-icon--colored-pink {
  fill: var(--color-primary-pink);
}

/* Icon-specific styles for CTA buttons */
.svg-icon--calendar,
.svg-icon--phone,
.svg-icon--email {
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.5em;
  flex-shrink: 0;
}

/* Icon-text layout only for spans containing both icon and text */
.cta-text .svg-icon {
  display: inline-flex;
  vertical-align: middle;
}

/* Floating contact button icon sizing */
.floating-contact-btn .svg-icon--phone {
  width: 1.5em;
  height: 1.5em;
  margin-right: 0;
}

/* Storybook-style wavy borders */
.wavy-border-top {
  position: relative;
}

.wavy-border-top::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  height: 10px;
  background-image: repeating-linear-gradient(
    45deg,
    var(--color-primary-mint) 0px,
    var(--color-primary-mint) 2px,
    transparent 2px,
    transparent 8px,
    var(--color-primary-pink) 8px,
    var(--color-primary-pink) 10px,
    transparent 10px,
    transparent 16px
  );
  opacity: 0.3;
}

.wavy-border-bottom {
  position: relative;
}

.wavy-border-bottom::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 10px;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--color-primary-pink) 0px,
    var(--color-primary-pink) 2px,
    transparent 2px,
    transparent 8px,
    var(--color-primary-mint) 8px,
    var(--color-primary-mint) 10px,
    transparent 10px,
    transparent 16px
  );
  opacity: 0.3;
}

/* Soft paper texture effect */
.paper-texture {
  background-image:
    radial-gradient(
      circle at 100% 50%,
      transparent 20%,
      rgba(255, 255, 255, 0.3) 21%,
      rgba(255, 255, 255, 0.3) 34%,
      transparent 35%,
      transparent
    ),
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 50%, transparent 50%);
  background-size:
    30px 30px,
    15px 15px;
}

/* === 8. ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-primary-mint-darker);
  outline-offset: 2px;
}

/* === 9. FLOATING CONTACT BUTTON === */
.floating-contact {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1000;
  display: none; /* Hidden by default, shown on mobile */
}

.floating-contact-btn {
  background: linear-gradient(135deg, var(--color-accent-warm) 0%, var(--color-accent-orange) 100%);
  color: var(--color-charcoal);
  border: none;
  border-radius: var(--radius-full);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  box-shadow: var(--shadow-strong);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-weight: 700;
}

.floating-contact-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.floating-contact-btn:active {
  transform: scale(0.95);
}

/* Show floating button on mobile only */
@media (max-width: 768px) {
  .floating-contact {
    display: block;
  }
}

/* === 10. FOOTER STYLES === */
.site-footer {
  background: linear-gradient(135deg, var(--color-primary-mint) 0%, var(--color-primary-pink) 100%);
  padding: var(--space-3xl) 0 var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.footer-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--space-xl);
  text-align: center;
  grid-template-areas: 
    "legal" 
    "hours";
}

.footer-info {
  color: var(--color-charcoal);
  grid-area: info;
}

.footer-address {
  font-style: normal;
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.footer-hours {
  font-size: var(--font-size-base);
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  grid-area: hours;
  text-align: center;
  justify-self: center;
}

.footer-hours strong {
  color: var(--color-charcoal);
  font-weight: 700;
}

.footer-legal {
  margin-top: var(--space-lg);
  grid-area: legal;
}

.footer-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-navigation a {
  color: var(--color-charcoal);
  text-decoration: none;
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
}

.footer-navigation a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-dark-gray);
  font-size: var(--font-size-sm);
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-bottom p {
  margin: 0;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "legal"
      "hours";
    text-align: center;
    align-items: center;
  }
  
  .footer-legal {
    text-align: center;
    margin-top: 0;
  }
  
  .footer-navigation ul {
    justify-content: center;
  }
}

/* === 11. PRINT STYLES === */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3,
  p {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
  
  .floating-contact {
    display: none !important;
  }
}
