/*
Theme Name: Galeri Tema
Theme URI: https://example.com
Author: Galeri Tema
Author URI: https://example.com
Description: Fotoğraf galeri teması. Her görsel ayrı URL ile sayfalanır. AdSense uyumlu reklam alanları içerir.
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: galeri-tema
Tags: gallery, news, adsense, photo-gallery, turkish
*/

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #c0392b;
    --color-primary-dark: #a93226;
    --color-secondary: #2c3e50;
    --color-bg: #f4f4f4;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #dddddd;
    --color-header-bg: #e8e8e8;
    --color-nav-bg: #c0392b;
    --color-nav-hover: #a93226;
    --color-footer-bg: #1a1a2e;
    --font-main: 'Roboto', 'Segoe UI', Arial, sans-serif;
    --font-heading: 'Oswald', 'Arial Narrow', Arial, sans-serif;
    --radius: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.2);
    --max-width: 1140px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;     /* viewport genişliğini asla aşma */
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* Hiçbir öğe viewport'u taşmasın */
*, *::before, *::after {
    max-width: 100%;
}

/* AdSense ins ve iframe'ler taşmasın */
ins.adsbygoogle,
.ad-area iframe,
.adsbygoogle,
.adsbygoogle iframe,
iframe {
    max-width: 100% !important;
}

/* =========================================================
   LAYOUT
   ========================================================= */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px 0;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 960px) {
    .content-area { grid-template-columns: 1fr; }
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
    background: var(--color-header-bg);
    padding: 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo img {
    height: 50px;
    width: auto;
}

.site-logo .logo-text {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-date {
    color: #777;
    font-size: 13px;
}

/* Header Reklam Alanı */
.header-ad-area {
    text-align: center;
    padding: 10px 0;
    background: var(--color-header-bg);
}

.header-ad-area .ad-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.main-nav {
    background: var(--color-nav-bg);
    position: relative;
    z-index: 100;
}

.main-nav ul {
    display: flex;
    align-items: center;
}

.main-nav > ul > li {
    position: relative;
}

.main-nav > ul > li > a {
    display: block;
    padding: 13px 16px;
    color: var(--color-white);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
    white-space: nowrap;
}

.main-nav > ul > li:hover > a,
.main-nav > ul > li.current-menu-item > a {
    background: var(--color-nav-hover);
}

/* Dropdown */
.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-secondary);
    min-width: 180px;
    box-shadow: var(--shadow);
    z-index: 200;
}

.main-nav li:hover > .sub-menu { display: block; }

.main-nav .sub-menu li a {
    display: block;
    padding: 10px 16px;
    color: var(--color-white);
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s;
}

.main-nav .sub-menu li a:hover { background: var(--color-primary); }

/* Category Nav */
.cat-nav {
    background: var(--color-secondary);
    overflow-x: auto;
}

.cat-nav ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.cat-nav ul li a {
    display: block;
    padding: 8px 14px;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: color 0.2s;
    white-space: nowrap;
}

.cat-nav ul li a:hover { color: var(--color-white); }

/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb {
    padding: 8px 0 12px;
    font-size: 12px;
    color: var(--color-text-light);
}

.breadcrumb a { color: var(--color-primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 5px; }

/* =========================================================
   AD AREAS
   ========================================================= */
.ad-area {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px;
    text-align: center;
    overflow: hidden;
}

.ad-area .ad-inner-label {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
}

.ad-area-header-bottom { margin: 12px 0; }
.ad-area-above-photo  { margin: 15px 0; }
.ad-area-below-photo  { margin: 15px 0; }

/* AdSense responsive wrapper */
.adsense-wrapper {
    display: block;
    width: 100%;
    overflow: hidden;
}

/* =========================================================
   GALLERY POST
   ========================================================= */
.gallery-post {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Başlık alanı — yalnızca padding */
.gallery-post-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border);
}

.gallery-post-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-post-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-light);
}
.gallery-post-meta span { margin-right: 12px; }

/* ── AÇIKLAMA: fotoğrafın ÜSTÜNDE, tam kart genişliği ──── */
.photo-description {
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    font-size: 18px;
    line-height: 1.85;
    color: var(--color-text);
    font-style: italic;
}
.photo-description p {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.85;
}
.photo-description p:last-child { margin-bottom: 0; }

