/**
 * YamanlarNet SMC - Blog System Main Stylesheet
 * Version: 2.0
 */

/* REMOVED: Global :root CSS variables that override site-wide colors
 * Footer was affected by this. Blog-specific colors now applied via inline styles or direct hex values.
 * Main site colors (style.css :root) will be used globally including footer.
 */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Blog sayfaları için main content padding */
.blog-content,
#main-content.blog-content {
    padding-top: var(--navbar-height, 80px);
}

/* ========================================
   BLOG PAGE CLASSES
======================================== */
.blog-index-page,
.blog-category-page,
.blog-author-page,
.blog-post-page,
.blog-popular-page,
.blog-search-page {
    padding-bottom: 0 !important;
}

/* Blog sayfaları için navbar padding'i main-content'e uygulanır */
#main-content.blog-content,
main#main-content.blog-content {
    padding-top: var(--navbar-height, 80px) !important;
}

/* ========================================
   POST HERO HEADER
======================================== */
.post-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    margin-bottom: 3rem;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.9) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.hero-author {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem 1.5rem 0.5rem 0.5rem;
    border-radius: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 3;
}

.hero-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.5);
    margin-left: -3px;
    flex-shrink: 0;
}

.hero-author span {
    font-weight: 600;
    white-space: nowrap;
    padding-right: 0.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
    line-height: 1.2;
    padding-bottom: 3rem;
    /* Renk seçiminin çalışması için webkit override */
    -webkit-text-fill-color: inherit;
}

.hero-info-band {
    background: #3a3a3a;
    padding: 1rem 0;
    color: white;
}

.info-band-left,
.info-band-center,
.info-band-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.info-item i {
    opacity: 0.8;
}

.category-badge-hero {
    background: #dc3545;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.category-badge-hero:hover {
    color: white;
    background: #c82333;
}

/* ========================================
   CONTENT LAYOUT
======================================== */
.content-wrapper {
    margin-top: 2rem;
}

/* ========================================
   LEFT SIDEBAR - TABLE OF CONTENTS
======================================== */
.toc-sidebar {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.toc-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.8rem;
}

.toc-list a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: block;
}

.toc-list a:hover,
.toc-list a.active {
    color: #667eea;
    font-weight: 600;
}

.toc-list .toc-h3 {
    padding-left: 1rem;
    font-size: 0.85rem;
}

.toc-list .toc-h4 {
    padding-left: 2rem;
    font-size: 0.8rem;
}

/* ========================================
   MAIN CONTENT
======================================== */
.post-content {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

/* Reklam alanları (SIDEBAR için) */
.ad-space {
    margin: 2rem 0;
    min-height: 0; /* Boş kare oluşmasın */
}

.ad-space:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

/* Reklam içeriği varsa göster */
.ad-space:not(:empty) {
    display: block;
    margin: 2rem 0;
}

/* ÖNEMLI: Yazı içi reklamlar için :empty kuralını devre dışı bırak */
.in-content-ad {
    display: block !important;
}

.in-content-ad:empty {
    display: block !important; /* ← Override .ad-space:empty kuralını */
}

.post-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
}

.post-content .lead {
    font-size: 1.3rem;
    font-weight: 400;
    color: #555;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.post-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.post-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin: 2rem 0 1rem;
}

.post-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin: 1.5rem 0 0.8rem;
}

.post-content ul,
.post-content ol {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding: 1.5rem 2rem;
    background: #f7fafc;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 10px 10px 0;
}

/* ========================================
   IMAGE LAYOUTS
======================================== */
.img-float-left {
    float: left;
    margin: 0 2rem 1rem 0;
    max-width: 40%;
    border-radius: 10px;
}

.img-float-right {
    float: right;
    margin: 0 0 1rem 2rem;
    max-width: 40%;
    border-radius: 10px;
}

.img-inline {
    display: block;
    margin: 2rem auto;
    max-width: 100%;
    border-radius: 10px;
}

