.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.25s;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  transition: width 0.4s var(--ease);
}
.project-card:hover {
  transform: translateY(-5px) scale(1.005);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-light);
  border-color: var(--accent-mid);
}
.project-card:hover::before {
  width: 100%;
}
.project-card:hover h3 {
  color: var(--accent);
}

.project-card h3 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: color 0.25s var(--ease);
}
.project-card p {
  color: var(--muted);
  font-size: var(--font-size-card);
  line-height: var(--line-card);
  font-weight: 400;
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.project-meta {
  font-size: 13px;
  color: var(--subtle);
  font-weight: 500;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================
   Section
   ============================================== */

.focus-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  justify-content: center;
}

@media (max-width: 900px) {
  .focus-actions {
    align-items: flex-start;
  }
}

/* ==============================================
   Section
   ============================================== */

.project-card-media {
  display: block;
  position: relative;
  margin: -28px -28px 4px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.project-card:hover .project-card-media img {
  transform: scale(1.04);
}
.project-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--font-size-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .project-card-media { margin: -20px -20px 4px; }
  .projects-grid[data-view="grid"] .project-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .projects-grid[data-view="grid"] .project-top > .btn {
    width: 100%;
    justify-content: center;
  }
  .project-top > div {
    width: 100%;
  }
}

/* ==============================================
   FILTERS — état interactif (bouton)
   ============================================== */
button.filter {
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
}
button.filter:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
button.filter:active {
  transform: scale(0.97);
}
button.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
button.filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-projects-count] {
  font-weight: 700;
  color: var(--accent);
}

/* Empty state */

