/* ============================================================
   ATELIER STEEVE RAY — sra.css
   CSS from scratch, sans dépendances
   Version réécrite : Grille 5→4→3→2→1, Slogans unifiés
   ============================================================ */

/* --- Reset minimal ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  background: #fff;
}
img { display: block; max-width: 100%; border: 0; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Header ------------------------------------------------- */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.brand {
  flex-shrink: 0;
  padding-right: 20px;
}
.brand img {
  height: 40px;
  width: auto;
  display: block;
}

/* Nav container */
.main-nav-container {
  flex: 1;
  min-width: 0;
}
.main-nav-container h2,
.site-brand {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: #111;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#main-nav { display: block; }
.main-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  padding: 0;
  margin: 0;
}
.main-nav li { display: inline-flex; align-items: center; }
.main-nav li a {
  font-size: 13px;
  color: #969696;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.main-nav li a::after {
  content: "/";
  padding: 0 7px;
  color: #ccc;
}
.main-nav li:last-child a::after { content: ""; }
.main-nav li a:hover { color: #000; font-weight: 700; }

/* Lien actif dans la nav */
.main-nav li a.active { font-weight: 700; }

/* Bouton menu mobile */
.nav-toggle {
  display: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
}

/* Menu secondaire (filtre par catégorie) */
.secondary-menu { display: none; }

/* --- Contenu principal -------------------------------------- */
.main-content {
  padding-top: 80px;
}

/* --- Grille projets (CSS Grid natif) ----------------------- */
/* Cascade : 5 → 4 → 3 → 2 → 1                               */
#grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 3px;
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Compatibilité avec l'ancien JS qui ajoute .loaded */
#grid.loaded { opacity: 1; }

/* 5 → 4 colonnes */
@media (max-width: 1399px) {
  #grid { grid-template-columns: repeat(4, 1fr); }
}

/* 4 → 3 colonnes */
@media (max-width: 1023px) {
  #grid { grid-template-columns: repeat(3, 1fr); }
}

/* 3 → 2 colonnes */
@media (max-width: 767px) {
  #grid { grid-template-columns: repeat(2, 1fr); }
}

/* 2 → 1 colonne */
@media (max-width: 480px) {
  #grid { grid-template-columns: 1fr; }
}

/* --- Vignette projet --------------------------------------- */
/* Le ratio 4/3 est garanti par aspect-ratio + overflow:hidden */
/* Le <a> et l'<img> sont en position absolute pour ne pas     */
/* pousser le conteneur, même si l'image a un ratio différent  */
article.item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e8e8e8;
  border-radius: 6px;
}

/* Le lien et le div conteneur remplissent la cellule en absolu */
/* :not(.slogan) pour ne pas affecter les cases slogans        */
article.item:not(.slogan) a,
article.item:not(.slogan) > div {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

/* L'image remplit le conteneur, croppée au centre */
article.item:not(.slogan) img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease;
}

article.item a:hover img {
  opacity: 0.75;
  transform: scale(1.04);
}
article.item a:hover .hover-info { opacity: 1; transform: translateY(0); }

/* Bandeau info au survol — badge flottant arrondi */
.hover-info {
  opacity: 0;
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0,0,0,1);
  font-family: 'Inconsolata', monospace;
  font-size: 11px;
  color: #fff;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: translateY(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 5px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.hover-info h3 {
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
  color: #fff;
}
.hover-info .fecha {
  font-size: 0.82em;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  margin-left: 10px;
  font-weight: 400;
}

