/* Jost lives inside this plugin. Nothing is fetched from anywhere else. */
@font-face {
	font-family: "FMP Jost";
	src: url("fonts/jost-latin-300-normal.woff2") format("woff2");
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "FMP Jost";
	src: url("fonts/jost-latin-300-italic.woff2") format("woff2");
	font-weight: 300;
	font-style: italic;
	font-display: swap;
}

/* Only for bold words typed into an explanation. Everything else is light. */
@font-face {
	font-family: "FMP Jost";
	src: url("fonts/jost-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

/* The colours and the one font of the whole design. */
.fmp-form {
	--fmp-plum: #36163f;
	--fmp-ink: #2b1233;
	--fmp-manila: #eed8a6;
	--fmp-manila-back: #d6b873;
	--fmp-sheet: #fffdf9;
	--fmp-rose: #a81e5c;
	--fmp-font: "FMP Jost", "Century Gothic", Futura, sans-serif;

	margin: 2.5em 0;
	max-width: 100%;
	color: var(--fmp-ink);
	font-family: var(--fmp-font);
	font-weight: 300;
	text-shadow: none;
	overflow-wrap: anywhere;
}

/* One solid card with a hairline in the folder's gold. */
.fmp-q {
	margin: 0 0 3.5rem;
	overflow: hidden;
	border: 1px solid var(--fmp-manila);
	border-radius: 8px;
	background: var(--fmp-plum);
}

/* Number strip */
.fmp-form .fmp-q__strip {
	padding: .55rem 1rem;
	color: var(--fmp-manila);
	font-family: var(--fmp-font);
	font-size: .95rem !important;
	font-weight: 300;
	line-height: 1.3;
}

/* Media */
.fmp-form .fmp-q__gif {
	margin: 0;
	background: var(--fmp-plum);
}

.fmp-form .fmp-q__gif img {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	margin: 0 auto;
}

/* Reveal: a box the same shape as the picture, so the page doesn't jump. */
.fmp-form .fmp-reveal {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	min-height: 12rem;
	max-height: 80vh;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.fmp-form .fmp-reveal .fmp-reveal__img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	object-fit: contain;
	visibility: hidden;
}

.fmp-form .fmp-reveal.is-open .fmp-reveal__img {
	visibility: visible;
}

.fmp-form .fmp-reveal .fmp-reveal__btn,
.fmp-form .fmp-reveal .fmp-reveal__btn:hover,
.fmp-form .fmp-reveal .fmp-reveal__btn:focus {
	padding: .55rem 1.8rem !important;
	border: 0 !important;
	border-radius: 6px !important;
	background: var(--fmp-manila) !important;
	box-shadow: none !important;
	color: var(--fmp-ink) !important;
	font-family: var(--fmp-font) !important;
	font-size: 1.2rem !important;
	font-weight: 300 !important;
	line-height: 1.3 !important;
	text-transform: none !important;
	cursor: pointer;
}

.fmp-form .fmp-reveal.is-open .fmp-reveal__btn {
	display: none !important;
}

/* Folder tabs: real file-folder shape. */
.fmp-tabs {
	display: flex;
	gap: .15rem;
	padding: .6rem clamp(.4rem, 2vw, 1rem) 0;
	background: var(--fmp-plum); /* Runs on from the picture, so the folder is flush with it. */
}

.fmp-form .fmp-tabs .fmp-tab,
.fmp-form .fmp-tabs .fmp-tab:hover,
.fmp-form .fmp-tabs .fmp-tab:focus {
	position: relative;
	z-index: 0;
	flex: 0 1 auto;
	margin: 0;
	padding: .4rem clamp(.8rem, 3.2vw, 1.5rem) .4rem !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: var(--fmp-ink) !important;
	font-family: var(--fmp-font) !important;
	font-size: 1.05rem !important;
	font-weight: 300 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	text-transform: none !important;
	white-space: nowrap;
	cursor: pointer;
}

/* Keeps themes' dotted boxes off anything clicked with a mouse. */
.fmp-form .fmp-tabs .fmp-tab:focus:not(:focus-visible),
.fmp-form .fmp-reveal .fmp-reveal__btn:focus:not(:focus-visible) {
	outline: none !important;
}

/* The tab's sloped shape */
.fmp-tab::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	border-radius: 9px 9px 0 0;
	background: var(--fmp-manila);
	transform: perspective(60px) rotateX(9deg);
	transform-origin: bottom;
	transition: background-color .15s;
}

.fmp-tab:hover::before {
	background: #f6e6c2;
}

/* Arrow: points down when closed, up when open. */
.fmp-tab__label::after {
	content: "";
	display: inline-block;
	width: .38em;
	height: .38em;
	margin: 0 .1em .16em .5em;
	border-right: 1px solid;
	border-bottom: 1px solid;
	transform: rotate(45deg);
	transition: transform .15s;
}

.fmp-tab.is-open .fmp-tab__label::after {
	margin-bottom: -.02em;
	transform: rotate(-135deg);
}

.fmp-form .fmp-tab:focus-visible,
.fmp-form .fmp-reveal__btn:focus-visible,
.fmp-form .fmp-send__btn:focus-visible,
.fmp-form .fmp-copy:focus-visible {
	outline: 3px solid var(--fmp-rose);
	outline-offset: 2px;
}

/* The folder: a gold edge under the tab, and the contents run edge to edge. */
.fmp-folder {
	border-top: .45rem solid var(--fmp-manila);
}

.fmp-form .fmp-panel {
	display: none;
	background: var(--fmp-sheet);
}

.fmp-form .fmp-panel.is-open {
	display: block;
	animation: fmp-open .2s ease-out;
}

.fmp-q__ask {
	padding: 1.4rem 1.35rem 1.6rem;
}

@keyframes fmp-open {
	from {
		opacity: 0;
		transform: translateY(.6rem);
	}
}

/* Questions sheet */
.fmp-form .fmp-q__title {
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
	color: var(--fmp-plum) !important;
	font-family: var(--fmp-font);
	font-size: 1.55rem;
	font-weight: 300;
	letter-spacing: 0;
	line-height: 1.25;
	text-transform: none;
}

.fmp-q__options {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}

.fmp-form .fmp-opt {
	display: block;
	margin: 0;
	font-weight: inherit;
	cursor: pointer;
}

/* The real radio stays in place for keyboards and screen readers, just invisible. */
.fmp-form .fmp-opt__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.fmp-form .fmp-opt__text {
	position: relative;
	display: block;
	padding: .7rem 1rem .7rem 2.7rem;
	border: 1.5px solid var(--fmp-manila-back);
	border-radius: 5px;
	color: var(--fmp-ink);
	font-family: var(--fmp-font);
	font-size: 1.12rem;
	font-weight: 300;
	line-height: 1.35;
	transition: background-color .12s, border-color .12s;
}

.fmp-opt__text::before {
	content: "";
	position: absolute;
	top: .85rem;
	left: 1rem;
	box-sizing: border-box;
	width: 1.05rem;
	height: 1.05rem;
	border: 1.5px solid var(--fmp-plum);
	border-radius: 50%;
}

.fmp-form .fmp-opt:hover .fmp-opt__text {
	border-color: var(--fmp-plum);
}

.fmp-form .fmp-opt__input:checked + .fmp-opt__text {
	border-color: var(--fmp-plum);
	background: var(--fmp-plum);
	color: #fff;
}

.fmp-opt__input:checked + .fmp-opt__text::before {
	padding: 2px;
	border-color: var(--fmp-manila);
	background: var(--fmp-manila) content-box;
}

.fmp-opt__input:focus-visible + .fmp-opt__text {
	outline: 3px solid var(--fmp-rose);
	outline-offset: 2px;
}

/* Explanation: white on the strip's purple, under the answers */
.fmp-form .fmp-q__note {
	padding: 1.3rem 1.35rem 1.5rem;
	background: var(--fmp-plum);
	color: #fff;
	font-family: var(--fmp-font);
	font-size: 1.12rem !important;
	font-weight: 300;
	line-height: 1.65;
}

/* Stops the theme's text and link colours or fonts getting into the sheet. */
.fmp-form .fmp-q__note * {
	color: inherit;
	font-family: inherit;
	font-size: inherit !important; /* Outranks the theme's fixed body size. */
	line-height: inherit;
}

.fmp-form .fmp-q__note strong,
.fmp-form .fmp-q__note b {
	font-weight: 500;
}

.fmp-form .fmp-q__note p {
	max-width: 62ch;
	margin: 0 0 .9em;
}

.fmp-form .fmp-q__note p:last-child {
	margin-bottom: 0;
}

.fmp-form .fmp-q__note a {
	color: var(--fmp-manila);
	text-decoration: underline;
}

/* Email button */
.fmp-send {
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--fmp-manila);
	border-radius: 8px;
	background: var(--fmp-plum);
}

