/* -------------------------------------------------
   PANEN138 – Final Unified CSS
   Fully matches your HTML (index, category, post)
   ------------------------------------------------- */

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6f7;
    color: #111;
    line-height: 1.65;
}

/* -------------------------------------------------
   Header
   ------------------------------------------------- */
.header {
    width: 100%;
    background: #111827;
    color: #fff;
    padding: 18px 12px;
}

.header .logo a {
    color: #fff;
    font-size: 24px;
    text-decoration: none;
    font-weight: 700;
}

/* Navigation */
.main-nav {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.main-nav a {
    padding: 4px 10px;
    color: #e5e7eb;
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.18);
}

/* -------------------------------------------------
   Layout
   ------------------------------------------------- */
.container {
    max-width: 1180px;
    margin: 20px auto;
    padding: 0 12px;
}

.homepage {
    display: grid;
    grid-template-columns: 3fr 1.2fr;
    gap: 24px;
}

.category-page,
.post-page {
    display: grid;
    grid-template-columns: 3fr 1.2fr;
    gap: 24px;
}

/* -------------------------------------------------
   Article Content
   ------------------------------------------------- */
.article-content h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
}

.article-content h2 {
    margin-top: 22px;
    font-size: 22px;
    font-weight: 700;
}

.article-content h3 {
    margin-top: 18px;
    font-size: 18px;
    font-weight: 700;
}

.article-content p {
    margin: 12px 0;
    font-size: 16px;
}

/* -------------------------------------------------
   Latest Section
   ------------------------------------------------- */
.home-latest h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.articles {
    list-style: none;
}

.articles li {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.articles li:last-child {
    border-bottom: none;
}

.articles a {
    text-decoration: none;
    color: #111;
    font-size: 16px;
    font-weight: 600;
}

.articles a:hover {
    color: #2563eb;
}

/* -------------------------------------------------
   Sidebar
   ------------------------------------------------- */
.sidebar h3 {
    font-size: 20px;
    margin-bottom: 14px;
}

.categories {
    display: flex;
    flex-direction: column;
}

.categories a {
    text-decoration: none;
    color: #111;
    padding: 6px 0;
}

.categories a:hover {
    color: #2563eb;
}

/* -------------------------------------------------
   Category Page (title + pagination)
   ------------------------------------------------- */
.cat-list h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
}

.pagination {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #111;
    text-decoration: none;
    font-size: 14px;
}

.pagination a:hover {
    background: #2563eb;
    color: white;
}

.pagination .active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

/* -------------------------------------------------
   Post Page
   ------------------------------------------------- */
.post-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

.post-meta {
    background: #e5e7eb;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-block;
    margin-bottom: 20px;
}

.placeholder-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #111827, #1f2937);
    border-radius: 10px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Related posts */
.related h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* -------------------------------------------------
   Ad Blocks
   ------------------------------------------------- */
.ad-block {
    width: 100%;
    background: repeating-linear-gradient(
        45deg,
        #f3f4f6,
        #f3f4f6 10px,
        #e5e7eb 10px,
        #e5e7eb 20px
    );
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* -------------------------------------------------
   Footer
   ------------------------------------------------- */
.footer {
    background: #111827;
    color: #fff;
    padding: 20px 12px;
    margin-top: 30px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-nav a {
    color: #e5e7eb;
    text-decoration: none;
    background: rgba(255,255,255,0.06);
    padding: 4px 10px;
    border-radius: 6px;
}

.footer-nav a:hover {
    background: rgba(255,255,255,0.18);
}

/* -------------------------------------------------
   Mobile
   ------------------------------------------------- */
@media (max-width: 900px) {
    .homepage,
    .category-page,
    .post-page {
        grid-template-columns: 1fr;
    }

    .main-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}
