/* ==========================================================================
   Dr Khan Editorial — component styles
   Colors/type intentionally hardcoded here match theme.json 1:1 so this file
   stays readable without cross-referencing — update both if you rebrand.
   ========================================================================== */

/* ---- Reading progress bar ---- */
.dk-progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0%;
	background: linear-gradient(90deg, #2A9D8F, #52B788);
	z-index: 9999;
	transition: width 0.1s linear;
}

/* ---- Trust badges ---- */
.dk-trust-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-block: 6px 4px;
}
.dk-badge {
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 0.35em 0.85em;
	border-radius: 999px;
	background: #F8FAFC;
	color: #1F2937;
	border: 1px solid #E5EAF0;
}
.dk-badge--reviewed { color: #2A9D8F; border-color: #CDEAE6; background: #EAF6F4; }
.dk-badge--factchecked { color: #52B788; border-color: #D3EEDD; background: #EDF9F1; }
.dk-badge--updated { color: #6B7280; }
.dk-badge--evidence { color: #123B63; border-color: #DCE6EF; background: #EFF4F9; }

/* ---- Category grid ---- */
.dk-category-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
	margin-top: 32px;
}
.dk-category-card {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 92px;
	padding: 18px 12px;
	background: #FFFFFF;
	border: 1px solid #E5EAF0;
	border-radius: 10px;
	font-weight: 600;
	font-size: 0.95rem;
	color: #123B63;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dk-category-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px -8px rgba(18, 59, 99, 0.18);
	border-color: #2A9D8F;
}
@media (max-width: 900px) {
	.dk-category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
	.dk-category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Expert card ---- */
.dk-expert-card { width: 260px; text-align: center; }

/* ---- Article two-column layout (content + sticky TOC) ---- */
.dk-article-layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}
.dk-toc {
	position: sticky;
	top: 96px;
}
.dk-toc-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
	font-size: 0.875rem;
}
.dk-toc-list a {
	color: #6B7280;
	text-decoration: none;
	border-left: 2px solid transparent;
	padding-inline-start: 10px;
}
.dk-toc-list a:hover,
.dk-toc-list a.is-active {
	color: #123B63;
	border-inline-start-color: #2A9D8F;
}
.dk-article-main { min-width: 0; }

@media (max-width: 900px) {
	.dk-article-layout { grid-template-columns: 1fr; }
	.dk-toc {
		position: relative;
		top: 0;
		order: -1;
		border: 1px solid #E5EAF0;
		border-radius: 10px;
		padding: 14px 18px;
		background: #F8FAFC;
	}
	.dk-toc-list { display: none; }
	.dk-toc.is-open .dk-toc-list { display: flex; }
}

/* ---- Reading time ---- */
.dk-reading-time::before { content: "· "; }

/* ---- References ---- */
.dk-references {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid #E5EAF0;
}
.dk-reference-list { font-size: 0.9rem; color: #6B7280; }

/* ---- FAQ ---- */
.dk-faq { margin-top: 40px; }
.dk-faq .wp-block-details {
	border: 1px solid #E5EAF0;
	border-radius: 8px;
	padding: 14px 18px;
	margin-block: 10px;
}
.dk-faq summary { font-weight: 600; color: #123B63; cursor: pointer; }

/* ---- Newsletter form ---- */
.dk-newsletter-form {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 28px;
	flex-wrap: wrap;
}
.dk-newsletter-form input[type="email"] {
	padding: 0.85em 1.1em;
	border-radius: 8px;
	border: none;
	min-width: 280px;
	font-size: 0.95rem;
}
.dk-newsletter-form button {
	padding: 0.85em 1.6em;
	border-radius: 8px;
	border: none;
	background: #2A9D8F;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.dk-newsletter-form button:hover { background: #52B788; }

/* ---- Contact form ---- */
.dk-contact-form {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 16px;
}
.dk-contact-form label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #123B63;
	margin-top: 10px;
}
.dk-contact-form input,
.dk-contact-form textarea {
	padding: 0.75em 1em;
	border-radius: 8px;
	border: 1px solid #E5EAF0;
	font-family: inherit;
	font-size: 0.95rem;
}
.dk-contact-form button {
	align-self: flex-start;
	margin-top: 16px;
	padding: 0.8em 1.6em;
	border-radius: 8px;
	border: none;
	background: #123B63;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.dk-contact-form button:hover { background: #2A9D8F; }

/* ---- Focus visibility (accessibility floor) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid #2A9D8F;
	outline-offset: 2px;
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.dk-progress-bar,
	.dk-category-card {
		transition: none !important;
	}
}
