/* ==========================================================================
   PAGE: PROJET-TOURNEE (Fiche projet type tournée)
   ========================================================================== */

/* ==========================================================================
   SECTION 1: HERO — Gallery background + Front panel overlay
   ========================================================================== */

.tournee-hero,
.tournee-section-gallery {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* ---------- Background: scrollable collage ---------- */
.tournee-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  /* Height will be set by content; the container clips via overflow */
  min-height: 100%;
  z-index: 0;
}

/*
 * COLLAGE LAYOUT 1
 * 5-image + title repeating pattern on a transparent/dark background.
 * Positions reference the attached mood-board layout:
 *   - pos-1: large, left side
 *   - pos-2: top-right, elevated
 *   - pos-3: center, middle
 *   - pos-4: right, lower-middle
 *   - pos-5: bottom-center, partially clipped (invites scroll)
 *   - pos-title: right side, between images
 *
 * Each "group" of 5 is offset vertically by --group-h.
 */

.tournee-hero-bg {
  display: grid;
  /* 12-column grid for precise placement */
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(0, auto);
  gap: 0;
  padding: 0;
}

/* Common collage item styles */
.tournee-collage-item,
.tournee-collage-title {
  margin: 0;
  padding: 0;
  position: relative;
}

.tournee-collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Title block inside collage */
.tournee-collage-title {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 2;
}

