/* ==========================================================================
   Reklam alanlari (public) — ad-render.js ile birlikte calisir.
   Yalnizca tema degiskenleri kullanilir (koyu tema yedek degerleriyle).
   ========================================================================== */

/* ---------- Kart ---------- */
.ct-ad {
  --ct-ad-ratio: 6 / 5;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin: 0 auto;
  font-family: inherit;
}
.ct-ad[data-ad-kind="landing"] { --ct-ad-ratio: 4 / 3; }

.ct-ad__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: var(--ct-ad-ratio);
  overflow: hidden;
  background: var(--bg-card, #18181b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-card, 0 1px 3px rgba(0, 0, 0, 0.4));
  color: var(--text-body, #a1a1aa);
  text-decoration: none;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out, border-color 160ms ease-out;
}

a.ct-ad__frame { cursor: pointer; }
a.ct-ad__frame:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift, 0 4px 12px rgba(0, 0, 0, 0.5));
  border-color: var(--text-muted, #71717a);
}
a.ct-ad__frame:focus { outline: none; }
a.ct-ad__frame:focus-visible {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px var(--focus-ring, rgba(59, 130, 246, 0.45));
}
a.ct-ad__frame:active { transform: translateY(0); }

.ct-ad__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 240ms ease-out;
}
.ct-ad[data-ad-loaded="true"] .ct-ad__img { opacity: 1; }

