/* assets/theme/media.css - Media Showcase Components */

.media-section {
  margin-top: 50px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Base Media Card */
.media-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent), transparent 70%);
  transform: translateY(-5px);
}

.media-card .label {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  border: 1px solid var(--accent);
}

/* For audio cards, render the label inline (not overlay) so it doesn't cover controls */
.audio-card .label {
  position: static;
  align-self: flex-end;
  margin: 0 0 8px 0;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* Image Handling */
.media-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

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

/* Video Handling */
.media-card video,
.media-card iframe {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #000;
  border: none;
}

/* Audio Specific Player */
.audio-card {
  /* Ensure the audio card creates a stacking context so we can layer
     controls above any decorative labels if needed. Also keep a bit
     of extra top padding to prevent label overlap on small heights. */
  position: relative;
  z-index: 1;
  padding: 24px 20px 20px 20px;
  background: linear-gradient(145deg, var(--card-bg), rgba(var(--accent-rgb), 0.05));
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.audio-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.audio-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg1);
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--accent);
}

.audio-details h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--fg);
}

.audio-details p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Simple Custom Audio Controls (Themed) */
.audio-player {
  width: 100%;
  height: 32px;
  filter: hue-rotate(var(--hue-adjust, 0deg)); /* Allows theme-based color shifting */
}

/* Media Info Footer */
.media-info {
  padding: 15px;
  border-top: 1px solid var(--card-border);
}

.media-info h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--fg);
}

.media-info p {
  margin: 5px 0 0;
  font-size: 0.8rem;
  opacity: 0.6;
  line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}
