/* =============================================
   Blog Sederhana - Style CSS
   ============================================= */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* ---- Header ---- */
.site-header {
    background: #2c3e50;
    color: #fff;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.site-nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin-left: 16px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.site-nav a:hover {
    color: #3498db;
}

/* ---- Main Content ---- */
.main-content {
    padding: 30px 20px;
    min-height: calc(100vh - 130px);
}

/* ---- Footer ---- */
.site-footer {
    background: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 16px 0;
    font-size: 0.9rem;
}

/* ---- Alert / Flash ---- */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* ---- Card ---- */
.card {
    background: #fff;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ---- Judul Halaman ---- */
.page-title {
    font-size: 1.6rem;
    margin-bottom: 24px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

/* ---- Form ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.82rem;
    color: #888;
    margin-top: 4px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
    line-height: 1;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ---- Post List (Index) ---- */
.post-list {
    list-style: none;
}

.post-item {
    background: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border-left: 4px solid #3498db;
}

.post-item h2 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.post-item h2 a {
    color: #2c3e50;
    text-decoration: none;
}

.post-item h2 a:hover {
    color: #3498db;
}

.post-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}

.post-excerpt {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.read-more {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* ---- Detail Artikel ---- */
.post-detail {
    background: #fff;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.post-detail h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-detail .post-meta {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.post-content {
    line-height: 1.8;
    color: #444;
}

.post-content p { margin-bottom: 16px; }
.post-content h2, .post-content h3 { margin: 24px 0 10px; color: #2c3e50; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 16px; }
.post-content img { max-width: 100%; height: auto; border-radius: 4px; }
.post-content blockquote {
    border-left: 4px solid #3498db;
    padding: 12px 20px;
    margin: 20px 0;
    background: #f0f7fd;
    color: #555;
    border-radius: 0 4px 4px 0;
}

/* ---- Comments ---- */
.comments-section {
    margin-top: 40px;
}

.comments-section h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.comment-item {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.comment-author {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #999;
    margin-left: 8px;
}

.comment-text {
    margin-top: 8px;
    color: #444;
    line-height: 1.6;
}

.comment-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-top: 24px;
}

.comment-form h4 {
    margin-bottom: 14px;
    color: #2c3e50;
}

/* ---- Auth Forms (Login & Register) ---- */
.auth-wrapper {
    max-width: 440px;
    margin: 0 auto;
}

.auth-wrapper .card {
    padding: 32px;
}

.auth-wrapper .page-title {
    text-align: center;
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: #666;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

/* ---- Admin Table ---- */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: #2c3e50;
    color: #fff;
}

thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f5f9fd;
}

tbody td {
    padding: 11px 14px;
    color: #444;
    vertical-align: middle;
}

.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ---- Dashboard Stats ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-top: 4px solid #3498db;
}

.stat-card.green { border-top-color: #28a745; }
.stat-card.orange { border-top-color: #fd7e14; }

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    margin-top: 4px;
}

/* ---- CKEditor Wrapper ---- */
.ck-editor__editable {
    min-height: 350px;
}

/* ---- No Posts / Empty ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* ---- Pagination (simple) ---- */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 30px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    font-size: 0.9rem;
}

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

.pagination a:hover {
    background: #f0f7fd;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav a {
        margin-left: 0;
        margin-right: 12px;
    }

    .post-detail h1 {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.85rem;
    }
}

/* =============================================
   MOBILE FULL WIDTH — Override .container
   Khusus untuk halaman detail artikel
   ============================================= */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
        margin-left: 0;
        margin-right: 0;
    }

    .dt-main-wrapper .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    body {
        overflow-x: hidden;
    }
}