/*
 * Cloud Callout — pure CSS thought-bubble cloud.
 * The cloud is a union of white shapes (a rounded body, a ring of puffs and
 * two trailing bubbles). A chain of hard drop-shadows on the wrapper draws one
 * continuous outline around the whole shape, then a soft shadow goes under it.
 * Tweak the variables below to restyle.
 */
.cloud-callout {
	--cc-fill: #ffffff;
	--cc-text: #2a1a14;
	--cc-outline: #2a1a14;
	--cc-outline-width: 7px;
	--cc-shadow: rgba(0, 0, 0, 0.35);
	--cc-puff: 96px;   /* size of the bumps around the edge */
	--cc-reach: 30px;  /* how far the bumps stick out past the body */
	--cc-a: calc(var(--cc-outline-width) * 0.414);
	--cc-d: calc(var(--cc-outline-width) * 0.293);

	position: relative;
	box-sizing: border-box;
	max-width: 620px;
	margin: 3.5em auto 6.5em !important;
	padding: 0 calc(var(--cc-reach) + var(--cc-outline-width) + 6px);

	/* Eight hard shadows = an even, rounded outline around the whole shape */
	filter:
		drop-shadow(var(--cc-a) 0 0 var(--cc-outline))
		drop-shadow(calc(-1 * var(--cc-a)) 0 0 var(--cc-outline))
		drop-shadow(0 var(--cc-a) 0 var(--cc-outline))
		drop-shadow(0 calc(-1 * var(--cc-a)) 0 var(--cc-outline))
		drop-shadow(var(--cc-d) var(--cc-d) 0 var(--cc-outline))
		drop-shadow(calc(-1 * var(--cc-d)) calc(-1 * var(--cc-d)) 0 var(--cc-outline))
		drop-shadow(var(--cc-d) calc(-1 * var(--cc-d)) 0 var(--cc-outline))
		drop-shadow(calc(-1 * var(--cc-d)) var(--cc-d) 0 var(--cc-outline))
		drop-shadow(5px 9px 8px var(--cc-shadow));
}

/* Body of the cloud — holds the text */
.cloud-callout__bubble {
	position: relative;
	z-index: 0; /* own stacking context so the puffs sit behind the text */
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60px;
	padding: 0.9em 1.4em;
	background: var(--cc-fill);
	color: var(--cc-text);
	border-radius: 40px;
	font-size: 1.05em;
	line-height: 1.55;
	text-align: center;
}

.cloud-callout__bubble p {
	margin: 0;
	position: relative;
}

/* Ring of puffs around the body; percentages keep them spread at any size */
.cloud-callout__bubble::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: calc(-1 * var(--cc-reach));
	--p: radial-gradient(circle closest-side, var(--cc-fill) 97%, transparent 100%) no-repeat;
	background:
		/* top edge: a few uneven puffs */
		var(--p) 2%   0%   / calc(var(--cc-puff) * 0.95) calc(var(--cc-puff) * 0.95),
		var(--p) 34%  0%   / calc(var(--cc-puff) * 1.3)  calc(var(--cc-puff) * 1.3),
		var(--p) 68%  0%   / calc(var(--cc-puff) * 1.15) calc(var(--cc-puff) * 1.15),
		var(--p) 98%  0%   / calc(var(--cc-puff) * 0.95) calc(var(--cc-puff) * 0.95),
		var(--p) 18%  10%  / calc(var(--cc-puff) * 0.9)  calc(var(--cc-puff) * 0.9),
		var(--p) 51%  10%  / calc(var(--cc-puff) * 0.9)  calc(var(--cc-puff) * 0.9),
		var(--p) 83%  10%  / calc(var(--cc-puff) * 0.9)  calc(var(--cc-puff) * 0.9),
		/* bottom edge */
		var(--p) 4%   100% / calc(var(--cc-puff) * 0.9)  calc(var(--cc-puff) * 0.9),
		var(--p) 36%  100% / calc(var(--cc-puff) * 1.05) calc(var(--cc-puff) * 1.05),
		var(--p) 68%  100% / calc(var(--cc-puff) * 0.95) calc(var(--cc-puff) * 0.95),
		var(--p) 97%  100% / calc(var(--cc-puff) * 0.9)  calc(var(--cc-puff) * 0.9),
		var(--p) 20%  90%  / calc(var(--cc-puff) * 0.85) calc(var(--cc-puff) * 0.85),
		var(--p) 52%  90%  / calc(var(--cc-puff) * 0.85) calc(var(--cc-puff) * 0.85),
		var(--p) 83%  90%  / calc(var(--cc-puff) * 0.85) calc(var(--cc-puff) * 0.85),
		/* left and right edges */
		var(--p) 0%   50%  / var(--cc-puff) var(--cc-puff),
		var(--p) 100% 50%  / var(--cc-puff) var(--cc-puff);
}

