/* ==========================================================================
   THE WATER PROJECT DESIGN SYSTEM 2025 - BASE STYLES
   ========================================================================== */

/* 
 * Base typography, reset, and global utilities
 * Foundation styles that work across all themes
 */

/* ========================================
   MODERN CSS RESET
   ======================================== */

.motif-2025 {
  /* Scope reset to prevent conflicts with legacy styles */
}

.motif-2025 *,
.motif-2025 *::before,
.motif-2025 *::after {
  box-sizing: border-box;
}

.motif-2025 * {
  margin: 0;
}

.motif-2025 body {
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; /* Changed from optimizeSpeed which breaks icon fonts */
}

.motif-2025 img,
.motif-2025 picture,
.motif-2025 video,
.motif-2025 canvas,
.motif-2025 svg {
  display: block;
  max-width: 100%;
}

.motif-2025 input,
.motif-2025 button,
.motif-2025 textarea,
.motif-2025 select {
  font: inherit;
}

.motif-2025 p,
.motif-2025 h1,
.motif-2025 h2,
.motif-2025 h3,
.motif-2025 h4,
.motif-2025 h5,
.motif-2025 h6 {
  overflow-wrap: break-word;
}

/* ========================================
   TYPOGRAPHY SYSTEM
   ======================================== */

.motif-2025 {
  /* Base font family - using comprehensive font system */
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-secondary);
  
  /* Optimize text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; /* Changed from optimizeSpeed which breaks icon fonts */
  font-feature-settings: "kern" 1;
}

/* Heading hierarchy - now handled in fonts.css */
.motif-2025 h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
}

.motif-2025 h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

.motif-2025 h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
}

.motif-2025 h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.motif-2025 h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.motif-2025 h6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
}

/* Body text */
.motif-2025 p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.motif-2025 p:last-child {
  margin-bottom: 0;
}

/* Links */
.motif-2025 a {
  color: var(--link-color, var(--primary));
  text-decoration: none;
  transition: color var(--duration-normal) ease;
}

.motif-2025 a:hover {
  color: var(--link-hover-color, var(--primary-hover));
  text-decoration: underline;
}

/* Lists */
.motif-2025 ul,
.motif-2025 ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.motif-2025 li {
  margin-bottom: var(--space-xs);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

/* Special text styles */
.motif-2025 .text-large {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

.motif-2025 .text-small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.motif-2025 .text-xs {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
}

/* Text color utilities */
.motif-2025 .text-primary { color: var(--text-primary); }
.motif-2025 .text-secondary { color: var(--text-secondary); }
.motif-2025 .text-muted { color: var(--text-muted); }
.motif-2025 .text-brand { color: var(--primary); }

/* Font weight utilities */
.motif-2025 .font-light { font-weight: var(--font-weight-light); }
.motif-2025 .font-normal { font-weight: var(--font-weight-normal); }
.motif-2025 .font-medium { font-weight: var(--font-weight-medium); }
.motif-2025 .font-semibold { font-weight: var(--font-weight-semibold); }
.motif-2025 .font-bold { font-weight: var(--font-weight-bold); }

/* ========================================
   LAYOUT FOUNDATION
   ======================================== */

/* Container system */
.motif-2025 .container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding-x);
}

@media (max-width: 767px) {
  .motif-2025 .container {
    padding: 0 var(--container-padding-x-mobile);
  }
}

/* Section system */
.motif-2025 .section {
  padding: var(--section-padding-y) 0;
  position: relative;
}

@media (max-width: 767px) {
  .motif-2025 .section {
    padding: var(--section-padding-y-mobile) 0;
  }
}

/* Wrapper for content within sections */
.motif-2025 .wrap {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding-x);
}

@media (max-width: 767px) {
  .motif-2025 .wrap {
    padding: 0 var(--container-padding-x-mobile);
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Text alignment */
.motif-2025 .text-left { text-align: left; }
.motif-2025 .text-center { text-align: center; }
.motif-2025 .text-right { text-align: right; }

/* Display utilities */
.motif-2025 .hidden { display: none; }
.motif-2025 .block { display: block; }
.motif-2025 .inline { display: inline; }
.motif-2025 .inline-block { display: inline-block; }
.motif-2025 .flex { display: flex; }
.motif-2025 .inline-flex { display: inline-flex; }
.motif-2025 .grid { display: grid; }

/* Flexbox utilities */
.motif-2025 .flex-col { flex-direction: column; }
.motif-2025 .flex-row { flex-direction: row; }
.motif-2025 .items-center { align-items: center; }
.motif-2025 .items-start { align-items: flex-start; }
.motif-2025 .items-end { align-items: flex-end; }
.motif-2025 .justify-center { justify-content: center; }
.motif-2025 .justify-between { justify-content: space-between; }
.motif-2025 .justify-start { justify-content: flex-start; }
.motif-2025 .justify-end { justify-content: flex-end; }

/* Spacing utilities */
.motif-2025 .gap-xs { gap: var(--space-xs); }
.motif-2025 .gap-sm { gap: var(--space-sm); }
.motif-2025 .gap-md { gap: var(--space-md); }
.motif-2025 .gap-lg { gap: var(--space-lg); }
.motif-2025 .gap-xl { gap: var(--space-xl); }
.motif-2025 .gap-2xl { gap: var(--space-2xl); }

/* Margin utilities */
.motif-2025 .m-0 { margin: 0; }
.motif-2025 .mt-sm { margin-top: var(--space-sm); }
.motif-2025 .mt-md { margin-top: var(--space-md); }
.motif-2025 .mt-lg { margin-top: var(--space-lg); }
.motif-2025 .mt-xl { margin-top: var(--space-xl); }
.motif-2025 .mb-sm { margin-bottom: var(--space-sm); }
.motif-2025 .mb-md { margin-bottom: var(--space-md); }
.motif-2025 .mb-lg { margin-bottom: var(--space-lg); }
.motif-2025 .mb-xl { margin-bottom: var(--space-xl); }

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Apply containment to major sections */
.motif-2025 .section {
  contain: layout style;
}

/* Optimize frequently animated elements */
.motif-2025 .will-change-transform {
  will-change: transform;
}

.motif-2025 .will-change-auto {
  will-change: auto;
}

/* GPU acceleration for smooth animations */
.motif-2025 .gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ========================================
   ACCESSIBILITY FOUNDATION
   ======================================== */

/* Focus styles */
.motif-2025 *:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Skip to content link */
.motif-2025 .skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: var(--z-maximum);
  transition: top var(--duration-normal) ease;
}

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

/* Screen reader only content */
.motif-2025 .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .motif-2025 {
    --border: #000000;
    --border-strong: #000000;
    --text-muted: var(--text-secondary);
  }
}

/* Special text patterns - now handled in fonts.css */

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Responsive display utilities */
@media (max-width: 767px) {
  .motif-2025 .hidden-mobile { display: none !important; }
  .motif-2025 .visible-mobile { display: block !important; }
}

@media (min-width: 768px) {
  .motif-2025 .hidden-desktop { display: none !important; }
  .motif-2025 .visible-desktop { display: block !important; }
  .motif-2025 .visible-mobile { display: none !important; }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .motif-2025 {
    color: #000 !important;
    background: #fff !important;
  }
  
  .motif-2025 * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .motif-2025 .no-print {
    display: none !important;
  }
}
