/* ============================================================
 * FBPortal — Theme Stylesheet (v2 Tema Sistemi, 2026-04-15)
 * ------------------------------------------------------------
 * Kaynak: _backup/tema_v1_20260415/main.php inline <style> bloğu
 * Hedef:  main.php'den inline CSS kaldırıldı, bu dosya yüklenir
 *
 * Bu dosya tailwind.css'ten SONRA yüklenir, tema-aware tüm token'lar
 * (rgb(var(--fb-*)) + var(--fb-cizgi) + glassmorphism) hazırdır.
 *
 * NOT: Reklam slot-spesifik min-height kuralları PHP içinde üretilir
 * (admin panelden boyut yönetildiği için), main.php'de KALIR.
 *
 * Sunai (Frontend/Sunum) — Task #3
 * ============================================================ */

/* ============================================================
   1) sr-only — ekran okuyucu için gizli başlık (FOUC fallback)
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   2) Logo — neon cyan, hover scale
   ============================================================ */
.logo-svg {
  transition: transform 0.35s var(--fb-ease-smooth);
}
.logo-svg:hover {
  transform: scale(1.08);
}

/* ============================================================
   3) Glassmorphism — .cam, .cam-soft, .cam-koyu
   tokens.css `--fb-cam-bg` light/dark farkını otomatik halleder.
   ============================================================ */
.cam {
  background: var(--fb-cam-bg);
  backdrop-filter: blur(var(--fb-blur-lg)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--fb-blur-lg)) saturate(120%);
  border: 1px solid var(--fb-cam-border);
  box-shadow: var(--fb-shadow-sm);
  transition: background var(--fb-transition) ease,
              border-color var(--fb-transition) ease,
              box-shadow var(--fb-transition) ease;
}

.cam-soft {
  background: var(--fb-cam-bg-soft);
  backdrop-filter: blur(var(--fb-blur-md)) saturate(115%);
  -webkit-backdrop-filter: blur(var(--fb-blur-md)) saturate(115%);
  border: 1px solid var(--fb-cam-border);
}

.cam-koyu {
  /* Header/footer gibi kapak yüzeylerde kullanılan kapalı varyant.
     Light'ta beyaz-yarısaydam, dark'ta deep-space yarısaydam */
  background: var(--fb-cam-bg);
  backdrop-filter: blur(var(--fb-blur-md));
  -webkit-backdrop-filter: blur(var(--fb-blur-md));
  border-bottom: 1px solid var(--fb-cam-border);
  box-shadow: var(--fb-shadow-sm);
}

/* ============================================================
   4) Izi-arka — sayfa arkası neon radial gradient
   tokens.css glow renkleri light/dark farkını yumuşatır.
   ============================================================ */
.izi-arka::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(at 12% 0%,   var(--fb-neon-glow)  0px, transparent 50%),
    radial-gradient(at 88% 100%, var(--fb-neon2-glow) 0px, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ============================================================
   5) Neon buton & çizgi — CTA, ayırıcı
   ============================================================ */
.neon-buton {
  background: linear-gradient(135deg,
              rgb(var(--fb-neon))   0%,
              rgb(var(--fb-neon-2)) 100%);
  box-shadow: 0 4px 20px var(--fb-neon-glow);
  transition: transform var(--fb-transition) var(--fb-ease-smooth),
              box-shadow var(--fb-transition) var(--fb-ease-smooth);
  color: #fff;
}
.neon-buton:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--fb-neon-glow);
}
.neon-buton:active {
  transform: translateY(0);
}

.neon-cizgi {
  background: linear-gradient(90deg,
              transparent,
              rgb(var(--fb-neon)),
              rgb(var(--fb-neon-2)),
              transparent);
  height: 1px;
}

/* ============================================================
   6) Anasayfa + kategori 2-kolon grid (lg+: ana + 300px sidebar)
   ============================================================ */
