/*
Theme Name: Je depanne ton ordi
Theme URI: https://jedepannetonordi.fr
Author: Gael Vadot
Description: Theme sur mesure pour Je depanne ton ordi (Philippe Felgines). Charte turquoise relevee sur le site du client, sections sombres en contrepoint, contenus editables via ACF.
Version: 1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: jedepanne
*/

/* Le gros de la mise en forme vient de assets/app.css (Tailwind compile de la
   maquette). Ce fichier ne porte que ce qui remplace framer-motion et Lenis. */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------- apparitions */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal][data-vu] {
  opacity: 1;
  transform: none;
}

[data-line] {
  display: block;
  transform: translateY(105%);
  transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-line][data-vu] {
  transform: translateY(0);
}

[data-eyebrow] {
  opacity: 0;
  letter-spacing: 0.04em;
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    letter-spacing 1s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-eyebrow][data-vu] {
  opacity: 1;
  letter-spacing: 0.22em;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-line],
  [data-eyebrow] {
    opacity: 1 !important;
    transform: none !important;
    letter-spacing: 0.22em;
    transition: none !important;
  }
}

/* --------------------------------------------------------- mot qui tourne */

[data-alterne] {
  position: relative;
  display: block;
  height: 1.15em;
  overflow: hidden;
}

[data-alterne-mot] {
  display: block;
  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------- le rideau */

:root[data-intro="1"] {
  background-color: #06090b;
  overflow: hidden;
}

.jd-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.jd-intro-panneau {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: #06090b;
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

.jd-intro-haut {
  top: 0;
}

.jd-intro-bas {
  bottom: 0;
}

.jd-intro-ouvre .jd-intro-haut {
  transform: translateY(-100%);
}

.jd-intro-ouvre .jd-intro-bas {
  transform: translateY(100%);
}

.jd-intro-centre {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 28px;
  grid-auto-flow: row;
  align-content: center;
  transition: opacity 0.35s ease-out;
}

.jd-intro-centre img {
  width: min(190px, 46vw);
  height: auto;
  animation: jd-fente 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.jd-intro-centre span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: rgba(255, 255, 255, 0.5);
  animation: jd-signature 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
  text-align: center;
  padding: 0 24px;
}

.jd-intro-passer {
  position: absolute;
  right: 32px;
  bottom: 32px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.3);
}

.jd-intro-ouvre .jd-intro-centre,
.jd-intro-ouvre .jd-intro-passer {
  opacity: 0;
}

@keyframes jd-fente {
  from {
    clip-path: inset(50% 0 50% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes jd-signature {
  from {
    opacity: 0;
    letter-spacing: 0.1em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.26em;
  }
}

/* ------------------------------------------------------------- le grain */

.grain {
  mix-blend-mode: multiply;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%3E%3Cfilter%20id%3D%22n%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.82%22%20numOctaves%3D%223%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%22180%22%20height%3D%22180%22%20filter%3D%22url(%23n)%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* ------------------------------------------- l'entete au-dessus de la photo */

[data-site-header][data-sur-media] .jd-coque {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------------------------- panneau menu */

[data-menu-panneau][hidden] {
  display: none;
}

/* --------------------------------------------------------- admin barre */

body.admin-bar [data-site-header] {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar [data-site-header] {
    top: 46px;
  }
}
