/* Thurial — feuille de style */

/* =========================================
   1. IMPORTS, VARIABLES ET BASE
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --paper: #f7f7f4;
  --ink: #111;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* =========================================
   2. TYPOGRAPHIE
   ========================================= */

.intro-content h1,
.intro-content > a,
.project-title,
.grading-project {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
}

.menu,
.location,
.grading-filters,
.project-category {
  font-family: 'IBM Plex Mono', monospace;
}

/* =========================================
   3. NAVIGATION
   ========================================= */

.menu {
  position: fixed;
  z-index: 9999;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 68px;
  gap: 24px;
  padding: 24px 4vw;
  background: transparent;
  color: #fff;
  font-size: 20px;
  mix-blend-mode: difference;
  pointer-events: none;
}

body.admin-bar .menu {
  top: 32px;
}

.menu a {
  color: #fff;
  font-size: 20px;
  white-space: nowrap;
  pointer-events: auto;
}

.menu a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.menu-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.language-switcher {
  display: flex;
  gap: 4px;
}

.language-switcher a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.menu-toggle {
  display: none;
}

/* =========================================
   4. PAGE D’ACCUEIL
   ========================================= */

main.home {
  position: relative;
  display: block;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

main.home > .intro {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 60%;
  height: 100%;
  padding: 0 4vw;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.intro-content h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1;
}

.intro-content > a {
  font-size: clamp(48px, 7vw, 120px);
}

.intro-content > a:hover {
  opacity: 0.6;
  transform: translateX(8px);
}

main.home > .location {
  position: absolute;
  bottom: 32px;
  left: 4vw;
  margin: 0;
  padding-block: 32px;
  font-size: 14px;
  opacity: 0.7;
}

/* --- Home: on coupe le scroll vertical global --- */
html:has(main.home),
body:has(main.home) {
  overflow-y: hidden !important;
  height: 100%;
}

/* =========================================
   5. COLONNE ET CARTES DE PROJETS
   ========================================= */

.project-column {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #777;
}

main.home > .project-column {
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
}

.project-track {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
}

.project-track::-webkit-scrollbar {
  display: none;
}

.project-card {
  position: relative;
  display: block;
  width: 100%;
  height: 80dvh;
  min-height: 400px;
  overflow: hidden;
  background: #777;
  scroll-snap-align: start;
}

.project-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.project-card:hover img {
  transform: scale(1.03);
}

.project-title {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 80%;
  margin: 0;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: clamp(24px, 3vw, 48px);
  line-height: 0.95;
  text-align: center;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* =========================================
   6. PAGE ÉTALONNAGE / MONTAGE
   ========================================= */

html:has(.grading-page),
body:has(.grading-page) {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.grading-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
}

body.admin-bar .grading-page {
  top: 32px;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
}

.grading-projects {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.grading-filters {
  position: absolute;
  z-index: 10;
  top: 90px;
  left: 50%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  transform: translateX(-50%);
  mix-blend-mode: difference;
  font-size: 18px;
}

.grading-filters button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.grading-filters button.is-active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.grading-list {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 145px 4vw 40px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  mix-blend-mode: difference;
}

.grading-project {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  width: min(700px, 90vw);
  padding: 0.15em 0;
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: clamp(1.5rem, 3vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  opacity: 0.48;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.grading-project:hover,
.grading-project.is-active {
  transform: translateX(8px);
  opacity: 1;
}

.grading-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  pointer-events: none;
}

.project-category {
  flex: 0 0 auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.35em;
}

.grading-empty {
  color: #fff;
}

/* =========================================
   7. PAGE PROJET — STRUCTURE
   Compatible avec le single-project.php fourni.
   ========================================= */

.project-page {
  min-height: 100vh;
  padding: 100px 4vw 40px;
}

.project-heading {
  margin: 0 0 24px;
}

.project-heading h1,
.project-heading p {
  margin: 0;
}

.project-heading p {
  margin-top: 8px;
}

/*
 * Vidéo à gauche, galerie à droite.
 * Le titre reste au-dessus des deux colonnes.
 */
.project-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.project-videos {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  min-width: 0;
}

.project-video {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  background: transparent;
}

.project-video iframe,
.project-video video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-video video {
  object-fit: contain;
}

.project-content {
  width: 100%;
}

.project-content > *:first-child {
  margin-top: 0;
}

.project-content > *:last-child {
  margin-bottom: 0;
}

.project-video-link {
  margin: 0;
}

.project-gallery {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.gallery-image img,
.gallery-placeholder {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-placeholder {
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  background: #e8e8e8;
  color: #555;
}

.project-credits {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-top: 32px;
}

.project-people p {
  margin: 0 0 8px;
}

.project-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Une seule colonne de médias : centrée et limitée en largeur. */
.project-media:not(:has(.project-gallery)) .project-videos,
.project-media:not(:has(.project-videos)) .project-gallery {
  grid-column: 1 / -1;
  width: min(100%, 900px);
  margin-inline: auto;
}

/* =========================================
   8. RESPONSIVE — ORDINATEUR
   ========================================= */

@media (min-width: 761px) {
  html:has(.project-page),
  body:has(.project-page) {
    height: 100%;
    overflow: hidden;
  }

  .project-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 100px 4vw 32px;
  }

  .project-heading {
    flex: 0 0 auto;
  }

  .project-media {
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
  }

  .project-videos {
    justify-content: center;
    align-items: center;
    min-height: 0;
  }

  .project-video {
    width: 100%;
    max-width: 900px;
  }

  .project-gallery {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 0 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .project-credits {
    flex: 0 0 auto;
  }

  /* Galerie seule : une colonne centrée, avec défilement si nécessaire. */
  .project-media:not(:has(.project-videos)) {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .project-media:not(:has(.project-videos)) .project-gallery {
    width: min(100%, 1000px);
    margin-inline: auto;
    overflow: visible;
  }

  /* Vidéos seules : une colonne centrée. */
  .project-media:not(:has(.project-gallery)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-media:not(:has(.project-gallery)) .project-videos {
    width: 100%;
  }

  .project-media:not(:has(.project-gallery)) .project-video {
    width: min(80%, 1000px);
  }
}

/* =========================================
   9. RESPONSIVE — MOBILE
   ========================================= */

@media (max-width: 760px) {
  /* Étalonnage */
  .grading-filters {
    top: 105px;
    left: 4vw;
    right: 4vw;
    justify-content: center;
    transform: none;
  }

  .grading-list {
    padding-top: 160px;
  }

  .grading-project {
    width: 92vw;
    gap: 12px;
  }

  /* Accueil */
  html:has(main.home),
  body:has(main.home) {
    height: 100%;
    overflow: hidden;
  }

  main.home {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  main.home > .intro {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 76px 4vw 16px;
    justify-content: flex-start;
  }

  main.home .intro-content h1 {
    font-size: clamp(26px, 7vw, 36px);
  }

  main.home .intro-content > a {
    font-size: clamp(34px, 8vw, 54px);
  }

  main.home > .project-column {
    position: relative;
    top: auto;
    right: auto;
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  main.home .project-track {
    height: 100%;
  }

  main.home .project-card {
    height: 100%;
    min-height: 0;
  }

  main.home > .location {
    bottom: 12px;
    left: 4vw;
    padding: 0;
  }

  main.home .intro-content p {
    font-size: clamp(16px, 3vw, 20px);
  }

  /* Page projet : colonnes empilées et défilement normal. */
  html:has(.project-page),
  body:has(.project-page) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .project-page {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 100px 4vw 32px;
    overflow: visible;
  }

  .project-media {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: visible;
  }

  .project-videos,
  .project-gallery {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding: 0;
  }

  .project-video {
    width: 100%;
    max-width: 100%;
  }

  .project-credits {
    flex-direction: column;
    margin-top: 32px;
  }

  .project-gallery {
    margin-top: 0;
  }

  .project-media:not(:has(.project-gallery)) .project-videos,
  .project-media:not(:has(.project-videos)) .project-gallery {
    width: 100%;
  }
}

/* =========================================
   10. MENU MOBILE
   ========================================= */

@media (max-width: 768px) {
  .menu {
    position: fixed;
    z-index: 99999;
    top: 0;
    right: 0;
    left: 0;
    height: 68px;
    padding: 10px 4vw;
    background: var(--paper);
    color: var(--ink);
    mix-blend-mode: normal;
    pointer-events: none;
  }

  body.admin-bar .menu {
    top: 46px;
  }

  .menu-toggle {
    position: absolute;
    top: 12px;
    right: 4vw;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border: 0;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ink);
  }

  .menu-links {
    display: none;
    pointer-events: auto;
  }

  .menu.is-open .menu-links {
    position: absolute;
    top: 100%;
    right: 4vw;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    width: max-content;
    padding: 16px;
    background: var(--paper);
    color: var(--ink);
  }

  .menu.is-open .menu-links a {
    color: var(--ink);
  }
}

/* =========================================
   11. PAGES À PROPOS ET CONTACT
   ========================================= */

.about,
.contact {
  max-width: 700px;
  margin: 0 auto;
  padding: 120px 24px 60px;
  line-height: 1.7;
}

.about {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.about h1,
.contact h1 {
  margin-bottom: 32px;
}

.about p {
  margin-bottom: 20px;
}

.contact a {
  color: inherit;
}