@media (min-width: 1024px) {
  .fb-iki-kolon {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* ============================================================
   7) Yazı detay tipografisi (.yazi-prose)
   tokens.css renkleri kullanılır → light/dark otomatik
   ============================================================ */
.yazi-prose {
  font-size: 17px;
  line-height: 1.8;
  color: rgb(var(--fb-yazi));
}
.yazi-prose p {
  margin: 1.4em 0;
}

.yazi-prose h2 {
  font-size: 1.6em;
  font-weight: 800;
  margin-top: 2em;
  margin-bottom: 0.7em;
  color: rgb(var(--fb-yazi));
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 1rem;
}
.yazi-prose h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.25em;
  bottom: 0.25em;
  width: 4px;
  background: linear-gradient(180deg,
              rgb(var(--fb-neon)),
              rgb(var(--fb-neon-2)));
  border-radius: 2px;
}

.yazi-prose h3 {
  font-size: 1.3em;
  font-weight: 700;
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  color: rgb(var(--fb-yazi));
}

.yazi-prose a {
  color: rgb(var(--fb-neon));
  border-bottom: 1px solid rgb(var(--fb-neon) / 0.3);
  transition: border-color var(--fb-transition-fast) ease;
}
.yazi-prose a:hover {
  border-bottom-color: rgb(var(--fb-neon));
}

/* ------------------------------------------------------------
   İçerik medyası — TAŞMA ENGELLEME
   ------------------------------------------------------------ */
