/* IPA Valais — feuille de style */

@font-face {
  font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(../fonts/OpenSans-Regular.woff) format("woff");
}
@font-face {
  font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(../fonts/OpenSans-SemiBold.woff) format("woff");
}
@font-face {
  font-family: "Open Sans"; font-weight: 700; font-style: normal; font-display: swap;
  src: url(../fonts/OpenSans-Bold.woff) format("woff");
}

:root {
  --blue: #00a5f2;
  --blue-mid: #007fdb;
  --blue-dark: #00488b;
  --header-h: 116px;
  --wave-h: min(120px, 14vh);
  --speed: .85s;
  --ease: cubic-bezier(.3, .2, .1, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: "Open Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.2;
  color: #676767;
  background: #fff;
}

img { max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 .35em; color: #444; }
h1, h2 { font-size: 34px; }
h3 { font-size: 22px; }
p { margin: 0 0 1.5em; }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: 600; }
a { color: var(--blue); }

.container { width: min(100% - 180px, 1425px); margin: 0 auto; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- En-tête ---------- */

header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--blue);
  box-shadow: 0 3px 45px rgba(0, 0, 0, .15);
}
header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo img { display: block; height: 60px; width: auto; }

.menu ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.menu a {
  position: relative; display: block; padding: 6px 0;
  color: #fff; font-size: 14px; text-decoration: none;
}
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  border-top: 2px solid #fff;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.2, 1, .2, 1);
}
.menu a:hover::after, .menu a:focus-visible::after { transform: scaleX(1); }

.menu-toggle { display: none; }

/* ---------- Sections ---------- */

.slide { position: relative; overflow: hidden; }

.bg, .overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.bg-image { background-position: center top; background-repeat: no-repeat; background-size: cover; }
.overlay { background: rgba(0, 77, 140, .5); }

.wave {
  position: absolute; left: 0; width: 100%; height: var(--wave-h);
  fill: var(--blue); pointer-events: none;
}
.wave-bottom { bottom: -1px; }
.wave-top { top: -1px; transform: rotate(180deg); }

.scroller { position: relative; }
.content {
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--wave-h) * .6) 0;
}

.cols { display: flex; align-items: center; gap: 4%; }

/* Zoom lent sur les images de fond (« Ken Burns ») */
.bg-image { transform: scale(1); transition: transform 0s var(--speed); }
.is-live .bg-image { transform: scale(1.12); transition: transform 14s cubic-bezier(.2, 0, .7, 1); }

/* Apparition en fondu des images */
.js .fade-in { opacity: 0; transition: opacity .3s; }
.js .is-live .fade-in { opacity: 1; transition: opacity .9s ease-out .35s; }

/* Bienvenue */
#bienvenue { color: #fff; text-align: center; }
#bienvenue .bg { background-color: #2797d8; background-image: url(../images/accueil2.jpg); }
#bienvenue .content { min-height: 75vh; justify-content: flex-end; align-items: center; padding-bottom: calc(var(--wave-h) + 70px); }
#bienvenue h1 { color: #fff; margin: 12px 0 0; }

/* Présentation */
#presentation .bg { background: linear-gradient(to bottom, #cfe8f8, #fff); }
#presentation .col-logo { flex: 0 0 22%; text-align: center; }
#presentation .col-text { flex: 1; }
blockquote {
  margin: 0 0 1.5em; padding-left: 35px;
  border-left: 4px solid var(--blue);
  font-size: 22px; line-height: 40px; letter-spacing: .5px;
}
blockquote p { margin: 0; }

/* Revue */
#revue { color: #fff; }
#revue .bg { background: var(--blue-dark); }
#revue .wave { fill: var(--blue-mid); height: min(100px, 12vh); }
#revue h2, #revue h3 { color: #fff; }
#revue .banner { display: block; align-self: center; width: auto; max-height: 22vh; margin-bottom: 24px; }
#revue .col-text { flex: 2; }
#revue .col-side { flex: 1; text-align: center; }
#revue h3 { margin-bottom: 1em; }

/* Contacts */
#contacts { color: #333; }
#contacts .bg { background-color: #f9f9f9; background-image: url(../images/slide-03v3.jpg); }
#contacts h2 { color: #333; }
.cards { display: flex; gap: 2%; align-items: stretch; }
.card { flex: 1; padding: 2%; background: rgba(255, 255, 255, .7); }
.card a:not(.button) { text-decoration: none; }
.card a:not(.button):hover { text-decoration: underline; }

/* Boutons */
.button {
  display: inline-block;
  padding: 15px 28px;
  background: var(--blue); color: #fff;
  font-size: 14px; font-weight: 600; line-height: 20px; text-decoration: none;
  border-radius: 2px;
  transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}
