/* ===================================================================
   STYLE-INDEX.CSS — REGIS DAVID — index.html
   Fusion de : general.css + s2.css + s3.css + s4.css
   Fichier unique, régle de chevron/cta-wrapper UNIQUE et cohérente
   (même principe que laurenceallart.fr/css/style-index.css)
   =================================================================== */

/* =============================== */
/* POLICES INTER                   */
/* =============================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Thin.woff2') format('woff2');
  font-weight: 100;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-ExtraLight.woff2') format('woff2');
  font-weight: 200;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
}

/* =============================== */
/* BASE GÉNÉRALE                   */
/* =============================== */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow: hidden;
}

html {
  scroll-behavior: auto;
}

body {
  color: #333;
  font-family: 'Inter', sans-serif;
  background: none;
  position: relative;
  overflow: hidden;

  /* Variables animées par GSAP */
  --zoom: 1;
  --bg-opacity: 0;
  --bg-x: 0px;
  --bg-y: 0px;
}

/* =============================== */
/* BACKGROUND GLOBAL (body::before) */
/* =============================== */

body::before {
    content: "";
    position: fixed;
    inset: 0;

    background-image: url("../images/davimages.webp");
    background-position: left center;
    background-repeat: no-repeat;
    background-size: cover;

    opacity: var(--bg-opacity);
    transform: translate(var(--bg-x), var(--bg-y)) scale(var(--zoom));
    transform-origin: center center;

    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4 {
  font-weight: 200;
  margin: 0 0 20px 0;
}

p {
  font-size: 16px;
  line-height: 1.6;
}

/* ===================================================================
   SECTIONS FULLSCREEN — RÈGLE UNIQUE (section + .inner)
   Toutes les sections DOIVENT rester exactement 100vh à tout moment :
   c'est ce sur quoi GSAP ScrollTrigger calcule le pin. Ne jamais
   remplacer height par min-height ici ni dans les overrides mobiles.
   =================================================================== */

section {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box; /* IMPORTANT : évite qu'un padding ajouté sur
     une section (ex: #s3 en mobile) n'ajoute de la hauteur en plus des
     100vh — ce qui casserait le calcul du pin GSAP. Ne jamais retirer. */
}

section .inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* Couleurs provisoires pour visualiser les sections */
#s1 {background: none;}
#s2 { background: #444;  }
#s3 { background: #777; color: #fff; }
#s4 { background: #999; color: #fff; }

section a {
  color: #fff;
  text-decoration: none;
  margin-top: 10px;
}

main {
  margin-top: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===================================================================
   CHEVRON / CTA — RÈGLE UNIQUE POUR LES 4 SECTIONS
   Un seul et même positionnement, identique quel que soit l'écran
   (mobile / tablette / desktop) et quelle que soit la section.
   C'est le principe qui fonctionne sur laurenceallart.fr.
   =================================================================== */

section .cta-wrapper {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: center;
    z-index: 9996;
    margin: 0 !important;
}

.cta-banniere {
    display: inline-block;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 2px;
    transition: all 0.25s ease;
    margin: 0;
}

.cta-banniere:hover {
    color: #ffffff;
}

.fleche-scroll {
    display: block;
    width: 19px;
    height: 19px;
    border-bottom: 3px solid #fff;
    border-right: 3px solid #fff;
    transform: rotate(45deg);
    margin: 0 auto;
    animation: flecheBounce 0.8s infinite ease-in-out;
    opacity: 0.8;
}

@keyframes flecheBounce {
    0%   { transform: translateY(0) rotate(45deg); opacity: 0.4; }
    50%  { transform: translateY(8px) rotate(45deg); opacity: 1; }
    100% { transform: translateY(0) rotate(45deg); opacity: 0.4; }
}

/* Variante "chevron vers le haut" (ex: S4 → retour vers S1) */
.fleche-scroll-up {
    display: block;
    width: 19px;
    height: 19px;
    border-top: 3px solid #fff;
    border-left: 3px solid #fff;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    margin: 0 auto;
    animation: flecheBounceUp 0.8s infinite ease-in-out;
    opacity: 0.8;
}

@keyframes flecheBounceUp {
    0%   { transform: translateY(0) rotate(45deg); opacity: 0.4; }
    50%  { transform: translateY(-8px) rotate(45deg); opacity: 1; }
    100% { transform: translateY(0) rotate(45deg); opacity: 0.4; }
}

/* ===================================================================
   SECTION 1
   =================================================================== */

#s1 h1,
#s1 h2 {
    opacity: 0;
}

#s1 h1 {
    font-family: 'Inter', sans-serif;
    font-size: 66px;
    font-weight: 100;
    letter-spacing: 0.08em;
    margin: 0;
    color: #fff;
}
#s1 h2 {
    font-family: 'Inter', sans-serif;
    font-size: 36px;
    font-weight: 200;
    margin-top: 10px;
    color: #fff;
}