.yazi-prose img,
.yazi-prose video,
.yazi-prose embed,
.yazi-prose object,
.yazi-prose iframe,
.yazi-prose figure {
  max-width: 100% !important;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.yazi-prose img {
  border-radius: var(--fb-radius-md);
  margin: 2em auto;
  box-shadow: var(--fb-shadow-md);
}

/* WP'den gelen inline width/height attribute'ları override */
.yazi-prose img[width],
.yazi-prose iframe[width] {
  width: auto !important;
  max-width: 100% !important;
}

/* Video iframe'leri (YouTube, Vimeo, Dailymotion) — 16:9 sarmalı */
.yazi-prose iframe[src*="youtube"],
.yazi-prose iframe[src*="youtu.be"],
.yazi-prose iframe[src*="vimeo"],
.yazi-prose iframe[src*="dailymotion"] {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border-radius: var(--fb-radius-md);
  border: 0;
  margin: 2em 0;
}

/* WordPress shortcode wrapper'ları */
.yazi-prose .wp-block-embed,
.yazi-prose .wp-block-video,
.yazi-prose .wp-video,
.yazi-prose .video-container,
.yazi-prose .embed-responsive {
  max-width: 100%;
  margin: 2em 0;
}

/* Tablo mobil scroll */
@media (max-width: 640px) {
  .yazi-prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Blockquote */
.yazi-prose blockquote {
  border-left: 4px solid rgb(var(--fb-neon));
  padding: 1em 1.5em;
  margin: 1.5em 0;
  background: rgb(var(--fb-neon) / 0.05);
  border-radius: 0 var(--fb-radius-sm) var(--fb-radius-sm) 0;
  font-style: italic;
  color: rgb(var(--fb-mutlu));
}

.yazi-prose ul,
.yazi-prose ol {
  margin: 1.2em 0;
  padding-left: 1.6em;
}
.yazi-prose li {
  margin: 0.5em 0;
}

.yazi-prose code {
  background: rgb(var(--fb-overlay) / 0.08);
  padding: 0.18em 0.45em;
  border-radius: var(--fb-radius-xs);
  font-size: 0.9em;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.yazi-prose pre {
  background: rgb(var(--fb-bg-3));
  border: 1px solid var(--fb-cizgi);
  padding: 1.2em;
  border-radius: var(--fb-radius-sm);
  overflow-x: auto;
  margin: 1.5em 0;
}
.yazi-prose pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.yazi-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}
.yazi-prose th,
.yazi-prose td {
  border: 1px solid var(--fb-cizgi);
  padding: 0.7em 1em;
  text-align: left;
}
.yazi-prose th {
  background: rgb(var(--fb-overlay) / 0.04);
  font-weight: 700;
}

.yazi-prose mark {
  background: rgb(var(--fb-neon) / 0.3);
  color: rgb(var(--fb-yazi));
  padding: 0.1em 0.3em;
  border-radius: var(--fb-radius-xs);
}

/* ============================================================
   8) Reklam sistemi — AdSense Policy uyumu
   ------------------------------------------------------------
   Slot-spesifik min-height/max-width PHP içinde (main.php) üretilir
   (admin panelden ayar değişebildiği için). Burada SADECE statik
   ortak kurallar var. Reklam container'ları contain:layout +
   content-visibility:auto ile CLS=0 garantisi.
   ============================================================ */

/* Tüm reklam kutuları için ortak taban */
.reklam-box {
  margin: 1.5rem auto;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;       /* AdSense policy — reklam kırpılamaz */
  display: block;
  contain: layout;
}
.reklam-box .reklam-etiket {
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgb(var(--fb-mutlu));
  margin-bottom: 6px;
  opacity: 0.7;
}
.reklam-box .reklam-blok,
.reklam-box ins.adsbygoogle,
.reklam-box iframe {
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}
.reklam-box .reklam-blok { margin: 0 !important; }
.reklam-box iframe       { max-width: 100% !important; }

/* In-Article (fluid format) — container'ı tam kullansın */
.reklam-in-article {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 300px;       /* CLS fix — fluid yüklenmeden yer ayır */
  contain: layout;
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
}
.reklam-in-article ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 280px;
  text-align: center;
  margin-left:  auto !important;
  margin-right: auto !important;
}
.reklam-in-article iframe {
  margin-left:  auto !important;
  margin-right: auto !important;
  display: block !important;
}

/* Yazı içerik kolonu — grid/flex parent taşmasını engelle */
.yazi-orta,
.yazi-prose,
.yazi-icerik { min-width: 0; }

/* Sabit boyut (Desktop 680×280, Mobil 336×280) */
.reklam-sabit {
  min-height: 280px;
  max-width: 100%;
  content-visibility: auto;
  contain-intrinsic-size: 0 280px;
}
.reklam-sabit ins.adsbygoogle {
  display: inline-block !important;
  max-width: 100% !important;
  margin-left:  auto !important;
  margin-right: auto !important;
}
.reklam-sabit iframe {
  margin-left:  auto !important;
  margin-right: auto !important;
  display: block !important;
}

/* Çok dar viewport (< 336px) — hafif ölçek */
@media (max-width: 335px) {
  .reklam-sabit ins.adsbygoogle {
    transform: scale(calc(100vw / 336 * 0.94));
    transform-origin: top center;
  }
}

/* Sidebar 300×600 (sağ kolon) */
.reklam-sidebar300 {
  width: 300px;
  max-width: 300px;
  min-height: 600px !important;
  content-visibility: auto;
  contain-intrinsic-size: 300px 600px;
}
.reklam-sidebar300 ins.adsbygoogle {
  width: 300px !important;
  max-width: 300px !important;
  min-height: 250px;
}

/* Sol kolon 160×600 */
.reklam-sol160 {
  width: 160px;
  max-width: 160px;
  min-height: 600px;
  content-visibility: auto;
  contain-intrinsic-size: 160px 600px;
}
.reklam-sol160 ins.adsbygoogle {
  width: 160px !important;
  max-width: 160px !important;
  height: 600px !important;
  min-height: 600px;
}

/* Eski .reklam-blok (geriye uyum — wrapper'sız kullanım) */
.reklam-blok:not(.reklam-box *) {
  margin: 1.5rem auto;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  min-height: 250px;
  contain: layout;
  content-visibility: auto;
  contain-intrinsic-size: 0 250px;
}
.reklam-blok:not(.reklam-box *) ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 250px;
}

/* ============================================================
   9) Scrollbar — tema-aware (webkit + firefox)
   ============================================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgb(var(--fb-bg));
}
::-webkit-scrollbar-thumb {
  background: rgb(var(--fb-overlay) / 0.08);
  border-radius: var(--fb-radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--fb-neon) / 0.4);
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--fb-overlay) / 0.12) rgb(var(--fb-bg));
}

/* ============================================================
   10) Reveal animasyonu — CSS-only (GSAP'a bağımlı değil)
   ============================================================ */