/* ── REKLAM ALANLARI: sıfır margin, kenara yapışık ──────── */
.ad-area-above-photo,
.ad-area-below-photo,
.ad-area-below-title {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

/* Başlık altı reklam — başlık ile içerik arasında hafif ayrım */
.ad-area-below-title {
    border-bottom: 1px solid var(--color-border);
}

/* ── FOTOĞRAF: tam kart genişliği, yan boşluk YOK ──────── */
.gallery-photo-wrap {
    display: block;
    width: 100%;
    background: #111;
    line-height: 0;
    overflow: hidden;
}
.gallery-photo-wrap a {
    display: block;
    width: 100%;
    line-height: 0;
}
.gallery-photo-wrap img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: contain;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

/* ── SAYFALAMA ───────────────────────────────────────────── */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    background: #fafafa;
    flex-wrap: wrap;
}
.gallery-pagination .pag-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: background 0.2s;
}
.gallery-pagination .pag-btn:hover {
    background: var(--color-primary-dark);
    color: #fff;
}
.gallery-pagination .pag-btn.disabled {
    background: #ccc;
    pointer-events: none;
}
.gallery-pagination .pag-info {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-light);
}

/* ── PAYLAŞ ─────────────────────────────────────────────── */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.share-buttons .share-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; color: #fff; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter  { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }

/* =========================================================
   MOBİL — GALERI SAYFASI (sade, tam ekran, beyaz kutu yok)
   ========================================================= */
@media (max-width: 768px) {

    /* ── HEADER: mobilde taşmayı önle ── */
    .site-header { overflow: hidden; }
    .header-top {
        padding: 10px 0;
        flex-wrap: nowrap;
        gap: 8px;
        overflow: hidden;
    }
    .site-logo { flex: 1; min-width: 0; overflow: hidden; }
    .site-logo .logo-text {
        font-size: 18px;
        letter-spacing: 0.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    .site-logo img { height: 36px; }
    /* Tarih mobilde gizli — yer kaplamasın, taşmasın */
    .header-date { display: none; }
    .nav-toggle { flex-shrink: 0; }

    /* Container'ın yan padding'i taşmaya yol açmasın */
    .container {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
    }

    /* Container yan boşluklarını sıfırla — içerik ekran kenarına yapışsın */
    .main-content { padding: 0; }
    .content-area { gap: 0; }
    .primary-content { padding: 0; }

    /* Breadcrumb sadece küçük bir yan boşlukla kalsın */
    .breadcrumb {
        padding: 8px 12px;
        margin: 0;
    }

    /* Galeri kartı: beyaz kutu, gölge, köşe yuvarlama, kenarlık YOK */
    .gallery-post {
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    /* Başlık — ekran kenarına yakın, sade */
    .gallery-post-header {
        padding: 10px 12px 8px;
        border-bottom: 1px solid var(--color-border);
        background: transparent;
    }
    .gallery-post-title { font-size: 20px; }

    /* Açıklama — tam genişlik, beyaz zemin yok, ekrana yapışık */
    .photo-description {
        font-size: 17px;
        line-height: 1.7;
        padding: 12px 12px;
        background: transparent;
        border-bottom: none;
        font-style: normal;
    }
    .photo-description p {
        font-size: 17px;
        line-height: 1.7;
    }

    /* Fotoğraf — ekranın TAM genişliği, hiç boşluk yok */
    .gallery-photo-wrap {
        background: transparent;
    }
    .gallery-photo-wrap img {
        max-height: none;
        width: 100%;
        object-fit: contain;
    }

    /* Reklam alanları — tam genişlik */
    .ad-area-above-photo,
    .ad-area-below-photo,
    .ad-area-below-title {
        padding: 6px 0;
        background: transparent;
        border: none;
    }

    /* Sayfalama — sade, ekrana yapışık */
    .gallery-pagination {
        padding: 14px 12px;
        gap: 8px;
        background: transparent;
        border-top: none;
    }
    .gallery-pagination .pag-btn { padding: 12px 22px; font-size: 14px; }

    /* Paylaş — sade, 3 buton tam genişlik */
    .share-buttons {
        padding: 12px;
        gap: 8px;
        flex-wrap: wrap;
        border-top: 1px solid var(--color-border);
    }
    .share-buttons .share-label { width: 100%; margin-bottom: 2px; }
    .share-btn { flex: 1; justify-content: center; padding: 11px 8px; font-size: 13px; }

    /* Son galeriler: mobilde 2 sütun (tek sütunda kutular çok uzun oluyor) */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 8px;
        max-width: 100%;
    }
    .gallery-card-thumb { padding-top: 70%; }
    .gallery-card-title { font-size: 12px; }
    .section-heading { margin: 12px 8px 10px; border-radius: 4px; }
}

/* Çok küçük ekranlarda da 2 sütun kalsın, tek sütun yok */
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Meta satırı: emoji yerine sade ayraç (tüm cihazlarda) */
.gallery-post-meta { letter-spacing: 0.2px; }

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.widget {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.widget-title {
    background: var(--color-primary);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
}

.widget-body { padding: 12px; }

/* Recent Galleries Widget */
.recent-gallery-list { display: flex; flex-direction: column; gap: 10px; }

.recent-gallery-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.recent-gallery-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-gallery-thumb {
    width: 75px;
    height: 55px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.recent-gallery-item:hover .recent-gallery-thumb img { transform: scale(1.08); }

.recent-gallery-info {
    flex: 1;
    min-width: 0;
}

.recent-gallery-info a {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.recent-gallery-info a:hover { color: var(--color-primary); }

/* =========================================================
   GALLERY GRID (Archive/Home)
   ========================================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.gallery-card {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s, transform 0.25s;
}

.gallery-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.gallery-card-thumb {
    position: relative;
    overflow: hidden;
    padding-top: 62%;
    background: #e9edf2; /* görsel yüklenene/yoksa boş kalmasın */
    display: block;
}

.gallery-card-thumb::before {
    content: "📷";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    opacity: 0.25;
    z-index: 0;
}

.gallery-card-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    z-index: 1;
    background: #e9edf2;
}

.gallery-card:hover .gallery-card-thumb img { transform: scale(1.06); }

.gallery-card-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
}

.gallery-card-info {
    padding: 10px 12px;
    border-top: 2px solid var(--color-primary);
}

.gallery-card-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-secondary);
    text-transform: uppercase;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.gallery-card:hover .gallery-card-title { color: var(--color-primary); }