/* ---------- Etiket satiri ---------- */
.ct-ad__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.35rem;
  padding: 0 0.15rem;
  font-size: 11px;
  line-height: 1;
  color: var(--text-muted, #71717a);
}
.ct-ad__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  border-radius: 999px;
  background: var(--bg-elevated, #1f1f23);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ct-ad__host {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-ad__host svg { width: 12px; height: 12px; flex: none; }

/* ---------- "Burada reklaminiz olabilir" ---------- */
.ct-ad__frame--house {
  background: var(--bg, #0c0c0e);
  border-style: dashed;
  box-shadow: none;
}
.ct-ad__house {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  max-width: 80%;
  text-align: center;
}
.ct-ad__house-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.25rem;
  border-radius: 999px;
  background: var(--bg-elevated, #1f1f23);
  color: var(--text-muted, #71717a);
}
.ct-ad__house-icon svg { width: 20px; height: 20px; }
.ct-ad__house-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #d4d4d8);
}
.ct-ad__house-sub {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted, #71717a);
}
.ct-ad__house-cta {
  margin-top: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  background: var(--bg-card, #18181b);
  color: var(--text, #d4d4d8);
  font-size: 0.78rem;
  font-weight: 500;
  transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}
a.ct-ad__frame--house:hover { border-color: var(--text-muted, #71717a); }
a.ct-ad__frame--house:hover .ct-ad__house-cta,
a.ct-ad__frame--house:focus-visible .ct-ad__house-cta {
  background: var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
  color: var(--primary-contrast, #ffffff);
}

/* ---------- Yukleniyor (skeleton) ---------- */
.ct-ad__frame--skeleton,
.ct-ad__badge--skeleton {
  background: linear-gradient(90deg,
    var(--bg-card, #18181b) 25%,
    var(--surface-hover, rgba(255, 255, 255, 0.05)) 50%,
    var(--bg-card, #18181b) 75%);
  background-size: 200% 100%;
  animation: ct-ad-shimmer 1.4s ease-in-out infinite;
  box-shadow: none;
}
.ct-ad__badge--skeleton { color: transparent; }
@keyframes ct-ad-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---------- Durumlar ---------- */
[data-ad-slot][data-ad-state="off"],
.wt-slot[data-ad-slot].hidden { display: none !important; }

/* ==========================================================================
   Sayfa yerlesimleri: style.css'teki eski slot kurallarini gecersiz kilar
   ========================================================================== */

/* Ana sayfa: reklam sag panelin TAMAMINI kaplar (dosya gonder / indirme ile ayni) */
.wt-slot-card[data-ad-slot] {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.wt-slot-card[data-ad-slot] > .wt-slot-skeleton,
.wt-slot-card[data-ad-slot] > .wt-slot-label { display: none; }
.wt-landing-layout > .wt-right:has(> .wt-slot-card[data-ad-slot]) { position: relative; }
/* Slot kapaliysa ana sayfa tek sutuna iner */
.wt-landing-layout:has(> .wt-right > [data-ad-slot][data-ad-state="off"]) { grid-template-columns: 1fr; }
.wt-landing-layout > .wt-right:has(> [data-ad-slot][data-ad-state="off"]) { display: none; }

/* Dosya gonder / indirme: genis sag panelin ortasinda kart */
.wt-slot[data-ad-slot] {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: none;
}
.wt-slot[data-ad-slot] > .ct-ad { max-width: 400px; }
.wt-slot[data-ad-slot] > .wt-slot-placeholder { display: none; }

/* ---------- Mobil: reklam icerigin altinda satir ici kart ---------- */
@media (max-width: 900px) {
  .wt-right:has(> [data-ad-slot]):not(:has(> .wt-success-overlay:not(.hidden))) {
    min-height: 0;
  }
  .wt-slot-card[data-ad-slot] {
    position: relative;
    inset: auto;
    margin: 0;
    padding: 0;
    max-width: none;
  }
  .wt-slot[data-ad-slot] {
    position: relative;
    inset: auto;
    padding: 1.25rem 1rem 1.5rem;
  }
  .wt-slot[data-ad-slot] > .ct-ad { max-width: 420px; }
  .wt-right:has(> .wt-success-overlay:not(.hidden)) > .wt-slot[data-ad-slot] {
    position: absolute;
    inset: 0;
  }
}

@media (max-width: 480px) {
  .ct-ad__house-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-ad__frame,
  .ct-ad__img,
  .ct-ad__house-cta { transition: none; }
  a.ct-ad__frame:hover { transform: none; }
  .ct-ad__frame--skeleton,
  .ct-ad__badge--skeleton { animation: none; }
}

@media print {
  [data-ad-slot] { display: none !important; }
}

/* ==========================================================================
   Rozetler görselin üstünde (Reklam solda, domain sağda) — link içinde
   ========================================================================== */
.ct-ad__frame > .ct-ad__meta {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  min-height: 0;
  padding: 0;
  pointer-events: none; /* tıklama alttaki linke gider */
}
.ct-ad__frame > .ct-ad__meta .ct-ad__badge,
.ct-ad__frame > .ct-ad__meta .ct-ad__host {
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 11px;
  line-height: 1;
}
.ct-ad__frame > .ct-ad__meta .ct-ad__host { margin-left: auto; font-weight: 600; max-width: 65%; }
a.ct-ad__frame:hover > .ct-ad__meta .ct-ad__host { background: rgba(0, 0, 0, 0.75); }

/* ==========================================================================
   Dosya gönder / indirme / ana sayfa: reklam sağ panelin TAMAMINI kaplar
   ========================================================================== */
:is(.wt-slot, .wt-slot-card)[data-ad-slot] { padding: 0; }
:is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad {
  max-width: none;
  width: 100%;
  height: 100%;
  gap: 0;
}
:is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad > .ct-ad__frame {
  flex: 1 1 auto;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
:is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad > a.ct-ad__frame:hover { transform: none; box-shadow: none; }
:is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="image"] .ct-ad__img { object-fit: cover; object-position: center; }
:is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad > .ct-ad__frame > .ct-ad__meta { top: 1rem; left: 1rem; right: 1rem; }

/* Mobil: panel içerik altında; görsel tam genişlik, oranını koruyarak tamamı görünür */
@media (max-width: 900px) {
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] { padding: 0; min-height: 0; }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad { max-width: none; height: auto; }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad > .ct-ad__frame { height: auto; aspect-ratio: var(--ct-ad-ratio); }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="image"] > .ct-ad__frame { aspect-ratio: auto; }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="image"] .ct-ad__img { height: auto; object-fit: contain; }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad > .ct-ad__frame > .ct-ad__meta { top: 0.6rem; left: 0.6rem; right: 0.6rem; }
}

/* HTML ve video reklam (sponsorlu alan) */
.ct-ad__frame--html { background: #000; }
.ct-ad__iframe { display: block; width: 100%; height: 100%; border: 0; }
.ct-ad[data-ad-variant="video"] .ct-ad__video { object-fit: cover; }
.ct-ad__frame > .ct-ad__meta .ct-ad__host--link { pointer-events: auto; text-decoration: none; }
.ct-ad__frame > .ct-ad__meta .ct-ad__host--link:hover { background: rgba(0, 0, 0, 0.8); }
@media (max-width: 900px) {
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="html"] > .ct-ad__frame { aspect-ratio: 6 / 5; }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="video"] > .ct-ad__frame { aspect-ratio: auto; }
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="video"] .ct-ad__video { height: auto; object-fit: contain; }
}
/* HTML reklamda rozetler her yerde sağ altta (reklamın kendi logosu/başlığı üstte olur) */
.ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta { top: auto; bottom: 0.6rem; justify-content: flex-end; gap: 0.4rem; }
.ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta .ct-ad__host { margin-left: 0; }

/* Ana sayfa HTML reklamı: rozetler sağ altta (yükleme/indirme ile aynı) */
.wt-slot-card[data-ad-slot] > .ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta { top: auto; bottom: 1rem; justify-content: flex-end; gap: 0.4rem; }
.wt-slot-card[data-ad-slot] > .ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta .ct-ad__host { margin-left: 0; }
@media (max-width: 900px) {
  .wt-slot-card[data-ad-slot] > .ct-ad[data-ad-variant="html"] > .ct-ad__frame { aspect-ratio: 4 / 3; }
  .wt-slot-card[data-ad-slot] > .ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta { bottom: 0.6rem; }
}

/* Metin reklam (başlık, açıklama, eylem) */
.ct-ad__frame--text {
  background: var(--gradient-subtle, var(--bg-card, #18181b));
}
.ct-ad__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: 85%;
  padding: 3rem 1rem 2rem;
  text-align: center;
}
.ct-ad__text-title {
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text, #d4d4d8);
}
.ct-ad__text-body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-body, #a1a1aa);
}
.ct-ad__text-cta {
  margin-top: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--primary, #3b82f6);
  color: var(--primary-contrast, #ffffff);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Yükleme sırasında dönen metin reklamda eylem bağlantısı (düğme görünümü) */
a.prison-ad-cta { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Sag panel reklami otomatik degisirken yumusak gecis */
.ct-ad-slot > .ct-ad { transition: opacity 0.35s ease; }
.ct-ad-slot.ct-ad-swapping > .ct-ad { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .ct-ad-slot > .ct-ad { transition: none; } }

/* Telif rozeti (© CodRon) sağ altta: reklam rozetleri onun üstünde */
:is(.wt-slot, .wt-slot-card)[data-ad-slot].ct-ad-slot > .ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta { bottom: 2.6rem; }
@media (max-width: 900px) {
  :is(.wt-slot, .wt-slot-card)[data-ad-slot].ct-ad-slot > .ct-ad[data-ad-variant="html"] > .ct-ad__frame > .ct-ad__meta { bottom: 0.6rem; }
}

/* Google AdSense: rozetsiz, ortulmeden; sag alttaki © CodRon rozetine yer birak */
.ct-ad__frame--google { background: transparent; border: 0; box-shadow: none; }
.ct-ad__adsense { display: block; }
:is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="google"] > .ct-ad__frame { height: calc(100% - 44px); }
@media (max-width: 900px) {
  :is(.wt-slot, .wt-slot-card)[data-ad-slot] > .ct-ad[data-ad-variant="google"] > .ct-ad__frame { height: auto; aspect-ratio: 6 / 5; }
}
