/* Blog CSS */
:root {
    --bg-light: #ffffff;
    --green-dark: #2c4c3b;
    --green-mid: #4a7c59;
    --accent: #a39786;
    --accent-hover: #a68a61;
    --cream: #ffffff;
    --text-main: #333;
    --text-light: #777;
    --border: #e0e0e0;
    --white: #ffffff;
    --danger: #d9534f;
    --radius: 8px;
}

.blog-container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    gap: 30px;
    padding: 0 20px;
}

.blog-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.blog-main {
    flex: 1;
}

.widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.widget h3 {
    color: var(--green-dark);
    border-bottom: 2px solid var(--forest);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-main);
    text-decoration: none;
}

.widget a:hover {
    color: var(--forest);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* ── Blog toolbar (heading + controls row) ── */
.blog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.blog-heading {
    color: var(--green-dark);
    margin: 0;
    font-size: 1.6em;
}

.blog-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Filter toggle button – hidden on desktop, shown on mobile via media query */
.btn-filter-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--cream);
    border: 1.5px solid rgba(44, 76, 59, 0.18);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--green-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.btn-filter-toggle:hover {
    background: rgba(163, 151, 134, 0.1);
    border-color: var(--forest);
    color: var(--forest);
}

/* Read more link */
.blog-read-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--green-dark);
    text-decoration: none;
    border-bottom: 1.5px solid var(--forest);
    padding-bottom: 1px;
    transition: color 0.2s;
}
.blog-read-more:hover { color: var(--forest); }

/* Tag cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Recent posts date */
.rp-date {
    display: block;
    font-size: 0.78em;
    color: var(--text-light);
    margin-top: 2px;
}

/* Mobile-only widgets (Recent Posts + Tags) – hidden on desktop */
.mobile-only-widgets {
    display: none;
}
.desktop-only-widgets {
    display: block;
}


.blog-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(44, 76, 59, 0.08);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
    border-color: rgba(44, 76, 59, 0.18);
}

.blog-image {
    position: relative;
    height: 210px;
    background: #eef2ed;
    display: block;
    overflow: hidden;
}

.blog-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ee 0%, #e2ece0 100%);
    color: #4a7c59;
    font-weight: 600;
    font-size: 14px;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-card-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--green-dark, #2c4c3b);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 2;
}

.blog-card-like-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #e11d48;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 2;
}

.blog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.blog-meta {
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.blog-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 10px;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    transition: color 0.2s;
}

.blog-title:hover {
    color: var(--forest);
}

.blog-excerpt {
    color: #64748b;
    margin-bottom: 15px;
    font-size: 0.92em;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-posts-list li:hover a {
    color: var(--forest) !important;
}

.popular-posts-list li img {
    transition: transform 0.25s ease;
}

.popular-posts-list li:hover img {
    transform: scale(1.05);
}

.btn-comment-like:hover {
    background: #fff1f2 !important;
    color: #e11d48 !important;
}

.btn-comment-like.liked {
    color: #e11d48 !important;
}

.article-header {
    margin-bottom: 30px;
}

.article-title {
    font-size: 2.5em;
    color: var(--green-dark);
    margin-bottom: 10px;
}

.article-image {
    width: 100%;
    height: 400px;
    background: var(--cream);
    border-radius: var(--radius);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.article-body {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 40px;
}

.article-tags {
    margin-bottom: 30px;
}

.tag {
    display: inline-block;
    background: var(--cream);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--text-main);
    text-decoration: none;
    margin-right: 5px;
}

.tag:hover {
    background: var(--forest);
    color: var(--white);
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-like {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.btn-like:hover {
    border-color: #e11d48;
    color: #e11d48;
    background: #fff1f2;
    transform: translateY(-1px);
}

.btn-like.liked {
    background: #fff1f2;
    color: #e11d48;
    border-color: #e11d48;
}

.btn-like:active .post-heart-svg {
    transform: scale(0.85);
}

.comments-section {
    margin-top: 50px;
}

.comment-form {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    min-height: 100px;
    margin-bottom: 15px;
    font-family: inherit;
}

.btn-submit {
    background: var(--green-dark);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.comment-meta {
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.comment-author {
    font-weight: bold;
    color: var(--green-dark);
}

.related-section {
    margin-top: 50px;
}

/* Image Alignment and Responsive Video Classes */
.image-left {
    float: left;
    margin: 0 20px 15px 0;
}

.image-center {
    display: block;
    margin: 20px auto;
}

.image-right {
    float: right;
    margin: 0 0 15px 20px;
}

.image-full {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto !important;
}

/* Override inline height for all blog content images if needed to maintain aspect ratio */
.article-body img {
    max-width: 100%;
}

.video-responsive {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    margin: 20px 0;
    border-radius: var(--radius);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Featured Image – blog detay sayfası */
.blog-featured-image {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto 30px;
    object-fit: contain;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .blog-container {
        flex-direction: column;
    }
    .blog-sidebar {
        width: 100%;
    }
    .image-left, .image-right {
        float: none;
        margin: 20px auto;
        display: block;
    }
}

/* ── Blog mobile layout ─────────────────────────────────── */
@media (max-width: 768px) {

    /* Show filter toggle button */
    .btn-filter-toggle {
        display: inline-flex !important;
    }

    /* Sidebar: collapsed by default via max-height */
    .blog-sidebar {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        margin-bottom: 0;
    }

    /* Sidebar open state */
    .blog-sidebar.is-open {
        max-height: 2000px;
        margin-bottom: 20px;
    }

    /* Blog grid: 1 column on all small screens */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* Blog card image height on mobile */
    .blog-image {
        height: 180px;
    }

    /* Blog toolbar: heading takes full row, controls below */
    .blog-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .blog-toolbar-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Mobile-only widgets: show after posts */
    .mobile-only-widgets {
        display: block !important;
        margin-top: 40px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }

    /* Desktop-only widgets in sidebar: hide on mobile */
    .desktop-only-widgets {
        display: none !important;
    }

    /* Recent posts list on mobile */
    .recent-posts li {
        display: flex;
        flex-direction: column;
        padding: 10px 0;
    }

    .recent-posts a {
        font-size: 0.95em;
        font-weight: 500;
        color: var(--green-dark);
        text-decoration: none;
        line-height: 1.4;
    }
    .recent-posts a:hover { color: var(--forest); }
}

/* Very small screens: ensure no horizontal overflow */
@media (max-width: 430px) {
    .blog-container {
        padding: 0 14px;
    }
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .blog-card {
        max-width: 100%;
    }
    .blog-title {
        font-size: 1.05em;
    }
    .blog-image {
        height: 160px;
    }
}

/* ── Related Products Grid in Blog ── */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.related-product-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.related-product-image {
    width: 60px;
    height: 60px;
    background-color: var(--cream);
    background-position: center;
    background-size: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.related-product-info {
    flex: 1;
    min-width: 0; /* allows text truncation if needed */
}

.related-product-title {
    color: var(--green-dark);
    font-weight: bold;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-product-price {
    color: var(--accent);
    font-weight: bold;
}

.related-product-action {
    margin-left: auto;
    flex-shrink: 0;
}

.related-product-btn {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
    transition: background 0.3s ease;
}

.related-product-btn:hover {
    background: var(--accent-hover, #059669);
    color: #fff;
}

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

@media (max-width: 480px) {
    .related-product-card {
        padding: 10px;
        gap: 10px;
    }
    
    .related-product-image {
        width: 50px;
        height: 50px;
    }
    
    .related-product-title {
        font-size: 14px;
    }
    
    .related-product-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}