.gallery-card-share {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--color-border);
}

.gallery-card-share a {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 3px;
    color: #fff;
    font-weight: 600;
}

.gallery-card-share .fb { background: #1877f2; }
.gallery-card-share .tw { background: #1da1f2; }

/* =========================================================
   SECTION TITLE
   ========================================================= */
.section-heading {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-white);
    text-transform: uppercase;
    background: var(--color-primary);
    padding: 9px 14px;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    background: var(--color-footer-bg);
    color: rgba(255,255,255,0.7);
    padding: 30px 0 0;
    margin-top: 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-widget-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: 14px;
}

.footer-links li { margin-bottom: 7px; }
.footer-links li a {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    transition: color 0.2s;
}
.footer-links li a:hover { color: var(--color-primary); }

.footer-bottom {
    text-align: center;
    padding: 14px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* =========================================================
   MOBILE NAV TOGGLE
   ========================================================= */
.nav-toggle {
    display: none;
    background: var(--color-primary);
    border: none;
    color: #fff;
    font-size: 22px;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: var(--radius);
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .main-nav ul { display: none; flex-direction: column; }
    .main-nav ul.open { display: flex; }
    .main-nav > ul > li { width: 100%; }
    .main-nav > ul > li > a { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.1); }
    /* Açılır alt menüler mobilde absolute değil, akış içinde — taşmayı önler */
    .main-nav .sub-menu {
        position: static;
        width: 100%;
        min-width: 0;
        box-shadow: none;
    }
    .main-nav li:hover > .sub-menu { display: none; } /* hover yerine dokunmayla */
    .main-nav ul.open .sub-menu { display: block; }
    .cat-nav { display: none; }
    .gallery-post-title { font-size: 18px; }
}

/* =========================================================
   UTILITIES
   ========================================================= */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-text-light);
    font-style: italic;
}

/* =========================================================
   GOOGLE FONTS IMPORT — load via functions.php instead
   ========================================================= */
