/*
 * TheChess.Art — Media placeholder system
 *
 * Görsel yoksa zarif bir placeholder, görsel gelince üzerine binmesine hazır.
 *
 * Kullanım:
 *   <figure class="media media--portrait" data-media="chess"></figure>
 *   <figure class="media media--landscape" data-image="/path/to/real.jpg"></figure>
 *
 * data-media değerleri: chess (default), knight, queen, king, bishop, rook, pawn, board, heatmap
 * data-image varsa arka plan görseli kullanır; yoksa decorative placeholder.
 */

/* ============================================================
   BASE
   ============================================================ */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  margin: 0;
  /* İçine tahta benzeri hafif bir doku — chess piece siluetinin arkasına */
}

.media::before {
  /* ince ekose backdrop — 16×16 satranç tahtası efekti, çok soluk */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(237, 227, 206, 0.015) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(237, 227, 206, 0.015) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(237, 227, 206, 0.015) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(237, 227, 206, 0.015) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0;
  pointer-events: none;
  z-index: 1;
}

/* Chess figure backdrop — ortada, opacity 0.06 */
.media::after {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 55% auto;
  opacity: 0.07;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: luminosity;
}

.media[data-media="knight"]::after  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♞</text></svg>"); }
.media[data-media="queen"]::after   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♛</text></svg>"); }
.media[data-media="king"]::after    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♚</text></svg>"); }
.media[data-media="bishop"]::after  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♝</text></svg>"); }
.media[data-media="rook"]::after    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♜</text></svg>"); }
.media[data-media="pawn"]::after    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♟</text></svg>"); }
.media[data-media="chess"]::after,
.media:not([data-media])::after     { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♛</text></svg>"); }

/* Gerçek görsel varsa figürü ve ekoseyi bastır */
.media[data-image] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.media[data-image]::before,
.media[data-image]::after { display: none; }

/* Radial accent glow */
.media__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(242, 72, 37, 0.1), transparent 65%);
  pointer-events: none;
  z-index: 3;
}

/* Label — zarif bir kicker, görsel kimliğini ima eder */
.media__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 6px 10px;
  border: 1px solid var(--line);
  opacity: 0.88;
}

