/* Blog Design SOS
   Scoped to .bdsos so it cannot fight the theme.

   NO `rem` ANYWHERE, deliberately. Many WordPress themes set
   html { font-size: 62.5% } so that 1rem = 10px. Using rem here made all
   body text render around 10px instead of 17px. The base size is set in px
   on .bdsos and everything below is em, relative to that. */

.bdsos {
	--sos-terracotta: #c2703d;
	--sos-terracotta-deep: #c2552b;
	--sos-teal: #379184;
	--sos-mustard: #ce9a06;
	--sos-cream: #fbf6ec;
	--sos-sand: #f4ecdd;
	--sos-ink: #2b2620;
	--sos-ink-soft: #6b6357;
	--sos-rule: #e6dcc9;

	--sos-display: "Fraunces", Georgia, serif;
	--sos-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

	/* All four are overridden inline by the plugin from the settings screen. */
	--sos-size: 18px;
	--sos-measure: 860px;   /* max width of the article column */
	--sos-rail: 200px;      /* width of the sticky in-guide nav */

	font-family: var(--sos-body);
	font-size: var(--sos-size);
	line-height: 1.7;
	color: var(--sos-ink);
}

/* ---------- meta bar ---------- */

.bdsos-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7em;
	margin: 0 0 2em;
	padding-bottom: 1em;
	border-bottom: 1px solid var(--sos-rule);
	font-size: 0.72em;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sos-ink-soft);
}

.bdsos-meta__cat {
	padding: 0.35em 0.8em;
	border-radius: 999px;
	background: var(--sos-sand);
	color: var(--sos-terracotta-deep);
	font-weight: 700;
	text-decoration: none;
}

.bdsos-meta__cat:hover { background: var(--sos-terracotta); color: #fff; }

.bdsos-meta__item { position: relative; padding-left: 0.9em; }

.bdsos-meta__item::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: var(--sos-rule);
	transform: translateY(-50%);
}

/* ---------- layout ---------- */

.bdsos-layout { display: block; }

@media (min-width: 1100px) {
	.bdsos-layout {
		display: grid;
		grid-template-columns: var(--sos-rail) minmax(0, 1fr);
		gap: 2.4em;
		align-items: start;
	}

	/* Inline mode: no rail. The nav sits above the article and the article
	   gets the full container width. */
	.bdsos-layout--inline { display: block; }
}

.bdsos-body { min-width: 0; max-width: var(--sos-measure); }

.bdsos-body p {
	font-size: 1em;
	line-height: 1.75;
	margin: 0 0 1.15em;
}

.bdsos-body a { color: var(--sos-terracotta-deep); text-underline-offset: 3px; }
.bdsos-body a:hover { color: var(--sos-teal); }

.bdsos-body h2.bdsos-h {
	font-family: var(--sos-display);
	font-weight: 600;
	font-size: 1.72em;
	line-height: 1.22;
	margin: 1.7em 0 0.5em;
	scroll-margin-top: 90px;
}

.bdsos-body h3.bdsos-h {
	font-family: var(--sos-display);
	font-weight: 600;
	font-size: 1.28em;
	line-height: 1.32;
	margin: 1.5em 0 0.4em;
	scroll-margin-top: 90px;
}

.bdsos-body ul,
.bdsos-body ol {
	font-size: 1em;
	line-height: 1.75;
	margin: 0 0 1.3em;
	padding-left: 1.2em;
}

.bdsos-body li { margin-bottom: 0.35em; }

.bdsos-body table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.6em 0;
	font-size: 0.92em;
}

.bdsos-body th,
.bdsos-body td {
	padding: 0.7em 0.85em;
	border-bottom: 1px solid var(--sos-rule);
	text-align: left;
}

.bdsos-body th {
	background: var(--sos-cream);
	font-weight: 700;
	font-size: 0.82em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--sos-ink-soft);
}

/* ---------- in-guide nav ---------- */

.bdsos-toc { margin: 0 0 2em; }
.bdsos-toc__title { display: none; }

.bdsos-toc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.85em 1.05em;
	border: 1px solid var(--sos-rule);
	border-radius: 10px;
	background: var(--sos-cream);
	font-family: var(--sos-body);
	font-size: 0.82em;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sos-ink);
	cursor: pointer;
}

.bdsos-toc__chev {
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--sos-terracotta);
	border-bottom: 2px solid var(--sos-terracotta);
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.bdsos-toc__toggle[aria-expanded="true"] .bdsos-toc__chev { transform: rotate(-135deg); }

.bdsos-toc__list {
	display: none;
	margin: 0.5em 0 0;
	padding: 0.8em 1.05em;
	list-style: none;
	counter-reset: bdsos-toc;
	border: 1px solid var(--sos-rule);
	border-radius: 10px;
	background: var(--sos-cream);
}

.bdsos-toc__list.is-open { display: block; }
.bdsos-toc__list li { counter-increment: bdsos-toc; margin: 0; }

