/* Main Stylesheet - Apple-Inspired Design */

@import url('./variables.css');
@import url('./components.css');

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-5xl);
}

/* Override for hero titles with images */
.hero-with-image h1 {
  color: var(--color-bg) !important;
}

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

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

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

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

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

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.6; /* Optimized for readability - Apple standard */
  color: var(--color-text); /* Changed from --color-text-light for better contrast */
}

/* Light text color only for specific contexts where contrast is sufficient */
.text-light {
  color: var(--color-text-light);
}

/* Override paragraph color in cards - must be dark for white card backgrounds */
.card p {
  color: #1d1d1f !important; /* Force dark text on white cards */
}

/* Ensure proper contrast on all backgrounds */
.section {
  background-color: var(--color-bg);
}

.section[style*="background"] {
  /* Override inline styles for better contrast */
}

/* Improve text contrast in cards - all text should be dark on white cards */
.card p,
.card li,
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.card span:not(.btn),
.card em,
.card strong {
  color: #1d1d1f !important; /* Force dark text for contrast on white cards */
}

.card h4 {
  font-weight: var(--font-weight-semibold);
}

/* But allow links and buttons to use their own colors */
.card a:not(.btn) {
  color: var(--color-primary) !important;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-xl);
}

li {
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-relaxed);
}

/* Utilities */
.text-center {
  text-align: center;
}

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

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-md); }
.mt-2 { margin-top: var(--spacing-xl); }
.mt-3 { margin-top: var(--spacing-2xl); }
.mt-4 { margin-top: var(--spacing-3xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-xl); }
.mb-3 { margin-bottom: var(--spacing-2xl); }
.mb-4 { margin-bottom: var(--spacing-3xl); }

.py-1 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
.py-2 { padding-top: var(--spacing-2xl); padding-bottom: var(--spacing-2xl); }
.py-3 { padding-top: var(--spacing-3xl); padding-bottom: var(--spacing-3xl); }
.py-4 { padding-top: var(--spacing-4xl); padding-bottom: var(--spacing-4xl); }

.px-1 { padding-left: var(--container-padding); padding-right: var(--container-padding); }

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-bg);
  padding: var(--spacing-md);
  text-decoration: none;
  z-index: var(--z-tooltip);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  z-index: var(--z-tooltip);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-light);
  padding: var(--spacing-lg) var(--container-padding);
  z-index: var(--z-fixed);
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 250px;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

#cookie-banner-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
  display: block;
}

#cookie-banner-description {
  color: var(--color-text-light);
  display: block;
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: var(--spacing-2xl);
  right: var(--spacing-2xl);
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all var(--transition-base);
  z-index: var(--z-fixed);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.scroll-top:hover {
  background: var(--color-primary-light);
  box-shadow: var(--shadow-lg);
  transform: scale(1.05);
}

.scroll-top:active {
  transform: scale(0.95);
}

/* Reduced Motion Support - Respect user preferences */
@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;
  }
  
  .fade-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Print Styles */
@media print {
  .nav,
  .footer,
  .cookie-banner,
  .scroll-top {
    display: none;
  }
  
  .hero-with-image .hero-content {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #000 !important;
  }
  
  .hero-with-image .hero-content * {
    color: #000 !important;
  }
}