.img-with-text-left {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

.img-with-text-left img {
    max-width: 45%;
    border-radius: 10px;
}

.img-with-text-right {
    display: flex;
    flex-direction: row-reverse;
    gap: 2rem;
    margin: 2rem 0;
}

.img-with-text-right img {
    max-width: 45%;
    border-radius: 10px;
}

/* ========================================
   AD SPACES
======================================== */
/* Ad spaces artık yukarıda tanımlı, duplikasyon kaldırıldı */

/* ========================================
   RIGHT SIDEBAR - POPULAR POSTS
======================================== */
.popular-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.sidebar-widget h4,
.sidebar-widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-widget-title i {
    color: #667eea;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.8rem;
}

.category-list li a {
    color: #2d3748;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.category-list li a:hover {
    background: #f7fafc;
    color: #667eea;
    padding-left: 1rem;
}

.category-count {
    background: #f7fafc;
    color: #2d3748;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.popular-post,
.popular-post-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.popular-post:last-child,
.popular-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-image,
.popular-post-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.popular-post-content,
.popular-post-info {
    flex: 1;
}

.popular-post-title,
.popular-post-info h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.popular-post-title a,
.popular-post-info h6 a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-post-title a:hover,
.popular-post-info h6 a:hover {
    color: #667eea;
}

.popular-post-date,
.popular-post-meta {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-post-date i,
.popular-post-meta i {
    opacity: 0.7;
}

.popular-post-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.popular-post-info h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.popular-post-info h6 a {
    color: #2d3748;
    text-decoration: none;
}

.popular-post-info h6 a:hover {
    color: #667eea;
}

.popular-post-meta {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    gap: 1rem;
}

/* ========================================
   FULL WIDTH SECTIONS
======================================== */
.full-width-section {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   TAGS
======================================== */
.post-tags {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.tag {
    background: #f7fafc;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tag:hover {
    background: #667eea;
    color: white;
}

/* ========================================
   SHARE BUTTONS
======================================== */
.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    flex: 1;
    min-width: 150px;
    padding: 0.8rem;
    border-radius: 10px;
    text-align: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #1da1f2; }
.share-linkedin { background: #0a66c2; }
.share-whatsapp { background: #25d366; }

/* ========================================
   AUTHOR PROFILE
======================================== */
.author-profile {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.author-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    flex-shrink: 0;
}

.author-info h3 {
    margin-bottom: 0.5rem;
}

.author-info p {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.author-social {
    display: flex;
    gap: 1rem;
}

.author-social a {
    color: white;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    text-decoration: none;
}

.author-social a:hover {
    background: rgba(255,255,255,0.3);
}

/* ========================================
   RELATED POSTS
======================================== */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-post-card {
    background: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-5px);
}

.related-post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.related-post-card-body {
    padding: 1.5rem;
}

.related-post-card h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.related-post-card h5 a {
    color: #2d3748;
    text-decoration: none;
}

.related-post-card h5 a:hover {
    color: #667eea;
}

/* ========================================
   COMMENTS
======================================== */
.comments-section.disabled {
    background: #f9f9f9;
    text-align: center;
    padding: 3rem;
    color: #999;
}

.comment {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Comment form styling */
.comment-form {
    background: #f7fafc;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.comment-form h4 {
    margin-bottom: 1.5rem;
}

.comment-form .form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.comment-form .btn-primary {
    background: #667eea;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
}

/* ========================================
   BLOG GRID LAYOUT
======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ========================================
   BLOG CARDS (for archive pages)
======================================== */
.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.blog-card-image {
    position: relative;
    overflow: hidden;
    display: block;
}

.blog-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover img {
    transform: scale(1.05);
}

.blog-card-category,
.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #667eea;
    color: white !important;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 2;
    transition: background 0.3s ease;
}

.blog-card-category:hover,
.category-badge:hover {
    background: #764ba2;
    color: white !important;
}

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: #667eea;
}

.blog-card-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #718096;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-card-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-card-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-card-date i {
    opacity: 0.7;
}

/* Legacy support */
.blog-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #2d3748;
}

.blog-card h3 a {
    color: inherit;
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: #667eea;
}

.blog-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* ========================================
   CATEGORY/AUTHOR HERO
======================================== */
.category-hero,
.author-hero {
    position: relative;
    height: 40vh;
    min-height: 300px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.category-hero .hero-overlay,
.author-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
}

.category-hero .hero-content,
.author-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.category-hero h1,
.author-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.category-hero p,
.author-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.page-header-simple {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 3rem 0;
    margin-bottom: 3rem;
    color: white;
    text-align: center;
}

.page-header-simple h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header-simple p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Tag Icon */
.tag-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.tag-icon i {
    display: inline-block;
    animation: tagPulse 2s infinite;
}

@keyframes tagPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tag-stats,
.category-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 1rem;
}

.tag-stats span,
.category-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.95;
}

.tag-stats i,
.category-stats i {
    font-size: 1.2rem;
}

/* ========================================
   PAGINATION
======================================== */
.blog-pagination {
    margin: 3rem 0;
}

.blog-pagination .pagination {
    gap: 0.5rem;
}

.blog-pagination .page-link {
    border: 1px solid #e2e8f0;
    color: #2d3748;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.blog-pagination .page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.blog-pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.blog-pagination .page-item.disabled .page-link {
    background: transparent;
    border-color: #e2e8f0;
    color: #cbd5e0;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1200px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        padding-bottom: 2rem;
    }
    
    .hero-author {
        top: 1rem;
        left: 1rem;
        font-size: 0.8rem;
    }
    
    .hero-author img {
        width: 32px;
        height: 32px;
    }
    
    .info-band-left,
    .info-band-center,
    .info-band-right {
        font-size: 0.8rem;
        gap: 0.8rem;
        justify-content: center !important;
    }
    
    .toc-sidebar,
    .popular-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .post-content {
        padding: 1.5rem;
    }
    
    .img-float-left,
    .img-float-right {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
    
    .img-with-text-left,
    .img-with-text-right {
        flex-direction: column;
    }
    
    .img-with-text-left img,
    .img-with-text-right img {
        max-width: 100%;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .author-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        min-width: auto;
    }
    
    .category-hero h1,
    .author-hero h1 {
        font-size: 2rem;
    }
    
    .full-width-section {
        padding: 1.5rem;
    }
}
