* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #222;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: #0056b3;
}

.container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 14px;
}

/* HEADER */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
}

.top-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand-left {
    min-width: 0;
}

.brand-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.5;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* NAV */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.main-nav a {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-weight: 600;
    color: #374151;
}

.main-nav a:hover,
.main-nav a.nav-highlight {
    background: #0d4f8b;
    color: #fff;
}

/* Contact full width */


.main-nav a.active,
.main-nav a:hover {
    background: #0d4f8b;
    color: #fff;
    border-color: #0d4f8b;
}

.main-nav a:last-child {
    grid-column: 1 / -1;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #0d4f8b;
    color: #fff;
}

.btn-outline {
    border: 1px solid #0d4f8b;
    color: #0d4f8b;
    background: transparent;
}

/* FOOTER */
.site-footer {
    margin-top: 60px;
    background: #111827;
    color: #fff;
    padding: 40px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.footer-links {
    list-style: none;
    margin-top: 10px;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #dbeafe;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 24px;
    padding-top: 16px;
    font-size: 14px;
    color: #d1d5db;
}

/* ADMIN */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #111827;
    color: white;
    padding: 20px;
}

.admin-brand h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.admin-brand p {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.admin-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-menu a {
    color: #e5e7eb;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    transition: 0.2s;
}

.admin-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.admin-content {
    flex: 1;
    padding: 24px;
}

.page-title {
    margin-bottom: 20px;
    font-size: 26px;
    line-height: 1.3;
}

/* CARDS */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}

/* GRID */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-box {
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}

.stat-box h3 {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 8px;
}

.stat-box p {
    font-size: 24px;
    font-weight: bold;
    color: #111;
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

table th,
table td {
    padding: 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

table th {
    background: #f3f4f6;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

/* FORM */
form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
}

form input,
form select,
form textarea,
form button {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    margin-bottom: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
}

form textarea {
    resize: vertical;
}

form button {
    background: #0d4f8b;
    color: white;
    border: none;
    cursor: pointer;
}

form button:hover {
    opacity: 0.95;
}

/* ALERTS */
.alert-success {
    padding: 12px;
    background: #dcfce7;
    color: #166534;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-error {
    padding: 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* POST PAGE */
.post-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.post-title {
    font-size: 22px;
    line-height: 1.4;
    margin-bottom: 15px;
    color: #111827;
    word-break: break-word;
}

.post-image-wrap {
    margin-bottom: 15px;
}

.post-image {
    width: 100%;
    border-radius: 10px;
}

.post-summary {
    font-size: 17px;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.8;
}

.post-content {
    margin-bottom: 20px;
    font-size: 17px;
    line-height: 1.9;
    color: #333;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content p {
    margin-bottom: 16px;
}

.post-links p {
    margin-bottom: 10px;
}

.vote-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.vote-form button {
    width: auto;
    min-width: 140px;
    margin-bottom: 0;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.comment-date {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
}

.related-list {
    padding-left: 20px;
}

.related-list li {
    margin-bottom: 8px;
}

/* TABLET */
@media (max-width: 992px) {
    .grid-4,
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }

    .container {
        max-width: 760px;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .top-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .top-actions,
    .user-menu {
        width: 100%;
        justify-content: flex-start;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-tagline {
        font-size: 14px;
    }

@media (max-width: 768px) {

    .main-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-nav a {
        flex: 1 1 48%;
        min-height: 46px;
        font-size: 14px;
        padding: 10px;
    }

    .main-nav a:last-child {
        flex: 1 1 100%;
    }
}

    .main-nav a {
        min-height: 46px;
        font-size: 14px;
        padding: 10px;
    }

    .main-nav a:last-child {
        grid-column: 1 / -1;
    }

    .grid-4,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 14px;
    }

    .card {
        padding: 16px;
        border-radius: 14px;
    }

    .page-title {
        font-size: 22px;
    }

    .post-title {
        font-size: 20px;
        line-height: 1.45;
    }

    .post-meta {
        font-size: 12px;
    }

    .post-summary {
        font-size: 15px;
        line-height: 1.75;
    }

    .post-content {
        font-size: 16px;
        line-height: 1.85;
    }

    .vote-form {
        flex-direction: column;
    }

    .vote-form button {
        width: 100%;
    }

    table {
        min-width: 900px;
    }
}

/* EXTRA SMALL */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .brand-title {
        font-size: 22px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .page-title {
        font-size: 20px;
    }

    .card {
        padding: 14px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-summary {
        font-size: 14px;
    }

    .post-content {
        font-size: 15px;
        line-height: 1.8;
    }

    table th,
    table td {
        padding: 10px;
    }

    form input,
    form select,
    form textarea,
    form button {
        font-size: 14px;
    }
}