/* =========================================================
   CARGO – CSS NETTOYÉ & COMPLET (remplace ton CSS actuel)
   - Responsive (desktop / tablette / mobile)
   - Grille home .js-grid
   - Images fluides + thumbs recadrées
   - Menu mobile sans débordements
   - A11Y: focus visible + reduced motion
   ========================================================= */


/* =========================
   0) Variables
========================= */
:root{
  --page-max: 1320px;
  --gutter: clamp(12px, 2.5vw, 24px);
  --grid-gap: clamp(12px, 2vw, 20px);
  --thumb-ratio: 3/2;
  --thumb-zoom: 1.02;
  --text-size: clamp(15px, 1.2vw, 18px);
}


/* =========================
   1) Base / Reset utile
========================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  background-color: #fff;
  color: #000;
  font-size: var(--text-size);
  line-height: 1.5;
}

/* Evite les styles Cargo Editor */
#toolset { display: none; }

/* Liens */
a:active { opacity: 0.7; }
.page a.active { color: #f00; }

/* Typo de base */
i, em { font-style: italic; }
b, strong { font-weight: bolder; }

sub, sup { position: relative; vertical-align: baseline; }
sub { top: 0.3em; }
sup { top: -0.4em; }
s { text-decoration: line-through; }

/* Listes + quotes */
ul, ol { margin: 0; padding: 0 0 0 2.5em; }
blockquote { margin: 0; padding: 0 0 0 1em; }

hr{
  background: rgba(0, 0, 0, 0.6);
  border: 0;
  height: 2px;
  display: block;
  margin: 1rem 0;
}

/* Focus visible (accessibilité clavier) */
a:focus-visible, button:focus-visible{
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* =========================
   2) Conteneurs (layout)
========================= */
.site-container,
.content,
#content{
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


/* =========================
   3) Images / médias fluides
========================= */
img{
  border: 0;
  padding: 0;
  max-width: 100%;
  height: auto;
  display: block;
}

.content img,
.project img,
figure img,
.entry img{
  max-width: 100%;
  height: auto;
  display: block;
  float: none;
  margin-bottom: 0;
  vertical-align: bottom;
}

/* Petit fix Cargo: images dans des liens */
a img { display: block; }

/* Slideshow Cargo */
[image-gallery="slideshow"] { margin-bottom: 2rem; }

.gallery_image_caption{
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.4);
  font-family: Diatype, Icons;
  font-style: normal;
  line-height: 1.2;
}

/* Image zoom */
.content img.image-zoom:active { opacity: .7; }


/* =========================
   4) Home Grid (si JS ajoute .js-grid)
========================= */
.js-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.js-grid .tile{
  grid-column: span 4; /* 3 colonnes desktop */
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

@media (max-width: 1100px){
  .js-grid .tile{ grid-column: span 6; } /* 2 colonnes */
}
@media (max-width: 680px){
  .js-grid .tile{ grid-column: span 12; } /* 1 colonne */
}

.js-grid .tile .thumb{
  aspect-ratio: var(--thumb-ratio);
  width: 100%;
  overflow: hidden;
}

.js-grid .tile .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform .35s ease;
}

.js-grid .tile:hover .thumb img{
  transform: scale(var(--thumb-zoom));
}

.js-grid .tile .caption{
  padding: 10px 4px 0;
  font-size: clamp(13px, 1vw, 16px);
}


/* =========================
   5) Pages Projet / Page
========================= */
.project .content,
.page .content{
  display: block;
}

.project .content > * + *{
  margin-top: clamp(10px, 2vw, 24px);
}

section, article{
  margin-block: clamp(24px, 5vw, 56px);
}


/* =========================
   6) Header sticky (fallback)
========================= */
.header-sticky{
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,.75); /* fallback */
  background: color-mix(in oklab, white 65%, transparent);
  z-index: 50;
}


/* =========================
   7) Loading
========================= */
.loading[data-loading]{
  position: fixed;
  bottom: 8px;
  left: 8px;
}


/* =========================
   8) Styles Cargo Preset (conservés)
========================= */

/* Editor typography */
[data-predefined-style="true"] bodycopy{
  font-size: 1.4rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.75);
  font-family: "Diatype Variable", Icons;
  font-style: normal;
  line-height: 1.2;
  font-variation-settings: 'slnt' 0, 'MONO' 0;
}
[data-predefined-style="true"] bodycopy a{
  color: rgba(0, 0, 0, 0.75);
  text-decoration: none;
}
bodycopy a.image-link,
bodycopy a.icon-link,
bodycopy a.image-link:hover,
bodycopy a.icon-link:hover{
  border-bottom: 0;
  padding-bottom: 0;
}

