/*
 * blog.css — Blog Archive & Single Post Styles
 *
 * Styles blog archive pages (index.php, archive.php) and single post
 * pages (single.php). Includes sidebar widget styling and comment thread.
 *
 * TABLE OF CONTENTS
 * ──────────────────────────────────────────────────────────────
 * 1.  Archive Header    — Hero banner with title and description
 * 2.  Blog Layout       — .blog-archive-layout (main + sidebar flex)
 * 3.  Sidebar Widgets   — .blog-sidebar widget cards, tag cloud
 * 4.  Blog Cards Grid   — .blog-posts-grid, .blog-card hover animation
 * 5.  Blog Card         — Image, badges, meta, title, excerpt, read-more
 * 6.  Single Post       — .blog-single-area, .blog-single-wrapper,
 *                         featured image, .entry-content typography
 * 7.  Author Info       — .entry-author-info, avatar, name, bio
 * 8.  Post Footer       — Tag links, social share buttons
 * 9.  Comments          — .comments-area, .comment-body, reply link
 * 10. Comment Form      — Grid-based comment submission form
 * 11. Pagination        — .pagination-list (also used in shop.css)
 * 12. Responsive        — (≤ 1200px, ≤ 992px, ≤ 768px)
 * ──────────────────────────────────────────────────────────────
 *
 * Enqueued by: functions.php — wp_enqueue_style('viromarket-blog')
 * Used on: is_home(), is_archive(), is_single()
 *
 * @package ViroMarket
 */

/* ══════════════════════════════════════════════════════════════════════
   BLOG & ARCHIVE STYLES
   ══════════════════════════════════════════════════════════════════════ */

/* --- Archive Header --- */
.archive-header {
    background-color: var(--color-light-grey);
    padding: 60px 0;
    margin-bottom: 60px;
    text-align: center;
}

.archive-header .page-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--viro-secondary-color);
    margin-bottom: 15px;
}

.archive-header .archive-description {
    font-size: 1.1rem;
    color: var(--color-grey);
    max-width: 700px;
    margin: 0 auto;
}

/* --- Blog Layout with Sidebar --- */
.blog-archive-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.blog-main-content {
    flex: 1;
    min-width: 0;
}

.blog-sidebar-wrapper {
    width: 300px;
    flex-shrink: 0;
}

/* Sidebar Widgets Styles */
.blog-sidebar .widget {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
}

.blog-sidebar .widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-light-grey);
    position: relative;
    color: var(--viro-secondary-color);
}

.blog-sidebar .widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 50px;
    height: 2px;
    background: var(--viro-primary-color);
}

.blog-sidebar .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-sidebar .widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-sidebar .widget ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-sidebar .widget ul li a {
    color: var(--color-grey);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.blog-sidebar .widget ul li a:hover {
    color: var(--viro-primary-color);
}

.blog-sidebar .widget_tag_cloud .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-sidebar .widget_tag_cloud .tagcloud a {
    display: inline-block;
    padding: 6px 12px;
    background: var(--color-light-grey);
    color: var(--viro-secondary-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem !important;
    /* Override WP inline styles */
    text-decoration: none;
    transition: all var(--transition-fast);
}

.blog-sidebar .widget_tag_cloud .tagcloud a:hover {
    background: var(--viro-primary-color);
    color: var(--color-white);
}

/* --- Blog Cards Grid --- */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Changed to 2 for sidebar layout */
    gap: 30px;
    margin-bottom: 60px;
}

.blog-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    border-color: var(--viro-primary-color);
}

.blog-card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.1);
}

.blog-card-badges {
    position: absolute;
    top: 15px;
    left: 15px;
}

.badge-cat {
    background-color: var(--viro-primary-color);
    color: var(--color-white);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.blog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-card-meta .sep {
    opacity: 0.5;
}

.blog-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 15px;
}

