/* css/nodehive-spaces-cards.css */

/* ===== Dashboard Cards (NodeHiveSpacesCardsBlock) ===== */

.nodehive-spaces-cards-container {
  display: grid;
  gap: 10px;
}

.nodehive-spaces-cards-container.desktop-columns-1 { grid-template-columns: repeat(1, 1fr); }
.nodehive-spaces-cards-container.desktop-columns-2 { grid-template-columns: repeat(2, 1fr); }
.nodehive-spaces-cards-container.desktop-columns-3 { grid-template-columns: repeat(3, 1fr); }
.nodehive-spaces-cards-container.desktop-columns-4 { grid-template-columns: repeat(4, 1fr); }
.nodehive-spaces-cards-container.desktop-columns-5 { grid-template-columns: repeat(5, 1fr); }
.nodehive-spaces-cards-container.desktop-columns-6 { grid-template-columns: repeat(6, 1fr); }

.nodehive-space-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .nodehive-spaces-cards-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .nodehive-spaces-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.nodehive-space-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}


.nodehive-space-card-thumbnail {
  border-top: 2px solid var(--gin-bg-header);
  border-bottom: 2px solid var(--gin-bg-header);
  background-color: var(--gin-bg-header);
  background-size: cover;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.nodehive-space-card-title-below {
  padding: 12px 16px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--gin-color-primary-active, #1b1b1b);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nodehive-space-card-stats {
  padding: 4px 16px 12px;
  font-size: 12px;
  color: var(--gin-color-text-light, #71717a);
}


/* ===== Admin Space List (/admin/content/space) ===== */

/* Remove Gin's content box wrapper on space list page */
.path-admin-content-space .region-content {
  background: none;
  box-shadow: none;
  border: none;
  padding: 0;
}

/* Filter bar */
.space-list-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.space-list-filters input[type="search"] {
  padding: 6px 12px;
  border: 1px solid var(--gin-border-color-layer, #d4d4d8);
  border-radius: var(--gin-border-s, 4px);
  font-size: 14px;
  min-width: 220px;
  background: var(--gin-bg-layer, #fff);
  color: var(--gin-color-text, #1b1b1b);
}

.space-list-filters select {
  padding: 6px 12px;
  border: 1px solid var(--gin-border-color-layer, #d4d4d8);
  border-radius: var(--gin-border-s, 4px);
  font-size: 14px;
  background: var(--gin-bg-layer, #fff);
  color: var(--gin-color-text, #1b1b1b);
}

.space-list-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--gin-color-text-light, #71717a);
}

.space-list-sections {
  display: grid;
  gap: 24px;
}

.space-list-section {
  display: grid;
  gap: 12px;
}

.space-list-section__heading {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Card grid */
.space-list-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 1400px) {
  .space-list-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .space-list-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.space-list-card {
  border: 1px solid var(--gin-border-color-layer, #d4d4d8);
  border-radius: var(--gin-border-m, 8px);
  overflow: hidden;
  background: var(--gin-bg-layer, #fff);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.space-list-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--gin-color-primary, #003cc5);
}

.space-list-card--disabled {
  opacity: 0.65;
}

/* Thumbnail */
.space-list-card__thumbnail {
  display: block;
  background-color: var(--gin-bg-header, #eee);
  background-size: cover;
  background-position: center top;
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
}

.space-list-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.space-list-card__badge--disabled {
  background: var(--gin-color-danger-background, #fce8e8);
  color: var(--gin-color-danger, #d72222);
}

/* Body */
.space-list-card__body {
  padding: 12px 16px 8px;
  flex: 1;
}

.space-list-card__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--gin-color-primary-active, #1b1b1b);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.space-list-card__title:hover {
  color: var(--gin-color-primary, #003cc5);
}

.space-list-card__domain {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--gin-color-text-light, #71717a);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.space-list-card__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gin-color-text-light, #71717a);
}

.space-list-card__stats {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gin-color-text-light, #71717a);
}
