/*
Theme Name: FARFA THEME
Author: Félix Juhel
Version: 1.0
*/

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

* {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(0, 0, 0, 0.2);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: #FFFFFF;
    max-width: 100vw;
    overscroll-behavior-y: none;
}

main {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: none;
}

header{
    position: absolute;
    z-index: 100;
}

#farfa-logo{
    width: 350px;
    height: auto;
    display: block;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 1.5s cubic-bezier(0.75, 0, 0.25, 1);
}

#projects{
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 160px 0 80px; 
    gap: 50px;
    transition: all 1s cubic-bezier(0.75, 0, 0.25, 1);
}

#projects .project .date,
#projects .project .title{
    display: block;
    font-size: 16px;
    font-weight: 400;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: fit-content;
    margin: 0 auto;
}

#projects .project .date>span,
#projects .project .title>span{
    transform: translateY(100%);
    display: block;
    transition: transform .7s cubic-bezier(0.75, 0, 0.25, 1);
}

html .splide{
    visibility: visible;
}

.splide__sr{
  display: none !important;
}

.splide__track{
  width: 100%;
}

.splide__track .splide__list{
  width: 100%;
  display: flex;
  flex-grow: 0;
  flex-shrink: 0;
}

.splide__track .splide__list .splide__slide{
  flex-shrink: 0;
}

.galerie .splide__track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.galerie .splide__track::-webkit-scrollbar {
    display: none;
}

.galerie.is-initialized .splide__track {
    overflow: hidden !important;
    padding: 0px 20px !important;
}

.galerie .splide__track .splide__list {
    display: flex;
    flex-grow: 0;
    flex-shrink: 0;
}
.galerie .splide__track .splide__list .splide__slide {
    flex-shrink: 0;
}

.galerie .splide__track .splide__list {
    align-items: center;
}

.galerie:not(.is-initialized) .splide__track .splide__list{
    width: fit-content;
    margin: auto !important;
}

#projects .project .content{
    overflow: hidden;
    margin-top: 10px;
    transition: height 1s cubic-bezier(0.75, 0, 0.25, 1);
}

#projects .project .content:has(.splide.galerie) {
    width: 100vw;
}

#projects .project.active .content{
    height: var(--height) !important;
}

#projects .project .content .image, #projects .project .content .video{
    width: 800px;
    max-height: 800px;
    padding-top: 20px;
    max-width: calc(100vw - 30px);
    margin: auto;
}

#projects .project .content .image:has(>*:not(:only-child)){
    max-height: unset;
}

#projects .project .content .image img, #projects .project .content .video video{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#projects .project .content .text{
    padding: 20px 15px 5px;
    max-width: 800px;
}

#projects .project .content .text p{
    margin: 0;
}

#projects .project .content .youtube{
    padding-top: 20px;
    max-width: calc(100vw - 30px);
    display: block;
    margin: auto;
    aspect-ratio: 8 / 5;
}

#projects .project .content .youtube iframe{
    max-width: calc(100vw - 30px);
    max-height: 100%;
}

em, i{
    font-style: normal;
    transform: scaleX(-1);
    display: inline-block;
}

#about-us{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 145px 15px 30px;
    position: fixed;
    max-width: 800px;
    z-index: 2;
    background-color: #FFF;
    transition: all 1s cubic-bezier(0.75, 0, 0.25, 1);
    opacity: 0;
    pointer-events: none;
}

#about-us>p a{
    display: block;
    color: #000;
    text-decoration: none;
}

#about-us a:hover{
    opacity: 0.5;
}

#about-us .copyright{
    margin-top: 1em;
    font-size: 12px;
}

#about-us .copyright p{
    margin: 0;
}

#about-us .copyright p a{
    color: #000;
    text-decoration: none;
}

.galerie:not(.is-initialized) .splide__track .splide__list{
    gap: 60px;
}

.galerie.is-initialized .splide__track .splide__list{
    gap: 0 !important;
}

@media (max-width: 1150px) {
    .galerie:not(.is-initialized) .splide__track .splide__list{
        gap: 40px;
    }
}

@media (max-width: 915px) {
    .galerie:not(.is-initialized) .splide__track .splide__list{
        gap: 30px;
    }
}

@media (max-width: 750px) {
    #farfa-logo {
        width: 200px;
    }

    #projects .project.active .content{
        width: 100vw;
    }

    #projects .project .content .galerie{
        padding: 20px 0 0;
    }

    .galerie.is-initialized{
        padding: 20px 0 0;
    }

    #projects .project .content{
        max-width: 100vw !important;
    }

    .galerie .splide__track {
        overflow: visible;
    }

    .galerie .splide__track .splide__list {
        width: 100%;
        gap: 0;
    }

    .galerie .splide__slide {
        width: auto !important;
    }

    #projects{
        padding: 145px 0 15px;
    }

    #about-us{
        padding: 129px 15px 30px;
    }

    #projects .project .content .youtube iframe{
        height: 100%;
    }

    header.active + main #about-us {
        opacity: 1;
        pointer-events: auto;
    }

    header.active + main #projects {
        opacity: 0;
        pointer-events: none;
    }
}



/* ─── Variable de scale pour le responsive ─── */
.galerie { --gs: 1; }
.galerie .splide__slide img { width: auto; }

/* ─── 3 images : 250 · 100 · 250 ─── */
.galerie[nb-img="3"] .splide__slide:nth-child(1) img,
.galerie[nb-img="3"] .splide__slide:nth-child(3) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="3"] .splide__slide:nth-child(2) img { height: calc(100px * var(--gs)); }

