/* ══════════════════════════════════════
   Blog Front Styles
   ══════════════════════════════════════ */

/* Blog layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.blog-layout--full {
    grid-template-columns: 1fr;
}

/* Post listing grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Post card */
.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.post-card__image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}
.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover .post-card__image img {
    transform: scale(1.05);
}
.post-card__category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--primary, #e63946);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.post-card__body {
    padding: 1.25rem;
}
.post-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}
.post-card__title a {
    color: #1a1a2e;
    text-decoration: none;
}
.post-card__title a:hover {
    color: var(--primary, #e63946);
}
.post-card__excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.post-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: #999;
}
.post-card__author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.post-card__author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Featured post (hero) */
.blog-featured {
    margin-bottom: 2rem;
}
.featured-post {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 21/9;
}
.featured-post__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-post__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    color: #fff;
}
.featured-post__title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.featured-post__title a {
    color: #fff;
    text-decoration: none;
}
.featured-post__excerpt {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
}

/* Single post */
.post-single {
    max-width: 800px;
    margin: 0 auto;
}
.post-single__header {
    text-align: center;
    margin-bottom: 2rem;
}
.post-single__title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1a1a2e;
}
.post-single__meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}
.post-single__image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.post-single__content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}
.post-single__content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.post-single__content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.post-single__content p {
    margin-bottom: 1.25rem;
}
.post-single__content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}
.post-single__content blockquote {
    border-left: 4px solid var(--primary, #e63946);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}
.post-tags__item {
    background: #f0f0f0;
    color: #555;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.2s;
}
.post-tags__item:hover {
    background: var(--primary, #e63946);
    color: #fff;
}

/* Author box */
.author-box {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}
.author-box__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.author-box__name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}
.author-box__bio {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Sidebar widgets */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sidebar-widget__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary, #e63946);
}
.sidebar-widget__list {
    list-style: none;
    padding: 0;
}
.sidebar-widget__list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.sidebar-widget__list li:last-child {
    border-bottom: none;
}
.sidebar-widget__list a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}
.sidebar-widget__list a:hover {
    color: var(--primary, #e63946);
}

/* Tag cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tag-cloud__item {
    background: #f0f0f0;
    color: #555;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
}
.tag-cloud__item:hover {
    background: var(--primary, #e63946);
    color: #fff;
}

/* Comments section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}
.comments-section__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.comment--reply {
    margin-left: 3rem;
}
.comment__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #666;
    flex-shrink: 0;
}
.comment__body {
    flex: 1;
}
.comment__header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}
.comment__author {
    font-weight: 600;
}
.comment__date {
    font-size: 0.8rem;
    color: #999;
}
.comment__content {
    color: #444;
    line-height: 1.5;
    font-size: 0.95rem;
}
.comment__reply-btn {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary, #e63946);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Comment form */
.comment-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}
.comment-form__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.comment-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary, #e63946);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
    transition: transform 0.2s;
}
.share-btn:hover {
    transform: scale(1.1);
}
.share-btn--facebook { background: #1877f2; }
.share-btn--twitter { background: #1da1f2; }
.share-btn--linkedin { background: #0077b5; }
.share-btn--copy { background: #666; }

/* Load more */
.load-more {
    text-align: center;
    margin-top: 2rem;
}
.load-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--primary, #e63946);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.load-more__btn:hover {
    background: #c0313e;
}
.load-more__btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.load-more__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.load-more__btn--loading .load-more__spinner {
    display: inline-block;
}

/* Breadcrumb */
.blog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 1.5rem;
}
.blog-breadcrumb a {
    color: #666;
    text-decoration: none;
}
.blog-breadcrumb a:hover {
    color: var(--primary, #e63946);
}
.blog-breadcrumb__sep {
    color: #ccc;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
}
.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    color: #333;
    background: #f0f0f0;
    transition: all 0.2s;
}
.blog-pagination a:hover {
    background: var(--primary, #e63946);
    color: #fff;
}
.blog-pagination .active {
    background: var(--primary, #e63946);
    color: #fff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .post-single__title {
        font-size: 1.6rem;
    }
    .featured-post {
        aspect-ratio: 16/9;
    }
    .featured-post__title {
        font-size: 1.3rem;
    }
    .comment--reply {
        margin-left: 1.5rem;
    }
    .comment-form__row {
        grid-template-columns: 1fr;
    }
    .author-box {
        flex-direction: column;
        text-align: center;
    }
}