[data-predefined-style="true"] h1{
  font-family: "Diatype Variable", Icons;
  font-style: normal;
  font-weight: 400;
  padding: 0;
  margin: 0;
  font-size: 3.2rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.75);
  font-variation-settings: 'slnt' 0, 'MONO' 0;
}
[data-predefined-style="true"] h1 a{ color: rgba(0, 0, 0, 0.75); }

[data-predefined-style="true"] h2{
  font-family: "Diatype Variable", Icons;
  font-style: normal;
  font-weight: 500;
  padding: 0;
  margin: 0;
  color: rgba(0, 0, 0, 0.75);
  font-size: 2.2rem;
  line-height: 1.2;
  font-variation-settings: 'slnt' 0, 'MONO' 0;
}
[data-predefined-style="true"] h2 a{ color: rgba(0, 0, 0, 0.75); }

[data-predefined-style="true"] small{
  display: inline-block;
  font-size: 1rem;
  line-height: 1.2;
  font-family: "Monument Grotesk Mono Variable", Icons;
  font-style: normal;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.6);
  font-variation-settings: 'slnt' 0, 'MONO' 1;
}
[data-predefined-style="true"] small a{
  color: rgba(0, 0, 0, 0.6);
  border-bottom-width: 0;
}

/* Breakpoints preset */
[data-css-preset] .page{ background-color: initial; }

.mobile .page,
[data-css-preset].mobile .page{
  position: relative;
  max-width: 100%;
  width: 100%;
  background-color: transparent;
}

[data-css-preset] .container{
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* Les largeurs desktop Cargo (on garde desktop, on override en responsive) */
[data-css-preset] .container_width{ width: 59%; }
[data-css-preset] .content_padding{
  padding-top: 3.1rem;
  padding-bottom: 3.1rem;
  padding-left: 3.1rem;
  padding-right: 3.1rem;
}

/* Thumbnails */
div[thumbnails]{ justify-content: flex-start; }
[data-css-preset] .thumbnails{ background-color: transparent; }
[data-css-preset] .thumbnails_width{ width: 60%; }

[data-css-preset] [thumbnails-pad]{ padding: 0.75rem; }
[data-css-preset] [thumbnails-gutter]{ margin: -1.5rem; }

[data-css-preset] [responsive-layout] [thumbnails-pad]{ padding: 0.5rem; }
[data-css-preset] [responsive-layout] [thumbnails-gutter]{ margin: -1rem; }

.thumbnails .thumb_image{
  outline: 0px solid rgba(0,0,0,.12);
  outline-offset: -1px;
}
.thumbnails .title{
  margin-top: 1rem;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.85);
  font-family: Diatype, Icons;
  font-style: normal;
  line-height: 1.3;
}
.thumbnails .tags{
  margin-top: .8rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.6);
  font-family: "Monument Grotesk Mono", Icons;
  font-style: normal;
  line-height: 1.2;
}
.thumbnails .tags a{
  border-bottom: 0;
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
}
.thumbnails .has_title .tags{ margin-top: -1.8rem; }


/* =========================
   9) Menu / boutons Cargo
========================= */
[data-css-preset] #site_menu_button{
  color: rgba(0, 0, 0, 0.75);
  font-size: 30px;
  padding: 6px;
  background: rgba(33, 32, 46, 0);
  position: fixed;
  right: 2rem;
  top: 2rem;
  line-height: 1;
}

body.mobile #site_menu_button{
  margin: -10px;
  font-size: 32px;
}

#site_menu_button.custom_icon{ width: 40px; height: auto; }
#site_menu_button.active{ display: none; }

#site_menu{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif, "Sans Serif", Icons;
  background: rgba(20, 20, 20, 0.95);
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  padding: 20px 30px 90px 30px;
  max-width: 400px;
  min-width: 300px;
  text-align: left;
  display: flex;
  justify-content: flex-start;
}

body.mobile #site_menu{ width: 100%; }

#site_menu .page-link a{ color: rgba(255, 255, 255, 0.75); }
#site_menu .set-link > a{
  color: rgba(255, 255, 255, 0.75);
  font-weight: bold;
}
#site_menu a:active{ opacity: .7; }
#site_menu a.active{ opacity: .4; }