/* ─── 4 images : 250 · 100 · 100 · 250 ─── */
.galerie[nb-img="4"] .splide__slide:nth-child(1) img,
.galerie[nb-img="4"] .splide__slide:nth-child(4) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="4"] .splide__slide:nth-child(2) img,
.galerie[nb-img="4"] .splide__slide:nth-child(3) img { height: calc(100px * var(--gs)); }

/* ─── 5 images : 250 · 175 · 100 · 175 · 250 ─── */
.galerie[nb-img="5"] .splide__slide:nth-child(1) img,
.galerie[nb-img="5"] .splide__slide:nth-child(5) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="5"] .splide__slide:nth-child(2) img,
.galerie[nb-img="5"] .splide__slide:nth-child(4) img { height: calc(175px * var(--gs)); }
.galerie[nb-img="5"] .splide__slide:nth-child(3) img { height: calc(100px * var(--gs)); }

/* ─── 6 images : 250 · 175 · 100 · 100 · 175 · 250 ─── */
.galerie[nb-img="6"] .splide__slide:nth-child(1) img,
.galerie[nb-img="6"] .splide__slide:nth-child(6) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="6"] .splide__slide:nth-child(2) img,
.galerie[nb-img="6"] .splide__slide:nth-child(5) img { height: calc(175px * var(--gs)); }
.galerie[nb-img="6"] .splide__slide:nth-child(3) img,
.galerie[nb-img="6"] .splide__slide:nth-child(4) img { height: calc(100px * var(--gs)); }

/* ─── 7 images : 250 · 200 · 150 · 100 · 150 · 200 · 250 ─── */
.galerie[nb-img="7"] .splide__slide:nth-child(1) img,
.galerie[nb-img="7"] .splide__slide:nth-child(7) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="7"] .splide__slide:nth-child(2) img,
.galerie[nb-img="7"] .splide__slide:nth-child(6) img { height: calc(200px * var(--gs)); }
.galerie[nb-img="7"] .splide__slide:nth-child(3) img,
.galerie[nb-img="7"] .splide__slide:nth-child(5) img { height: calc(150px * var(--gs)); }
.galerie[nb-img="7"] .splide__slide:nth-child(4) img { height: calc(100px * var(--gs)); }

/* ─── 8 images : 250 · 200 · 150 · 100 · 100 · 150 · 200 · 250 ─── */
.galerie[nb-img="8"] .splide__slide:nth-child(1) img,
.galerie[nb-img="8"] .splide__slide:nth-child(8) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="8"] .splide__slide:nth-child(2) img,
.galerie[nb-img="8"] .splide__slide:nth-child(7) img { height: calc(200px * var(--gs)); }
.galerie[nb-img="8"] .splide__slide:nth-child(3) img,
.galerie[nb-img="8"] .splide__slide:nth-child(6) img { height: calc(150px * var(--gs)); }
.galerie[nb-img="8"] .splide__slide:nth-child(4) img,
.galerie[nb-img="8"] .splide__slide:nth-child(5) img { height: calc(100px * var(--gs)); }

/* ─── 9 images : 250 · 212 · 175 · 138 · 100 · 138 · 175 · 212 · 250 ─── */
.galerie[nb-img="9"] .splide__slide:nth-child(1) img,
.galerie[nb-img="9"] .splide__slide:nth-child(9) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="9"] .splide__slide:nth-child(2) img,
.galerie[nb-img="9"] .splide__slide:nth-child(8) img { height: calc(212px * var(--gs)); }
.galerie[nb-img="9"] .splide__slide:nth-child(3) img,
.galerie[nb-img="9"] .splide__slide:nth-child(7) img { height: calc(175px * var(--gs)); }
.galerie[nb-img="9"] .splide__slide:nth-child(4) img,
.galerie[nb-img="9"] .splide__slide:nth-child(6) img { height: calc(138px * var(--gs)); }
.galerie[nb-img="9"] .splide__slide:nth-child(5) img { height: calc(100px * var(--gs)); }

/* ─── 10 images : 250 · 212 · 175 · 138 · 100 · 100 · 138 · 175 · 212 · 250 ─── */
.galerie[nb-img="10"] .splide__slide:nth-child(1) img,
.galerie[nb-img="10"] .splide__slide:nth-child(10) img { height: calc(250px * var(--gs)); }
.galerie[nb-img="10"] .splide__slide:nth-child(2) img,
.galerie[nb-img="10"] .splide__slide:nth-child(9) img { height: calc(212px * var(--gs)); }
.galerie[nb-img="10"] .splide__slide:nth-child(3) img,
.galerie[nb-img="10"] .splide__slide:nth-child(8) img { height: calc(175px * var(--gs)); }
.galerie[nb-img="10"] .splide__slide:nth-child(4) img,
.galerie[nb-img="10"] .splide__slide:nth-child(7) img { height: calc(138px * var(--gs)); }
.galerie[nb-img="10"] .splide__slide:nth-child(5) img,
.galerie[nb-img="10"] .splide__slide:nth-child(6) img { height: calc(100px * var(--gs)); }

/* ─── Responsive ─── */
@media (max-width: 1150px) {
    .galerie { --gs: 0.84; }
}

@media (max-width: 915px) {
    .galerie { --gs: 0.72; }
}

/* ─── Vidéo sans autoplay ─── */
.video.no-autoplay {
  position: relative;
  cursor: pointer;
}

.video.no-autoplay .play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity .3s;
}

.video.no-autoplay .play-btn svg {
  width: 60px;
  height: 60px;
  fill: #FFF;
}

.video.no-autoplay.playing .play-btn {
  opacity: 0;
}