.blog-card-title a {
    color: var(--viro-secondary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.blog-card-title a:hover {
    color: var(--viro-primary-color);
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-grey);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--viro-primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: gap var(--transition-fast);
}

.blog-read-more:hover {
    gap: 12px;
}

.blog-read-more i {
    width: 18px;
    height: 18px;
}

/* --- Single Post Layout --- */
.blog-single-area {
    padding: 80px 0;
}

.blog-single-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.single-post-card .entry-meta-top {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.single-post-card .cat-links a {
    text-decoration: none;
    color: var(--viro-primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.single-post-card .posted-on {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.single-post-card .entry-title {
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 40px;
    color: var(--viro-secondary-color);
}

.entry-author-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
}

.author-avatar img {
    border-radius: 50%;
    border: 3px solid var(--color-light-grey);
}

.author-name {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--viro-secondary-color);
}

.author-bio {
    display: block;
    font-size: 0.9rem;
    color: var(--color-grey);
}

.post-featured-image {
    margin: 0 -80px 60px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.post-featured-image img {
    width: 100%;
    display: block;
}

.entry-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--viro-secondary-color);
}

.entry-content p {
    margin-bottom: 30px;
}

.entry-content blockquote {
    background: var(--color-light-grey);
    border-left: 5px solid var(--viro-primary-color);
    padding: 40px;
    margin: 40px 0;
    font-style: italic;
    font-size: 1.4rem;
    color: var(--color-grey);
}

.entry-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.tag-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-links a {
    background: var(--color-light-grey);
    color: var(--color-grey);
    padding: 6px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.tag-links a:hover {
    background: var(--viro-primary-color);
    color: var(--color-white);
}

.post-share-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.share-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.post-share-buttons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-light-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--viro-secondary-color);
    transition: all var(--transition-fast);
}

.post-share-buttons a:hover {
    background: var(--viro-primary-color);
    color: var(--color-white);
    transform: translateY(-3px);
}

/* --- Comments Section --- */
.comments-area {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--viro-secondary-color);
    margin-bottom: 40px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-body {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.comment-body:hover {
    border-color: var(--viro-primary-color);
    box-shadow: var(--shadow-sm);
}

.comment-author-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
}

.comment-content {
    flex: 1;
}

.comment-author-name {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--viro-secondary-color);
    margin-bottom: 5px;
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 15px;
}

.comment-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-grey);
    margin-bottom: 15px;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    color: var(--viro-primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Respond Form */
.comment-respond {
    background: var(--color-light-grey);
    padding: 40px;
    border-radius: var(--radius-lg);
    margin-top: 60px;
}

.comment-reply-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--viro-secondary-color);
    margin-bottom: 30px;
}

.comment-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.comment-form-comment {
    grid-column: 1 / -1;
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
    grid-column: span 1;
}

.comment-form-cookies-consent {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-grey);
}

.comment-form label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--viro-secondary-color);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.comment-form textarea {
    min-height: 150px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--viro-primary-color);
    box-shadow: 0 0 0 4px rgba(98, 208, 182, 0.1);
}

.form-submit {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.form-submit input[type="submit"] {
    background-color: var(--viro-primary-color);
    color: var(--color-white);
    padding: 15px 40px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-submit input[type="submit"]:hover {
    background-color: var(--viro-secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- Pagination --- */
.pagination-container {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    align-items: center;
}

.pagination-link,
.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    border-radius: var(--radius-sm);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    color: var(--viro-secondary-color);
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-link.active {
    background: var(--viro-primary-color);
    color: var(--color-white);
    border-color: var(--viro-primary-color);
}

.pagination-link:hover:not(.active),
.pagination-btn:hover {
    border-color: var(--viro-primary-color);
    color: var(--viro-primary-color);
    transform: translateY(-2px);
}

.pagination-btn {
    padding: 0 10px;
}

.pagination-dots {
    color: var(--color-text-muted);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .blog-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-featured-image {
        margin: 0 0 50px;
    }
}

@media (max-width: 992px) {
    .blog-archive-layout {
        flex-direction: column;
    }

    .blog-sidebar-wrapper {
        width: 100%;
        margin-top: 40px;
    }

    .blog-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }

    .archive-header .page-title {
        font-size: 2.2rem;
    }

    .single-post-card .entry-title {
        font-size: 2.2rem;
    }

    .entry-content {
        font-size: 1.05rem;
    }

    .post-featured-image {
        margin: 30px 0;
    }

    .comment-form {
        grid-template-columns: 1fr;
    }

    .comment-respond {
        padding: 30px;
    }

    .comment-body {
        padding: 20px;
        flex-direction: column;
    }
}