#site_menu .close{
  display: none;
  color: rgba(255, 255, 255, 0.4);
  line-height: .85em;
  font-size: 45px;
}
body.mobile #site_menu .close{
  display: block;
  font-size: 50px;
  line-height: 1em;
}
#site_menu .break{ height: 28px; }
#site_menu .indent{ margin-left: 28px; }

/* Shop button */
[data-css-preset] #shop_button{
  color: rgba(0, 0, 0, 0.85);
  background: transparent;
  font-size: 32px;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  position: fixed;
  padding: 6px;
  top: 1rem;
  left: 1.5rem;
}
#shop_button.text{
  font-size: 1.6rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.75);
  font-family: Diatype, Icons;
  padding: 0;
  line-height: 1.3;
  font-style: normal;
}
#shop_button.custom_icon{ width: 40px; height: auto; }
body.mobile #shop_button:not(.text){
  margin: -6px;
  font-size: 40px;
}

/* Shop product widget */
.shop_product{
  width: 100%;
  max-width: 22rem;
  position: relative;
  display: block;
}
.shop_product .price{
  font-family: Diatype, Icons;
  font-size: 1.6rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.75);
  display: block;
  margin-bottom: 1rem;
  font-style: normal;
  font-weight: 400;
}
.shop_product .dropdown{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif, "Sans Serif", Icons;
  font-size: 1.3rem;
  display: inline-block;
  width: 100%;
  border: 1px solid rgba(0,0,0,.2);
  background: white url(https://static.cargo.site/assets/images/select-line-arrows.svg) no-repeat right;
  margin-bottom: 1rem;
  line-height: 1.4;
  padding: .7rem 2.5rem 0.6rem 1rem;
  font-style: normal;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.75);
}
.shop_product .button{
  font-family: Diatype, Icons;
  font-size: 1.3rem;
  background: rgba(0, 0, 0, 0.75);
  color: rgba(255,255,255,1);
  flex: 0 0 50%;
  text-align: left;
  display: inline-block;
  line-height: 1;
  padding: .8rem 1rem;
  font-style: normal;
  font-weight: 700;
}


/* =========================
   10) Quick view / nav / audio (conservé)
========================= */
[data-css-preset] .quick-view{
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  height: 100%;
  width: 100%;
}
body.mobile .quick-view{
  width: 100%;
  height: 100%;
  margin: 0;
}
[data-css-preset] .quick-view-background{
  background: rgba(255, 255, 255, 1);
}
.quick-view-caption{
  font-family: Diatype, Icons;
  transition: 100ms opacity ease-in-out;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 3.5rem 0;
  text-align: center;
  font-size: 1.6rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
}
.quick-view-caption span{
  padding: 0.5rem 1rem;
  display: inline-block;
  background: rgba(0,0,0,0.4);
  color: white;
}