/* Thought-bubble trail, lower right */
.cloud-callout::before,
.cloud-callout::after {
	content: "";
	position: absolute;
	background: var(--cc-fill);
	border-radius: 50%;
}

.cloud-callout::before {
	width: 30px;
	height: 30px;
	right: 22%;
	bottom: calc(-1 * (var(--cc-reach) + 30px));
}

.cloud-callout::after {
	width: 18px;
	height: 18px;
	right: 15%;
	bottom: calc(-1 * (var(--cc-reach) + 58px));
}

@media (max-width: 480px) {
	.cloud-callout {
		--cc-puff: 72px;
		--cc-reach: 22px;
		--cc-outline-width: 5px;
	}
	.cloud-callout__bubble {
		padding: 0.9em 1em;
		font-size: 1em;
	}
}

/* ------------------------------------------------------------------
 * "Circle" block style (Block sidebar > Styles > Circle).
 * .is-circle is also supported for blocks tagged by hand earlier.
 * ------------------------------------------------------------------ */
.cloud-callout.is-style-circle,
.cloud-callout.is-circle {
	--cc-reach: 0px;
	--cc-circle: 320px;               /* diameter of the circle */
	width: min(var(--cc-circle), 100%);
	padding: 0;
}

.cloud-callout.is-style-circle .cloud-callout__bubble,
.cloud-callout.is-circle .cloud-callout__bubble {
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	padding: 15%;                     /* keeps text inside the round edge */
	overflow-wrap: anywhere;
}

/* No cloud puffs on the circle */
.cloud-callout.is-style-circle .cloud-callout__bubble::before,
.cloud-callout.is-circle .cloud-callout__bubble::before {
	display: none;
}

/* Thought-bubble trail positioned for the round shape */
.cloud-callout.is-style-circle::before,
.cloud-callout.is-circle::before {
	right: 10%;
	bottom: -26px;
}
.cloud-callout.is-style-circle::after,
.cloud-callout.is-circle::after {
	right: 2%;
	bottom: -52px;
}

@media (max-width: 480px) {
	.cloud-callout.is-style-circle,
	.cloud-callout.is-circle {
		--cc-circle: 260px;
	}
}

/* ==================================================================
 * More shapes (Block sidebar > Styles).
 * Every style except Cloud starts from this reset: no puffs, no trail.
 * :where() keeps it low-priority so each style below can switch
 * pieces back on.
 * ================================================================== */
.cloud-callout:where([class*="is-style-"]:not(.is-style-cloud)) {
	--cc-reach: 0px;
	padding: 0 10px;
	margin-bottom: 3em !important;
}
.cloud-callout:where([class*="is-style-"]:not(.is-style-cloud)) .cloud-callout__bubble::before,
.cloud-callout:where([class*="is-style-"]:not(.is-style-cloud))::before,
.cloud-callout:where([class*="is-style-"]:not(.is-style-cloud))::after {
	display: none;
}

/* Circle keeps its thought-bubble trail */
.cloud-callout.is-style-circle { margin-bottom: 6em !important; }
.cloud-callout.is-style-circle::before,
.cloud-callout.is-style-circle::after { display: block; }

