/* ==============================
   Exiles.TV Main Stylesheet
   Production Optimized 2026
============================== */

/* ==============================
   Root Variables
============================== */
:root {
  --bg-main: #0f0f0f;
  --bg-card: #1b1b1b;
  --border-subtle: #2a2a2a;
  --accent: #ff2f6d;
  --text-primary: #f5f5f5;
  --text-muted: #9a9a9a;
}

/* ==============================
   Global Reset
============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ==============================
   Typography
============================== */
h1, h2, h3 {
  font-family: 'Arial Black', Gadget, sans-serif;
  margin: 0 0 14px;
  letter-spacing: 0.5px;
}

section {
  margin-bottom: 70px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

/* ==============================
   Layout Container
============================== */
.homepage-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 70px;
}

/* ==============================
   Hero Module
============================== */
.hero-module {
  position: relative;
  margin: 0 auto 70px auto;  /* top 0, horizontal auto, bottom 70px */
  max-width: 1280px;          /* optional: same as container */
}

.hero-slide {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.hero-slide img,
.hero-slide iframe {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.25));
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 35px;
  left: 35px;
  z-index: 2;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 14px 22px;
  border-radius: 6px;
}

.hero-content h2 {
  font-size: 2.3rem;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 0;
}

/* ==============================
   Grid Sections
============================== */
.featured-videos .video-grid,
.experimental-section .experimental-grid {
  display: grid;
  gap: 28px;
  width: 100%;
}

/* Desktop – Fixed 3 Column Layout */
@media (min-width: 1024px) {
  .featured-videos .video-grid,
  .experimental-section .experimental-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet & Mobile – Fluid */
@media (max-width: 1023px) {
  .featured-videos .video-grid,
  .experimental-section .experimental-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* ==============================
   Cards
============================== */
.video-card,
.experimental-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover,
.experimental-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.6);
}

.video-card img,
.experimental-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.video-card:hover img,
.experimental-card:hover img {
  transform: scale(1.05);
}

.video-card h3,
.experimental-card h3 {
  padding: 16px 16px 20px;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.4;
}

/* ==============================
   Inline YouTube Behavior (Clean)
============================== */
.video-grid.has-active {
  grid-template-columns: 1fr !important;
}

.video-grid.has-active .video-card:not(.playing) {
  display: none;
}

.video-card.playing iframe {
  width: 100%;
  height: 460px;
  border: none;
}

/* ==============================
   Play Button Overlay
============================== */
.video-trigger {
  position: relative;
  cursor: pointer;
}

.video-trigger img {
  width: 100%;
  display: block;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 74px;
  height: 74px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.play-button::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 24px;
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent white;
}

.video-trigger:active .play-button {
  transform: translate(-50%, -50%) scale(0.9);
}

/* ==============================
   Experimental Projects Media Gallery
   Optimized Full-Width Grid
============================== */
.experimental-project .media-gallery {
  display: grid;
  /* Automatically fit as many columns as possible, min 260px each */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  
  /* Uniform spacing between items, matches Featured Videos */
  gap: 24px;

  /* Make the grid fill the container width */
  width: 100%;

  /* Align items nicely within their columns */
  justify-items: stretch;
}

.media-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  cursor: default;
  width: 100%; /* fill its grid cell */
}

.media-item video,
.media-item img {
  width: 100%;
  height: auto;
  display: block;
}

.media-item video {
  pointer-events: none; /* prevents tap-to-pause on mobile */
}

/* ==============================
   Discord Section
============================== */
.discord-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 24px;
}

.discord-message {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.discord-message:last-child {
  border-bottom: none;
}

.discord-author {
  font-weight: 600;
  color: var(--accent);
}

.discord-timestamp {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.discord-content {
  margin-top: 6px;
  color: #ddd;
  line-height: 1.5;
}

/* ==============================
   Responsive Adjustments
============================== */
@media (max-width: 1024px) {
  .hero-slide img,
  .hero-slide iframe {
    height: 420px;
  }
}

@media (max-width: 768px) {
  .hero-slide img,
  .hero-slide iframe {
    height: 320px;
  }

  .hero-content h2 {
    font-size: 1.7rem;
  }

  .homepage-container {
    padding: 24px 18px 50px;
  }

  section {
    margin-bottom: 50px;
  }
}

@media (max-width: 480px) {
  .video-card img,
  .experimental-card img {
    height: 140px;
  }

  .video-card h3,
  .experimental-card h3 {
    font-size: 0.95rem;
  }
}