/**
 * Claritas tools.
 *
 * The theme owns the design tokens. Every one of them has a fallback here, so
 * the tools still look like themselves under any other theme, and the result
 * card is meant to read as a small tarot card: paper, a thin gold frame, and
 * the display face for the number.
 */

.claritas-tools {
	--ct-paper: var(--paper, #F8F2EC);
	--ct-paper-2: var(--paper-2, #FBF7F2);
	--ct-ink: var(--ink, #33243A);
	--ct-ink-soft: var(--ink-soft, #6C5A72);
	--ct-rose: var(--rose, #C9697E);
	/* The fill of a solid button: white on --rose is 3.58:1, on this 5.25:1. */
	--ct-rose-strong: var(--rose-strong, #A94F66);
	--ct-rose-deep: var(--rose-deep, #9E4459);
	--ct-rose-soft: var(--rose-soft, #F3D9DE);
	--ct-gold: var(--gold, #C39A55);
	--ct-sage: var(--sage, #7E9A86);
	--ct-night: var(--night, #2C2136);
	--ct-line: var(--line, rgba(51, 36, 58, .14));
	--ct-display: var(--display, "Fraunces", Georgia, "Times New Roman", serif);
	--ct-body: var(--body, "Alegreya Sans", "Gill Sans", Calibri, system-ui, sans-serif);
	--ct-moonlight: #F8F2EC;
	--ct-radius: 12px;
	--ct-shadow: 0 30px 44px -34px rgba(74, 40, 50, .45), 0 2px 4px rgba(74, 40, 50, .06);

	font-family: var(--ct-body);
	color: var(--ct-ink);
	font-size: 19px;
	line-height: 1.5;
	max-width: 46rem;
	margin: 0 auto 8px;
	display: block;
}

.claritas-tool-slot {
	margin: 28px 0;
}

.claritas-tools p {
	margin: 0 0 16px;
}

.claritas-tools h2,
.claritas-tools h3 {
	font-family: var(--ct-display);
	font-weight: 500;
	line-height: 1.12;
	margin: 0 0 12px;
	font-variation-settings: "opsz" 96, "SOFT" 60, "WONK" 1;
}

.claritas-tools h2 {
	font-size: clamp(26px, 3.2vw, 36px);
	letter-spacing: -.012em;
}

.claritas-tools h3 {
	font-size: 24px;
	font-variation-settings: "opsz" 48, "SOFT" 50;
}

.claritas-tools a {
	color: var(--ct-rose-deep);
}

.claritas-tools :focus-visible {
	outline: 2px solid var(--ct-rose-deep);
	outline-offset: 3px;
}

.claritas-tools [tabindex="-1"]:focus {
	outline: none;
}

/* The form
   ------------------------------------------------------------------ */

.ct-form {
	background: var(--ct-paper-2);
	border: 1px solid var(--ct-line);
	border-radius: var(--ct-radius);
	box-shadow: var(--ct-shadow);
	padding: clamp(20px, 3.6vw, 32px);
}

.ct-form-title {
	font-family: var(--ct-display);
	font-style: italic;
	font-size: 21px;
	line-height: 1.35;
	color: var(--ct-rose-deep);
	font-variation-settings: "opsz" 24, "SOFT" 100, "WONK" 1;
	margin: 0 0 16px;
}

.ct-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0 0 8px;
}

.ct-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0;
	flex: 1 1 120px;
	min-width: 0;
}

.ct-field-day {
	flex: 0 1 96px;
}

.ct-field-year {
	flex: 0 1 128px;
}

.ct-field-name {
	flex: 1 1 100%;
}

.ct-field label {
	font-size: 15px;
	letter-spacing: .02em;
	color: var(--ct-ink-soft);
}

.ct-field input,
.ct-field select {
	font-family: inherit;
	font-size: 18px;
	color: var(--ct-ink);
	background: var(--ct-paper);
	border: 1px solid var(--ct-line);
	border-radius: 10px;
	padding: 11px 12px;
	width: 100%;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
}

.ct-field select {
	background-image: linear-gradient(45deg, transparent 50%, var(--ct-ink-soft) 50%), linear-gradient(135deg, var(--ct-ink-soft) 50%, transparent 50%);
	background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 34px;
}

.ct-field input:focus,
.ct-field select:focus {
	border-color: var(--ct-rose);
}

.ct-actions {
	margin: 18px 0 10px;
}

.ct-btn {
	font-family: inherit;
	font-size: 18px;
	line-height: 1;
	color: #fff;
	background: var(--ct-rose-strong);
	border: 1px solid var(--ct-rose-strong);
	border-radius: 12px;
	padding: 14px 22px;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}

.ct-btn:hover {
	background: var(--ct-rose-deep);
	border-color: var(--ct-rose-deep);
}

.ct-btn-light {
	color: var(--ct-rose-deep);
	background: transparent;
	border-color: var(--ct-rose);
	padding: 11px 18px;
	font-size: 16px;
}

.ct-btn-light:hover {
	background: var(--ct-rose-soft);
	border-color: var(--ct-rose-deep);
}

.ct-note,
.ct-noscript {
	font-size: 15px;
	line-height: 1.45;
	color: var(--ct-ink-soft);
	margin: 0;
}

.ct-noscript {
	margin: 16px 0 0;
}

.ct-error {
	margin: 12px 0 0;
	font-size: 16px;
	color: var(--ct-rose-deep);
}

/* The result, which wants to look like a small card
   ------------------------------------------------------------------ */

.ct-result {
	margin: 26px 0 0;
}

.ct-card {
	position: relative;
	background: var(--ct-paper);
	background-image: radial-gradient(120% 90% at 50% 0%, var(--ct-paper-2) 0%, var(--ct-paper) 62%);
	border: 1px solid var(--ct-line);
	border-radius: 16px;
	box-shadow: var(--ct-shadow);
	padding: 10px;
}

.ct-card-frame {
	border: 1px solid var(--ct-gold);
	border-radius: 10px;
	padding: clamp(22px, 4vw, 36px);
}

.ct-card-frame::before {
	content: "";
	display: block;
	width: 42px;
	height: 1px;
	background: var(--ct-gold);
	opacity: .7;
	margin: 0 auto 18px;
}

.ct-card-kicker {
	font-size: 14px;
	letter-spacing: .13em;
	text-transform: lowercase;
	color: var(--ct-ink-soft);
	text-align: center;
	margin: 0 0 10px;
}

.ct-card-figure {
	font-family: var(--ct-display);
	font-size: clamp(46px, 9vw, 72px);
	line-height: 1;
	text-align: center;
	color: var(--ct-rose-deep);
	font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1;
	margin: 0 0 8px;
}

.ct-card-figure-small {
	font-size: clamp(26px, 4.2vw, 36px);
	line-height: 1.15;
}

.ct-card-title {
	font-family: var(--ct-display);
	text-align: center;
	margin: 4px 0 6px;
}

.ct-card-meta {
	text-align: center;
	font-size: 15px;
	color: var(--ct-ink-soft);
	margin: 0 0 18px;
}

.ct-card-body {
	margin: 0;
}

.ct-card-body p:last-child {
	margin-bottom: 0;
}

.ct-card-aside {
	color: var(--ct-ink-soft);
	font-size: 17px;
	margin-top: 14px;
}

.ct-card-reason {
	text-align: center;
	font-family: var(--ct-display);
	font-style: italic;
	font-size: 21px;
	line-height: 1.35;
	font-variation-settings: "opsz" 24, "SOFT" 100, "WONK" 1;
	margin: 0 0 14px;
}

.ct-card-link {
	margin: 16px 0 0;
	text-align: center;
}

.ct-card-link a {
	border-bottom: 1px solid var(--ct-gold);
	text-decoration: none;
	padding-bottom: 1px;
}

.ct-card-link a:hover {
	border-bottom-color: var(--ct-rose-deep);
}

.ct-status {
	display: block;
	margin: 0 auto 18px;
	width: fit-content;
	padding: 4px 12px;
	border: 1px solid var(--ct-gold);
	border-radius: 999px;
	font-size: 14px;
	letter-spacing: .06em;
	color: var(--ct-ink-soft);
}

.ct-status-inside {
	color: var(--ct-rose-deep);
	border-color: var(--ct-rose);
	background: var(--ct-rose-soft);
}

/* The lean is the one word the whole card is about, so it has to be legible on
   the paper: --ct-sage measured 2.8:1 and --ct-gold 2.4:1 against it. These are
   the same two colours taken a shade deeper, at 4.1:1 and above. */
.ct-lean-yes {
	color: #5F7C68;
}

.ct-lean-no {
	color: var(--ct-rose-deep);
}

.ct-lean-maybe {
	color: #96702F;
}

/* The step box
   ------------------------------------------------------------------ */

.ct-step {
	margin: 22px 0 0;
	padding: 16px 18px;
	background: var(--ct-rose-soft);
	border-radius: 10px;
}

.ct-step p {
	margin: 0;
}

.ct-step-label {
	font-size: 13px;
	letter-spacing: .13em;
	color: var(--ct-rose-deep);
	margin: 0 0 6px;
}

/* The small notes under a life path
   ------------------------------------------------------------------ */

.ct-notes {
	margin: 20px 0 0;
	padding: 0;
	border-top: 1px solid var(--ct-line);
}

.ct-note-row {
	padding: 14px 0 0;
}

.ct-notes dt {
	font-size: 13px;
	letter-spacing: .12em;
	color: var(--ct-ink-soft);
	margin: 0 0 4px;
}

.ct-notes dd {
	margin: 0;
	font-size: 18px;
}

/* Card pictures
   ------------------------------------------------------------------ */

.ct-card-strip {
	display: flex;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
	margin: 0 0 18px;
}

.ct-mini {
	margin: 0;
	width: 132px;
	text-align: center;
}

.ct-mini img {
	display: block;
	width: 100%;
	/* The script builds this tag without a width or a height, so the box is
	   held open here and the card below it does not jump when the picture
	   arrives. Every card in the deck is drawn three by five. */
	aspect-ratio: 3 / 5;
	height: auto;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--ct-gold);
	background: var(--ct-paper-2);
}

.ct-mini-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	aspect-ratio: 3 / 5;
	padding: 10px;
	border-radius: 8px;
	border: 1px solid var(--ct-gold);
	/* This tile carries the card's name and it is what everybody sees until
	   the artwork ships, so it has to be legible: paper on the old
	   rose-soft-to-rose gradient measured 1.2:1 at the top. The same pink,
	   taken deep enough to read against, is 4.7:1 to 7.3:1. */
	background: linear-gradient(180deg, var(--ct-rose-strong), #7E3A4E);
	color: var(--ct-paper);
	font-family: var(--ct-display);
	font-size: 17px;
	line-height: 1.2;
}

.ct-mini-name {
	font-size: 15px;
	color: var(--ct-ink-soft);
	margin: 8px 0 0;
}

.ct-mini-link {
	text-decoration: none;
	color: inherit;
	display: inline-block;
}

.ct-mini-link:hover .ct-mini-name {
	color: var(--ct-rose-deep);
}

.ct-related-card {
	margin: 22px 0 0;
	text-align: center;
}

.ct-related-label {
	font-size: 13px;
	letter-spacing: .12em;
	color: var(--ct-ink-soft);
	margin: 0 0 10px;
}

.ct-tool-yesno .ct-mini {
	margin: 0 auto 4px;
}

/* The moon
   ------------------------------------------------------------------ */

.ct-tool-moon .ct-card {
	margin: 0;
}

.ct-moon-art {
	display: flex;
	justify-content: center;
	margin: 0 0 14px;
}

.ct-moon-svg {
	display: block;
	filter: drop-shadow(0 8px 18px rgba(44, 33, 54, .28));
}

.ct-moon-dates {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	justify-content: center;
	margin: 22px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--ct-line);
}

.ct-moon-dates > div {
	text-align: center;
	min-width: 140px;
}

.ct-moon-dates dt {
	font-size: 13px;
	letter-spacing: .12em;
	color: var(--ct-ink-soft);
	margin: 0 0 4px;
}

.ct-moon-dates dd {
	margin: 0;
	font-family: var(--ct-display);
	font-size: 20px;
	font-variation-settings: "opsz" 24, "SOFT" 60;
}

/* Sharing, links and standing copy
   ------------------------------------------------------------------ */

.ct-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 18px 0 0;
}

.ct-share-status {
	font-size: 15px;
	color: var(--ct-ink-soft);
}

.ct-links {
	margin: 22px 0 0;
}

.ct-links-title {
	font-size: 13px;
	letter-spacing: .12em;
	color: var(--ct-ink-soft);
	margin: 0 0 8px;
}

.ct-links ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
}

.ct-links li {
	margin: 0;
}

.ct-standing-copy {
	margin: 24px 0 0;
}

/* Motion, kept small and switched off on request
   ------------------------------------------------------------------ */

.ct-result.is-in .ct-card {
	animation: ct-rise .45s ease both;
}

@keyframes ct-rise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.claritas-tools *,
	.claritas-tools *::before,
	.claritas-tools *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}

	.ct-result.is-in .ct-card {
		animation: none;
	}
}

/* ---------- phones: type, tap targets and one column
   ------------------------------------------------------------------ */

@media (max-width: 600px) {
	/* Nothing under 15px on a phone. The labels keep their letter-spacing, so
	   they still read as labels rather than as copy. */
	.ct-card-kicker,
	.ct-status,
	.ct-step-label,
	.ct-notes dt,
	.ct-moon-dates dt,
	.ct-links-title,
	.ct-related-label {
		font-size: 15px;
	}

	.ct-btn,
	.ct-btn-light {
		min-height: 48px;
		width: 100%;
	}

	.ct-share .ct-btn,
	.ct-share .ct-btn-light {
		width: auto;
		flex: 1 1 auto;
	}

	/* A link in a row of links needs room around it to be tapped. */
	.ct-links ul {
		gap: 4px 18px;
	}

	.ct-links a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.ct-moon-dates > div {
		min-width: 0;
		flex: 1 1 46%;
	}
}

@media (max-width: 480px) {
	.claritas-tools {
		font-size: 18px;
	}

	.ct-field-day,
	.ct-field-year {
		flex: 1 1 40%;
	}

	.ct-field-month {
		flex: 1 1 100%;
	}

	.ct-mini {
		width: 118px;
	}

	.ct-card-strip {
		gap: 12px;
	}
}

/* The door from a result into a free reading with that result in mind. */
.ct-reading-door {
	margin: 22px 0 4px;
	padding: 18px 20px;
	border: 1px solid rgba(201, 105, 126, .28);
	border-radius: 16px;
	background: rgba(243, 217, 222, .28);
}
.ct-reading-copy { margin: 0 0 12px; }
.ct-reading-door .ct-btn { display: inline-block; text-decoration: none; }
.entry-content .ct-reading-door a.ct-btn,
.ct-reading-door a.ct-btn { color: #fff; border-bottom: 0; text-decoration: none; }
.entry-content .ct-reading-door a.ct-btn:hover { color: #fff; border-bottom: 0; }

/* ---------------------------------------------------------------------
 * Wave two: pick a card, the generator, the year, the name, the pairing
 * ------------------------------------------------------------------ */

.ct-pick-row {
	display: flex;
	justify-content: center;
	gap: clamp(10px, 3vw, 26px);
	margin: 8px auto 20px;
	perspective: 1200px;
}

.ct-pick-card {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	width: clamp(88px, 26vw, 150px);
	aspect-ratio: 558 / 1000;
	cursor: pointer;
	position: relative;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .45s ease, transform .45s ease, filter .4s ease;
	border-radius: 10px;
}

.ct-pick-row.is-dealt .ct-pick-card {
	opacity: 1;
	transform: translateY(0);
}

.ct-pick-card:focus-visible {
	outline: 2px solid var(--ct-rose-deep);
	outline-offset: 4px;
}

.ct-pick-card:hover:not(:disabled) .ct-pick-inner {
	transform: translateY(-8px) rotate(-1.5deg);
}

.ct-pick-inner {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform .65s cubic-bezier(.2, .7, .2, 1);
	border-radius: 10px;
	box-shadow: 0 18px 30px -18px rgba(74, 40, 50, .55);
}

.ct-pick-card.is-flipped .ct-pick-inner {
	transform: rotateY(180deg);
}

.ct-pick-card.is-aside {
	opacity: .35;
	filter: saturate(.6);
	pointer-events: none;
}

.ct-pick-face {
	position: absolute;
	inset: 0;
	border-radius: 10px;
	overflow: hidden;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	background: var(--ct-paper);
}

.ct-pick-face img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ct-pick-front {
	transform: rotateY(180deg);
}

.ct-pick-front .ct-mini-fallback {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.ct-pick-card,
	.ct-pick-inner {
		transition: none;
	}
}

.ct-big {
	margin: 0 auto;
	width: clamp(150px, 42vw, 220px);
}

.ct-big img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 22px 36px -22px rgba(74, 40, 50, .55);
	transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.ct-big.is-reversed img {
	transform: rotate(180deg);
}

.ct-line {
	font-family: var(--ct-display);
	font-style: italic;
	font-size: 1.15em;
	line-height: 1.35;
	color: var(--ct-rose-deep);
	text-align: center;
	margin: 6px auto 18px;
	max-width: 30em;
}

.ct-toggle {
	text-align: center;
	color: var(--ct-ink-soft);
	font-size: .92em;
}

.ct-toggle label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.ct-toggle input {
	accent-color: var(--ct-rose-deep);
	width: 18px;
	height: 18px;
}

.ct-fields-wide .ct-field-fullname {
	flex: 1 1 100%;
}

.ct-person {
	border: 1px solid var(--ct-line);
	border-radius: var(--ct-radius);
	padding: 14px 16px 4px;
	margin: 0 0 14px;
	background: var(--ct-paper-2);
}

.ct-person-label {
	font-family: var(--ct-display);
	font-style: italic;
	color: var(--ct-rose-deep);
	margin: 0 0 6px;
}

.ct-card-strip-pair {
	gap: clamp(14px, 4vw, 36px);
	align-items: flex-start;
}

.ct-pair-person {
	text-align: center;
}

.ct-pair-label {
	font-family: var(--ct-display);
	font-style: italic;
	color: var(--ct-ink-soft);
	margin: 0 0 6px;
}

.ct-notes-numbers dt {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.ct-note-figure {
	font-family: var(--ct-display);
	font-size: 1.7em;
	line-height: 1;
	color: var(--ct-rose-deep);
}

.ct-note-label {
	font-size: .92em;
	color: var(--ct-ink-soft);
}

@media (max-width: 560px) {
	.ct-pick-row {
		gap: 10px;
	}
	.ct-pick-card {
		width: 24vw;
	}
}

.ct-card-body .ct-related-label {
	margin-top: 22px;
	padding-top: 14px;
	border-top: 1px solid var(--ct-line);
}
