/* ─────────────────────────────────────────
   Template B — Sidebar fixe
───────────────────────────────────────── */

/* ── LAYOUT ── */
.tb-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.tb-sidebar {
  border-right: 1px solid var(--stone-mid);
  position: relative;
}

.tb-sidebar-inner {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  padding: 0 40px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.tb-back-zone {
  height: 110px;
  display: flex;
  align-items: center;
  margin-bottom: 0px;
}

.tb-sidebar-top {
  margin-bottom: 48px;
}

.tb-num {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--sage);
  margin-bottom: 16px;
}

.tb-title {
  font-family: var(--f-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.tb-title em {
  font-style: italic;
  color: var(--sage);
}

/* Metadata */
.tb-sidebar-meta {
  flex: 1;
}

.tb-meta-block {
  margin-bottom: 28px;
}

.tb-meta-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-dark);
  margin-bottom: 8px;
}

.tb-meta-value {
  font-size: 13px;
  color: var(--forest);
  line-height: 1.5;
}

.tb-missions {
  list-style: none;
  margin-top: 4px;
}

.tb-missions li {
  font-size: 14px;
  color: var(--forest);
  padding: 8px 0;
  border-bottom: 1px solid var(--stone-mid);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tb-missions li::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}

.projet-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.projet-tags span {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-dark);
  border: 1px solid var(--stone-mid);
  padding: 6px 12px;
}

.tb-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
  text-decoration: none;
  border: 1px solid var(--stone-mid);
  padding: 8px 14px;
  margin-bottom: 32px;
  transition: background 0.25s, border-color 0.25s;
}

.tb-back-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}

.tb-back-btn:hover {
  background: var(--stone-mid);
  border-color: var(--stone-dark);
}

.tb-figma-btn {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  background: var(--forest);
  border: 1px solid var(--forest);
  padding: 8px 14px;
  transition: background 0.25s, border-color 0.25s, opacity 0.25s;
  margin-top: 8px;
}

.tb-figma-btn:not(.is-disabled):hover {
  background: var(--sage);
  border-color: var(--sage);
}

.tb-figma-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── CONTENU ── */
.tb-content {
  padding: 0;
}

/* Première section pleine hauteur */
.tb-first-screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--stone-mid);
}

/* Hero image */
.tb-hero-img {
  width: 100%;
  flex: 1;
  min-height: 40vh;
  overflow: hidden;
  background: var(--stone-mid);
}

.tb-first-screen .tb-block {
  flex-shrink: 0;
  border-bottom: none;
}

.tb-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Blocs texte */
.tb-block {
  padding: 64px 56px;
  border-bottom: 1px solid var(--stone-mid);
}

.tb-block-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-dark);
  margin-bottom: 24px;
}

.tb-statement {
  font-family: var(--f-display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--forest);
  margin-bottom: 24px;
}

.tb-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--forest);
  margin-bottom: 20px;
}

.tb-body:last-child {
  margin-bottom: 0;
}

/* Image inline */
.tb-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--stone-mid);
}

.tb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grille 2×2 */
.tb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--stone-mid);
}

.tb-grid-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone-mid);
}

.tb-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── DÉCISIONS CLÉS ── */
.tb-decisions {
}

.tb-decisions-label {
  padding: 48px 56px 32px;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-dark);
}

.tb-decisions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--stone-mid);
}

.tb-decision-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--stone-mid);
}

.tb-decision-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tb-decision-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 43, 28, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 28px 32px;
  transform: translateY(100%);
  transition: transform 0.65s var(--ease-out-expo);
  overflow-y: auto;
}

.tb-decision-card:hover .tb-decision-overlay,
.tb-decision-card.active .tb-decision-overlay {
  transform: translateY(0);
}

.tb-decision-title {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 300;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.tb-decision-text {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(245, 242, 238, 0.72);
  margin-bottom: 12px;
}

.tb-decision-result {
  font-size: 13px;
  line-height: 1.65;
  color: var(--sage);
}

/* Bouton trigger — mobile uniquement */
.tb-decision-trigger {
  display: none;
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(26, 43, 28, 0.65);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(200, 191, 179, 0.25);
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tb-decision-trigger svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.tb-decision-card.active .tb-decision-trigger {
  background: rgba(26, 43, 28, 0.9);
}

/* ── MARQUEE ── */
.tb-marquee {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: var(--forest);
  border-top: 1px solid var(--stone-mid);
  border-bottom: 1px solid var(--stone-mid);
  cursor: grab;
}

.tb-marquee::-webkit-scrollbar {
  display: none;
}

.tb-marquee:active {
  cursor: grabbing;
}

.tb-marquee-track {
  display: flex;
  gap: 3px;
  width: max-content;
  padding: 48px 56px;
}

.tb-marquee-item {
  flex-shrink: 0;
  height: 380px;
}

.tb-marquee-item img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

/* ── AVANT / APRÈS ── */
.tb-full-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--stone-mid);
}

