/* ============================================
   BISP Base CSS
   Design Language: Haut-Lac.ch
   ============================================
   Depends on: design-tokens.css
   ============================================ */

/* =============================================
   1. GOOGLE FONTS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');


/* =============================================
   2. CSS RESET
   ============================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  line-height: var(--line-height-normal);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: 15px;
  color: var(--color-text);
  background-color: var(--color-white);
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

/* Remove default focus styles and add accessible ones */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove animations for users who prefer reduced motion */
@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;
  }
}


/* =============================================
   3. BASE TYPOGRAPHY
   Haut-lac specs:
     Headings: Poppins 600, line-height 1.1em
     Body:     Montserrat 400 15px, line-height 1.5em
     Labels:   Montserrat 500 15px, uppercase, line-height 1em
     Accent:   Montserrat 500 14px, uppercase
   ============================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: var(--font-weight-semibold);
  line-height: 1.1em;
  color: var(--color-heading);
}

h1 {
  font-size: var(--text-hero);
}

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

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

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

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

h6 {
  font-size: var(--text-xl);
}

p {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

/* Label style - Montserrat 15px, 500, uppercase */
.label {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  line-height: 1em;
  letter-spacing: 0.05em;
}

/* Accent text - Montserrat 14px, 500, uppercase */
.accent-text {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Large heading variant - Montserrat 45px, 600 */
.heading--large {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 4vw, 2.8125rem); /* 32px - 45px */
  font-weight: var(--font-weight-semibold);
  line-height: 1em;
}

/* Basic text element styles */
strong, b {
  font-weight: var(--font-weight-bold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--color-text-dark);
}


/* =============================================
   4. LAYOUT & UTILITY CLASSES
   ============================================= */

/* --- Containers --- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Sections --- */

.section {
  position: relative;
  width: 100%;
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.section--dark {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--color-white);
}

.section--dark p {
  color: rgba(255, 255, 255, 0.9);
}

.section--teal {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--teal h1,
.section--teal h2,
.section--teal h3,
.section--teal h4,
.section--teal h5,
.section--teal h6 {
  color: var(--color-white);
}

.section--teal p {
  color: rgba(255, 255, 255, 0.9);
}

.section--light {
  background-color: var(--color-off-white);
}

.section--red {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.section--red h1,
.section--red h2,
.section--red h3,
.section--red h4,
.section--red h5,
.section--red h6 {
  color: var(--color-white);
}

.section--red p {
  color: rgba(255, 255, 255, 0.9);
}

/* --- Grid --- */

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* --- Flexbox Utilities --- */

.flex {
  display: flex;
}

.flex--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex--column {
  display: flex;
  flex-direction: column;
}

.flex--wrap {
  flex-wrap: wrap;
}

.flex--gap-sm {
  gap: var(--space-sm);
}

.flex--gap-md {
  gap: var(--space-md);
}

.flex--gap-lg {
  gap: var(--space-lg);
}

.flex--gap-xl {
  gap: var(--space-xl);
}

/* --- Text Alignment --- */

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

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

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

/* --- Visibility Utilities --- */

.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;
}


/* =============================================
   5. BUTTONS
   Haut-lac: Montserrat 14px, 500, uppercase,
   0px border-radius on primary CTA
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1em;
  padding: var(--space-md) var(--space-xl);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  gap: var(--space-sm);
}

/* Primary: Red CTA, no border-radius (haut-lac uses 0px!) */
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  border-radius: 0;
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: translateY(0);
}

/* Secondary: Transparent bg, white border */
.btn--secondary {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
  border-radius: 0;
}

.btn--secondary:hover {
  background-color: var(--color-white);
  color: var(--color-secondary);
  transform: translateY(-2px);
}

/* Outline: Transparent bg, teal border */
.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: 0;
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline:active {
  transform: translateY(0);
}

/* Button size variants */
.btn--sm {
  font-size: var(--text-xs);
  padding: var(--space-sm) var(--space-md);
}

.btn--lg {
  font-size: 15px;
  padding: var(--space-lg) var(--space-3xl);
}


/* =============================================
   6. STAR HEADING PATTERN
   Haut-lac uses "* " prefix on section subtitles
   ============================================= */

.star-heading {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1em;
  margin-bottom: var(--space-md);
}

.star-heading::before {
  content: "* ";
  color: var(--color-primary);
  font-size: 1.4em;
  font-weight: var(--font-weight-bold);
  vertical-align: baseline;
}

