/* Page Références — plaquette web (assets/setic-references) */

.refs-page {
  --refs-blue: #073a37;
  --refs-blue-dark: #041f1d;
  --refs-accent: #d32902;
  --refs-accent-light: #d5ebe8;
  --refs-bg: #f7f7f5;
  --refs-white: #ffffff;
  --refs-text: #1c1c1c;
  --refs-muted: #4b5563;
  --refs-border: #e0e0da;
}

/* ─── Hero plaquette ─── */
.refs-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  margin-top: -5rem;
}

@media (min-width: 768px) {
  .refs-hero {
    margin-top: -8rem;
  }
}

.refs-hero__bg {
  position: absolute;
  inset: 0;
  background: var(--refs-blue-dark) center/cover no-repeat;
  filter: brightness(0.5);
}

.refs-hero__sidebar {
  position: relative;
  z-index: 2;
  width: 72px;
  flex-shrink: 0;
  background: rgba(7, 58, 55, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

@media (min-width: 768px) {
  .refs-hero__sidebar {
    width: 110px;
  }
}

.refs-hero__sidebar img {
  width: 44px;
  height: auto;
  opacity: 0.95;
}

.refs-hero__brand {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: #fff;
  font-family: Sora, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.refs-hero__brand span {
  color: var(--refs-accent-light);
}

.refs-hero__content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.75rem;
}

@media (min-width: 768px) {
  .refs-hero__content {
    padding: 0 3.75rem;
  }
}

.refs-hero__content h1 {
  font-family: Sora, sans-serif;
  font-weight: 800;
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.refs-hero__content h1 .line2 {
  display: block;
}

.refs-hero__divider {
  width: 80px;
  height: 3px;
  background: var(--refs-accent);
  margin: 1.5rem 0;
}

.refs-hero__subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  max-width: 28rem;
}

.refs-hero__actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.refs-hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  animation: refs-bounce 2s infinite;
}

.refs-hero__scroll svg {
  width: 20px;
}

@keyframes refs-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* ─── Filtres ─── */
.refs-filters-wrap {
  position: sticky;
  top: 5rem;
  z-index: 40;
  background: var(--refs-white);
  border-bottom: 1px solid var(--refs-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
  .refs-filters-wrap {
    top: 8rem;
  }
}

.refs-filters {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  height: 4rem;
}

@media (min-width: 768px) {
  .refs-filters {
    padding: 0 2rem;
  }
}

.refs-filters::-webkit-scrollbar {
  display: none;
}

.refs-filter-btn {
  background: none;
  border: 1.5px solid var(--refs-border);
  border-radius: 100px;
  padding: 0.375rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--refs-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.refs-filter-btn:hover {
  border-color: var(--refs-blue);
  color: var(--refs-blue);
}

.refs-filter-btn.is-active {
  background: var(--refs-blue);
  border-color: var(--refs-blue);
  color: #fff;
}

.refs-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.7rem;
  margin-left: 0.375rem;
  padding: 0 0.25rem;
}

.refs-filter-btn:not(.is-active) .refs-filter-count {
  background: var(--refs-bg);
  color: var(--refs-muted);
}

/* ─── Grille ─── */
.refs-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1rem 5rem;
  background: var(--refs-bg);
}

@media (min-width: 768px) {
  .refs-main {
    padding: 3rem 2rem 5rem;
  }
}

.refs-section-header {
  margin-bottom: 2rem;
}

.refs-section-header h2 {
  font-family: Sora, sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  text-transform: uppercase;
  color: var(--refs-text);
}

.refs-section-header .refs-count {
  color: var(--refs-accent);
  margin-left: 0.75rem;
  font-weight: 600;
}

.refs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 1.75rem;
}

/* ─── Carte projet ─── */
.refs-card {
  background: var(--refs-white);
  border-radius: 0.25rem;
  overflow: hidden;
  border-left: 4px solid var(--refs-blue);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.refs-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.13);
}

.refs-card.is-hidden {
  display: none;
}

.refs-card-thumb {
  height: 220px;
  overflow: hidden;
  position: relative;
  background: #ddd;
}

.refs-card-thumb img,
.refs-card-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease, opacity 0.25s ease;
  background: #e4ebe8;
}

.refs-card-thumb__img:not([src]) {
  opacity: 0.35;
}

.refs-card:hover .refs-card-thumb img {
  transform: scale(1.04);
}

.refs-card-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--refs-blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
}

.refs-tag-residence {
  background: #5b8c5a;
}

.refs-tag-public {
  background: #8c5a2e;
}

.refs-card-body {
  padding: 1.375rem 1.5rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.refs-card-location {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--refs-blue);
  margin-bottom: 0.5rem;
}

.refs-card-title {
  font-family: Sora, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--refs-text);
  margin-bottom: 0.625rem;
}

.refs-card-desc {
  font-size: 0.82rem;
  color: var(--refs-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.refs-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem 0.75rem;
  border-top: 1px solid var(--refs-border);
  padding-top: 0.875rem;
  margin-bottom: 0.875rem;
}

.refs-card-stats .stat-label {
  font-size: 0.7rem;
  color: var(--refs-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.refs-card-stats .stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--refs-text);
}

.refs-card-team {
  border-top: 1px solid var(--refs-border);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.refs-card-team .team-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.refs-card-team .team-label {
  color: var(--refs-muted);
  min-width: 5.5rem;
  flex-shrink: 0;
}

.refs-card-team .team-value {
  color: var(--refs-text);
  font-weight: 600;
}

.refs-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #f2f2ef;
  border-top: 1px solid var(--refs-border);
}

.refs-card-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--refs-blue);
}

.refs-card-view {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--refs-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Lightbox ─── */
.refs-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.refs-lightbox.is-open {
  display: flex;
}

.refs-lightbox__inner {
  position: relative;
  max-width: 1100px;
  width: 100%;
}

.refs-lightbox__inner img {
  width: 100%;
  border-radius: 4px;
  display: block;
  max-height: 85vh;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.refs-lightbox__inner img.is-loaded {
  opacity: 1;
}

.refs-lightbox__inner.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: refs-spin 0.7s linear infinite;
}

@keyframes refs-spin {
  to {
    transform: rotate(360deg);
  }
}

.refs-lightbox__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}

.refs-lightbox__close:hover {
  opacity: 1;
}

.refs-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0.75rem 1.125rem;
  cursor: pointer;
  border-radius: 4px;
}

.refs-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.refs-lightbox__prev {
  left: -3.5rem;
}

.refs-lightbox__next {
  right: -3.5rem;
}

@media (max-width: 768px) {
  .refs-lightbox__prev {
    left: 0;
  }

  .refs-lightbox__next {
    right: 0;
  }
}

.refs-download {
  margin-top: 3.5rem;
  text-align: center;
  padding-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .refs-hero__scroll {
    animation: none;
  }

  .refs-card,
  .refs-card-thumb img {
    transition: none;
  }
}