.tournee-collage-title span {
  font-family: 'PLAAK44B';
  font-size: 25px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 0.9;
  color: var(--fg);
  /* Allow line-breaking for long titles */
  max-width: 100%;
  word-break: break-word;
  /* A punchline taller than its grid zone grows over the photo above:
     its lines keep the page background to stay readable */
  background: var(--bg);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ==========================================================================
   LAYOUT 1 — Collage positions (desktop)
   ========================================================================== */

/* Mobile: simple stacked layout */
@media (max-width: 959px) {
  .tournee-hero-bg {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding: var(--header-offset) var(--gap) var(--section-padding-y);
  }

  .tournee-collage-item img {
    height: auto;
    max-height: 50vh;
    object-fit: cover;
  }

  /* The photos come after the title and the text (maquette mobile, G4):
     the panel above already keeps the space under the logo */
  .tournee-hero-front + .tournee-hero-bg {
    padding-top: 0;
  }

  .tournee-collage-title {
    padding: 16px 0;
  }

  .tournee-collage-title span {
    font-size: clamp(28px, 8vw, 48px);
  }

  .tournee-hero,
  .tournee-section-gallery {
    min-height: auto;
  }

  .tournee-hero-bg {
    position: relative;
  }

  .tournee-hero-front {
    position: relative;
  }
}

/* Desktop: grid-based collage */
@media (min-width: 960px) {
  .tournee-hero-bg {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    /* Square cells: row height = column width (100vw / 48) */
    grid-auto-rows: calc(100vw / 96);
    /* gap: 12px; */
    padding: var(--header-offset) 0 0;
  }



  /* ---- Position 1: large image, left side ---- */
  .tournee-collage-separator-1 {
    display: none;
  }
  .tournee-collage-pos-1 {
    grid-column: 25 / 41;
    grid-row: span 21;
    padding: 20px 12px;
  }

  /* ---- Position 2: top-right, elevated ---- */
  .tournee-collage-separator-2 {
    grid-column: 9 / 25;
    grid-row: span 9;
  }
  .tournee-collage-pos-2 {
    grid-column: 9 / 25;
    grid-row: span 18;
  }

  /* ---- Position 3: center-middle ---- */
  .tournee-collage-separator-3 {
    display: none;
  }
  .tournee-collage-pos-3 {
    grid-column: 25 / 33;
    grid-row: span 21;
  }

  /* ---- Position 4: right, lower ---- */
  .tournee-collage-separator-4 {
    display: none;
  }
  .tournee-collage-pos-4 {
    grid-column: 33 / 48;
    grid-row: span 17;
  }

  /* ---- Position 5: bottom-center, partially visible ---- */
  .tournee-collage-separator-5 {
    grid-column: 29 / 37;
    grid-row: span 2;
  }
  .tournee-collage-pos-5 {
    grid-column: 36 / 44;
    grid-row: span 23;
  }

  /* ---- Position 6: bottom-left ---- */
  .tournee-collage-separator-6 {
    grid-column: 1 / 9;
    grid-row: span 3;
  }
  .tournee-collage-pos-6 {
    grid-column: 18 / 30;
    grid-row: span 15;
  }

  /* ---- Punchline after pos6 ---- */
  .tournee-collage-pos-punchline-6 {
    grid-column: 5 / 36;
    grid-row: span 7;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 12px;
  }

  /* Maquette : accroches en Plaak 44B 48px à 1280px de large, plus petites
     en dessous ; un mot plus large que sa zone du collage est coupé avec
     un trait d'union (lang fr), jamais au milieu sans */
  .tournee-collage-title span {
    font-size: min(48px, 3.75vw);
    hyphens: auto;
  }

  /* ---- Punchline before pos5 ---- */
  .tournee-collage-pos-punchline-5,
  .tournee-collage-pos-title {
    grid-column: 33 / 47;
    grid-row: span 4;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 12px;
  }
}

/* ==========================================================================
   LAYOUT 2 — 7-image repeating collage (alternate for additional galleries)
   ========================================================================== */
@media (min-width: 960px) {
  /* ---- Position 1: top-left ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-1 {
    display: none;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-1 {
    grid-column: 3 / 13;
    grid-row: span 15;
    padding: 20px 0;
  }

  /* ---- Position 2: top-right, offset down ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-2 {
    grid-column: 17 / 33;
    grid-row: span 5;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-2 {
    grid-column: 17 / 33;
    grid-row: span 18;
    padding: 20px;
  }

  /* ---- Position 3: right, mid-high ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-3 {
    display: none;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-3 {
    grid-column: 3 / 17;
    grid-row: span 16;
  }

  /* ---- Position 4: left, mid ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-4 {
    display: none;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-4 {
    grid-column: 17 / 33;
    grid-row: span 20;
  }

  /* ---- Position 5: center, mid-lower ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-5 {
    display: none;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-5 {
    grid-column: 33 / 49;
    grid-row: span 17;
    padding-left: 20px;
  }

  /* ---- Position 6: left-lower ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-6 {
    display: none;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-6 {
    grid-column: 4 / 21;
    grid-row: span 18;
  }

  /* ---- Position 7: right-lower ---- */
  .tournee-gallery-layout-2 .tournee-collage-separator-7 {
    display: none;
  }
  .tournee-gallery-layout-2 .tournee-collage-pos-7 {
    grid-column: 24 / 44;
    grid-row: span 19;
  }

  /* ---- Punchline before pos6 ---- */
  .tournee-gallery-layout-2 .tournee-collage-pos-punchline-6 {
    grid-column: 1 / 24;
    grid-row: span 5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
  }

  /* ---- Punchline after pos7 ---- */
  .tournee-gallery-layout-2 .tournee-collage-pos-punchline-7 {
    grid-column: 5 / 36;
    grid-row: span 7;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 12px;
  }
}

/* ---------- Front panel: title + description ---------- */
.tournee-hero-front {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: var(--gap);
  padding-top: var(--header-offset);
}

@media (min-width: 960px) {
  /* Section is the scroll-track: height set dynamically by JS */
  .tournee-hero,
  .tournee-section-gallery {
    position: relative;
    overflow: visible;
    min-height: 0;
  }

  /* Sticky viewport frame — pins content while section scrolls through */
  .tournee-scroll-frame {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    width: 100%;
  }

  .tournee-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    inset: auto;
    min-height: 0;
    width: 100%;
    z-index: 0;
    will-change: transform;
    backface-visibility: hidden;
  }

  /* The panel is as tall as the frame (100vh). When its text is taller,
     site.js scrolls it along with the page (initTourneeScrollPin). */
  .tournee-hero-front {
    position: relative;
    z-index: 10;
    width: min(40vw, 42rem);
    flex-shrink: 0;
    padding: clamp(var(--header-offset), 11vw, 180px) 0 clamp(32px, 4vw, 60px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    pointer-events: auto;
    overflow-y: hidden;
  }

  /* Top spaces follow the screen height, never above the logo */
  .tournee-front-no-title {
    padding-top: clamp(var(--header-offset), 20vh, 173px);
  }

  /* Section 3: text panel on right */
  .tournee-front-right {
    margin-left: auto;
    padding-top: clamp(var(--header-offset), 28vh, 300px);
  }
}

/* Title (h1) */
.tournee-title {
  font-size: var(--size-h1);
  letter-spacing: 0;
  margin: 0 0 33px;
  background: transparent;
}

/* Computers: at the page-title size the title reaches the collage photos
   behind the panel; like the text block below it, it keeps the page
   background to stay readable (black on a dark photo otherwise) */
@media (min-width: 960px) {
  .tournee-title {
    width: fit-content;
    max-width: 100%;
    background: var(--bg);
  }
}

/* Description block */
.tournee-hero-desc {
  background: var(--bg);
  /* color: var(--bg); */
  padding: calc(var(--section-padding-y) + 4px) var(--gap);
}

/* CRÉATION — YEAR line */
.tournee-creation-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 12px;
}