.reveal {
  animation: revealIn 0.6s var(--fb-ease-smooth) both;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes revealIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   11) Reduced-motion — animasyonları sıfırla
   (input.css'te global var; burada .reveal için kesin override)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .izi-arka::before { opacity: 0.5; }
}

/* ============================================================
   12) Tema Segmented Control (Task #6 — Light / Auto / Dark)
   Mobilde drawer içinde .w-full + butonlarda .flex-1 kullanılır.
   ============================================================ */
.fb-tema-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: rgb(var(--fb-bg-3));
  border: 1px solid var(--fb-cizgi);
  border-radius: var(--fb-radius-full);
  overflow: hidden;
  position: relative;
}
.fb-tema-segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  color: rgb(var(--fb-mutlu));
  background: transparent;
  border: none;
  border-radius: var(--fb-radius-full);
  cursor: pointer;
  transition: color var(--fb-transition-fast),
              background var(--fb-transition-fast),
              box-shadow var(--fb-transition-fast),
              transform var(--fb-transition-fast);
}
.fb-tema-segmented button:hover {
  color: rgb(var(--fb-yazi));
  background: var(--fb-hover-bg);
}
.fb-tema-segmented button.fb-tema-aktif,
.fb-tema-segmented button[aria-pressed="true"] {
  color: rgb(var(--fb-neon));
  background: rgb(var(--fb-bg-2));
  box-shadow: var(--fb-shadow-sm);
}
.fb-tema-segmented button:focus-visible {
  outline: 2px solid var(--fb-focus-ring);
  outline-offset: 2px;
}
.fb-tema-segmented button:active {
  transform: scale(0.94);
}
@media (prefers-reduced-motion: reduce) {
  .fb-tema-segmented button {
    transition: none;
  }
  .fb-tema-segmented button:active {
    transform: none;
  }
}

/* ============================================================
   13) Tema Toast (1.5sn, sağ alt köşe, glass)
   ============================================================ */
.fb-tema-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--fb-z-toast, 80);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: var(--fb-cam-bg);
  border: 1px solid var(--fb-cam-border);
  border-radius: var(--fb-radius-md);
  backdrop-filter: blur(var(--fb-blur-md)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--fb-blur-md)) saturate(120%);
  box-shadow: var(--fb-shadow-lg);
  color: rgb(var(--fb-yazi));
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s var(--fb-ease-smooth),
              transform 0.25s var(--fb-ease-smooth);
  pointer-events: none;
}
.fb-tema-toast-gosterir {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fb-tema-toast {
    transition: opacity 0.1s linear;
    transform: none;
  }
  .fb-tema-toast-gosterir {
    transform: none;
  }
}

/* Task #10 (Sunai) — Toast iç düzen: ikon + mesaj yan yana */
.fb-tema-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fb-tema-toast .fb-tema-toast-ikon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 16px;
  line-height: 1;
  color: rgb(var(--fb-neon));
  flex-shrink: 0;
}
.fb-tema-toast .fb-tema-toast-mesaj {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   14) Task #10 polish — segmented focus + aktif neon halo
   ============================================================ */
.fb-tema-segmented button.fb-tema-aktif,
.fb-tema-segmented button[aria-pressed="true"] {
  box-shadow:
    var(--fb-shadow-sm),
    0 0 0 1px rgb(var(--fb-neon) / 0.18),
    0 0 12px rgb(var(--fb-neon) / 0.12);
}
.fb-tema-segmented button:focus-visible {
  outline: 2px solid rgb(var(--fb-neon));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgb(var(--fb-neon) / 0.15);
}

/* ============================================================
   15) Task #10 — View Transitions API crossfade
   (Chrome 111+ / Edge / Safari 18+; @supports guard ile)
   ============================================================ */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.25s;
    animation-timing-function: var(--fb-ease-smooth);
  }
  ::view-transition-old(root) {
    animation-name: fb-tema-kaybol;
  }
  ::view-transition-new(root) {
    animation-name: fb-tema-goster;
  }
}
@keyframes fb-tema-kaybol {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes fb-tema-goster {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
