/* Nina Lê — Portfolio Grid Layout */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

:root {
  --paper: #ffffff;
  --paper-deep: #f9f9f9;
  --ink: #111111;
  --ink-soft: #5c5c5c;
  --hand: 'Cormorant Garamond', serif;
  --sans: 'Cormorant Garamond', serif;
  --mono-light: 'Cormorant Garamond', serif;
}

*, *::before, *::after { 
  box-sizing: border-box; 
}

/* Force la barre de défilement pour éviter les sauts de mise en page */
html { 
  scroll-behavior: smooth; 
  overflow-y: scroll !important;
  width: 100% !important;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Masquage du curseur natif uniquement si le JS du curseur personnalisé est actif --- */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

/* --- Style du curseur personnalisé (Point de 6px en négatif) --- */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;                        /* Diamètre exact de 6px */
  height: 14px;                       /* Diamètre exact de 6px */
  background-color: #ffffff;         /* Fond blanc pour créer l'inversion */
  border-radius: 50% !important;     /* Forme ronde parfaite */
  pointer-events: none !important;   /* Laisse passer les clics */
  z-index: 999999;                   /* Toujours au premier plan */
  opacity: 0;                        /* Invisible au départ, géré par le JS */
  transform: translate(-50%, -50%);  /* Centre le point pile sur la souris */
  mix-blend-mode: difference;        /* Crée l'effet "négatif" sur les images/fonds */
  transition: opacity 0.2s ease;
  will-change: transform;
}

/* --- Filtre Noir et Blanc --- */
.bw-img {
  filter: grayscale(100%) !important;
  -webkit-filter: grayscale(100%) !important; /* Pour la compatibilité Safari/Mac */
}

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

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

/* ==========================================================================
    Conteneur principal (2cm de marge latérale)
   ========================================================================== */
.wrap {
  width: calc(100% - 4cm) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0 !important;
  margin-bottom: 3cm !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ---------- Header / Nav ---------- */

header.site {
  height: 3cm;
  position: sticky;
  top: 0;
  z-index: 500;
  background: transparent;
  font-family: var(--mono-light);
}

header.site .wrap {
  height: 100%;
  margin-bottom: 0 !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.site nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-left: auto;
  width: auto;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
}

.logo a {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
  font-family: var(--hand);
  font-size: 18px !important;
  letter-spacing: 0.15em !important;
  font-weight: 400;
}

.logo a:hover {
  opacity: 0.7;
}

/* Navigation */
.nav-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono-light);
  font-weight: 300;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  margin: 0;
  padding: 0;
  white-space: nowrap;
  letter-spacing: 0.15em;
  text-decoration: none;
}

.nav-label::before,
.nav-label::after {
  content: "" !important;
  display: inline !important;
}

.nav-label.active::before {
  content: "(\00a0" !important;
}

.nav-label.active::after {
  content: "\00a0)" !important;
}

.nav-label:hover:not(.active) {
  text-decoration: underline;
}

/* ---------- Grille 5 Colonnes Centrée avec Points (Index) ---------- */

.dot-grid-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.dot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr) !important;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.grid-cell {
  position: relative;
  aspect-ratio: 1 / 1 !important;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3cm !important;
}

/* Point noir aux intersections (angle supérieur gauche) */
.grid-cell::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 6px;
  height: 6px;
  background-color: var(--ink);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}

/* Point noir supplémentaire pour fermer le bord supérieur droit de la dernière colonne */
.grid-cell:nth-child(5n)::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 6px;
  height: 6px;
  background-color: var(--ink);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}

/* Conteneur de l'image */
.grid-cell a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Images au format d'origine */
.grid-cell img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
  transition: transform 0.4s ease;
}

.grid-cell a:hover img {
  transform: scale(1.05);
}

/* Textes placés éventuellement dans certaines cases */
.cell-text {
  font-family: var(--mono-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  padding: 10px;
  text-align: center;
}

/* ---------- Pages Secondaires (Architectures, Pratiques, Divers) ---------- */

.section-head {
  padding: 10px 0 40px;
}

.section-head h1 {
  font-family: var(--hand);
  font-weight: 300;
  font-size: clamp(34px, 5vw, 58px);
  margin: 0 0 14px;
  transform: rotate(-1deg);
  display: inline-block;
}

.section-head p {
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0;
}

/* Grille Masonry 3 colonnes pour les pages secondaires */
.masonry {
  width: 100%;
  column-count: 3;
  column-gap: 1.2cm !important;
  margin-top: 1cm;
}

.masonry a {
  display: block;
  margin-bottom: 1.2cm !important;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  background: var(--paper-deep);
  overflow: hidden;
}

.masonry img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.masonry a:hover img {
  transform: scale(1.03);
}

/* ---------- Page Contact (3 Colonnes Égales) ---------- */

.contact-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.5cm;
  width: 100%;
  padding-top: 1cm;
  align-items: start;
}

.col-center {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.business-card-img {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.business-card-img img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.contact-info-block {
  margin-top: 1cm;
  width: 4cm;
  max-width: 100%;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.contact-info-block p {
  margin: 0 auto;
  text-align: center;
}

.contact-info-block a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
    Responsive Mobile (< 860px)
   ========================================================================== */

@media (max-width: 860px) {

  /* 1. Ajustement de la marge latérale globale sur mobile */
  .wrap {
    width: calc(100% - 3cm) !important;
    margin-bottom: 1.5cm !important;
  }

  /* 2. Passage de la grille principale à un format 2 colonnes sur mobile */
  .dot-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 3. Adaptation du Masonry en 1 colonne sur mobile */
  .masonry {
    column-count: 1;
    column-gap: 0 !important;
  }

  /* 4. Adaptation de la grille de contact en colonne unique */
  .contact-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 2cm;
  }
}