/* Fixed-size shapes (short text works best) */
.cloud-callout.is-style-seal,
.cloud-callout.is-style-scalloped,
.cloud-callout.is-style-octagon,
.cloud-callout.is-style-diamond,
.cloud-callout.is-style-heart {
	--cc-size: 300px;                 /* width of the shape */
	width: min(var(--cc-size), 100%);
	padding: 0;
}
.cloud-callout.is-style-seal .cloud-callout__bubble,
.cloud-callout.is-style-scalloped .cloud-callout__bubble,
.cloud-callout.is-style-octagon .cloud-callout__bubble,
.cloud-callout.is-style-diamond .cloud-callout__bubble,
.cloud-callout.is-style-heart .cloud-callout__bubble {
	aspect-ratio: 1 / 1;
	border-radius: 0;
	overflow-wrap: anywhere;
}

/* ---------- Speech bubble ---------- */
.cloud-callout.is-style-speech { margin-bottom: 4.5em !important; }
.cloud-callout.is-style-speech .cloud-callout__bubble {
	border-radius: 26px;
	padding: 1.1em 1.6em;
}
.cloud-callout.is-style-speech::before {
	display: block;
	width: 46px;
	height: 44px;
	left: 16%;
	right: auto;
	bottom: -38px;
	border-radius: 0;
	clip-path: polygon(0 0, 100% 0, 8% 100%);
}

