/* The flag stamp beside a country archive's title (country-stamp.php).
   Loaded only on a country archive with a flag. On Olga's homes the
   postmark from homes.css moves onto the stamp's lower-left corner. */

.olga-country-head {
	--olga-stamp-base: clamp(5.5rem, 2rem + 7.5vw, 10.5rem);
	display: flex;
	gap: clamp(1rem, 3vw, 2.5rem);
	align-items: flex-start;
	justify-content: space-between;
}

.olga-country-archive > .olga-country-head {
	margin-bottom: clamp(1.5rem, 3vw, 2.75rem);
}

.olga-country-head__main {
	min-width: 0;
}

/* Beside the stamp, a long single word shrinks to fit the phone's line
   rather than breaking; ordinary titles keep the xx-large preset. The
   preset class sets its size with !important, so this must too. */
.olga-country-head .wp-block-query-title {
	min-width: 0;
	margin: 0;
}

.olga-country-head .wp-block-query-title.has-xx-large-font-size {
	font-size: min(
		var(--wp--preset--font-size--xx-large),
		calc(
			(100vw - 2 * var(--wp--style--root--padding-left, 1.25rem) - var(--olga-stamp-base) * var(--olga-stamp-scale, 1) - 2.25rem)
			/ (var(--olga-title-longest, 8) * 0.56)
		)
	) !important;
}

.olga-country-stamp {
	position: relative;
	flex: none;
	width: calc(var(--olga-stamp-base) * var(--olga-stamp-scale, 1));
	max-width: 40%;
	margin-top: 0.15em;
	margin-right: 0.35rem;
	transform: rotate(3deg);
}

.olga-country-stamp.has-postmark {
	margin-bottom: calc(var(--olga-stamp-base) * 0.22);
	margin-left: calc(var(--olga-stamp-base) * 0.2);
}

.olga-country-stamp__art {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
	filter: saturate(0.85) drop-shadow(0 1px 1.5px rgb(18 17 15 / 0.18));
}

.olga-country-stamp__paper {
	fill: #fbf9f4;
}

.olga-country-stamp__keyline {
	fill: none;
	stroke: var(--wp--preset--color--contrast);
	stroke-opacity: 0.55;
	stroke-width: 0.7;
}

.olga-country-stamp__cancel {
	position: absolute;
	bottom: calc(var(--olga-stamp-base) * -0.07);
	left: 20%;
	width: 84%;
	color: var(--wp--preset--color--accent);
	opacity: 0.6;
	mix-blend-mode: multiply;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	pointer-events: none;
}

/* The postmark from homes.css, set over the stamp's corner */
.olga-country-stamp .olga-home-stamp {
	position: absolute;
	bottom: calc(var(--olga-stamp-base) * -0.24);
	left: calc(var(--olga-stamp-base) * -0.24);
	width: calc(var(--olga-stamp-base) * 0.54);
	opacity: 0.84;
	mix-blend-mode: multiply;
	transform: rotate(-12deg);
}

.olga-country-stamp .olga-home-stamp:hover,
.olga-home-head:has(.olga-home-head__note a:hover) .olga-country-stamp .olga-home-stamp {
	opacity: 1;
	transform: rotate(-7deg);
}

/* The postmark has left the title row, so a short title (Greece) no longer
   sets a useful measure for the note: give the note a reading width up to
   the stamp, and start it under the title. */
.olga-country-head .olga-home-head__inner {
	min-width: min(30rem, calc(100% - var(--olga-stamp-base) * var(--olga-stamp-scale, 1) * 1.25 - 3rem));
}

.olga-country-head .olga-home-head__note {
	text-align: left;
}
