/* Media page — Grid + Feed views, portrait TikTok cards, inline player lightbox */

.media-page {
  padding-bottom: 6rem;
  overflow-x: hidden;
}

/* ======================================================================
   INTRO
   ====================================================================== */

.media-intro {
  padding: 8rem 0 3rem;
  position: relative;
}
.media-intro::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(120, 100, 255, 0.25), transparent 60%);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}
.media-intro-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.media-intro .eyebrow {
  color: rgba(120, 200, 255, 0.9);
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: 1rem;
}
.media-intro h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0 0 1rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #b8d4ff 60%, #a48cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.media-intro .lead {
  color: rgba(230, 235, 245, 0.72);
  font-size: 1.15rem;
  max-width: 40rem;
  margin: 0;
  line-height: 1.55;
}

/* ======================================================================
   VIEW SWITCH (Grid / Feed)
   ====================================================================== */

.view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(16, 22, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}
.view-switch button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: rgba(200, 210, 225, 0.72);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.view-switch button svg { width: 15px; height: 15px; }
.view-switch button:hover { color: #fff; }
.view-switch button.active {
  background: linear-gradient(135deg, rgba(120, 200, 255, 0.2), rgba(164, 140, 255, 0.15));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(120, 200, 255, 0.25);
}

/* ======================================================================
   GRID VIEW - packt Portrait + Landscape
   ====================================================================== */

.media-grid-section { padding: 2rem 0 0; }

/* Grid view: automatic packing */
.media-grid[data-view="grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: 1.25rem;
}

/* Feed view: TikTok-Style zentrale Bahn, portrait dominant */
.media-grid[data-view="feed"] {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  align-items: center;
}
.media-grid[data-view="feed"] .media-card {
  width: 100%;
  max-width: 440px;
}
.media-grid[data-view="feed"] .media-portrait .media-cover {
  aspect-ratio: 9 / 16;
}
.media-grid[data-view="feed"] .media-landscape .media-cover {
  aspect-ratio: 16 / 9;
}
.media-grid[data-view="feed"] .media-card {
  transform: none !important;
}

/* ======================================================================
   CARDS
   ====================================================================== */

.media-card {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 22, 32, 0.7), rgba(10, 14, 22, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.35s cubic-bezier(0.19, 1, 0.22, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.media-card:hover {
  transform: translateY(-6px);
  border-color: rgba(120, 200, 255, 0.28);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.65),
    0 0 60px -30px rgba(120, 180, 255, 0.4);
}

.media-cover {
  position: relative;
  display: block;
  background: #0a1220;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  outline: none;
}
.media-cover:focus-visible { box-shadow: inset 0 0 0 3px rgba(120, 200, 255, 0.9); }

/* Aspect ratios */
.media-landscape .media-cover { aspect-ratio: 16 / 9; }
.media-portrait .media-cover { aspect-ratio: 9 / 16; }

.media-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.media-card:hover .media-cover img { transform: scale(1.06); }

.media-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 25% 25%, rgba(120, 100, 255, 0.4), transparent 60%),
    radial-gradient(circle at 75% 75%, rgba(80, 220, 255, 0.35), transparent 60%),
    #0a1220;
  color: rgba(230, 235, 245, 0.55);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.media-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(5, 9, 14, 0.82);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.media-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.98);
  opacity: 0;
  transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
  background: rgba(0, 0, 0, 0.4);
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
  z-index: 2;
}
.media-play svg { width: 72px; height: 72px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6)); }
.media-play-external svg { width: 40px; height: 40px; }
.media-card:hover .media-play,
.media-cover:focus-visible .media-play {
  opacity: 1;
  backdrop-filter: blur(2px);
}

/* Immer sichtbarer kleiner Play-Indikator unten rechts */
.media-portrait .media-cover::after {
  content: "";
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  z-index: 3;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 5v14l11-7z' fill='white'/></svg>");
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: 60% center;
}