.projects-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--subtle);
  pointer-events: none;
}
.search-wrap input[type="search"] {
  width: 100%;
  padding: 11px 38px 11px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--font-size-ui);
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}
.search-wrap input[type="search"]::-webkit-search-cancel-button { display: none; }
.search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: var(--surface2);
  color: var(--muted);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  line-height: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.search-clear svg {
  width: 12px;
  height: 12px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-clear:hover { background: var(--accent-light); color: var(--accent); }

.toolbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sort-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}
.sort-wrap select {
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.18s;
}
.sort-wrap select:hover,
.sort-wrap select:focus {
  border-color: var(--accent-mid);
  outline: none;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.view-btn {
  border: none;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.view-btn svg { width: 16px; height: 16px; display: block; }
.view-btn:hover { color: var(--text); background: var(--surface2); }
.view-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

/* ══════════════════════════════════════════════════
   Vue LISTE compacte : grille à colonnes fixes
   alignement vertical strict entre les rangées
   ══════════════════════════════════════════════════ */
.projects-grid[data-view="list"] {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Overlay link : rend toute la card cliquable */
.project-card-link {
  display: none;
}
.projects-grid[data-view="list"] .project-card-link {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
/* Tags & bouton restent au-dessus du link overlay */
.projects-grid[data-view="list"] .tags,
.projects-grid[data-view="list"] .project-top > .btn {
  position: relative;
  z-index: 2;
}

/* Card en mode liste : grid 4 colonnes */
.projects-grid[data-view="list"] .project-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 20px;
  padding: 0 16px 0 0;
  overflow: hidden;
}

/* Image : colle au bord gauche, hauteur fixe */
.projects-grid[data-view="list"] .project-card-media {
  width: 96px;
  height: 76px;
  aspect-ratio: auto;
  margin: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-bottom: none;
  border-right: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.projects-grid[data-view="list"] .project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badge "Projet phare" : très discret en mode liste */
.projects-grid[data-view="list"] .project-card-badge {
  top: 4px;
  left: 4px;
  font-size: 9px;
  padding: 2px 5px;
  letter-spacing: 0.4px;
}

/* Bloc texte : titre + sous-titre, sans bouton */
.projects-grid[data-view="list"] .project-top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.projects-grid[data-view="list"] .project-top > div {
  min-width: 0;
}
/* Bouton "Détails" caché : remplacé par chevron à droite */
.projects-grid[data-view="list"] .project-top > .btn {
  display: none;
}

.projects-grid[data-view="list"] .project-card h3 {
  font-size: var(--font-size-card);
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.projects-grid[data-view="list"] .project-card p {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.projects-grid[data-view="list"] .project-meta,
.projects-grid[data-view="list"] hr.sep,
.projects-grid[data-view="list"] .mini-list {
  display: none;
}

/* Tags : 3ème colonne, alignés à droite, max 2 tags pour éviter la troncature */
.projects-grid[data-view="list"] .tags {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  min-width: 0;
}
.projects-grid[data-view="list"] .tags .tag {
  font-size: var(--font-size-meta);
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* On masque le 3ème tag (et plus) en mode liste : alignement propre, lisible */
.projects-grid[data-view="list"] .tags .tag:nth-child(n+3) {
  display: none;
}

/* Chevron à droite : 4ème colonne, via pseudo */
.projects-grid[data-view="list"] .project-card::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  color: var(--muted);
  justify-self: center;
  transition: transform .25s var(--ease), color .25s var(--ease);
  grid-column: 4;
}
.projects-grid[data-view="list"] .project-card:hover::after {
  color: var(--accent);
  transform: translateX(2px) rotate(45deg);
}
.projects-grid[data-view="list"] .project-card:hover h3 {
  color: var(--accent);
}

/* Responsive : sous 720px, on cache l'image et on resserre */
@media (max-width: 900px) {
  .projects-grid[data-view="list"] .project-card {
    grid-template-columns: 88px minmax(0, 1fr) 24px;
    gap: 14px;
  }
  .projects-grid[data-view="list"] .tags {
    display: none;
  }
}
@media (max-width: 600px) {
  .projects-grid[data-view="list"] .project-card {
    grid-template-columns: minmax(0, 1fr) 20px;
    padding: 12px 14px;
    gap: 12px;
  }
  .projects-grid[data-view="list"] .project-card-media {
    display: none;
  }
}

@media (max-width: 700px) {
  .projects-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-end { justify-content: space-between; }
}

@media (max-width: 520px) {
  .toolbar-end {
    width: 100%;
    flex-wrap: wrap;
  }
  .sort-wrap,
  .view-toggle {
    width: 100%;
  }
  .sort-wrap {
    justify-content: space-between;
  }
  .sort-wrap select {
    flex: 1;
    min-width: 0;
  }
  .view-btn {
    flex: 1;
  }
}

/* Pagination "Afficher plus" */
.projects-pagination {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.btn-load-more {
  padding: 12px 28px;
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--font-size-ui);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn-load-more:hover {
  background: var(--accent-light);
  border-color: var(--accent-mid);
  color: var(--accent);
  border-style: solid;
}

.sectors-marquee {
  position: relative;
  overflow: hidden;
  margin: 0 -8px;
  padding: 12px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
}

.sectors-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 48s linear infinite;
}

.sectors-row {
  display: flex;
  gap: 14px;
  padding: 0 7px;
  flex-shrink: 0;
}

.sector-pill {
  flex-shrink: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}

.sector-pill:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.sector-pill h3 {
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.sector-pill p {
  font-size: var(--font-size-card-compact);
  color: var(--muted);
  line-height: var(--line-card);
  margin: 0;
}

.sectors-marquee:hover .sectors-track,
.sectors-marquee:focus-within .sectors-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* ==============================================
   Section
   ============================================== */

/* ── Project cards (mode grille) — peau dark ── */
.project-card {
  background: var(--surface) !important;
  border: 0.5px solid var(--rule) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}
.project-card::before { display: none !important; }
.project-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
}
.project-card p {
  font-family: var(--font-display);
  color: var(--muted);
}

/* ── Featured cards (home) ── */

/* ── Toolbar projects (search, sort, view) ── */
.search-wrap input,
.sort-wrap select {
  background: var(--surface) !important;
  border: 0.5px solid var(--rule) !important;
  color: var(--text) !important;
  font-family: var(--font-display) !important;
}
.view-btn {
  background: transparent !important;
  border: 0.5px solid var(--rule) !important;
  color: var(--muted) !important;
}
.view-btn.is-active {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ── Filter chips ── */
.filter {
  background: transparent !important;
  border: 0.5px solid var(--rule) !important;
  color: var(--muted) !important;
  font-family: var(--font-display) !important;
  font-style: italic;
}
.filter:hover { color: var(--accent) !important; border-color: var(--accent) !important; }
.filter.is-active {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

@media (max-width: 600px) {
  .sector-pill { width: 240px; padding: 18px; }
  .sectors-track { animation-duration: 36s; }
}