.tournee-creation-label {
  font-family: var(--font-subtitle);
  font-size: clamp(16px, 2vw, 22px);
  text-transform: uppercase;
  letter-spacing: 0em;
}

.tournee-creation-year {
  font-family: var(--font-subtitle);
  font-size: clamp(16px, 2vw, 22px);
  text-transform: uppercase;
  letter-spacing: 0;
}

.tournee-creation-label,
.tournee-creation-year {
  /* no Plaak ligatures without letter-spacing (« NOTRE » → « Nᵗʳᵉ ») */
  font-variant-ligatures: none;
}

/* Maquette : « CRÉATION » et l'année en 24px sur ordinateur */
@media (min-width: 960px) {
  .tournee-creation-line .tournee-creation-label,
  .tournee-creation-line .tournee-creation-year {
    font-size: 24px;
  }
}

body.theme-light .tournee-creation-line {
  border-bottom-color: rgba(0, 0, 0, 0.15);
}

/* Ordinateur. Maquette « PAGE PRESENTATION » (fiche Hide & Seek, cadre 1280,
   515:608), en vw de ce cadre : bloc blanc de 528px (41,25vw) à 7,27vw du
   bord (93px ; 24px avant), titre à 8,67vw, capitales du titre 220px
   (17,19vw) sous le haut de l'écran, bloc blanc 33px (2,58vw) sous la ligne
   de base du titre ; dans le bloc, CRÉATION et le texte à 40px (3,13vw) du
   bord gauche et 31px (2,4vw) du bord droit, CRÉATION 14px sous le haut du
   bloc. Sections suivantes : bloc à droite, à 51,95vw du bord (665 sur
   1280). Le titre garde l'échelle commune (215px à
   1280, 190 dessinés). Thomas, 16/11/2026. */
@media (min-width: 960px) {
  .tournee-hero-front {
    width: 41.25vw;
    margin-left: calc(7.27vw - var(--gap));
    /* the frame starts below the section's top padding */
    padding-top: max(var(--header-offset), calc(17.19vw - 0.025 * var(--size-h1) - var(--section-padding-y)));
  }

  .tournee-front-no-title {
    padding-top: clamp(var(--header-offset), 20vh, 173px);
  }

  .tournee-front-right {
    margin-left: calc(51.95vw - var(--gap));
    padding-top: clamp(var(--header-offset), 28vh, 300px);
  }

  .tournee-title {
    line-height: 0.75;
    margin: 0 0 calc(2.58vw - 0.025 * var(--size-h1)) 1.4vw;
  }

  .tournee-hero-desc {
    padding: 0.43vw 2.4vw 1.6vw 3.13vw;
  }

  .tournee-creation-line {
    margin-bottom: 0;
  }
}

/* Description text */
.tournee-desc-text {
  font-size: var(--text-base);
  line-height: var(--line-height-body);
}

.tournee-desc-text p {
  margin: 0 0 1em;
}

.tournee-desc-text p:last-child {
  margin-bottom: 0;
}

/* Meta inside front panel */
.tournee-meta {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   SECTION 2: VIDEOS — Full-width, black background
   ========================================================================== */

.tournee-videos {
  background: #000;
  padding: clamp(40px, 8vh, 80px) var(--gap);
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tournee-videos-inner {
  width: min(100%, var(--max-width-wide));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 4vh, 48px);
}

.tournee-video-player {
  position: relative;
  max-height: calc(100vh - 200px);
  width: min(100%, calc((100vh - 200px) * 16 / 9));
}

.tournee-video-player video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

/* Embedded media (YouTube / Vimeo / SoundCloud) */
.tournee-embed {
  position: relative;
}

/* 16:9 aspect ratio for video embeds */
.tournee-embed-video {
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 200px);
  width: min(100%, calc((100vh - 200px) * 16 / 9));
}

.tournee-embed-video iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* SoundCloud / audio embeds — fixed height */
.tournee-embed-audio {
  height: 166px;
}

.tournee-embed-audio iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.tournee-embed-label {
  margin: 8px 0 0;
  font-size: var(--text-sm, 14px);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  text-align: center;
}

/* ==========================================================================
   KEYPOINTS SECTION — Full viewport with cover image and overlay
   ========================================================================== */

.tournee-keypoints {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
}

.tournee-keypoints-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.tournee-keypoints-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  padding: clamp(40px, 6vw, 60px) var(--gap);
  display: flex;
  align-items: stretch;
}

.tournee-keypoints-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  flex: 1;
}

.tournee-keypoints-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
}

