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

html, body {
    width: 100%;
    overflow-x: hidden; /* IMPORTANT FIX */
}

body {
    font-family: system-ui, sans-serif;
    background: #f5f7fb;
    color: #222;
}

/* =========================
   CONTAINER
========================= */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 15px;
}

/* ================= HEADER ================= */
.header {
    background: #232b4f;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo a {
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

.nav ul {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-link {
    color: #fff;
    text-decoration: none;
}

/* =========================
   BLOG GRID
========================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.blog-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* FIX CARD IMAGE */
.blog-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* =========================
   SINGLE POST FIX (IMPORTANT)
========================= */
.single {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 20px;
    overflow-wrap: break-word;
}

/* 🔥 CRITICAL FIX FOR BLOG IMAGES */
.single img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px 0;
}

/* fix content images inside editor */
.single p img {
    max-width: 100% !important;
    height: auto !important;
}

/* text safety */
.single p {
    line-height: 1.7;
    word-break: break-word;
}

/* =========================
   RELATED POSTS
========================= */
.related-posts {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* =========================
   SHARE BOX
========================= */
.share-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.share-box a {
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
}

.fb { background: #1877f2; }
.tw { background: #1da1f2; }
.wa { background: #25d366; }
.lk { background: #0a66c2; }

/* =========================
   COMMENTS
========================= */
.comments {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.comments input,
.comments textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.comments button {
    background: #1d4ed8;
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* =========================
   PAGINATION
========================= */
.pagination {
    text-align: center;
    margin: 40px 0;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    margin: 4px;
    background: #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
}

.pagination a.active {
    background: #1d4ed8;
    color: #fff;
}

/* =========================
   FOOTER
========================= */
.footer {
    background: #232b4f;
    color: #fff;
    padding: 25px;
    margin-top: 40px;
}

/* =========================
   MOBILE FIX
========================= */
@media (max-width: 600px) {

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

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

    .single {
        padding: 15px;
    }

}