.bdsos-toc__list a {
	display: block;
	position: relative;
	padding: 0.42em 0 0.42em 2em;
	font-size: 0.82em;
	line-height: 1.45;
	color: var(--sos-ink-soft);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.bdsos-toc__list a::before {
	content: counter(bdsos-toc, decimal-leading-zero);
	position: absolute;
	left: 0.5em;
	font-size: 0.82em;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--sos-rule);
}

.bdsos-toc__list a:hover { color: var(--sos-ink); }

.bdsos-toc__list a.is-active {
	color: var(--sos-terracotta-deep);
	font-weight: 700;
	border-left-color: var(--sos-terracotta);
}

.bdsos-toc__list a.is-active::before { color: var(--sos-terracotta); }

@media (min-width: 1100px) {
	.bdsos-toc { position: sticky; top: 24px; margin: 0; }
	.bdsos-toc__toggle { display: none; }

	/* Inline mode keeps the collapsible box, full width, above the article. */
	.bdsos-layout--inline .bdsos-toc {
		position: static;
		max-width: var(--sos-measure);
		margin: 0 0 2em;
	}
	.bdsos-layout--inline .bdsos-toc__toggle { display: flex; }
	.bdsos-layout--inline .bdsos-toc__title { display: none; }
	.bdsos-layout--inline .bdsos-toc__list {
		display: none;
		border: 1px solid var(--sos-rule);
		border-radius: 10px;
		background: var(--sos-cream);
		padding: 0.8em 1.05em;
		max-height: none;
	}
	.bdsos-layout--inline .bdsos-toc__list.is-open { display: block; }
	.bdsos-layout--inline .bdsos-toc__list a { padding-left: 2em; margin-left: 0; }

	.bdsos-toc__title {
		display: block;
		margin: 0 0 0.7em;
		padding-left: 1.05em;
		font-size: 0.7em;
		font-weight: 700;
		letter-spacing: 0.1em;
		text-transform: uppercase;
		color: var(--sos-ink-soft);
	}

	.bdsos-toc__list {
		display: block;
		max-height: calc(100vh - 130px);
		overflow-y: auto;
		background: transparent;
		border: 0;
		border-left: 1px solid var(--sos-rule);
		border-radius: 0;
		padding: 0;
	}

	.bdsos-toc__list a { padding-left: 2.2em; margin-left: -1px; }
}

/* ---------- callouts ---------- */

.bdsos-callout {
	margin: 1.6em 0;
	padding: 1.05em 1.3em 1.05em 1.4em;
	border-radius: 4px 12px 12px 4px;
	border-left: 3px solid var(--sos-ink);
	background: var(--sos-cream);
}

.bdsos-callout__label {
	display: block;
	margin-bottom: 0.35em;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sos-ink);
}

.bdsos-callout__text {
	margin: 0 !important;
	font-size: 0.97em !important;
	line-height: 1.65 !important;
	color: var(--sos-ink);
}

.bdsos-callout--tip { border-left-color: var(--sos-teal); background: #eef5f3; }
.bdsos-callout--tip .bdsos-callout__label { color: var(--sos-teal); }

.bdsos-callout--know { border-left-color: var(--sos-mustard); background: #fbf3dd; }
.bdsos-callout--know .bdsos-callout__label { color: #9c7404; }

.bdsos-callout--read { border-left-color: var(--sos-terracotta); background: var(--sos-sand); }
.bdsos-callout--read .bdsos-callout__label { color: var(--sos-terracotta-deep); }

.bdsos-callout--note { border-left-color: var(--sos-ink-soft); background: var(--sos-cream); }
.bdsos-callout--note .bdsos-callout__label { color: var(--sos-ink-soft); }

/* ---------- figures ---------- */

.bdsos-figure { position: relative; margin: 2em 0; padding: 0; }

.bdsos-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

.bdsos-figure__caption {
	margin-top: 0.6em;
	font-size: 0.8em;
	line-height: 1.5;
	color: var(--sos-ink-soft);
	text-align: left;
}

.bdsos-pin {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 0.45em 0.9em;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: var(--sos-terracotta-deep);
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.bdsos-figure:hover .bdsos-pin,
.bdsos-pin:focus-visible { opacity: 1; transform: translateY(0); }

@media (hover: none) { .bdsos-pin { opacity: 1; transform: none; } }

/* ---------- FAQ ---------- */

.bdsos-faq { margin: 1.3em 0 2em; border-top: 1px solid var(--sos-rule); }
.bdsos-faq__item { border-bottom: 1px solid var(--sos-rule); }

.bdsos-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: 0.95em 0;
	cursor: pointer;
	list-style: none;
}

.bdsos-faq__q::-webkit-details-marker { display: none; }

.bdsos-faq__q::after {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--sos-terracotta);
	border-bottom: 2px solid var(--sos-terracotta);
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.bdsos-faq__item[open] .bdsos-faq__q::after { transform: rotate(-135deg); }

.bdsos-faq__qtext {
	margin: 0 !important;
	font-family: var(--sos-display);
	font-size: 1.08em !important;
	font-weight: 600;
	line-height: 1.4;
}

.bdsos-faq__a { padding: 0 0 1em; }
.bdsos-faq__a p { margin: 0 0 0.7em; font-size: 0.97em; }
.bdsos-faq__a p:last-child { margin-bottom: 0; }

/* ---------- resources ---------- */

.bdsos-resources {
	margin: 3em 0 0;
	padding: 1.6em;
	border-radius: 14px;
	background: var(--sos-sand);
}

.bdsos-resources__title {
	margin: 0 0 0.9em !important;
	font-family: var(--sos-display);
	font-size: 1.28em !important;
	font-weight: 600;
}

.bdsos-resources__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0.5em;
	margin: 0 0 0.9em;
	padding: 0;
	list-style: none;
}

.bdsos-resources__list a {
	display: block;
	padding: 0.75em 1em;
	border-radius: 8px;
	background: #fff;
	color: var(--sos-ink);
	font-size: 0.92em;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease, transform 0.15s ease;
}

.bdsos-resources__list a:hover { color: var(--sos-terracotta-deep); transform: translateX(2px); }

.bdsos-resources__note {
	margin: 0 !important;
	font-size: 0.8em !important;
	color: var(--sos-ink-soft);
}

/* ---------- share ---------- */

.bdsos-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin: 2.4em 0;
	padding-top: 1.4em;
	border-top: 1px solid var(--sos-rule);
}

.bdsos-share__label {
	margin-right: 0.35em;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sos-ink-soft);
}

