/**
 * Article Detail Page Styles
 * Matching the design from Figma/screenshot
 * Madagascar flag colors: White, Red (#ED2024), Green (#0E8040)
 */

/* ===========================
   Hero Meta Styles
   =========================== */
.article-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.article-hero-meta .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fff;
    backdrop-filter: blur(4px);
}

.article-hero-meta .meta-tag i {
    color: #fff;
}

.article-hero-meta .meta-divider {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

/* ===========================
   Main Layout
   =========================== */
.article-page-container {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    gap: 40px;
    padding: 0 20px;
    font-family: 'Roboto', 'Lato', sans-serif;
}

.article-main-content {
    flex: 2;
    min-width: 0;
}

.article-sidebar {
    flex: 0 0 350px;
    max-width: 350px;
}

/* ===========================
   Article Content
   =========================== */
.article-detail {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.article-main-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 25px;
    object-fit: cover;
}

.article-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.article-text p {
    margin-bottom: 20px;
}

.article-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* ===========================
   Comments Section
   =========================== */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #222;
}

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

.comment-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
}

.comment-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #0E8040;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 700;
    font-size: 1.05rem;
    color: #222;
}

.comment-date {
    color: #888;
    font-size: 0.85rem;
    margin-top: 2px;
}

.comment-text {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

.comment-reply-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.comment-reply-btn:hover {
    background: #0E8040;
    border-color: #0E8040;
    color: #fff;
}

/* ===========================
   Comment Form
   =========================== */
.comment-form-wrapper {
    margin-top: 40px;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.form-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #222;
}

.form-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 15px;
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #0E8040;
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 128, 64, 0.1);
}

.comment-form textarea {
    min-height: 130px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #555;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #0E8040;
}

.submit-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background-color: #0E8040;
}

/* ===========================
   Footer Actions
   =========================== */
.article-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.social-share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.share-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
    background-color: #ED2024;
}

.share-icon:hover {
    transform: translateY(-3px);
    background-color: #c61a1d;
    color: #fff;
}

.next-article-btn {
    background-color: #ED2024;
    color: #fff;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s, transform 0.2s;
}

.next-article-btn:hover {
    background-color: #c61a1d;
    color: #fff;
    transform: translateY(-2px);
}

/* ===========================
   Sidebar Widgets
   =========================== */
.sidebar-widget {
    background: #fff;
    border: 1px solid #eee;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* Widget Title with Flag Underline */
.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
    padding-bottom: 12px;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #FFFFFF 33.33%, #ED2024 33.33%, #ED2024 66.66%, #0E8040 66.66%);
    border-radius: 2px;
}

/* Search Widget */
.search-form {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 0.95rem;
    outline: none;
}

.search-btn {
    padding: 12px 18px;
    background: #0E8040;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background: #0a6a34;
}

/* Categories Widget */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.categories-list li:hover {
    background-color: #f0f9f4;
    border-left-color: #0E8040;
}

.categories-list a {
    display: block;
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.categories-list a:hover {
    color: #0E8040;
}

/* Recent News Widget */
.recent-news-item,
.featured-item {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
}

.recent-news-item:last-child,
.featured-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-news-thumb {
    width: 75px;
    height: 75px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.placeholder-thumb {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.recent-news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recent-news-date {
    font-size: 0.8rem;
    color: #ED2024;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.recent-news-date i {
    color: #ED2024;
}

.recent-news-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.recent-news-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s;
}

.recent-news-title a:hover {
    color: #0E8040;
}

/* Featured Articles Category Badge */
.featured-category {
    font-size: 0.8rem;
    color: #ED2024;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.featured-category i {
    color: #ED2024;
}

/* ===========================
   Responsive Styles
   =========================== */
@media (max-width: 992px) {
    .article-page-container {
        flex-direction: column;
        gap: 30px;
    }

    .article-sidebar {
        max-width: 100%;
        flex: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-detail {
        padding: 20px;
    }

    .article-hero-meta {
        gap: 10px;
    }

    .article-hero-meta .meta-tag {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .article-hero-meta .meta-divider {
        display: none;
    }

    .comment-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-header {
        flex-direction: column;
        gap: 10px;
    }

    .article-footer-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .social-share {
        justify-content: center;
    }

    .next-article-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .article-page-container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .sidebar-widget {
        padding: 20px;
    }

    .comments-title {
        font-size: 1.25rem;
    }

    .form-title {
        font-size: 1.2rem;
    }
}