#s1 .inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding-top: 400px;
    padding-bottom: 110px; /* réserve l'espace du cta-wrapper */
}

#s1 .titles {
    text-align: center;
}

/* Le script GSAP pin S1 dès le chargement avec un décalage de +60px
   (pour laisser voir le header fixe) : "top top+=60". Résultat, la
   section S1 est affichée avec 60px de trop qui dépassent en bas de
   l'écran — sans ce correctif le chevron tombe hors du viewport.
   Ce correctif ne touche à aucune valeur du script GSAP. */
#s1 .cta-wrapper {
    bottom: 110px;
}

@media (max-width: 768px) {
    #s1 h1 {
        font-size: 46px;
        letter-spacing: 0.06em;
        text-align: center;
    }

    #s1 h2 {
        font-size: 26px;
        text-align: center;
    }

    #s1 {
        height: 100svh;
        position: relative;
        overflow: hidden;
    }

    #s1 .inner {
        padding-top: 200px;
        padding-bottom: 110px;
        justify-content: flex-start;
        align-items: center;
        height: 100%;
    }

    /* 100vh compte la hauteur AVEC la barre d'adresse du navigateur
       mobile masquée : au premier affichage elle est visible, donc le
       bas de la section (chevron/CTA) passe sous cette barre et devient
       invisible. 100svh (small viewport height) est la hauteur réelle
       visible, barre d'adresse comprise. */
    #s2 {
        height: 100svh;
    }
}

/* --- S1 TABLETTE 769–1400px ---
   Zone dédiée entre le desktop et le mobile (même principe que la
   zone tablette de S2), au lieu de sauter directement de 66px/400px
   de padding à 46px/200px. Uniquement de la typo/espacement : aucune
   position ni hauteur de section modifiée hors du height:100svh déjà
   utilisé ailleurs (pin GSAP non concerné). */
@media (max-width: 1400px) and (min-width: 769px) {
    #s1 {
        height: 100svh;
    }

    #s1 h1 {
        font-size: 58px;
        letter-spacing: 0.07em;
    }

    #s1 h2 {
        font-size: 32px;
    }

    #s1 .inner {
        padding-top: 300px;
    }
}

/* ===================================================================
   SECTION 2
   =================================================================== */

#s2 {
    background: #444;
    color: #999;
    font-family: 'Inter', sans-serif;
    font-size: 19px;
    line-height: 1.8;
}

#s2 .inner {
    padding: 0 6vw;
    padding-bottom: 110px; /* réserve l'espace du cta-wrapper */
}

.s2-container {
    display: flex;
    align-items: flex-start;
    justify-content: left;
    gap: 4vw;
    width: 88vw;
    max-width: 1400px;
}

.s2-left img {
    max-width: 400px;
    max-height: 70vh;
    object-fit: contain;
}

.s2-right {
    max-width: 900px;
    padding-left: 60px;
}

.s2-right h2 {
    font-size: 56px;
    font-weight: 200;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
    color: #ddd;
}

.text-desktop { display: block; }
.text-mobile { display: none; }