/* White variant for dark/teal sections */
.section--dark .star-heading,
.section--teal .star-heading {
  color: var(--color-white);
}

.section--dark .star-heading::before,
.section--teal .star-heading::before {
  color: var(--color-white);
}


/* =============================================
   7. CARD STYLES
   ============================================= */

.card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.card__image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card__content {
  padding: var(--space-lg);
}

.card__title {
  font-family: 'Poppins', sans-serif;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-xl);
  line-height: 1.1em;
  color: var(--color-heading);
  margin-bottom: var(--space-sm);
}

.card__text {
  font-size: 15px;
  line-height: 1.5em;
  color: var(--color-text);
}

.card__tag {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}


/* =============================================
   8. SCROLL ANIMATION CLASSES
   Haut-lac uses fadeIn reveal patterns
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Directional variants */
.reveal--left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal--left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal--right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal--right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Scale variant */
.reveal--scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal--scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Staggered animation delays for children */
.reveal--stagger > *:nth-child(1) { transition-delay: 0.1s; }
.reveal--stagger > *:nth-child(2) { transition-delay: 0.2s; }
.reveal--stagger > *:nth-child(3) { transition-delay: 0.3s; }
.reveal--stagger > *:nth-child(4) { transition-delay: 0.4s; }
.reveal--stagger > *:nth-child(5) { transition-delay: 0.5s; }
.reveal--stagger > *:nth-child(6) { transition-delay: 0.6s; }


/* =============================================
   9. WAVE DECORATIONS
   SVG paths from haut-lac.ch
   viewBox="0 0 1200 120", preserveAspectRatio="none"
   Fill color controlled via --wave-fill custom property
   ============================================= */

.wave-top,
.wave-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--wave-height);
  overflow: hidden;
  line-height: 0;
  z-index: var(--z-base);
  pointer-events: none;
}

.wave-top {
  top: 0;
}

.wave-bottom {
  bottom: 0;
}

.wave-top svg,
.wave-bottom svg {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* Wave fill color - defaults to teal, overridable via custom property */
.wave-top {
  --wave-fill: var(--color-primary);
}

.wave-bottom {
  --wave-fill: var(--color-primary);
}

/* Wave color modifiers */
.wave-top--white,
.wave-bottom--white {
  --wave-fill: var(--color-white);
}

.wave-top--off-white,
.wave-bottom--off-white {
  --wave-fill: var(--color-off-white);
}

.wave-top--dark,
.wave-bottom--dark {
  --wave-fill: var(--color-secondary);
}

.wave-top--teal,
.wave-bottom--teal {
  --wave-fill: var(--color-primary);
}

.wave-top--red,
.wave-bottom--red {
  --wave-fill: var(--color-accent);
}

/* Inline SVG background approach for cases where no <svg> child is used */
.wave-top--bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23348397'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.wave-bottom--bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M985.66,92.83C906.67,72,823.78,31,743.84,14.19c-82.26-17.34-168.06-16.33-250.45.39-57.84,11.73-114,31.07-172,41.86A600.21,600.21,0,0,1,0,27.35V120H1200V95.8C1132.19,118.92,1055.71,111.31,985.66,92.83Z' fill='%23348397'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Padding for sections that contain wave decorations */
.section--has-wave-top {
  padding-top: calc(var(--space-section) + var(--wave-height));
}

.section--has-wave-bottom {
  padding-bottom: calc(var(--space-section) + var(--wave-height));
}


/* =============================================
   10. RESPONSIVE BREAKPOINTS
   Mobile:  max-width 768px
   Tablet:  max-width 1024px
   Desktop: min-width 1025px
   ============================================= */

/* --- Tablet (max-width: 1024px) --- */

@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

/* --- Mobile (max-width: 768px) --- */

@media (max-width: 768px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

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

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

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

  .btn {
    width: 100%;
    text-align: center;
  }

  .btn--lg {
    padding: var(--space-md) var(--space-xl);
  }

  /* Stack flex containers on mobile */
  .flex--responsive {
    flex-direction: column;
  }

  /* Reduce wave height on mobile */
  :root {
    --wave-height: 50px;
  }

  .card__image {
    height: 180px;
  }

  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }
}

/* --- Desktop (min-width: 1025px) --- */

@media (min-width: 1025px) {
  /* Show desktop-only elements */
  .mobile-only {
    display: none !important;
  }
}
