/* ============================================================
   soodu.id — Blog (publik + editor admin)
   ============================================================ */
:root {
   --blog-green: #27b441;
   --blog-green-dark: #1d8f33;
   --blog-ink: #1f2933;
   --blog-muted: #6b7280;
   --blog-line: #e5e7eb;
   --blog-soft: #f3f8f4;
}

/* ---------- tata letak ---------- */
.blog-wrap { max-width: 1100px; margin: 0 auto 48px; padding: 0 16px; color: var(--blog-ink); }
.blog-wrap a { color: inherit; }
.blog-wrap h1, .blog-wrap h2, .blog-wrap h3 { font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--blog-ink); }

.blog-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px 0 12px; }
.blog-hero h1 { font-size: 2rem; margin: 0 0 4px; line-height: 1.2; }
.blog-hero p { margin: 0; color: var(--blog-muted); }

.blog-search { position: relative; flex: 0 1 300px; min-width: 220px; }
.blog-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--blog-muted); pointer-events: none; }
.blog-search input[type=search] { box-sizing: border-box; height: 42px; margin: 0; padding: 0 14px 0 40px; border: 1px solid var(--blog-line); border-radius: 21px; background: #fff; box-shadow: none; }
.blog-search input[type=search]:focus { border-color: var(--blog-green); box-shadow: 0 0 0 3px rgba(39,180,65,.15); }

.blog-cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; margin-bottom: 8px; scrollbar-width: none; }
.blog-cats::-webkit-scrollbar { display: none; }
.blog-cats a { flex: none; padding: 6px 14px; border-radius: 18px; background: #fff; border: 1px solid var(--blog-line); font-size: .9rem; white-space: nowrap; }
.blog-cats a span { color: var(--blog-muted); font-size: .8rem; margin-left: 2px; }
.blog-cats a.active { background: var(--blog-green); border-color: var(--blog-green); color: #fff; }
.blog-cats a.active span { color: rgba(255,255,255,.85); }

.blog-result-info { color: var(--blog-muted); margin: 0 0 16px; }
.blog-result-info a { color: var(--blog-green-dark); text-decoration: underline; }

.blog-cat-label { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blog-green-dark); margin-bottom: 6px; }
.blog-meta { display: block; font-size: .85rem; color: var(--blog-muted); }

/* ---------- artikel utama ---------- */
.blog-featured { display: grid; grid-template-columns: 1.35fr 1fr; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 24px; transition: box-shadow .2s; }
.blog-featured:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.blog-featured-img { aspect-ratio: 1.9 / 1; background: var(--blog-soft); }
.blog-featured-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-featured-body { padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.blog-featured-body h2 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 10px; }
.blog-featured-body p { color: #4b5563; margin: 0 0 12px; line-height: 1.6; }

/* ---------- kartu ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.blog-card { display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .2s, box-shadow .2s; }
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.blog-card-img { aspect-ratio: 1.9 / 1; background: var(--blog-soft); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-img { display: flex; align-items: center; justify-content: center; }
.no-img img.blog-logo-fallback { width: 40%; height: auto; object-fit: contain; opacity: .35; }
.blog-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.blog-card-body h3 { font-size: 1.1rem; line-height: 1.35; margin: 0 0 8px; }
.blog-card-body p { color: #4b5563; font-size: .92rem; line-height: 1.55; margin: 0 0 10px; flex: 1; }

.blog-empty { text-align: center; padding: 56px 16px; color: var(--blog-muted); background: #fff; border-radius: 12px; }
.blog-empty i { font-size: 48px; color: #c7d2cb; }

.blog-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
.blog-pager a { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--blog-line); background: #fff; }
.blog-pager a:hover { border-color: var(--blog-green); color: var(--blog-green-dark); }
.blog-pager-info { color: var(--blog-muted); font-size: .9rem; }

/* ---------- halaman artikel ---------- */
.blog-article { max-width: 740px; margin: 16px auto 0; background: #fff; border-radius: 14px; padding: 32px 40px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.blog-article header h1 { font-size: 2.1rem; line-height: 1.25; margin: 0 0 10px; }
.blog-article-cover { margin: 20px -40px 24px; }
.blog-article-cover img { width: 100%; display: block; }

.blog-content { font-size: 1.08rem; line-height: 1.8; color: #27303a; overflow-wrap: break-word; }
.blog-content p { margin: 0 0 1.1em; }
.blog-content h2 { font-size: 1.5rem; line-height: 1.35; margin: 1.6em 0 .6em; }
.blog-content h3 { font-size: 1.25rem; line-height: 1.4; margin: 1.4em 0 .5em; }
.blog-content a { color: var(--blog-green-dark); text-decoration: underline; }
.blog-content img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.2em auto; }
.blog-content ul, .blog-content ol { margin: 0 0 1.1em; padding-left: 1.6em; }
.blog-content ul li { list-style-type: disc; }
.blog-content ol li { list-style-type: decimal; }
.blog-content li { margin-bottom: .35em; }
.blog-content blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--blog-green); color: #4b5563; font-style: italic; }
.blog-content iframe.ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; margin: 1.2em 0; }
.blog-content .ql-align-center { text-align: center; }
.blog-content .ql-align-right { text-align: right; }
.blog-content .ql-align-justify { text-align: justify; }
.blog-content .ql-indent-1 { padding-left: 2em; } .blog-content .ql-indent-2 { padding-left: 4em; }
.blog-content pre { background: #f5f5f5; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: .9rem; }

.blog-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--blog-line); }
.blog-share span { color: var(--blog-muted); margin-right: 4px; }
.blog-share a, .blog-share button { padding: 6px 14px; border-radius: 18px; font-size: .88rem; font-weight: 600; border: 0; cursor: pointer; font-family: inherit; color: #fff !important; }
.blog-share .share-wa { background: #25d366; }
.blog-share .share-fb { background: #1877f2; }
.blog-share .share-x { background: #111; }
.blog-share .share-copy { background: #e5e7eb; color: var(--blog-ink) !important; }

.blog-cta { max-width: 740px; margin: 20px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--blog-soft); border: 1px solid #d4ecd9; border-radius: 14px; padding: 18px 22px; }
.blog-cta p { margin: 4px 0 0; color: #4b5563; }
.blog-cta .btn { background: var(--blog-green); flex: none; border-radius: 20px; }

.blog-related { margin-top: 40px; }
.blog-related h2 { font-size: 1.4rem; margin: 0 0 16px; }

.blog-preview-bar { display: flex; align-items: center; gap: 10px; max-width: 740px; margin: 16px auto 0; padding: 12px 16px; background: #fff7e6; border: 1px solid #f5c26b; border-radius: 10px; color: #7a4b00; }
.blog-preview-bar a { margin-left: auto; font-weight: 700; text-decoration: underline; }
.blog-admin-edit { max-width: 740px; margin: 12px auto 0; text-align: right; font-size: .9rem; }
.blog-admin-edit a { color: var(--blog-green-dark); }

@media (max-width: 992px) {
   .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
   .blog-featured { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
   .blog-hero h1 { font-size: 1.6rem; }
   .blog-search { flex-basis: 100%; }
   .blog-grid { grid-template-columns: 1fr; gap: 14px; }
   .blog-featured-body { padding: 16px; }
   .blog-featured-body h2 { font-size: 1.3rem; }
   .blog-article { padding: 20px 16px; border-radius: 0; margin-left: -16px; margin-right: -16px; box-shadow: none; }
   .blog-article header h1 { font-size: 1.6rem; }
   .blog-article-cover { margin: 16px -16px 20px; }
   .blog-content { font-size: 1.02rem; }
   .blog-cta { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Admin
   ============================================================ */
.blog-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.blog-tabs a { padding: 6px 12px; border-radius: 16px; background: #f1f1f1; color: #444; font-size: .9rem; }
.blog-tabs a.active { background: #616161; color: #fff; }
.blog-chip { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .8rem; font-weight: 600; color: #fff; }
.blog-chip.grey { background: #9e9e9e !important; }
.blog-chip.green { background: #27b441 !important; }
.blog-chip.orange { background: #f39c12 !important; }
.blog-thumb { width: 56px; height: 36px; object-fit: cover; border-radius: 4px; display: block; }
.blog-thumb-empty { background: #eee; display: flex; align-items: center; justify-content: center; color: #bbb; }
.blog-thumb-empty i { font-size: 18px; }
.blog-admin-table td { vertical-align: middle; }
.blog-empty-admin { text-align: center; padding: 40px 16px; color: #777; }
.blog-empty-admin i { font-size: 48px; color: #ccc; }
.blog-alert { background: #fdecea; color: #b3261e; border-radius: 6px; padding: 12px 16px; margin-bottom: 8px; }

.blog-editor-page .card-header { padding: 14px 20px; font-weight: 600; }
.blog-title-field { margin-top: 0; }
.blog-title-field input[type=text] { font-size: 1.6rem; font-weight: 700; height: auto; padding: 6px 0; }
.blog-slug { display: flex; align-items: center; font-size: .9rem; margin-bottom: 4px; }
.blog-slug input[type=text] { height: 28px; margin: 0; font-size: .9rem; border-bottom: 1px dashed #ccc; }
.blog-hint { font-size: .82rem; margin: 6px 0 0; }
#editor-toolbar { margin-top: 18px; border-radius: 6px 6px 0 0; background: #fafafa; }
#editor-toolbar select.ql-header, #editor-toolbar select.ql-align { display: none; }
#editor.blog-content { min-height: 380px; border-radius: 0 0 6px 6px; font-size: 1.02rem; }
#editor.blog-content .ql-editor { min-height: 380px; line-height: 1.75; }
#editor .ql-editor img { max-width: 100%; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before, .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: 'Paragraf'; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: 'Subjudul'; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: 'Subjudul kecil'; }
.ql-snow .ql-tooltip[data-mode=link]::before { content: 'Alamat link:'; }
.ql-snow .ql-tooltip[data-mode=video]::before { content: 'Link YouTube:'; }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: 'Simpan'; }
.ql-snow .ql-tooltip::before { content: 'Buka link:'; }
.ql-snow .ql-tooltip a.ql-action::after { content: 'Ubah'; }
.ql-snow .ql-tooltip a.ql-remove::before { content: 'Hapus'; }
.ql-snow .ql-tooltip input[type=text] { height: 26px; margin: 0; }
.blog-field { margin-top: 16px; }
.blog-field label { font-size: .85rem; color: #555; }
.blog-field input[type=datetime-local] { margin-bottom: 2px; }
.blog-field .helper-text, .blog-editor-page .helper-text { display: block; font-size: .8rem; color: #888; }
.blog-editor-page .helper-text.red-text { color: #e53935 !important; }
.blog-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.blog-actions-secondary { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid #eee; font-size: .9rem; }
.blog-actions-secondary i { vertical-align: middle; }
.blog-cover-preview { border-radius: 6px; margin-bottom: 4px; }
