/*
Theme Name: Viral Galeri Teması
Theme URI: https://example.com
Description: Viral içerik ve foto galeri odaklı WordPress teması
Version: 1.1.2
Author: Rusa Tyler
Author URI: https://example.com
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: viral-galeri-temasi
Domain Path: /languages
*/

/* =======================
   RESET & BASE
   ======================= */
:root { --anchor-offset: 0px; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.65;
    color: #111;
    background-color: #f5f5f5;
    min-height: 100dvh;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    padding-bottom: var(--anchor-offset, 0px);
}
/* Safe-area birleşimi */
@supports (padding: env(safe-area-inset-bottom)) {
    body { padding-bottom: calc(env(safe-area-inset-bottom) + var(--anchor-offset, 0px)); }
}
@supports (padding: constant(safe-area-inset-bottom)) {
    body { padding-bottom: calc(constant(safe-area-inset-bottom) + var(--anchor-offset, 0px)); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.2rem; }
button { font-family: inherit; }

/* Ana kapsayıcılarda taşmayı engelle */
header, footer, .container, .menu-overlay, .menu-overlay-content,
.gallery-container, .gallery-viewer, .gallery-image-wrapper {
    max-width: 100%;
}

/* Uzun kelimeler yatay kaydırma yapmasın */
.gallery-text, .news-content, .news-title { overflow-wrap: anywhere; word-break: break-word; }

/* =======================
   MOBİL/TABLET HEADER BANT (HEADER'IN ÜSTÜNDE)
   ======================= */
.vg-mobile-header {
    display: none;
    width: 100%;
    background: #ffffff;
    color: #111;
    border-bottom: 1px solid #eee;
    padding: 10px 12px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
}
.vg-mobile-header a { color: #c41e3a; font-weight: 700; text-decoration: none; }
.vg-mobile-header a:hover { text-decoration: underline; }

@media (min-width: 1025px) {
    .vg-mobile-header { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; }
}
@media (max-width: 1024px) {
    .vg-mobile-header { display: block !important; visibility: visible !important; height: auto !important; overflow: visible !important; }
}

/* =======================
   HEADER
   ======================= */
header {
    background: linear-gradient(135deg, #c41e3a 0%, #a01729 100%);
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.header-container {
    max-width: 1200px; margin: 0 auto; padding: 0 15px;
    display: flex; align-items: center; gap: 16px;
}
.site-logo { font-size: 28px; font-weight: 800; color: #fff; display: inline-flex; align-items: center; }
.menu-button { appearance: none; border: 0; background: #fff; color: #c41e3a; font-weight: 800; padding: 10px 14px; border-radius: 6px; cursor: pointer; }
.menu-button:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.15); }

/* =======================
   OVERLAY MENÜ (KATEGORİLER)
   ======================= */
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; z-index: 9999; }
.menu-overlay.open { display: block; }
.menu-overlay-content { background: #fff; max-width: 960px; margin: 60px auto; padding: 22px; border-radius: 10px; position: relative; }

/* =======================
   LAYOUT
   ======================= */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 15px; }

/* =======================
   HOMEPAGE (NEWS GRID)
   ======================= */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; margin-bottom: 40px; }
.news-item { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.08); transition: transform .3s, box-shadow .3s; }
.news-item:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,.15); }
.news-item img { width: 100%; height: 200px; object-fit: cover; }

/* =======================
   GALERİ GENEL
   ======================= */