/* Platform-Farben (Badge + Border-Hover) */
.media-tiktok .media-badge { background: linear-gradient(135deg, #ff0050, #00f2ea); border-color: transparent; }
.media-tiktok:hover { border-color: rgba(255, 0, 80, 0.42); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.65), 0 0 60px -30px rgba(255, 0, 80, 0.35); }
.media-youtube .media-badge { background: #ff0000; border-color: transparent; }
.media-youtube:hover { border-color: rgba(255, 0, 0, 0.4); }
.media-twitch .media-badge { background: #9146ff; border-color: transparent; }
.media-twitch:hover { border-color: rgba(145, 70, 255, 0.4); }
.media-instagram .media-badge { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); border-color: transparent; }
.media-twitter .media-badge { background: #000; border-color: rgba(255, 255, 255, 0.25); }
.media-discord .media-badge { background: #5865F2; border-color: transparent; }
.media-vimeo .media-badge { background: #1ab7ea; border-color: transparent; }

.media-body {
  padding: 1.15rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.media-body h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.media-body h3 a {
  color: rgba(240, 245, 255, 0.95);
  text-decoration: none;
  transition: color 0.2s ease;
}
.media-body h3 a:hover { color: rgba(120, 200, 255, 1); }
.media-body p {
  margin: 0;
  color: rgba(215, 220, 232, 0.62);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ======================================================================
   LIGHTBOX (Inline-Player)
   ====================================================================== */

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.media-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 26, 38, 0.7);
  color: #fff;
  cursor: pointer;
  z-index: 3;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(12px);
}
.lightbox-close:hover { background: rgba(240, 60, 80, 0.85); transform: rotate(90deg); }
.lightbox-close svg { width: 20px; height: 20px; }

.lightbox-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  max-height: calc(100vh - 140px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9), 0 0 100px -20px rgba(120, 180, 255, 0.35);
  transform: scale(0.96);
  transition: transform 0.28s cubic-bezier(0.19, 1, 0.22, 1);
}
.media-lightbox.open .lightbox-stage { transform: scale(1); }

/* TikTok / YouTube-Shorts: portrait 9:16, viel schmaler */
.lightbox-stage[data-orientation="portrait"] {
  aspect-ratio: 9 / 16;
  max-width: min(440px, calc((100vh - 140px) * 9 / 16));
  max-height: calc(100vh - 140px);
}
.lightbox-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 0.7rem 1.15rem;
  background: rgba(10, 14, 22, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 3;
  text-align: center;
}
.lightbox-caption:empty { display: none; }
.lightbox-caption b { font-weight: 600; }
.lightbox-caption span { color: rgba(220, 230, 240, 0.6); font-size: 0.78rem; }

body.lightbox-open { overflow: hidden; }

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(10, 14, 22, 0.4);
  color: rgba(200, 210, 225, 0.6);
}
.empty-glyph {
  font-size: 2.5rem;
  color: rgba(120, 200, 255, 0.3);
  margin-bottom: 1rem;
}
.empty-state h3 { margin: 0 0 0.5rem; color: rgba(230, 235, 245, 0.85); font-weight: 600; }
.empty-state p { margin: 0; }

/* ======================================================================
   RESPONSIVE
   ====================================================================== */

@media (max-width: 720px) {
  .media-intro { padding: 6rem 0 2rem; }
  .media-intro-body { flex-direction: column; align-items: flex-start; }
  .media-grid[data-view="grid"] { grid-template-columns: 1fr; }
  .media-grid[data-view="feed"] .media-card { max-width: 100%; }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-stage { border-radius: 14px; max-height: calc(100vh - 110px); }
  .lightbox-caption { bottom: 12px; font-size: 0.82rem; max-width: 90vw; padding: 0.55rem 0.9rem; }
}

@media (max-width: 480px) {
  .media-play svg { width: 56px; height: 56px; }
}
