/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================= BASE ================= */
body {
    font-family: 'Segoe UI', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* ================= NAVBAR ================= */
.navbar {
    background: linear-gradient(135deg, #dc3545, #c82333);
    position: sticky;
    top: 0;
    z-index: 2000;
    padding: 0.5rem 0;
}

.navbar-container {
    max-width: 1200px;
    margin: auto;
    padding: 0 1rem 0 70px;
    /* space for hamburger */
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ================= HAMBURGER ================= */
.hamburger-menu {
    position: fixed;
    top: 18px;
    left: 20px;
    width: 28px;
    height: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 3000;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    background: #fff;
    border-radius: 3px;
}

/* ================= BRAND ================= */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand h1 {
    color: white;
    font-size: 1.6rem;
    white-space: nowrap;
}

.logo {
    height: 50px;
    width: auto;
}

/* ================= DESKTOP MENU ================= */
.navbar-links-container {
    margin-left: auto;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: #ffc107;
}

/* ================= SEARCH ================= */
.search-form {
    margin-left: 1rem;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    outline: none;
}

.search-btn {
    background: #ffc107;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* ================= MOBILE SIDEBAR ================= */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease;
    z-index: 2500;
}

.mobile-sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
}

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

.sidebar-menu a {
    display: block;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-menu a:hover {
    background: #f1f1f1;
}

.close-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ================= ARTICLES GRID ================= */
.articles-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.category-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.article-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-body {
    padding: 1rem;
}

.article-category-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 5px;
    margin-bottom: 5px;
    text-decoration: none;
}

.article-title a {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0.3rem 0;
    color: #222;
    text-decoration: none;
    transition: color 0.3s;
}

.article-title a:hover {
    color: #dc3545;
}

.article-summary {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #777;
    flex-wrap: wrap;
}

.read-more-btn {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.read-more-btn:hover {
    background: #c82333;
}

/* ================= PAGINATION ================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    color: #333;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
    border: 1px solid #ddd;
}

.page-link:hover {
    background: #dc3545;
    color: white;
}

.page-link.current {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* ================= EMPTY STATE ================= */
.no-articles {
    text-align: center;
    padding: 3rem;
    color: #555;
}

.no-articles .empty-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.btn-back-home {
    display: inline-block;
    margin-top: 1rem;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border-radius: 5px;
    text-decoration: none;
}

.btn-back-home:hover {
    background: #c82333;
}

/* ================= FOOTER ================= */
.footer {
    background: #222;
    color: white;
    padding: 2rem 0;
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.3rem;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
}

.footer-section ul li a:hover {
    color: #ffc107;
}

.social-links a {
    font-size: 1.4rem;
    margin-right: 10px;
    color: white;
}

/* ================= ARTICLE DETAIL PAGE ================= */

.article-detail-container {
    max-width: 850px;
    margin: 2rem auto;
    background: #ffffff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Title */
.article-detail-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    color: #222;
}

/* Meta info */
.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1.5rem;
}

.article-detail-meta i {
    margin-right: 4px;
    color: #dc3545;
}

/* Featured image */
.article-detail-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Article body (TinyMCE content) */
.article-detail-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

/* Paragraph spacing */
.article-detail-content p {
    margin-bottom: 1rem;
}

/* Headings inside article */
.article-detail-content h2,
.article-detail-content h3,
.article-detail-content h4 {
    margin: 1.8rem 0 0.8rem;
    font-weight: 600;
    color: #222;
}

/* Lists */
.article-detail-content ul,
.article-detail-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Images inside content */
.article-detail-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 8px;
}

/* Blockquotes */
.article-detail-content blockquote {
    border-left: 4px solid #dc3545;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
    background: #f9f9f9;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .article-detail-container {
        padding: 1.2rem;
        margin: 1rem;
    }

    .article-detail-title {
        font-size: 1.7rem;
    }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {

    .navbar-menu,
    .search-form {
        display: none;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .navbar-container {
        padding-left: 50px;
    }
}

/* ================= FORCE ARTICLE IMAGE STANDARD SIZE ================= */

/* Wrapper of article body */
.article-detail-content,
.article-body-content {
    max-width: 100%;
}

/* FORCE all images inside article content */
.article-detail-content img,
.article-body-content img {
    width: 100% !important;
    /* override inline width */
    max-width: 700px !important;
    /* STANDARD width */
    height: auto !important;
    /* keep aspect ratio */
    display: block !important;
    margin: 1.5rem auto !important;
    /* center image */
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* Prevent very tall images */
.article-detail-content img {
    max-height: 420px;
    object-fit: contain;
    /* IMPORTANT: prevents stretching */
}

/* Mobile optimization */
@media (max-width: 768px) {

    .article-detail-content img,
    .article-body-content img {
        max-width: 100% !important;
        max-height: 300px;
    }
}

/* ================= CLEAN ARTICLE PAGE ================= */

.article-page-wrapper {
    max-width: 820px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    background: #fff;
}

/* Title */
.article-page-title {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    color: #222;
}

/* Meta */
.article-page-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Image */
.article-page-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    display: block;
    margin: 0 auto 2rem;
    border-radius: 8px;
}

/* Content */
.article-page-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

/* FORCE TinyMCE images inside content */
.article-page-content img {
    width: 100% !important;
    max-width: 700px !important;
    height: auto !important;
    display: block;
    margin: 1.5rem auto;
    object-fit: contain;
    border-radius: 6px;
}

/* Back link */
.article-page-back {
    margin-top: 3rem;
    text-align: center;
}

.article-page-back a {
    text-decoration: none;
    font-weight: 600;
    color: #dc3545;
}

.article-page-back a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    .article-page-title {
        font-size: 1.6rem;
    }

    .article-page-image img {
        max-height: 300px;
    }
}

/* ================= SUGGESTED ARTICLES ================= */

.suggested-articles {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.suggested-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #222;
}

/* Grid */
.suggested-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Card */
.suggested-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.suggested-card:hover {
    transform: translateY(-4px);
}

/* Image */
.suggested-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    /* 🔥 fixes oversized images */
    display: block;
}

/* Body */
.suggested-body {
    padding: 0.8rem;
}

.suggested-body h4 {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.suggested-body a {
    text-decoration: none;
    color: #222;
}

.suggested-body a:hover {
    color: #dc3545;
}

.suggested-date {
    font-size: 0.8rem;
    color: #777;
}

/* ================= MOBILE IMPROVEMENTS ================= */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .navbar-container {
        padding: 0 1rem;
        justify-content: space-between;
    }

    .navbar-brand h1 {
        font-size: 1.2rem;
        white-space: normal;
        line-height: 1.1;
    }

    .logo {
        height: 40px;
    }

    .header-with-logo {
        flex-direction: column;
        gap: 8px;
    }

    .header-logo {
        height: 100px;
    }

    .search-input {
        width: 140px;
    }

    .mobile-sidebar {
        width: 80%;
        left: -80%;
    }

    .hamburger-menu {
        left: 14px;
        top: 12px;
    }

    .footer-content {
        padding: 0 1rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
    }

    .article-detail-container,
    .article-page-wrapper,
    .articles-container {
        margin: 1rem;
        padding: 0.8rem;
    }

    .article-image,
    .article-detail-image,
    .suggested-card img {
        height: auto;
        max-height: 300px;
    }

    .read-more-btn {
        padding: 8px 10px;
        font-size: 0.95rem;
    }
}