/* Blog & community — loaded on blog, profile, auth and dashboard pages. */

.muted { color: var(--muted); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

.avatar-img { border-radius: 10px; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; }
.avatar-initial { display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .9em; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge--live { background: #e5f6ec; color: #116936; border-color: #b7e4c7; }
@media (prefers-color-scheme: dark) { .badge--live { background: #12301f; color: #7ddc9f; border-color: #1e5233; } }

/* Blog index */
.blog-head { padding: 72px 0 0; }
.blog-head h1 { max-width: 760px; }
.blog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 32px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chips a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; font-weight: 500; }
.cat-chips a:hover { text-decoration: none; color: var(--text); }
.cat-chips a.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post-cover { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-cover img { transform: scale(1.03); }
.post-cover-empty { display: grid; place-items: center; height: 100%; color: var(--muted); opacity: .5; }
.post-cover { position: relative; }
.post-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.post-badge {
	padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	background: rgba(255, 255, 255, .92); color: #2e4059; box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.post-badge--new { background: #f5a623; color: #1f1400; }

.section-head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; max-width: none; }
.section-head--row h2 { margin-bottom: 0; }

/* Share bar */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 32px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prose + .share { margin: 40px 0 0; }
.share-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font: inherit; font-size: .85rem; font-weight: 600;
	border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
}
.share-btn:hover { text-decoration: none; border-color: var(--accent); }
.share-facebook svg { color: #1877f2; }
.share-linkedin svg { color: #0a66c2; }
.share-whatsapp svg { color: #25d366; }
@media (max-width: 640px) { .share-btn span { display: none; } .share-native span { display: inline; } }

.post-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.post-body h3 { margin: 6px 0 8px; }
.post-body h3 a { color: var(--text); }
.post-body > p { color: var(--muted); font-size: .95rem; }
.post-cat { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.byline { display: flex; align-items: center; gap: 10px; font-size: .9rem; margin-top: auto; }
.byline a { color: var(--text); }

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.pagination .page-numbers.current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.empty { text-align: center; padding: 56px 28px; }
.empty h2 { font-size: 1.4rem; }

/* Article */
.article { padding: 56px 0 96px; }
.article-wrap { max-width: 800px; }
.article-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 10px 0 20px; }
.article-head .byline { margin: 0 0 32px; }
.article-cover { margin: 0 0 40px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.prose { font-size: 1.08rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.5em; }
.prose img { border-radius: 10px; border: 1px solid var(--line); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: .9rem; line-height: 1.5; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose figure { margin: 2em 0; }
.prose figure a { display: block; text-decoration: none; }
.prose figcaption { font-size: .88rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.prose blockquote strong { color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.5; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.prose td:first-child { font-weight: 500; }
.prose td code { white-space: nowrap; }
.prose ol li, .prose ul li { margin-bottom: .4em; }
.author-box { display: flex; gap: 18px; align-items: flex-start; margin: 56px 0 0; }
.author-box h3 { margin: 2px 0 6px; }
.author-box h3 a { color: var(--text); }

/* Comments */
.comments { margin-top: 56px; }
.comments h2 { font-size: 1.35rem; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { margin-left: 28px; border-left: 2px solid var(--line); padding-left: 20px; }
.comment-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.comment-head .comment-author { font-weight: 600; color: var(--text); display: block; }
.comment-head .muted { font-size: .85rem; }
.comment-text p { margin: 0 0 .6em; }
.comment-reply a { font-size: .88rem; font-weight: 600; }
.comment-form { margin-top: 28px; }
.comment-form .comment-reply-title { font-size: 1.15rem; margin: 0; }
.comment-form .form-submit { margin: 0; }
.login-to-comment { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.login-to-comment p { margin: 0 auto 0 0; }

/* Join / login */
.auth { padding: 72px 0 96px; }
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; gap: 28px; } }
.auth-card { max-width: 480px; width: 100%; }
.auth-card h2 { font-size: 1.4rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--muted); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.resend { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Dashboard */
.dash { padding: 48px 0 96px; }
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.dash-user { display: flex; align-items: center; gap: 14px; font-size: .92rem; }
.dash-user h1 { font-size: 1.5rem; margin: 0 0 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }
.table-card { padding: 0; overflow: hidden; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.dash-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dash-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .actions { white-space: nowrap; text-align: right; }
.dash-table .actions a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: .85rem; }
.dash-table .actions a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dash-table .actions a.danger:hover { color: var(--danger); }
@media (max-width: 760px) {
	.dash-table thead { display: none; }
	.dash-table tr { display: block; padding: 14px 18px; border-bottom: 1px solid var(--line); }
	.dash-table td { display: flex; justify-content: space-between; padding: 4px 0; border: 0; }
	.dash-table td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
	.dash-table .actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 10px; }
	.dash-table .actions::before { display: none; }
}
.editor-form { max-width: 900px; }
.editor-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.editor-label label:first-child { margin: 0; }
.insert-image { cursor: pointer; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cover-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.cover-preview img { width: 180px; border-radius: 8px; border: 1px solid var(--line); }
.field select { appearance: auto; }
.wp-editor-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wp-editor-wrap .mce-tinymce { box-shadow: none !important; border: 0 !important; }
.avatar-row { display: flex; gap: 20px; align-items: center; }
.card-title { font-size: 1.15rem; }
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person-info { flex: 1; display: flex; flex-direction: column; font-size: .92rem; }
.person-info a { color: var(--text); }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Legal pages */
.legal { padding: 56px 0 96px; }
.legal-wrap { max-width: 800px; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.legal h2 { font-size: 1.2rem; margin-top: 2em; }
.legal-note { color: var(--muted); font-size: .92rem; }
.legal-todo { background: #fff3cd; color: #7a4d00; padding: 1px 6px; border-radius: 4px; font-size: .9em; }

/* Delete account */
.danger-zone { margin-top: 24px; }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.danger-zone[open] summary { margin-bottom: 16px; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Profile */
.profile-head { padding: 64px 0 0; }
.profile-card { display: flex; gap: 28px; align-items: flex-start; }
@media (max-width: 640px) { .profile-card { flex-direction: column; gap: 16px; } }
.profile-info h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 6px; }
.profile-bio { max-width: 680px; margin: 16px 0 0; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }

/* Tags: coloured pills, same colour per tag */
.htags { display: flex; flex-wrap: wrap; gap: 6px; }
.htag {
	--tag-bg: #eef1f5; --tag-fg: #2e4059; --tag-line: #d8dee8;
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
	font: inherit; font-size: .82rem; font-weight: 600; line-height: 1.4;
	background: var(--tag-bg); color: var(--tag-fg); border: 1px solid var(--tag-line); cursor: pointer;
}
.htag a { color: inherit; }
a.htag:hover, .htag a:hover, button.htag:hover { text-decoration: none; filter: brightness(.96); }
.htag.is-active { outline: 2px solid var(--tag-fg); outline-offset: 1px; }
.htag--green  { --tag-bg: #e6f6ec; --tag-fg: #146c37; --tag-line: #bfe6cd; }
.htag--yellow { --tag-bg: #fff5d6; --tag-fg: #7a5600; --tag-line: #f3dc93; }
.htag--blue   { --tag-bg: #e7f0fd; --tag-fg: #1f4f9a; --tag-line: #c3d7f6; }
.htag--violet { --tag-bg: #f1ebfd; --tag-fg: #5b34a6; --tag-line: #dacdf7; }
.htag--teal   { --tag-bg: #e2f6f5; --tag-fg: #0f6662; --tag-line: #b7e5e2; }
.htag--rose   { --tag-bg: #fdebef; --tag-fg: #9c2547; --tag-line: #f5c9d4; }
@media (prefers-color-scheme: dark) {
	.htag         { --tag-bg: #1d2735; --tag-fg: #b8c8e0; --tag-line: #2c394d; }
	.htag--green  { --tag-bg: #12301f; --tag-fg: #7ddc9f; --tag-line: #1e5233; }
	.htag--yellow { --tag-bg: #33290d; --tag-fg: #f5cf6b; --tag-line: #5c4a13; }
	.htag--blue   { --tag-bg: #142640; --tag-fg: #8fb8f5; --tag-line: #23406b; }
	.htag--violet { --tag-bg: #251a3d; --tag-fg: #c2a8f5; --tag-line: #3d2c66; }
	.htag--teal   { --tag-bg: #0f2e2d; --tag-fg: #78d8d2; --tag-line: #1b4d4b; }
	.htag--rose   { --tag-bg: #3a1621; --tag-fg: #f5a3b8; --tag-line: #612536; }
}
.htags--small .htag { font-size: .74rem; padding: 2px 9px; }
.post-body .htags--small { margin: 12px 0 16px; }
.article-tags { margin: -12px 0 32px; }
.blog-tags { margin-top: 14px; }

/* References at the end of a post */
.references { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.references h2 { font-size: 1.2rem; }
.references ol { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.references li a { font-weight: 500; word-break: break-word; }
.references li .muted { font-size: .85rem; margin-left: 6px; }
.references + .share { margin-top: 40px; }