/* ---------- Oval speech bubble ---------- */
.cloud-callout.is-style-oval-speech { margin-bottom: 4.5em !important; }
.cloud-callout.is-style-oval-speech .cloud-callout__bubble {
	border-radius: 50%;
	min-height: 130px;
	padding: 2em 3.2em;
}
.cloud-callout.is-style-oval-speech::before {
	display: block;
	width: 48px;
	height: 66px;
	left: 26%;
	right: auto;
	bottom: -36px;
	border-radius: 0;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* ---------- Shout / burst ---------- */
.cloud-callout.is-style-shout {
	--cc-fill: #ffe14d;
	max-width: 560px;
}
.cloud-callout.is-style-shout .cloud-callout__bubble {
	min-height: 220px;
	padding: 17% 22%;
	border-radius: 0;
	clip-path: polygon(50% 2.03%, 56.95% 15.08%, 68.73% 4.77%, 69.61% 20.66%, 84.37% 15.63%, 80.32% 29.74%, 93.58% 31.95%, 86.32% 42.78%, 97.11% 50%, 86.03% 57.17%, 93.62% 68.07%, 79.4% 69.65%, 84.13% 84.13%, 71.28% 81.85%, 68.13% 93.77%, 57% 85.2%, 50% 98.88%, 42.43% 88.05%, 31.35% 95.02%, 29.67% 80.42%, 14.7% 85.3%, 20.74% 69.55%, 4.2% 68.97%, 14.54% 57.05%, 2.57% 50%, 15.21% 43.08%, 5.72% 31.66%, 18.18% 28.74%, 16.38% 16.38%, 29.26% 18.96%, 31.28% 4.81%, 42.88% 14.21%);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* ---------- Whisper (dashed) ---------- */
.cloud-callout.is-style-whisper {
	filter: drop-shadow(3px 6px 6px var(--cc-shadow));
	margin-bottom: 3.5em !important;
}
.cloud-callout.is-style-whisper .cloud-callout__bubble {
	border: 3px dashed var(--cc-outline);
	border-radius: 30px;
	font-style: italic;
	color: #5a4a44;
}
.cloud-callout.is-style-whisper::after {
	display: block;
	width: 22px;
	height: 22px;
	left: 18%;
	right: auto;
	bottom: -12px;
	z-index: 1;
	border-radius: 0 0 4px 0;
	border-right: 3px dashed var(--cc-outline);
	border-bottom: 3px dashed var(--cc-outline);
	transform: rotate(45deg);
}

/* ---------- Starburst seal ---------- */
.cloud-callout.is-style-seal { --cc-fill: #ffd54f; }
.cloud-callout.is-style-seal .cloud-callout__bubble {
	padding: 20%;
	clip-path: polygon(100% 50%, 95.25% 54.76%, 98.91% 60.4%, 93.27% 64.06%, 95.68% 70.34%, 89.4% 72.75%, 90.45% 79.39%, 83.81% 80.45%, 83.46% 87.16%, 76.74% 86.81%, 75% 93.3%, 68.51% 91.57%, 65.45% 97.55%, 59.46% 94.51%, 55.23% 99.73%, 50% 95.5%, 44.77% 99.73%, 40.54% 94.51%, 34.55% 97.55%, 31.49% 91.57%, 25% 93.3%, 23.26% 86.81%, 16.54% 87.16%, 16.19% 80.45%, 9.55% 79.39%, 10.6% 72.75%, 4.32% 70.34%, 6.73% 64.06%, 1.09% 60.4%, 4.75% 54.76%, 0% 50%, 4.75% 45.24%, 1.09% 39.6%, 6.73% 35.94%, 4.32% 29.66%, 10.6% 27.25%, 9.55% 20.61%, 16.19% 19.55%, 16.54% 12.84%, 23.26% 13.19%, 25% 6.7%, 31.49% 8.43%, 34.55% 2.45%, 40.54% 5.49%, 44.77% 0.27%, 50% 4.5%, 55.23% 0.27%, 59.46% 5.49%, 65.45% 2.45%, 68.51% 8.43%, 75% 6.7%, 76.74% 13.19%, 83.46% 12.84%, 83.81% 19.55%, 90.45% 20.61%, 89.4% 27.25%, 95.68% 29.66%, 93.27% 35.94%, 98.91% 39.6%, 95.25% 45.24%);
	font-weight: 700;
}

/* ---------- Scalloped circle ---------- */
.cloud-callout.is-style-scalloped { --cc-size: 290px; }
.cloud-callout.is-style-scalloped .cloud-callout__bubble {
	border-radius: 50%;
	padding: 17%;
}
.cloud-callout.is-style-scalloped .cloud-callout__bubble::before {
	display: block;
	inset: -8%;
	background:
		var(--p) 99.17% 50% / 12.33% 12.33%,
		var(--p) 96.76% 65.19% / 12.33% 12.33%,
		var(--p) 89.78% 78.9% / 12.33% 12.33%,
		var(--p) 78.9% 89.78% / 12.33% 12.33%,
		var(--p) 65.19% 96.76% / 12.33% 12.33%,
		var(--p) 50% 99.17% / 12.33% 12.33%,
		var(--p) 34.81% 96.76% / 12.33% 12.33%,
		var(--p) 21.1% 89.78% / 12.33% 12.33%,
		var(--p) 10.22% 78.9% / 12.33% 12.33%,
		var(--p) 3.24% 65.19% / 12.33% 12.33%,
		var(--p) 0.83% 50% / 12.33% 12.33%,
		var(--p) 3.24% 34.81% / 12.33% 12.33%,
		var(--p) 10.22% 21.1% / 12.33% 12.33%,
		var(--p) 21.1% 10.22% / 12.33% 12.33%,
		var(--p) 34.81% 3.24% / 12.33% 12.33%,
		var(--p) 50% 0.83% / 12.33% 12.33%,
		var(--p) 65.19% 3.24% / 12.33% 12.33%,
		var(--p) 78.9% 10.22% / 12.33% 12.33%,
		var(--p) 89.78% 21.1% / 12.33% 12.33%,
		var(--p) 96.76% 34.81% / 12.33% 12.33%;
}

/* ---------- Ribbon banner ---------- */
.cloud-callout.is-style-ribbon .cloud-callout__bubble {
	border-radius: 0;
	padding: 0.9em 64px;
	clip-path: polygon(0 0, 100% 0, calc(100% - 32px) 50%, 100% 100%, 0 100%, 32px 50%);
	font-weight: 700;
}

/* ---------- Tag ---------- */
.cloud-callout.is-style-tag .cloud-callout__bubble {
	border-radius: 0 14px 14px 0;
	padding: 1em 1.6em 1em 70px;
	clip-path: polygon(42px 0, 100% 0, 100% 100%, 42px 100%, 0 50%);
}
.cloud-callout.is-style-tag::after {
	display: block;
	width: 10px;
	height: 10px;
	left: 34px;
	right: auto;
	top: calc(50% - 8px);
	bottom: auto;
	z-index: 1;
	background: transparent;
	border: 3px solid var(--cc-outline);
}

/* ---------- Sticky note ---------- */
.cloud-callout.is-style-sticky-note {
	--cc-fill: #fff59d;
	--cc-fold: #e3d36a;
	max-width: 440px;
	transform: rotate(-1.5deg);
	filter: drop-shadow(3px 8px 7px var(--cc-shadow));
}
.cloud-callout.is-style-sticky-note .cloud-callout__bubble {
	border-radius: 2px;
	min-height: 160px;
	padding: 1.6em 1.6em 2em;
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
}
.cloud-callout.is-style-sticky-note::after {
	display: block;
	width: 30px;
	height: 30px;
	right: 10px;
	bottom: 0;
	z-index: 1;
	border-radius: 0 0 0 2px;
	background: linear-gradient(to top left, transparent 50%, var(--cc-fold) 50%);
}

/* ---------- Torn paper ---------- */
.cloud-callout.is-style-torn-paper {
	--cc-fill: #fbf8f1;
	--cc-outline-width: 3px;
}
.cloud-callout.is-style-torn-paper .cloud-callout__bubble {
	border-radius: 0;
	padding: 1.8em 2em;
	clip-path: polygon(0% 2px, 2.5% 0px, 5% 8px, 7.5% 7px, 10% 1px, 12.5% 6px, 15% 7px, 17.5% 7px, 20% 6px, 22.5% 3px, 25% 8px, 27.5% 5px, 30% 8px, 32.5% 2px, 35% 3px, 37.5% 7px, 40% 6px, 42.5% 7px, 45% 3px, 47.5% 2px, 50% 2px, 52.5% 1px, 55% 5px, 57.5% 6px, 60% 5px, 62.5% 7px, 65% 1px, 67.5% 0px, 70% 2px, 72.5% 6px, 75% 6px, 77.5% 6px, 80% 7px, 82.5% 7px, 85% 2px, 87.5% 2px, 90% 3px, 92.5% 7px, 95% 2px, 97.5% 0px, 100% 3px, 100% calc(100% - 7px), 97.5% calc(100% - 3px), 95% calc(100% - 1px), 92.5% calc(100% - 6px), 90% calc(100% - 0px), 87.5% calc(100% - 7px), 85% calc(100% - 6px), 82.5% calc(100% - 5px), 80% calc(100% - 2px), 77.5% calc(100% - 7px), 75% calc(100% - 0px), 72.5% calc(100% - 8px), 70% calc(100% - 3px), 67.5% calc(100% - 5px), 65% calc(100% - 8px), 62.5% calc(100% - 1px), 60% calc(100% - 1px), 57.5% calc(100% - 7px), 55% calc(100% - 2px), 52.5% calc(100% - 5px), 50% calc(100% - 7px), 47.5% calc(100% - 1px), 45% calc(100% - 3px), 42.5% calc(100% - 5px), 40% calc(100% - 1px), 37.5% calc(100% - 3px), 35% calc(100% - 1px), 32.5% calc(100% - 6px), 30% calc(100% - 1px), 27.5% calc(100% - 8px), 25% calc(100% - 5px), 22.5% calc(100% - 2px), 20% calc(100% - 5px), 17.5% calc(100% - 5px), 15% calc(100% - 8px), 12.5% calc(100% - 8px), 10% calc(100% - 0px), 7.5% calc(100% - 7px), 5% calc(100% - 5px), 2.5% calc(100% - 3px), 0% calc(100% - 3px));
}

/* ---------- Index card ---------- */
.cloud-callout.is-style-index-card {
	--cc-outline: #b9b2a8;
	--cc-outline-width: 2px;
}
.cloud-callout.is-style-index-card .cloud-callout__bubble {
	--line: 1.7em;
	display: block;
	border-radius: 3px;
	line-height: var(--line);
	text-align: left;
	padding: calc(var(--line) * 1.5) 1.6em calc(var(--line) * 0.6);
	background:
		linear-gradient(#e57373, #e57373) 0 calc(var(--line) * 1.25) / 100% 2px no-repeat,
		repeating-linear-gradient(transparent 0 calc(var(--line) - 1px), #a9c7ef calc(var(--line) - 1px) var(--line))
			0 calc(var(--line) * 1.5) / 100% calc(100% - var(--line) * 1.5) no-repeat,
		var(--cc-fill);
}

/* ---------- Rounded box ---------- */
.cloud-callout.is-style-rounded .cloud-callout__bubble {
	border-radius: 20px;
	padding: 1.1em 1.6em;
}

/* ---------- Hexagon ---------- */
.cloud-callout.is-style-hexagon .cloud-callout__bubble {
	border-radius: 0;
	min-height: 90px;
	padding: 1.1em 64px;
	clip-path: polygon(44px 0, calc(100% - 44px) 0, 100% 50%, calc(100% - 44px) 100%, 44px 100%, 0 50%);
}

/* ---------- Octagon (stop sign) ---------- */
.cloud-callout.is-style-octagon {
	--cc-fill: #c62828;
	--cc-text: #ffffff;
	--cc-size: 280px;
}
.cloud-callout.is-style-octagon .cloud-callout__bubble {
	padding: 16%;
	clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* ---------- Diamond ---------- */
.cloud-callout.is-style-diamond { --cc-size: 300px; }
.cloud-callout.is-style-diamond .cloud-callout__bubble {
	padding: 27%;
	clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

/* ---------- Heart ---------- */
.cloud-callout.is-style-heart { --cc-fill: #ffd6e0; }
.cloud-callout.is-style-heart .cloud-callout__bubble {
	padding: 22% 23% 34%;
	clip-path: polygon(50% 23.9%, 50.05% 23.23%, 50.37% 21.27%, 51.22% 18.26%, 52.8% 14.53%, 55.24% 10.5%, 58.57% 6.63%, 62.77% 3.35%, 67.68% 1.05%, 73.1% 0%, 78.74% 0.37%, 84.3% 2.18%, 89.43% 5.37%, 93.82% 9.74%, 97.17% 15.05%, 99.28% 21.01%, 100% 27.36%, 99.28% 33.85%, 97.17% 40.28%, 93.82% 46.54%, 89.43% 52.57%, 84.3% 58.35%, 78.74% 63.9%, 73.1% 69.26%, 67.68% 74.43%, 62.77% 79.4%, 58.57% 84.11%, 55.24% 88.46%, 52.8% 92.32%, 51.22% 95.54%, 50.37% 97.97%, 50.05% 99.49%, 50% 100%, 49.95% 99.49%, 49.63% 97.97%, 48.78% 95.54%, 47.2% 92.32%, 44.76% 88.46%, 41.43% 84.11%, 37.23% 79.4%, 32.32% 74.43%, 26.9% 69.26%, 21.26% 63.9%, 15.7% 58.35%, 10.57% 52.57%, 6.18% 46.54%, 2.83% 40.28%, 0.72% 33.85%, 0% 27.36%, 0.72% 21.01%, 2.83% 15.05%, 6.18% 9.74%, 10.57% 5.37%, 15.7% 2.18%, 21.26% 0.37%, 26.9% 0%, 32.32% 1.05%, 37.23% 3.35%, 41.43% 6.63%, 44.76% 10.5%, 47.2% 14.53%, 48.78% 18.26%, 49.63% 21.27%, 49.95% 23.23%);
}

@media (max-width: 480px) {
	.cloud-callout.is-style-seal,
	.cloud-callout.is-style-scalloped,
	.cloud-callout.is-style-octagon,
	.cloud-callout.is-style-diamond,
	.cloud-callout.is-style-heart {
		--cc-size: 250px;
	}
	.cloud-callout.is-style-shout .cloud-callout__bubble {
		min-height: 200px;
		padding: 18% 20%;
	}
}
