/* ===== Space — Picture of the Day ===== */

.space-loading,
.space-error {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
}

.space-error {
  color: #ff6b6b;
}

/* --- Featured image / video --- */
.space-featured {
  margin-bottom: 1rem;
}

.space-media-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  line-height: 0;
}

.space-featured-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 480px;
}

/* Video responsive 16:9 */
.space-video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}

.space-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Title overlay with gradient */
.space-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 1rem 0.75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.space-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.space-date {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

/* --- Info / explanation --- */
.space-info {
  padding: 0.75rem 0.25rem 0;
}

.space-explanation {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
}

.space-truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.space-readmore {
  background: none;
  border: none;
  color: #64b5f6;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.space-readmore:hover {
  color: #90caf9;
}

.space-credit {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* --- Gallery strip --- */
.space-gallery-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.space-gallery-label {
  margin: 0 0 0.5rem 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.space-gallery-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

/* Hide scrollbar but keep scroll */
.space-gallery-strip::-webkit-scrollbar {
  height: 4px;
}

.space-gallery-strip::-webkit-scrollbar-track {
  background: transparent;
}

.space-gallery-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.space-thumb {
  flex: 0 0 auto;
  width: 100px;
  cursor: pointer;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.space-thumb:hover {
  border-color: rgba(100, 181, 246, 0.5);
  transform: scale(1.04);
}

.space-thumb-active {
  border-color: #64b5f6;
}

.space-thumb img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  display: block;
}

.space-thumb-video {
  width: 100%;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.5);
}

.space-thumb-date {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 0.2rem 0;
  background: rgba(0, 0, 0, 0.3);
}