.fmp-form .fmp-send .fmp-send__note {
	margin: 0;
	padding: 0 1.2rem 1.1rem;
	color: #fff;
	font-family: var(--fmp-font);
	font-size: 1rem !important;
	font-weight: 300;
	line-height: 1.5;
	text-align: center;
}

/* Empty until the copy link is pressed. */
.fmp-form .fmp-copy-status {
	display: block;
	color: var(--fmp-manila);
}

.fmp-form .fmp-copy-status:not(:empty) {
	margin-top: .5rem;
}

/* Reads as a link inside the sentence. */
.fmp-form .fmp-send .fmp-copy,
.fmp-form .fmp-send .fmp-copy:hover,
.fmp-form .fmp-send .fmp-copy:focus {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: var(--fmp-manila) !important;
	font: inherit !important;
	text-decoration: underline !important;
	text-transform: none !important;
	cursor: pointer;
}

.fmp-form .fmp-send .fmp-send__btn,
.fmp-form .fmp-send .fmp-send__btn:hover {
	display: block;
	padding: .75rem 1rem .5rem;
	border: 0 !important;
	background: none !important;
	color: var(--fmp-manila) !important;
	font-family: var(--fmp-font) !important;
	font-size: 1.3rem;
	font-weight: 300;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.fmp-form .fmp-panel.is-open {
		animation: none;
	}

	.fmp-tab::before,
	.fmp-tab__label::after,
	.fmp-form .fmp-opt__text {
		transition: none;
	}
}