.bdsos-share__btn {
	padding: 0.5em 1em;
	border: 1px solid var(--sos-rule);
	border-radius: 999px;
	font-size: 0.8em;
	font-weight: 600;
	color: var(--sos-ink);
	text-decoration: none;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.bdsos-share__btn:hover { border-color: var(--sos-terracotta); color: var(--sos-terracotta-deep); }

/* ---------- author ---------- */

.bdsos-author {
	display: flex;
	align-items: flex-start;
	gap: 1.1em;
	margin: 2.4em 0;
	padding: 1.5em;
	border-radius: 14px;
	background: var(--sos-cream);
}

.bdsos-author__photo {
	flex: none;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	object-fit: cover;
}

.bdsos-author__eyebrow {
	margin: 0 0 0.2em !important;
	font-size: 0.7em !important;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sos-ink-soft);
}

.bdsos-author__name {
	margin: 0 0 0.4em !important;
	font-family: var(--sos-display);
	font-size: 1.15em !important;
	font-weight: 600;
}

.bdsos-author__name a { color: var(--sos-ink); text-decoration: none; }
.bdsos-author__name a:hover { color: var(--sos-terracotta-deep); }

.bdsos-author__bio p {
	margin: 0 !important;
	font-size: 0.92em !important;
	line-height: 1.6 !important;
	color: var(--sos-ink-soft);
}

/* ---------- topic chips ---------- */

.bdsos-topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45em;
	margin: 2em 0;
}

.bdsos-topics__label {
	margin-right: 0.3em;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sos-ink-soft);
}

.bdsos-topics a {
	padding: 0.35em 0.85em;
	border-radius: 999px;
	background: var(--sos-sand);
	color: var(--sos-terracotta-deep);
	font-size: 0.78em;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.bdsos-topics a:hover { background: var(--sos-terracotta); color: #fff; }

/* ---------- related ---------- */

.bdsos-related {
	margin: 3em 0 0;
	padding-top: 2em;
	border-top: 1px solid var(--sos-rule);
}

.bdsos-related__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 1.3em;
}

.bdsos-related__title {
	margin: 0 !important;
	font-family: var(--sos-display);
	font-size: 1.5em !important;
	font-weight: 600;
	line-height: 1.2;
}

.bdsos-related__all {
	flex: none;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sos-terracotta-deep);
	text-decoration: none;
	white-space: nowrap;
}

.bdsos-related__all:hover { color: var(--sos-teal); }

.bdsos-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.6em;
}

.bdsos-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--sos-ink);
}

.bdsos-card__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	margin-bottom: 0.85em;
	border-radius: 12px;
	overflow: hidden;
	background: var(--sos-sand);
}

.bdsos-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.bdsos-card:hover .bdsos-card__img { transform: scale(1.04); }

.bdsos-card__cat {
	position: absolute;
	left: 10px;
	bottom: 10px;
	padding: 0.35em 0.75em;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: var(--sos-terracotta-deep);
	font-size: 0.65em;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.bdsos-card__title {
	display: block;
	margin-bottom: 0.4em;
	font-family: var(--sos-display);
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.35;
	transition: color 0.15s ease;
}

.bdsos-card:hover .bdsos-card__title { color: var(--sos-terracotta-deep); }

.bdsos-card__excerpt {
	margin: 0 0 0.6em;
	font-size: 0.85em;
	line-height: 1.55;
	color: var(--sos-ink-soft);
}

.bdsos-card__meta {
	margin-top: auto;
	font-size: 0.72em;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sos-ink-soft);
}

/* ---------- a11y floor ---------- */

.bdsos a:focus-visible,
.bdsos button:focus-visible,
.bdsos summary:focus-visible {
	outline: 2px solid var(--sos-terracotta);
	outline-offset: 3px;
	border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.bdsos *,
	.bdsos *::before,
	.bdsos *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
