/**
 * OpenNewser – Professional Article Page Stylesheet
 * Optimized for readability, Malayalam typography, fast rendering, and responsiveness.
 */

/* Import Malayalam font with font-display: swap for non-blocking rendering */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap');

/* --- Reset & Layout Base --- */
.article-page-wrap {
    margin-top: 20px;
    margin-bottom: 40px;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.article-main-container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.article-grid {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.article-col-main {
    flex: 0 0 70%;
    max-width: 70%;
    padding-left: 15px;
    padding-right: 15px;
}

.article-col-sidebar {
    flex: 0 0 30%;
    max-width: 30%;
    padding-left: 15px;
    padding-right: 15px;
}

/* --- Article Header & Hierarchy --- */
.article-header {
    margin-bottom: 20px;
}

.article-cat-badge {
    display: inline-block;
    background: #ca2720;
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.article-cat-badge:hover {
    background: #b91c1c;
    color: #ffffff !important;
}

.article-headline {
    font-family: 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 34px;
    line-height: 1.38;
    font-weight: 700;
    color: #0f172a;
    margin: 14px 0 16px 0;
    word-break: break-word;
    letter-spacing: -0.2px;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 10px 0 14px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #64748b;
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta-item svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.article-author-name {
    font-weight: 600;
    color: #334155;
}

/* --- Social Share Bar --- */
.article-share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 20px 0;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease, transform 0.15s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #ffffff !important;
}

.share-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.share-btn-whatsapp { background-color: #25D366; }
.share-btn-facebook { background-color: #1877F2; }
.share-btn-twitter  { background-color: #0f1419; }
.share-btn-telegram { background-color: #229ED9; }
.share-btn-copy     { background-color: #475569; }

/* --- Hero Featured Image --- */
.article-featured-img-wrap {
    width: 100%;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8fafc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.article-featured-img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

/* --- Article Content Typography --- */
.article-body-content {
    font-family: 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 18.5px;
    line-height: 1.88;
    color: #1e293b;
    font-weight: 600;
    word-break: break-word;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.article-body-content p {
    margin-bottom: 22px;
    color: #1e293b;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.article-body-content strong,
.article-body-content b {
    font-weight: 700;
    color: #0f172a;
}

.article-body-content h2,
.article-body-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 30px 0 16px 0;
    line-height: 1.4;
}

.article-body-content blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    background-color: #f8fafc;
    border-left: 4px solid #ca2720;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #334155;
    font-size: 18px;
}

.article-body-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px;
    margin: 18px auto;
    display: block;
}

/* --- Facebook Video Embed --- */
.article-video-box {
    margin: 34px 0 26px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.article-video-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}

.article-video-title svg {
    width: 20px;
    height: 20px;
    fill: #1877F2;
}

.article-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: #000000;
}

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

/* --- Tags --- */
.article-tags-wrap {
    margin: 24px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.article-tag-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.article-tag-pill {
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.article-tag-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* --- Banner Advertisement --- */
.article-banner-ad {
    margin: 30px 0;
    text-align: center;
}

.article-banner-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* --- Comments Section --- */
.article-comments-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.article-comments-heading {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid #ca2720;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.article-comments-notice {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 20px;
}

.comment-form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.comment-input-col {
    flex: 1;
}

.comment-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.comment-form-input:focus {
    border-color: #ca2720;
    outline: none;
    box-shadow: 0 0 0 3px rgba(202, 39, 32, 0.12);
}

.comment-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    min-height: 90px;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.comment-form-textarea:focus {
    border-color: #ca2720;
    outline: none;
    box-shadow: 0 0 0 3px rgba(202, 39, 32, 0.12);
}

.comment-submit-btn {
    background: #ca2720;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-submit-btn:hover {
    background: #b91c1c;
}

.comment-item {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.comment-author {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 8px;
    font-weight: normal;
}

.comment-body {
    margin-top: 6px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #334155;
}

/* --- Right Sidebar: Dynamic Category News --- */
.category-sidebar-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.category-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #ca2720;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.category-sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.category-sidebar-title a {
    color: #0f172a;
    text-decoration: none;
}

.category-sidebar-badge {
    background: #fee2e2;
    color: #ca2720;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

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

.category-sidebar-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none !important;
    transition: background 0.15s ease;
}

.category-sidebar-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-sidebar-thumb-wrap {
    flex: 0 0 84px;
    width: 84px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
}

.category-sidebar-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.category-sidebar-item:hover .category-sidebar-thumb {
    transform: scale(1.06);
}

.category-sidebar-info {
    flex: 1;
    min-width: 0;
}

.category-sidebar-headline {
    font-family: 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.45;
    color: #1e293b;
    margin: 0 0 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.category-sidebar-item:hover .category-sidebar-headline {
    color: #ca2720;
}

.category-sidebar-time {
    font-size: 12px;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-sidebar-time svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* --- Responsive Media Queries --- */
@media (max-width: 991px) {
    .article-col-main {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .article-col-sidebar {
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 24px;
    }

    .article-headline {
        font-size: 27px;
        line-height: 1.36;
    }

    .article-body-content {
        font-size: 17.5px;
        line-height: 1.82;
    }

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

@media (max-width: 600px) {
    .article-headline {
        font-size: 24px;
        line-height: 1.35;
    }

    .article-body-content {
        font-size: 17px;
        line-height: 1.8;
    }

    .article-share-bar {
        gap: 6px;
    }

    .share-btn {
        padding: 6px 11px;
        font-size: 12px;
    }

    .share-btn-text {
        display: none;
    }

    .category-sidebar-thumb-wrap {
        flex: 0 0 76px;
        width: 76px;
        height: 54px;
    }

    .category-sidebar-headline {
        font-size: 13.5px;
    }
}

