/*
 * SHSAT Callouts: how callouts look. Self-contained (no theme classes); colours come from
 * Callouts → Settings as custom properties on .shsat-callout. Selectors on aside/div outrank a
 * block theme's layout gaps (":root :where(.is-layout-…) > *"), so the spacing is the plugin's.
 */

aside.shsat-callout {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	box-sizing: border-box;
	margin: 2rem 0;
	padding: 1.25rem 1.5rem;
	background: var(--shsat-callout-bg, #fbf5e4);
	color: var(--shsat-callout-text, #2b1d0e);
	border-left: 6px solid var(--shsat-callout-accent, #7a5c00);
	line-height: 1.55;
	overflow-wrap: break-word;
}

.shsat-callout > *,
.shsat-callout__body > :first-child {
	margin-top: 0;
}

.shsat-callout > *,
.shsat-callout__body > :last-child {
	margin-bottom: 0;
}

/* The icon: a built-in line icon in the accent colour, or an image at the same size. */
.shsat-callout .shsat-callout__icon {
	flex: none;
	width: 2.5rem;
	height: 2.5rem;
	color: var(--shsat-callout-accent, #7a5c00);
}

.shsat-callout .shsat-callout__icon svg,
.shsat-callout .shsat-callout__icon img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
}

.shsat-callout .shsat-callout__content {
	flex: 1 1 auto;
	min-width: 0;
}

/* Edit and Hide/Show (for those who write callouts), at the content's top right; the text wraps
   around them. */
.shsat-callout .shsat-callout__tools {
	float: right;
	display: flex;
	align-items: center;
	gap: .25rem;
	margin: -.4rem -.6rem .25rem .75rem;
}

.shsat-callout .shsat-callout__body p,
.shsat-callout .shsat-callout__body ul,
.shsat-callout .shsat-callout__body ol {
	margin: 0 0 .75em;
}

.shsat-callout .shsat-callout__body > :last-child {
	margin-bottom: 0;
}

/* A label's words never break (the theme's "word-break: break-word" would split them); beside
   the controls, one that doesn't fit goes below them. */
.shsat-callout .shsat-callout__label {
	word-break: normal;
	overflow-wrap: normal;
	margin: 0 0 .35rem;
	font-size: .8em;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--shsat-callout-accent, #7a5c00);
}

.shsat-callout .shsat-callout__title {
	margin: 0 0 .5rem;
	font-size: 1.35em;
	line-height: 1.25;
	color: inherit;
}

.shsat-callout a {
	color: var(--shsat-callout-accent, #7a5c00);
	text-decoration: underline;
	text-underline-offset: .15em;
}

.shsat-callout .shsat-callout__more {
	margin: .75em 0 0;
	font-weight: 600;
}

/* Styles. */

aside.shsat-callout--subtle {
	background: transparent;
	color: inherit;
	border: 1px solid var(--shsat-callout-accent, #7a5c00);
}

aside.shsat-callout--strong {
	background: var(--shsat-callout-strong-bg, #2b1d0e);
	color: var(--shsat-callout-strong-text, #fbf5e4);
	border-left: 0;
}

.shsat-callout--strong a,
.shsat-callout--strong .shsat-callout__label,
.shsat-callout--strong .shsat-callout__icon {
	color: var(--shsat-callout-strong-text, #fbf5e4);
}

.shsat-callout--strong .shsat-callout__label {
	opacity: .85;
}

/* Sizes. A half-width banner's wrapper takes the text column's place; the banner floats (or
   centres) inside it. */

div.shsat-callout-wrap {
	margin-top: 0;
	margin-bottom: 0;
}

aside.shsat-callout--half {
	width: calc(50% - .75rem);
	min-width: 14rem;
	font-size: .9em;
}

.shsat-callout-wrap--right > aside.shsat-callout {
	float: right;
	margin: .35rem 0 1rem 1.5rem;
}

.shsat-callout-wrap--left > aside.shsat-callout {
	float: left;
	margin: .35rem 1.5rem 1rem 0;
}

/* Only paragraphs flow beside a floated banner; anything else after it (an embed, an image, a
   table, a list, a heading) starts below it rather than under or beside it. */
.shsat-callout-wrap--right ~ :not(p),
.shsat-callout-wrap--left ~ :not(p) {
	clear: both;
}

.shsat-callout-wrap--center > aside.shsat-callout {
	margin-left: auto;
	margin-right: auto;
}

.shsat-callout--half .shsat-callout__title {
	font-size: 1.15em;
}

aside.shsat-callout--half {
	gap: .75rem;
}

.shsat-callout--half .shsat-callout__icon {
	width: 2rem;
	height: 2rem;
}

aside.shsat-callout--inline {
	margin: 1.5rem 0;
	padding: .75rem 1rem;
	font-size: .95em;
}

.shsat-callout--inline .shsat-callout__title {
	margin-bottom: .25rem;
	font-size: 1.05em;
}

aside.shsat-callout--inline {
	gap: .75rem;
}

.shsat-callout--inline .shsat-callout__icon {
	width: 1.75rem;
	height: 1.75rem;
}

div.shsat-callout-clear {
	clear: both;
	margin: 0;
}

/* Between a list's posts: an item of the list, holding its floats. */
.shsat-callout-item {
	display: flow-root;
	list-style: none;
	margin-left: 0;
	padding-left: 0;
}

@media (max-width: 600px) {
	aside.shsat-callout--half {
		width: auto;
		min-width: 0;
	}

	.shsat-callout-wrap--right > aside.shsat-callout,
	.shsat-callout-wrap--left > aside.shsat-callout {
		float: none;
		margin: 1.5rem 0;
	}
}

/* Editing, and hiding for everyone (for those who write callouts; visitors cannot close
   callouts). */

.shsat-callout .shsat-callout__edit,
.shsat-callout .shsat-callout__toggle {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	margin: 0;
	padding: .2rem .4rem;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: .8em;
	font-weight: 600;
	line-height: 1.2;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	opacity: .8;
}

.shsat-callout .shsat-callout__edit:hover,
.shsat-callout .shsat-callout__edit:focus-visible,
.shsat-callout .shsat-callout__toggle:hover,
.shsat-callout .shsat-callout__toggle:focus-visible {
	opacity: 1;
	text-decoration: underline;
}

.shsat-callout .shsat-callout__toggle:disabled {
	cursor: progress;
	opacity: .5;
}

.shsat-callout .shsat-callout__edit svg,
.shsat-callout .shsat-callout__toggle svg {
	width: 1em;
	height: 1em;
}

.shsat-callout .shsat-callout__when-shown {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
}

.shsat-callout .shsat-callout__when-hidden,
.shsat-callout .shsat-callout__hidden-note {
	display: none;
}

.shsat-callout .shsat-callout__hidden-note {
	padding: 0 .4em;
	border: 1px dashed currentColor;
	font-size: .75em;
	white-space: nowrap;
}

.shsat-callout .shsat-callout__error {
	flex-basis: 100%;
	font-size: .8em;
	color: #b32d2e;
}

/* Hidden for everyone: folded to its title (only those who write callouts see it), with Show. */
.shsat-callout--hidden .shsat-callout__when-shown {
	display: none;
}

.shsat-callout--hidden .shsat-callout__when-hidden {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
}

.shsat-callout--hidden .shsat-callout__hidden-note {
	display: inline-block;
}

.shsat-callout--hidden .shsat-callout__icon,
.shsat-callout--hidden .shsat-callout__label,
.shsat-callout--hidden .shsat-callout__body,
.shsat-callout--hidden .shsat-callout__more {
	display: none;
}

aside.shsat-callout--hidden {
	padding: .6rem 1rem;
	background: transparent;
	color: inherit;
	border: 1px dashed currentColor;
	opacity: .75;
}

.shsat-callout--hidden .shsat-callout__title {
	font-size: 1em;
	margin: 0;
}

.shsat-callout .shsat-callout__title--folded {
	display: none;
}

.shsat-callout--hidden .shsat-callout__title--folded {
	display: block;
}

aside.shsat-callout--hidden.shsat-callout--half {
	width: auto;
	min-width: 0;
	float: none;
}

/* Drafts, seen only by those who write callouts. */

aside.shsat-callout--draft {
	outline: 2px dashed var(--shsat-callout-accent, #7a5c00);
	outline-offset: 3px;
}

.shsat-callout .shsat-callout__draft {
	display: inline-block;
	margin-left: .5em;
	padding: 0 .4em;
	border: 1px dashed currentColor;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.shsat-callout-note {
	padding: .75rem 1rem;
	border: 1px dashed currentColor;
	font-size: .9em;
}

@media print {
	.shsat-callout .shsat-callout__tools {
		display: none;
	}
}