.tb-full-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tb-before-after {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--stone-mid);
}

.tb-before-after img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tb-ba-before {
  clip-path: inset(0 0% 0 0);
  transition: clip-path 0.7s var(--ease-out-expo);
}

.tb-before-after.show-before .tb-ba-before {
  clip-path: inset(0 100% 0 0);
}

.tb-ba-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(26, 43, 28, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(200, 191, 179, 0.2);
  padding: 7px 14px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}

.tb-ba-btn:hover {
  background: rgba(26, 43, 28, 0.85);
}

/* ── AUTRES RÉALISATIONS ── */
.tb-other {
  border-top: 1px solid var(--stone-mid);
  padding: 64px 56px;
}

.tb-other-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-dark);
  margin-bottom: 32px;
}

.tb-other-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stone-mid);
  border: 1px solid var(--stone-mid);
}

.tb-other-card {
  background: var(--stone);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.3s;
}

.tb-other-card:hover {
  background: var(--white);
}

.tb-other-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone-mid);
}

.tb-other-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tb-other-body {
  padding: 20px 24px 28px;
}

.tb-other-title {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 300;
  color: var(--forest);
  margin-bottom: 4px;
}

.tb-other-type {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-dark);
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */

/* ── TABLETTE (≤ 768px) ── */
@media (max-width: 768px) {
  .tb-layout {
    grid-template-columns: 240px 1fr;
  }

  .tb-sidebar-inner {
    padding: 0 28px 48px;
  }

  .tb-block {
    padding: 48px 40px;
  }

  .tb-other {
    padding: 48px 40px;
  }

  .tb-other-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tb-marquee-item {
    height: 300px;
  }

  .tb-marquee-track {
    padding: 40px;
  }
}

/* ── MOBILE (≤ 480px) ── */
@media (max-width: 480px) {
  /* Nav — redondante avec le bouton retour */
  .projet-page nav {
    display: none;
  }

  /* Layout : sidebar au-dessus, contenu en dessous */
  .tb-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Sidebar — devient un header compact */
  .tb-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--stone-mid);
  }

  .tb-sidebar-inner {
    position: static;
    height: auto;
    padding: 16px 24px 24px;
    flex-direction: column;
    gap: 8px;
  }

  .tb-back-zone {
    height: auto;
    margin-bottom: 0;
  }

  .tb-sidebar-top {
    margin-bottom: 0;
  }

  .tb-title {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .tb-meta-block {
    margin: 0;
    padding: 0;
  }

  .tb-meta-block:has(> .tb-missions) {
    display: none;
  }

  .projet-tags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Cacher les missions sur mobile — redondant avec le contenu */
  .tb-missions-block {
    display: none;
  }

  .tb-meta-block:has(> .tb-missions) {
    display: none;
  }


  /* Hero image */
  .tb-hero-img {
    height: 52vw;
  }

  /* Blocs texte */
  .tb-block {
    padding: 40px 24px;
  }

  /* Grille 2×2 → 1 colonne */
  .tb-grid {
    grid-template-columns: 1fr;
  }

  /* Décisions clés */
  .tb-decisions-label {
    padding: 32px 24px 20px;
  }

  .tb-decisions-grid {
    grid-template-columns: 1fr;
  }

  .tb-decision-card:hover .tb-decision-overlay {
    transform: translateY(100%);
  }

  .tb-decision-card.active .tb-decision-overlay {
    transform: translateY(0);
  }

  .tb-decision-trigger {
    display: flex;
  }

  .tb-decision-overlay {
    padding: 20px 24px;
  }

  /* Marquee */
  .tb-marquee-item {
    height: 220px;
  }

  .tb-marquee-track {
    padding: 32px 24px;
  }

  /* Avant/après — label adapté au touch */
  .tb-ba-label {
    opacity: 1 !important;
    font-size: 9px;
  }

  /* Autres réalisations */
  .tb-other {
    padding: 40px 24px;
  }

  .tb-other-grid {
    grid-template-columns: 1fr;
  }
}