.button::after {
  content: ""; display: inline-block; margin-left: 28px; vertical-align: -1px;
  border: 5px solid transparent; border-left-color: #fff; border-right-width: 0;
}
.button:hover, .button:focus-visible {
  background: #0bb0fb;
  transform: perspective(500px) rotateX(10deg) rotateY(-8deg) translateY(-3px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, .25);
}

/* ---------- Points de navigation ---------- */

.dots { display: none; }

/* ---------- Mode plein écran (grand écran + JavaScript) ---------- */

.fullpage, .fullpage body { height: 100%; overflow: hidden; }

.fullpage main {
  position: fixed; top: var(--header-h); right: 0; bottom: 0; left: 0;
  overflow: hidden;
}
.fullpage .slide {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform var(--speed) var(--ease), visibility 0s var(--speed);
  will-change: transform;
}
.fullpage .slide:nth-of-type(1) { z-index: 1; }
.fullpage .slide:nth-of-type(2) { z-index: 2; }
.fullpage .slide:nth-of-type(3) { z-index: 3; }
.fullpage .slide:nth-of-type(4) { z-index: 4; }
.fullpage .slide.is-above { transform: translateY(-50%); }
.fullpage .slide.is-active {
  visibility: visible;
  transform: translateY(0);
  transition: transform var(--speed) var(--ease), visibility 0s;
}
.fullpage.no-anim .slide { transition: none; }

.fullpage .scroller {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  overflow-x: hidden; overflow-y: auto;
}
.fullpage .content { min-height: 100%; }
.fullpage #bienvenue .content { min-height: 100%; }

.fullpage .dots {
  display: block;
  position: fixed; z-index: 90; right: 24px;
  top: calc(50% + var(--header-h) / 2); transform: translateY(-50%);
}
.dots ul { list-style: none; margin: 0; padding: 0; }
.dots a {
  position: relative; display: block; width: 30px; height: 30px;
  text-decoration: none;
}
.dots .dot {
  position: absolute; top: 50%; left: 50%;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 3px rgba(0, 40, 80, .35);
  transition: all .2s ease;
}
.dots a:hover .dot { background: #fff; }
.dots a[aria-current="true"] .dot {
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: transparent;
  box-shadow: inset 0 0 0 2px #fff, 0 0 3px rgba(0, 40, 80, .35);
}
.dots .label {
  position: absolute; right: 38px; top: 0;
  color: #fff; font: 14px/30px Arial, Helvetica, sans-serif; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 40, 80, .7);
  opacity: 0; transform: translateX(10px); pointer-events: none;
  transition: opacity .2s ease, transform .25s cubic-bezier(.165, .84, .44, 1);
}
.dots a:hover .label, .dots a:focus-visible .label { opacity: 1; transform: translateX(0); }

/* ---------- Tablettes et mobiles ---------- */

@media (max-width: 999px) {
  :root { --header-h: 64px; --wave-h: 60px; }
  .container { width: min(100% - 48px, 700px); }
  h1, h2 { font-size: 28px; }
  body { font-size: 17px; line-height: 1.35; }

  header .container { width: calc(100% - 36px); }
  .logo img { height: 40px; }

  /* Sans JavaScript : menu simple, toujours visible */
  .menu ul { gap: 14px; }

  /* Avec JavaScript : bouton et menu plein écran */
  .js .menu-toggle {
    display: block; position: relative; z-index: 2;
    width: 44px; height: 44px; padding: 12px 10px;
    background: none; border: 0; cursor: pointer;
  }
  .menu-toggle span {
    display: block; height: 2px; margin: 0 0 6px; background: #fff;
    transition: transform .3s ease, opacity .2s ease;
  }
  .menu-toggle span:last-child { margin: 0; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .js .menu {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 60, 115, .97);
    visibility: hidden; opacity: 0;
    transition: opacity .3s ease, visibility 0s .3s;
  }
  .js.menu-open .menu { visibility: visible; opacity: 1; transition: opacity .3s ease, visibility 0s; }
  .js.menu-open body { overflow: hidden; }
  .js .menu ul { flex-direction: column; gap: 10px; text-align: center; }
  .js .menu a { font-size: 28px; font-weight: 600; padding: 8px 0; }

  .cols, .cards { flex-direction: column; align-items: stretch; gap: 30px; }
  .card { padding: 24px; }
  #presentation .col-logo { flex-basis: auto; }
  #bienvenue .content { min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); }
  #revue .banner { max-height: none; width: 100%; }
  #revue .wave { height: 50px; }
}

@media (max-width: 480px) {
  html:not(.js) header { height: auto; }
  html:not(.js) header .container { flex-wrap: wrap; justify-content: center; padding: 6px 0; }
}

/* ---------- Respect du réglage « réduire les animations » ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
  .is-live .bg-image { transform: none; }
  .button:hover, .button:focus-visible { transform: none; }
}