.gallery-page, .gallery-header, .gallery-container, .gallery-image-wrapper, .gallery-viewer, .gallery-text {
    background: transparent !important; box-shadow: none !important; border: 0 !important;
}
.no-card { background: transparent !important; box-shadow: none !important; border: 0 !important; }
.gallery-header { padding: 12px 0 8px; color: #111; }
.gallery-title { font-size: 32px; font-weight: 800; margin-bottom: 6px; }
.gallery-byline { font-size: 14px; color: #666; margin-bottom: 12px; }
.gallery-image { width: 100%; height: auto; display: block; border-radius: 6px; }

/* =======================
   GALLERY FOOTER (DÜZELTİLMİŞ)
   ======================= */
/* Gallery footer container: fotoğrafın genişliğine göre hizalanması için max-width ve otomatik margin */
.gallery-footer {
    margin-top: 12px;
    padding: 8px 12px 0;
    max-width: 860px;
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

/* İçerik: sol - ort - sağ, yatayda tam ortalanmış ve kenarlara dayalı */
.gallery-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Sol / Sağ bölümler kenarlarda sabitlenir */
.gallery-footer .footer-left,
.gallery-footer .footer-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
}
.gallery-footer .footer-left { justify-content: flex-start; }
.gallery-footer .footer-right { justify-content: flex-end; }

/* Sayaç ortada sabit genişlik ile */
.gallery-footer .footer-center {
    flex: 0 0 auto;
    width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Nav butonlarının bloklaşmasını engelle ve dikey ortala */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: rgba(0,0,0,0.06);
    color: #111;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.nav-btn.disabled { opacity: .4; pointer-events: none; cursor: default; }

/* Sayaç stili */
.gallery-counter { color: #7a7a7a; font-weight: 600; font-size: 14px; }

/* =======================
   REKLAM ALANLARI
   ======================= */
.ad-slot { display: block; width: 100%; max-width: 100%; margin: 16px auto; text-align: center; }
.ad-slot ins.adsbygoogle { display: block !important; width: 100% !important; min-height: 60px; }

/* =======================
   FOOTER
   ======================= */
footer { background: #333; color: #fff; padding: 30px; text-align: center; margin-top: 50px; }
footer a { color: #c41e3a; }

/* =======================
   RESPONSIVE
   ======================= */
/* Mobil/tablet genel responsive */
@media (max-width: 900px) {
    header nav { display: none; }
    .header-container { gap: 10px; }
    .menu-button { padding: 9px 12px; }
    .container { padding: 26px 12px; }
    .news-grid { grid-template-columns: 1fr; gap: 22px; }
    .gallery-container { flex-direction: column; }

    /* Mobilde Önceki/Sonraki gizle, footer orta sayaç yerine mobil sayaç gösterilecek */
    body.single .gallery-footer {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Mobil sayaç: reklam altında özel element (.vg-mobile-counter) gösterilir */
    .vg-mobile-counter {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 8px auto 6px !important;
        padding: 0 !important;
        position: relative !important;
        z-index: 99999 !important;
        pointer-events: none;
    }
    .vg-mobile-counter .mobile-counter-text {
        display: inline-block;
        background: rgba(20,20,20,0.55) !important;
        color: #fff !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        padding: 8px 14px !important;
        border-radius: 999px !important;
        box-shadow: 0 6px 18px rgba(0,0,0,0.18) !important;
        border: 1px solid rgba(255,255,255,0.03) !important;
        line-height: 1 !important;
    }

    /* Reklam bloğunun altındaki boşluğu minimize et, sayaç daha yakın gözüksün */
    .ad-below-image { margin-bottom: 6px !important; }
}

/* Çok küçük ekranlar için ince ayar */
@media (max-width: 420px) {
    .vg-mobile-counter .mobile-counter-text {
        font-size: 14px !important;
        padding: 6px 10px !important;
    }
}

/* Masaüstünde kesinlikle mobil sayaç gizli olsun */
@media (min-width: 901px) {
    .vg-mobile-counter { display: none !important; }
}

/* ---------- VG MOBILE COUNTER - FORCE CENTER OVERRIDE (FINAL) ----------
   Force center + conflict fixes (this block is last and critical)
--------------------------------------------------------------------- */

/* Ensure hidden by default; JS will inline-style the element on mobile */
.vg-mobile-counter { display: none !important; }

@media (max-width: 900px) {
  .vg-mobile-counter,
  body.single .vg-mobile-counter {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 860px !important;
    margin: 12px auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    text-align: center !important;
    float: none !important;
    clear: both !important;
    z-index: 99999 !important;
    pointer-events: none !important;
    background: transparent !important;
  }

  .ad-below-image + .vg-mobile-counter,
  .ad-below-image ~ .vg-mobile-counter,
  .gallery-image-wrapper + .vg-mobile-counter,
  .gallery-viewer > .vg-mobile-counter {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .vg-mobile-counter .mobile-counter-text {
    display: inline-block !important;
    margin: 0 auto !important;
    vertical-align: middle !important;
    background: rgba(0,0,0,0.60) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 22px rgba(0,0,0,0.22) !important;
    border: 1px solid rgba(255,255,255,0.03) !important;
    line-height: 1 !important;
    pointer-events: none !important;
    transform: translateZ(0) !important;
  }

  .gallery-viewer, .gallery-container, .container {
    overflow: visible !important;
  }

  body.single .container > .vg-mobile-counter,
  body.single .gallery-viewer > .vg-mobile-counter {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .gallery-footer { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; padding: 0 !important; margin: 0 !important; }
}

@media (min-width: 901px) {
  .vg-mobile-counter { display: none !important; }
}

/* ---------------------------
   MOBILE-ONLY ADS: HIDE ON DESKTOP
   --------------------------- */
/* Hide ad containers marked for mobile-only on desktop (strong override) */
@media (min-width: 901px) {
  .vg-mobile-only-ad,
  .vg-mobile-only-ad * {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Extra safety: hide ins elements that might be left */
  ins.adsbygoogle.vg-mobile-only,
  ins.adsbygoogle.vg-mobile-only * {
    display: none !important;
    visibility: hidden !important;
  }

  /* Also hide ad-slot variants explicitly marked */
  .ad-slot.vg-mobile-only,
  .ad-slot.vg-mobile-only * {
    display: none !important;
    visibility: hidden !important;
  }
}

/* End of file */