/* --- S2 TABLETTE 601–1400px --- */
@media (max-width: 1400px) and (min-width: 601px) {

    #s2 .inner {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0 40px;
        padding-bottom: 110px;
        box-sizing: border-box;
    }

    .s2-container {
        width: 100%;
        max-width: 900px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 25px;
        margin-top: 40px;
    }

    .s2-left {
        margin-top: 60px;
    }

    .s2-left img {
        max-width: 320px;
        max-height: 45vh;
        width: auto;
        margin: 0 auto;
        display: block;
    }

    .s2-right {
        padding-left: 0 !important;
        max-width: 90%;
        text-align: center;
    }

    .s2-right h2 {
        font-size: 42px;
        margin-bottom: 10px;
    }

    .text-desktop {
        display: none !important;
    }

    .text-mobile {
        display: block !important;
        font-size: 17px;
        line-height: 1.55;
        text-align: justify;
        margin: 0 auto;
        max-width: 90%;
    }
}

/* --- S2 MOBILE ≤600px --- */
@media (max-width: 600px) {

    #s2 .inner {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px;
        padding-bottom: 110px;
        position: relative;
        box-sizing: border-box;
    }

    .s2-container {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 18px !important;
        padding: 0 !important;
        margin: 50px auto 0 auto !important;
        box-sizing: border-box;
    }

    .s2-left img {
        max-height: 270px;
        width: auto;
        max-width: 100% !important;
        margin: 0 auto;
        display: block;
    }

    .s2-right {
        padding: 0 !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 90% !important;
        text-align: center;
        box-sizing: border-box;
    }

    .s2-right h2 {
        font-size: 32px;
        letter-spacing: 0.03em;
        margin: 10px 0 8px 0;
        text-align: center;
    }

    .text-desktop { display: none; }

    .text-mobile {
        display: block;
        font-size: 17px;
        line-height: 1.55;
        text-align: justify;
        margin: 0 auto;
        max-width: 90%;
    }

    .text-mobile .lire-plus {
        color: #f5eeda;
        margin-left: 6px;
    }
}

/* ===================================================================
   SECTION 3
   =================================================================== */

#s3 .inner {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 40px;
    padding-bottom: 110px; /* réserve l'espace du cta-wrapper */
}

.s3-title {
    font-size: 56px;
    font-weight: 200;
    letter-spacing: 0.08em;
    margin-bottom: 40px;
    color: #fff;
    text-align: center;
}

/* DESKTOP ONLY */
.s3-gallery-static {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.s3-item {
    width: 350px;
    height: 350px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.s3-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.s3-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0));
    color: #f5eeda;
    font-size: 20px;
}

/* MOBILE ONLY (masqué par défaut) */
.s3-mobile-list {
    display: none;
}

/* --- HOVER DESKTOP SUR LES IMAGES --- */
@media (hover: hover) and (pointer: fine) {

    .s3-gallery-static {
        display: flex;
        gap: 0;
        justify-content: space-between;
    }

    .s3-item {
        position: relative;
        width: 32%;
        height: 400px;
        overflow: hidden;
        border-radius: 2px;
    }

    .s3-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: grayscale(100%);
        opacity: 0.88;
        transition: filter 0.4s ease, opacity 0.4s ease;
    }

    .s3-item:hover img {
        filter: grayscale(0%);
        opacity: 1;
    }

    .s3-caption {
        position: absolute;
        bottom: 0;
        width: 100%;
        padding: 15px;
        background: linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0));
        color: #f5eeda;
        font-size: 22px;
        pointer-events: none;
    }

    .s3-item::after {
        content: "";
        position: absolute;
        right: 18px;
        bottom: 18px;
        width: 12px;
        height: 12px;
        border-right: 2px solid rgba(255,255,255,0.6);
        border-bottom: 2px solid rgba(255,255,255,0.6);
        transform: rotate(-45deg);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .s3-item:hover::after {
        opacity: 1;
    }
}

/* --- S3 TABLETTE (paysage principalement) 901–1400px ---
   Contrairement à avant, la grille de photos reste visible (juste
   réduite) au lieu de basculer sur la liste texte — c'est ce qui
   couvre la quasi-totalité des tablettes en paysage (iPad, etc.).
   Toujours height:100svh + flex, jamais min-height/block. */
@media (max-width: 1400px) and (min-width: 901px) {
    #s3 {
        height: 100svh;
    }

    #s3 .inner {
        padding: 0 30px;
    }

    .s3-title {
        font-size: 44px;
        margin-bottom: 24px;
    }

    .s3-gallery-static {
        gap: 16px;
    }

    .s3-item {
        width: 220px;
        height: 220px;
    }

    .s3-caption {
        font-size: 16px;
        padding: 10px;
    }
}