.tournee-keypoints-arrow {
  width: 24px;
  height: auto;
  flex-shrink: 0;
  filter: invert(1);
}

.tournee-keypoints-text {
  font-family: var(--font-title);
  font-size: clamp(32px, 3.2vw, 60px);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #fff;
  min-width: 0;
  /* VIDÉOPROJECTIONS does not fit a phone line: hyphenate (lang fr), never cut */
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Phones: long words (CYCLOLOGISTIQUE) must fit the screen; unchanged from 492px */
@media (max-width: 959px) {
  .tournee-keypoints-text {
    font-size: clamp(22px, 6.5vw, 32px);
  }
}

@media (min-width: 960px) {
  .tournee-keypoints-item {
    gap: 24px;
  }

  /* Maquette : Plaak 44B 80px / Plaak 56 50px en alternance (polices posées
     par site.js) ; plus petits sous 1280px de large */
  .tournee-keypoints-item:nth-child(odd) .tournee-keypoints-text {
    font-size: min(80px, 6.25vw);
  }

  .tournee-keypoints-item:nth-child(even) .tournee-keypoints-text {
    font-size: min(50px, 3.91vw);
  }

  .tournee-keypoints-arrow {
    width: 32px;
  }
}

/* ==========================================================================
   FOCUS SECTION — Full-screen with citation and/or keypoints
   ========================================================================== */

.tournee-section-focus {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.tournee-focus-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.tournee-focus-overlay {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(40px, 6vw, 60px) var(--gap);
  text-align: left;
  gap: clamp(24px, 4vw, 40px);
}

/* Citation styles */
.tournee-focus-citation {
  font-family: 'plaak44b', sans-serif;
  font-size: 1.5rem;
  font-weight: normal;
  color: #fff;
  line-height: 1.4;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  /* background: rgba(0, 0, 0, 0.5); */
  /* padding: 20px 30px; */
  width: 100%;
}

.tournee-focus-quote {
  display: inline;
  font-size: 1.2em;
  vertical-align: middle;
  opacity: 0.7;
}

.tournee-focus-quote-open {
  margin-right: 0.1em;
}

.tournee-focus-quote-close {
  margin-left: 0.1em;
}

/* Keypoints styles */
.tournee-focus-keypoints {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: clamp(40px, 6vw, 60px) var(--gap);
}

.tournee-focus-keypoint {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tournee-focus-arrow {
  width: 20px;
  height: auto;
  flex-shrink: 0;
  filter: invert(1);
}

.tournee-focus-keypoint-text {
  font-size: 1.5rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #fff;
}

@media (min-width: 960px) {
  .tournee-focus-overlay {
    padding: clamp(48px, 6vw, 60px) clamp(32px, 6vw, 80px);
    gap: clamp(32px, 5vw, 60px);
  }

  .tournee-focus-citation {
    font-size: 2.5rem;
    /* padding: 30px 40px; */
  }

  .tournee-focus-keypoints {
    gap: 16px;
    padding: clamp(48px, 6vw, 60px) clamp(32px, 6vw, 80px);
  }

  .tournee-focus-keypoint {
    gap: 24px;
  }

  .tournee-focus-arrow {
    width: 32px;
  }

  .tournee-focus-keypoint-text {
    font-size: 2rem;
  }
}

/* ==========================================================================
   TEXT SECTION — Full-width text block with subtitle
   ========================================================================== */

.tournee-section-text {
  position: relative;
  width: 100%;
  padding: clamp(40px, 6vw, 60px) var(--gap);
}

.tournee-text-content {
  width: 100%;
  max-width: var(--max-width);
}

.tournee-text-subtitle {
  margin-bottom: 20px;
}

.tournee-text-body {
  font-size: var(--text-base);
  line-height: var(--line-height-body);
}

.tournee-text-body p {
  margin: 0 0 1em;
}

.tournee-text-body p:last-child {
  margin-bottom: 0;
}

@media (min-width: 960px) {
  .tournee-section-text {
    padding: clamp(48px, 6vw, 60px) clamp(32px, 6vw, 80px);
  }
}

/* ==========================================================================
   SECTION 3 & EXTRA SECTIONS: Gallery + Description
   ========================================================================== */

.tournee-section-3,
.tournee-section-extra {
  margin-top: 0;
}

/* ==========================================================================
   SCROLL INDICATOR — gradient hint at bottom of gallery frame
   ========================================================================== */

@media (min-width: 960px) {
  .tournee-scroll-frame::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
    z-index: 5;
  }

  /* Hide gradient once gallery is fully scrolled */
  .tournee-scroll-frame.is-scrolled-end::after {
    opacity: 0;
    transition: opacity 0.3s;
  }
}