.media__caption {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  z-index: 4;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.3;
  color: var(--primary);
  opacity: 0.9;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.media__noise {
  /* İnce grain — legacy dokusuyla uyumlu */
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.04;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ============================================================
   ASPECT VARIANTS
   ============================================================ */
.media--portrait  { aspect-ratio: 4 / 5; }
.media--landscape { aspect-ratio: 4 / 3; }
.media--square    { aspect-ratio: 1 / 1; }
.media--wide      { aspect-ratio: 16 / 9; }
.media--cinema    { aspect-ratio: 21 / 9; }
.media--tall      { aspect-ratio: 3 / 5; }

/* ============================================================
   IMAGE BAND — sayfalar arası nefes veren tam genişlik şerit
   ============================================================ */
.image-band {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  background: var(--panel);
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.image-band--short { aspect-ratio: 5 / 1; }
.image-band--tall  { aspect-ratio: 16 / 9; }

.image-band::before,
.image-band::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.image-band::before {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(242, 72, 37, 0.08), transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(237, 227, 206, 0.05), transparent 55%);
  z-index: 1;
}
.image-band::after {
  /* 8×8 soluk tahta */
  background-image:
    linear-gradient(45deg, rgba(237, 227, 206, 0.02) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(237, 227, 206, 0.02) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(237, 227, 206, 0.02) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(237, 227, 206, 0.02) 75%);
  background-size: 60px 60px;
  background-position: 0 0, 0 30px, 30px -30px, -30px 0;
  z-index: 0;
}

.image-band__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.image-band__quote {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 44px);
  line-height: 1.25;
  color: var(--primary);
  max-width: 60%;
  letter-spacing: -0.005em;
}
.image-band__quote em { font-style: normal; color: var(--accent); }
.image-band__author {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-top: 16px;
  display: block;
}

.image-band__figure {
  font-family: 'Segoe UI Symbol', serif;
  font-size: clamp(120px, 18vw, 280px);
  line-height: 0.85;
  color: var(--primary);
  opacity: 0.08;
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
}

.image-band[data-image] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.image-band[data-image]::after { display: none; }

/* ============================================================
   SPEC CARD MEDIA STRIP — spec-grid'lerde üst kenara mini görsel
   ============================================================ */
.spec { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.spec__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.spec__media::before,
.spec__media::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.spec__media::before {
  background-image:
    linear-gradient(45deg, rgba(237, 227, 206, 0.02) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(237, 227, 206, 0.02) 25%, transparent 25%);
  background-size: 28px 28px;
}
.spec__media::after {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 45% auto;
  opacity: 0.12;
  mix-blend-mode: luminosity;
}
.spec__media[data-media="knight"]::after  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23F24825'>♞</text></svg>"); }
.spec__media[data-media="queen"]::after   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23F24825'>♛</text></svg>"); }
.spec__media[data-media="king"]::after    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23F24825'>♚</text></svg>"); }
.spec__media[data-media="bishop"]::after  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23F24825'>♝</text></svg>"); }
.spec__media[data-media="rook"]::after    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23F24825'>♜</text></svg>"); }
.spec__media[data-media="pawn"]::after    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23F24825'>♟</text></svg>"); }
.spec__media[data-media="board"]::after   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='%23F24825'><rect x='10' y='10' width='20' height='20'/><rect x='50' y='10' width='20' height='20'/><rect x='30' y='30' width='20' height='20'/><rect x='70' y='30' width='20' height='20'/><rect x='10' y='50' width='20' height='20'/><rect x='50' y='50' width='20' height='20'/><rect x='30' y='70' width='20' height='20'/><rect x='70' y='70' width='20' height='20'/></g></svg>"); }
.spec__media[data-media="heatmap"]::after { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><radialGradient id='g'><stop offset='0%' stop-color='%23F24825'/><stop offset='100%' stop-color='%23F24825' stop-opacity='0'/></radialGradient></defs><rect width='100' height='100' fill='url(%23g)'/></svg>"); opacity: 0.28; }
.spec__media[data-image] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.spec__media[data-image]::before,
.spec__media[data-image]::after { display: none; }
.spec__media-tag {
  position: absolute;
  bottom: 12px;
  left: 14px;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.65;
}
.spec__body-wrap {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* Spec için gereken mevcut iç boşluk vardı — yeni yapıda spec'in tekrar padding eklememesi için */
.spec > .spec__num ~ * { padding: 0 28px; }

/* ============================================================
   HERO BACKDROP — sağa yaslı figür, metin arkasında nefes
   ============================================================ */
.hero-stage {
  position: relative;
}
.hero-stage::after {
  /* Dev figür backdrop */
  content: '';
  position: absolute;
  top: 50%;
  right: -5%;
  width: 55vw;
  max-width: 720px;
  aspect-ratio: 1 / 1.2;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}
.hero-stage[data-hero-figure="knight"]::after { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♞</text></svg>"); }
.hero-stage[data-hero-figure="queen"]::after  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♛</text></svg>"); }
.hero-stage[data-hero-figure="king"]::after   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♚</text></svg>"); }
.hero-stage[data-hero-figure="bishop"]::after { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♝</text></svg>"); }
.hero-stage[data-hero-figure="rook"]::after   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='80' text-anchor='middle' font-family='Segoe UI Symbol,serif' font-size='90' fill='%23EDE3CE'>♜</text></svg>"); }

.hero-stage > * { position: relative; z-index: 1; }

@media (max-width: 900px) {
  .hero-stage::after { right: -20%; width: 80vw; opacity: 0.03; }
  .image-band { aspect-ratio: 3 / 2; }
  .image-band__inner { flex-direction: column; text-align: center; gap: 24px; padding: 32px 20px; }
  .image-band__quote { max-width: 100%; font-size: 22px; }
}