/* --- S3 MOBILE / TABLETTE PORTRAIT ≤900px ---
   Bascule d'affichage galerie → liste texte (la grille serait trop
   étroite sur un écran portrait). La section reste flex + height
   explicite (jamais min-height + block : c'est ce qui cassait le
   calcul du pin GSAP). Le cta-wrapper garde la règle globale unique
   définie plus haut, sans override ici. */
@media (max-width: 900px) {

    #s3 {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        height: 100svh; /* voir note S2 : hauteur visible réelle sur mobile */
        overflow: hidden;
        padding-top: 90px;
    }

    #s3 .inner {
        padding: 0 20px;
        padding-bottom: 110px;
        margin-top: 0;
        width: 100%;
    }

    .s3-gallery-static {
        display: none !important;
    }

    .s3-mobile-list {
        display: block !important;
        margin-top: 20px !important;
    }

    .s3-title {
        font-size: 40px !important;
        margin-bottom: 10px;
        text-align: center;
    }

    .s3-mobile-list .theme {
        font-size: 24px !important;
        color: #ffcc66 !important;
        margin-top: 18px;
        margin-bottom: 5px;
        text-align: center !important;
    }

    .s3-mobile-list .theme a {
        color: bisque !important;
    }

    .s3-mobile-list .gallery {
        display: block;
        font-size: 20px;
        color: #f5eeda;
        text-decoration: none;
        padding-left: 10px;
        margin-bottom: 4px;
    }
}

/* ===================================================================
   SECTION 4
   =================================================================== */

#s4 .inner {
    justify-content: flex-start;
    padding-bottom: 110px; /* réserve l'espace du chevron de retour vers S1 */
}

.s4-title {
    font-size: 56px;
    font-weight: 200;
    letter-spacing: 0.08em;
    margin-top: 150px;
    margin-bottom: 40px;
    color: #fff;
    text-align: center;
}

.s4-subtitle,
.s4-text p {
    font-size: 20px;
    color: #fff;
    text-align: center;
}

.s4-image-wrapper {
    width: 100%;
    padding: 0 60px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.s4-image-link {
    display: inline-block;
    line-height: 0;
}

.s4-image {
    max-width: 260px;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transition:
        transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.6s ease-out;
}

.s4-image-link:hover .s4-image {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.s4-text a {
    color: bisque !important;
    font-size: 17px;
}
.s4-text a:hover {
    color: #ffcc66 !important;
}

/* --- S4 TABLETTE 601–1400px ---
   Zone dédiée (même principe que S2) : on garde le layout desktop
   (image en médaillon, pas en plein cadre) mais avec des tailles
   intermédiaires, au lieu de sauter directement à la version mobile
   plein cadre. */
@media (max-width: 1400px) and (min-width: 601px) {
    #s4 {
        height: 100svh;
    }

    .s4-title {
        font-size: 44px;
        margin-top: 100px;
        margin-bottom: 30px;
    }

    .s4-image-wrapper {
        padding: 0 80px;
    }

    .s4-image {
        max-width: 320px;
    }

    .s4-subtitle,
    .s4-text p {
        font-size: 19px;
    }
}

@media (max-width: 600px) {

    #s4 {
        height: 100svh; /* voir note S2 : hauteur visible réelle sur mobile */
    }

    #s4 .inner > *:first-child {
        margin-top: 80px;
    }

    .s4-title {
        font-size: 32px;
        margin-top: 0;
        margin-bottom: 30px;
        letter-spacing: 0.02em;
        text-align: center;
    }

    .s4-image-wrapper {
        width: 100%;
        padding: 0 40px;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
    }

    .s4-image {
        width: auto;
        max-width: 220px;
        height: auto;
        max-height: 36vh;
        object-fit: contain;
        display: block;
        margin: 0 auto 30px;
        border-radius: 6px;
    }

    .s4-text p {
        font-size: 18px;
        margin-bottom: 10px;
        text-align: center;
    }
}
