/* =========================
   COLLECTIONS
   ========================= */

/* Spazio sotto alle collezioni */
.collections-section {
  padding-bottom: 40px;
}

/* Griglia cards: 3 colonne desktop, 2 tablet, 1 mobile */
.collections-grid {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .collections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Card cliccabile */
.collection-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  display: block;
}

/* Immagine di preview */
.collection-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 220ms ease;
}

/* Testi card */
.collection-body {
  padding: 14px 14px 16px;
}

.collection-title {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.collection-subtitle {
  margin: 0 0 10px;
  opacity: 0.75;
  font-size: 14px;
  line-height: 1.4;
}

.collection-cta {
  font-size: 14px;
  opacity: 0.9;
}

/* Hover */
.collection-card:hover {
  border-color: rgba(15, 23, 42, 0.22);
}

.collection-card:hover .collection-media img {
  transform: scale(1.02);
}

.hero-title {
  margin-bottom: 30px;
}

.hero-collection-subtitle {
  max-width: 900px;
  margin-left: 0px;
  margin-right: auto;
  margin-top: 1px;
}

.hero-collection-subtitle {
  margin-top: 0px;
  margin-bottom: 0px;
}


/* =========================
   CARD INTERACTION FIX
   ========================= */

.collection-card {
  position: relative;
  cursor: pointer;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.collection-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 23, 42, 0.28);
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.08);
}

/* rafforza feedback hover immagine */
.collection-card:hover .collection-media img {
  transform: scale(1.04);
}

/* rende chiaro che è cliccabile anche senza underline */
.collection-card::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* LIGHTBOX */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 14px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }


/* Related nodes (mini cards) */
.related-nodes {
  padding: 3.5rem 0 4rem;
  border-top: 1px solid rgb(226 232 240 / 1);
  margin-top: 2.5rem;
}

.related-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.related-title {
  font-weight: 600;
  letter-spacing: -0.025em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-card {
  background: rgb(255 255 255 / 1);
  padding: 1rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.related-card:hover {
  transform: translateY(-2px);
}

.related-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.related-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(100 116 139 / 1);
}

.related-dot {
  font-size: 0.7rem;
  color: rgb(100 116 139 / 1);
}

.related-card-title {
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgb(15 23 42 / 1);
}

.related-card-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgb(71 85 105 / 1);
  max-width: 44ch;
}

.related-cta {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgb(15 23 42 / 1);
}

/* Evidenzia il nodo corrente e rendi gli altri più "latenti" */
.related-nodes[data-current="toroidal"] .related-card:not([data-node="toroidal"]),
.related-nodes[data-current="spin"] .related-card:not([data-node="spin"]),
.related-nodes[data-current="graphity"] .related-card:not([data-node="graphity"]) {
  opacity: 0.62;
}

.related-nodes[data-current="toroidal"] .related-card[data-node="toroidal"],
.related-nodes[data-current="spin"] .related-card[data-node="spin"],
.related-nodes[data-current="graphity"] .related-card[data-node="graphity"] {
  box-shadow: 0 0 0 0px #fff, 0 0 0 calc(2px + 0px) rgb(226 232 240 / 1), 0 0 #0000;
}

/* Responsive */
@media (max-width: 992px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
  .related-card-text {
    max-width: none;
  }
}