/* Quick view arrows */
.quick-view-navigation .left-arrow{ left: 10px; }
.quick-view-navigation .right-arrow{ right: 10px; }
.quick-view-navigation .left-arrow,
.quick-view-navigation .right-arrow{
  height: 36px;
  width: 36px;
}
.quick-view-navigation .left-arrow .inner-color,
.quick-view-navigation .right-arrow .inner-color{
  stroke: #fff;
  stroke-width: 0px;
}
.quick-view-navigation .left-arrow .outer-color,
.quick-view-navigation .right-arrow .outer-color{
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 2px;
}
.quick-view-navigation .close-button{
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
}
.quick-view-navigation .close-button .inner-color{ stroke: #fff; stroke-width: 0px; }
.quick-view-navigation .close-button .outer-color{ stroke: rgba(0, 0, 0, 0.85); stroke-width: 2px; }

/* Gallery arrows */
.image-gallery-navigation .left-arrow,
.image-gallery-navigation .right-arrow{
  height: 36px;
  width: 36px;
}
.image-gallery-navigation .left-arrow .inner-color,
.image-gallery-navigation .right-arrow .inner-color{
  stroke: #fff;
  stroke-width: 2px;
}
.image-gallery-navigation .left-arrow .outer-color,
.image-gallery-navigation .right-arrow .outer-color{
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 3px;
}

/* Wallpaper arrows */
.wallpaper-navigation .left-arrow,
.wallpaper-navigation .right-arrow{
  width: 36px;
  height: 36px;
}
.wallpaper-navigation .left-arrow .inner-color,
.wallpaper-navigation .right-arrow .inner-color{
  stroke: #fff;
  stroke-width: 2px;
}
.wallpaper-navigation .left-arrow .outer-color,
.wallpaper-navigation .right-arrow .outer-color{
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 3px;
}

/* Feed borders */
.feed .content_container .page{ border-top: 0px dashed rgba(0, 0, 0, 0.2); }
.feed .content_container .page_container:first-child .page{ border-top: 0; }

/* Audio */
.audio-player{
  max-width: 36rem;
  height: 3.3rem;
  outline: 1px solid rgba(0,0,0,0.15);
  color: rgba(0, 0, 0, 0.6);
  background: #fff;
  font-size: 1.4rem;
  line-height: 1.3;
  font-family: Diatype, Icons;
  font-style: normal;
  font-weight: 400;
  text-align: left;
  margin: 1px 1px 1em 1px;
}
body.mobile .audio-player{ max-width: 100%; }
.audio-player .separator{ width: 1px; background-color: rgba(0,0,0,0.15); }
.audio-player .button{ background: transparent; cursor: pointer; fill: rgba(0, 0, 0, 0.85); }
.audio-player .icon{
  fill: rgba(0, 0, 0, 0.85);
  padding: 30%;
  width: 100%;
  margin: auto;
}
.audio-player .buffer{ background: rgba(0,0,0,0.03); }
.audio-player .progress{ background: rgba(0,0,0,0.1); }
.audio-player .progress-indicator{
  border: 1px solid rgba(0, 0, 0, 0.7);
  width: 1px;
  height: 100%;
  right: 0;
  position: absolute;
  cursor: ew-resize;
}
.audio-player .note-icon{
  height: 100%;
  width: 3.8rem;
  padding: 0.9rem;
  fill: rgba(0, 0, 0, 0.5);
}
.audio-player .current-time{ padding-left: 1rem; }
.audio-player .total-time{ padding-right: 1rem; }


/* =========================
   11) RESPONSIVE (le plus important)
========================= */

/* TABLETTE */
@media (max-width: 1024px){

  /* Cargo: plein largeur (au lieu de 59% / 60%) */
  [data-css-preset] .container_width,
  [data-css-preset] .thumbnails_width{
    width: 100% !important;
  }

  /* Padding global réduit */
  [data-css-preset] .content_padding{
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* H1 plus fluide */
  [data-predefined-style="true"] h1{
    font-size: clamp(2rem, 5vw, 3rem) !important;
    line-height: 1.05 !important;
  }
}

/* MOBILE */
@media (max-width: 768px){

  /* overflow-x hidden -> mobile only (évite scroll horizontal) */
  html, body{ overflow-x: hidden !important; }

  /* Container plein largeur */
  [data-css-preset] .container_width,
  [data-css-preset] .thumbnails_width{
    width: 100% !important;
  }

  /* Padding global */
  [data-css-preset] .content_padding{
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  /* Listes moins “mangeuses d’espace” */
  ul, ol{ padding-left: 1.4em !important; }

  /* Bouton menu mieux placé */
  [data-css-preset] #site_menu_button{
    right: 1rem !important;
    top: 1rem !important;
  }

  /* Menu: pas de min-width (sinon ça déborde) */
  #site_menu{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 18px 18px 70px 18px !important;
  }

  /* Titres plus safe */
  [data-predefined-style="true"] h1{
    font-size: 2.2rem !important;
    line-height: 1.05 !important;
  }
  [data-predefined-style="true"] h2{
    font-size: 1.6rem !important;
    line-height: 1.15 !important;
  }

  /* Thumbnails texte */
  .thumbnails .title{
    font-size: 1.2rem !important;
    margin-bottom: 1.2rem !important;
  }
  .thumbnails .tags{
    font-size: 0.95rem !important;
    margin-bottom: 1rem !important;
  }

  /* Tap targets */
  a, button{ min-height: 44px; }
}

/* Petits mobiles */
@media (max-width: 480px){
  .site-container, .content, #content{ padding-inline: 16px; }
}

/* Très petits mobiles */
@media (max-width: 420px){
  [data-predefined-style="true"] h1{ font-size: 2rem !important; }
  [data-predefined-style="true"] h2{ font-size: 1.45rem !important; }
}