/* --- Archives --------------------------------------------- */
article.item.archive {
  cursor: default;
  filter: grayscale(100%);
  transition: filter 0.4s ease;
}
article.item.archive:hover {
  filter: grayscale(100%);
}
article.item.archive > div {
  pointer-events: none;
}
article.item.archive .hover-info {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
  background: rgba(0,0,0,1);
}
article.item.archive:hover .hover-info {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
article.item.archive .hover-info h3 { margin: 0; color: #fff; }
article.item.archive .hover-info .fecha { display: none; }
article.item.archive .hover-info::after {
  content: "ARCHIVE";
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #ff0000;
}

/* --- Cases slogans positionnels (UNIQUE SOURCE) ----------- */
/* Ces règles sont la seule définition des slogans.           */
/* Plus aucun style inline dans index.html.                   */
article.item.slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: 1.2rem;
  text-align: center;
  cursor: default;
  position: relative;
  overflow: hidden;
}

/* Slogan cliquable (Fondation Cartier) */
article.item.slogan[data-link] {
  cursor: pointer;
}

/* Variantes de couleur */
article.item.slogan.dark {
  background: #111;
  color: #fff;
}
article.item.slogan.light {
  background: #fff;
  color: #111;
  border: 1px solid #e8e8e8;
}

/* Conteneur interne — centrage vertical/horizontal */
article.item.slogan .slogan-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

/* Texte principal du slogan */
article.item.slogan .slogan-text {
  font-family: 'Inconsolata', monospace;
  font-size: clamp(0.65rem, 1vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

/* Sous-titre du slogan */
article.item.slogan .slogan-sub {
  font-family: 'Inconsolata', monospace;
  font-size: clamp(0.55rem, 0.75vw, 0.78rem);
  letter-spacing: 0.12em;
  text-align: center;
  margin-top: 0.5rem;
  opacity: 0.45;
  text-transform: uppercase;
}

/* --- Cases catégories (affichées sur filtre actif) --------- */
.category-header {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  aspect-ratio: 4 / 3;
  padding: 1.2rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.02);
}
.category-header .slogan-text {
  font-family: 'Inconsolata', monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #111;
  line-height: 1.3;
}
.category-header .slogan-sub {
  font-family: 'Inconsolata', monospace;
  font-size: 0.7rem;
  color: #555;
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* --- Responsive slogans & catégories ----------------------- */
/* Sur mobile 2 colonnes : les slogans prennent toute la largeur */
@media (max-width: 767px) {
  article.item.slogan,
  .category-header {
    grid-column: 1 / -1;
    aspect-ratio: 3 / 1;
    min-height: 120px;
  }
  article.item.slogan .slogan-text {
    font-size: 0.85rem;
  }
  article.item.slogan .slogan-sub {
    font-size: 0.65rem;
  }
}

/* Sur mobile 1 colonne : format plus haut */
@media (max-width: 480px) {
  article.item.slogan,
  .category-header {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
    min-height: 140px;
  }
  article.item.slogan .slogan-text {
    font-size: 0.9rem;
  }
  article.item.slogan .slogan-sub {
    font-size: 0.7rem;
  }
}

/* --- Page projet ------------------------------------------- */
.project-layout {
  display: flex;
  height: calc(100vh - 80px);
  overflow: hidden;
}
.project-panel {
  width: 320px;
  flex-shrink: 0;
  padding: 32px 28px 24px;
  overflow-y: auto;
  border-right: 0.5px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
}
.project-panel::-webkit-scrollbar { display: none; }
.project-number {
  font-family: 'Inconsolata', monospace;
  font-size: 12px;
  color: #bbb;
  letter-spacing: 0.1em;
}
.project-panel h2 {
  font-family: 'Inconsolata', monospace;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: #111;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-panel h3 {
  font-family: 'Inconsolata', monospace;
  font-size: 15px;
  font-weight: 400;
  color: #888;
  margin: 4px 0 0;
}
.txt-gray { color: #aaa; }
.project-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  border-top: 0.5px solid #e8e8e8;
  padding-top: 12px;
}
.project-meta-list li span {
  font-weight: 700;
  margin-right: 6px;
  color: #333;
}
.project-meta-list li { color: #666; }
.project-description {
  font-size: 14px;
  line-height: 1.65;
  color: #555;
  border-top: 0.5px solid #e8e8e8;
  padding-top: 12px;
  margin: 0;
}

/* Galerie projet — scroll vertical, fond blanc */
.project-gallery {
  flex: 1;
  height: 100%;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  padding: 4px 8px 4px 4px;
  cursor: default;
  scrollbar-width: none;
  box-sizing: border-box;
}
.project-gallery::-webkit-scrollbar { display: none; }

/* Grille galerie — 2 colonnes responsive */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  align-items: start;
}
@media (min-width: 1600px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .gallery-grid { grid-template-columns: 1fr; } }

.gallery-grid img {
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* Mobile projet */
@media (max-width: 767px) {
  .project-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .project-panel {
    width: 100%;
    border-right: none;
    border-bottom: 0.5px solid #e0e0e0;
  }
  .project-gallery {
    height: auto;
    overflow-y: visible;
    overflow-x: visible;
    padding: 0;
  }
  .gallery-grid { grid-template-columns: 1fr; }
}

/* --- Pages Atelier / Nouvelles / Contact ------------------- */
.page-layout {
  display: flex;
  height: calc(100vh - 80px);
  overflow: hidden;
}
.page-panel {
  width: 280px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  padding: 32px 28px 24px;
  border-right: 0.5px solid #e0e0e0;
  box-sizing: border-box;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}
.page-panel::-webkit-scrollbar { display: none; }
.page-section-label {
  font-family: 'Inconsolata', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bbb;
  margin-bottom: 12px;
}
.page-panel h2 {
  font-family: 'Inconsolata', monospace;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: #111;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin: 0 0 20px;
}
.page-panel .sep {
  width: 32px;
  height: 1px;
  background: #e0e0e0;
  margin-bottom: 20px;
}
.page-panel p {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: #999;
  margin: 0;
}
.page-content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 36px 48px 48px 40px;
  box-sizing: border-box;
  scrollbar-width: none;
}
.page-content::-webkit-scrollbar { display: none; }

/* Sections Atelier */
.atelier-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 0.5px solid #ebebeb;
  max-width: 680px;
}
.atelier-section:last-child { border-bottom: none; }
.atelier-section-title {
  font-family: 'Inconsolata', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #bbb;
  margin-bottom: 16px;
}
.atelier-section p {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 12px;
}
.atelier-section p:last-child { margin-bottom: 0; }
.atelier-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.atelier-list li {
  font-family: 'Inconsolata', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  padding: 5px 0;
  border-bottom: 0.5px solid #f0f0f0;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
}
.atelier-list li:last-child { border-bottom: none; }
.atelier-list li .year { color: #bbb; font-size: 12px; padding-top: 2px; }

/* Nouvelles */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
  align-items: start;
}
@media (max-width: 1100px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
.news-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.news-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}
.news-date {
  font-family: 'Inconsolata', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #bbb;
  margin: 0;
}
.news-title {
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  margin: 0;
}
.news-sub {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: #999;
  line-height: 1.4;
  margin: 0;
}

/* Contact */
.contact-block {
  max-width: 480px;
  margin-bottom: 40px;
}
.contact-block p {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 2;
  color: #444;
  margin-bottom: 4px;
}
.contact-block strong {
  font-family: 'Inconsolata', monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.contact-block a { color: #444; border-bottom: 0.5px solid #ccc; transition: border-color 0.2s; }
.contact-block a:hover { border-color: #111; }
.contact-label {
  font-family: 'Inconsolata', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #bbb;
  margin-bottom: 16px;
}
.contact-map { max-width: 560px; }
.contact-map iframe { width: 100%; height: 360px; border: 0; display: block; }

/* Mobile pages texte */
@media (max-width: 767px) {
  .page-layout { flex-direction: column; height: auto; overflow: visible; }
  .page-panel { width: 100%; height: auto; border-right: none; border-bottom: 0.5px solid #e0e0e0; padding: 24px 20px; }
  .page-content { padding: 24px 20px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
}

/* --- Responsive header mobile ------------------------------ */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: center;
    padding: 10px 14px 8px;
    gap: 4px;
    text-align: center;
  }

  /* Logo centré */
  .brand {
    display: flex;
    justify-content: center;
    padding-right: 0;
  }
  .brand img { height: 28px; }

  .main-nav-container {
    width: 100%;
    text-align: center;
  }
  .main-nav-container h2 {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 5px;
    white-space: normal;
    text-align: center;
  }

  /* Bouton burger masqué */
  .nav-toggle { display: none; }

  /* Menu centré, retour à la ligne automatique */
  #main-nav { display: block; }
  .main-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    overflow: visible;
  }
  .main-nav li { display: inline-flex; }
  .main-nav li a {
    font-size: 14px;
    color: #969696;
    white-space: nowrap;
    padding: 2px 0;
  }
  .main-nav li a::after {
    content: "/";
    padding: 0 6px;
    color: #ccc;
  }
  .main-nav li:last-child a::after { content: ""; }

  .main-content { padding-top: 120px; }
}
