/* Idyllic Free Reading - styles. Design tokens per idyllic-visions-theme. */

.ivfr-root {
	--ivfr-bone: #F5F1E8;
	--ivfr-ink: #16130E;
	--ivfr-gold: #B0863C;
	--ivfr-gold-deep: #8A6526;
	--ivfr-night: #0E0C14;
	color: var(--ivfr-ink);
	font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
	max-width: 1080px;
	margin: 0 auto;
	padding: 8px 16px 40px;
}

.ivfr-h2 {
	font-family: Fraunces, Georgia, serif;
	font-size: 30px;
	font-weight: 600;
	text-align: center;
	margin: 18px 0 6px;
}

.ivfr-sub,
.ivfr-note {
	text-align: center;
	font-size: 16px;
	color: #3A342B;
	margin: 0 0 22px;
}

.ivfr-note { border-left: 4px solid var(--ivfr-gold); background: #fff; padding: 10px 14px; text-align: left; }

/* ---------- deck picker ---------- */
.ivfr-deck-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
.ivfr-deck-tile {
	background: #fff;
	border: 1px solid #E2D9C6;
	border-radius: 10px;
	padding: 14px 12px;
	cursor: pointer;
	text-align: center;
	transition: transform .15s ease, box-shadow .15s ease;
	font-family: inherit;
}
.ivfr-deck-tile:hover,
.ivfr-deck-tile:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 8px 22px rgba(22, 19, 14, .12);
	outline: 2px solid var(--ivfr-gold);
	outline-offset: 2px;
}
.ivfr-deck-tile img {
	width: 100%;
	max-width: 150px;
	border-radius: 6px;
	display: block;
	margin: 0 auto;
}
.ivfr-deck-title {
	display: block;
	margin-top: 10px;
	font-family: Fraunces, Georgia, serif;
	font-size: 16px;
	font-weight: 600;
	color: var(--ivfr-ink);
}
.ivfr-deck-count {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	letter-spacing: .5px;
	color: #6E6552;
	text-transform: uppercase;
}

/* ---------- spread ---------- */
.ivfr-cards {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	gap: 26px;
	margin: 26px 0 8px;
	flex-wrap: wrap;
}
.ivfr-cell {
	flex: 0 1 300px;
	max-width: 300px;
	text-align: center;
}
.ivfr-pos-label {
	font-family: Fraunces, Georgia, serif;
	font-size: 18px;
	font-weight: 600;
	color: var(--ivfr-gold-deep);
	margin-bottom: 10px;
}
.ivfr-card {
	perspective: 1200px;
	width: 100%;
}
.ivfr-card-inner {
	position: relative;
	width: 100%;
	transform-style: preserve-3d;
	transition: transform .65s cubic-bezier(.4, .1, .2, 1);
	will-change: transform;
}
.ivfr-card.is-flipped .ivfr-card-inner { transform: rotateY(180deg); }
.ivfr-face {
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 6px 18px rgba(22, 19, 14, .18);
}
/* Back face sits in normal flow and defines the card's height.
   No reliance on aspect-ratio support or theme img rules. */
.ivfr-face-back { position: relative; }
.ivfr-face-back img { width: 100%; height: auto; display: block; }
.ivfr-face-front { position: absolute; inset: 0; transform: rotateY(180deg); }
.ivfr-face-front img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* After the flip lands, settle to a plain in-flow image. This removes
   all resting 3D state, which Chrome paints unreliably on narrow
   viewports and phones. */
.ivfr-card.is-settled .ivfr-card-inner { transform: none; transition: none; }
.ivfr-card.is-settled .ivfr-face-back { display: none; }
.ivfr-card.is-settled .ivfr-face-front { position: static; transform: none; }
.ivfr-card.is-settled .ivfr-face-front img { height: auto; }

/* ---------- reading text ---------- */
.ivfr-reading {
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .5s ease, transform .5s ease;
	margin-top: 14px;
	text-align: left;
}
.ivfr-reading[hidden] { display: none; } /* takes NO layout space before the flip */
.ivfr-reading.is-visible { opacity: 1; transform: none; }
.ivfr-lens {
	font-size: 13px;
	font-style: italic;
	color: #6E6552;
	margin: 0 0 6px;
	text-align: center;
}
.ivfr-card-name {
	font-family: Fraunces, Georgia, serif;
	font-size: 21px;
	font-weight: 600;
	margin: 0 0 4px;
	text-align: center;
}
.ivfr-keywords {
	font-size: 12.5px;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: var(--ivfr-gold-deep);
	margin: 0 0 10px;
	text-align: center;
}
.ivfr-interp { font-size: 15.5px; line-height: 1.65; margin: 0; color: #2E2921; }

/* ---------- controls, gate, footer ---------- */
.ivfr-controls,
.ivfr-foot { text-align: center; margin-top: 26px; }

.ivfr-btn {
	display: inline-block;
	height: 40px;
	line-height: 40px;
	padding: 0 30px;
	border-radius: 40px;
	border: 0;
	font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
	font-size: 14px;
	letter-spacing: 1px;
	cursor: pointer;
	text-decoration: none;
	margin: 6px 8px;
}
.ivfr-btn-gold { background: var(--ivfr-gold); color: #fff; }
.ivfr-btn-gold:hover { background: var(--ivfr-gold-deep); }
.ivfr-btn-gold:disabled { opacity: .55; cursor: default; }
.ivfr-btn-outline {
	background: transparent;
	color: var(--ivfr-gold-deep);
	border: 1.5px solid var(--ivfr-gold);
	line-height: 37px;
}
.ivfr-btn-outline:hover { background: rgba(176, 134, 60, .08); }

.ivfr-linklike {
	display: block;
	margin: 12px auto 0;
	background: none;
	border: 0;
	color: #6E6552;
	text-decoration: underline;
	cursor: pointer;
	font-size: 13.5px;
	font-family: inherit;
}

.ivfr-gate {
	max-width: 460px;
	margin: 22px auto 0;
	background: #fff;
	border: 1px solid #E2D9C6;
	border-radius: 10px;
	padding: 22px 24px;
	text-align: center;
}
.ivfr-offer { font-size: 15.5px; line-height: 1.55; margin: 0 0 14px; }
.ivfr-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ivfr-input {
	flex: 1 1 220px;
	height: 40px;
	border: 1px solid #C9BFA8;
	border-radius: 40px;
	padding: 0 16px;
	font-size: 15px;
	font-family: inherit;
	background: var(--ivfr-bone);
	color: var(--ivfr-ink);
}
.ivfr-input:focus { outline: 2px solid var(--ivfr-gold); outline-offset: 1px; }
.ivfr-hp { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; opacity: 0; }
.ivfr-error { color: #8A2B2B; font-size: 13.5px; margin: 10px 0 0; }
.ivfr-consent { font-size: 12px; color: #6E6552; margin: 12px 0 0; }
.ivfr-testnote { font-size: 12.5px; font-style: italic; color: #8A6526; margin: 0 0 12px; }
.ivfr-gate-note { font-size: 13.5px; color: #8A6526; background: rgba(176, 134, 60, .08); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }
.ivfr-input-code { flex: 0 1 160px; text-align: center; letter-spacing: 4px; font-size: 17px; }
.ivfr-gate .ivfr-linklike { display: inline-block; margin: 12px 10px 0; }

.ivfr-kit-note {
	font-size: 15px;
	color: var(--ivfr-gold-deep);
	margin: 0 0 12px;
	font-weight: 500;
}
.ivfr-next-note { font-size: 13px; color: #6E6552; margin: 14px 0 0; }

.ivfr-print-foot { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
	.ivfr-deck-grid { grid-template-columns: repeat(2, 1fr); }
	.ivfr-cards { flex-direction: column; align-items: center; }
	.ivfr-cell { flex-basis: auto; width: min(320px, 86vw); max-width: none; }
}

/* ---------- print ----------
   The reading is cloned into #ivfr-print (a direct child of <body>) and
   printed in NORMAL FLOW. The old visibility/absolute overlay truncated
   at page boundaries in Chrome and on phones. */
#ivfr-print { display: none; }

@media print {
	@page { margin: 12mm; }

	body.ivfr-printing > :not(#ivfr-print) { display: none !important; }

	#ivfr-print {
		display: block;
		font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
		color: #16130E;
	}
	#ivfr-print .ivfr-print-title {
		font-family: Fraunces, Georgia, serif;
		font-size: 19px;
		font-weight: 600;
		text-align: center;
		margin: 0 0 12px;
	}
	/* One row per card: text left, card image right. Sized so three rows
	   plus title and footer fit a single Letter or A4 sheet. */
	#ivfr-print .ivfr-p-row {
		display: flex;
		align-items: center;
		gap: 16px;
		break-inside: avoid;
		page-break-inside: avoid;
		margin: 0 0 13px;
	}
	#ivfr-print .ivfr-p-text { flex: 1 1 auto; min-width: 0; }
	#ivfr-print .ivfr-p-card { flex: 0 0 180px; }
	#ivfr-print .ivfr-p-card img {
		width: 180px;
		height: 254px;
		object-fit: cover;
		border-radius: 8px;
		display: block;
	}
	#ivfr-print .ivfr-p-pos {
		font-family: Fraunces, Georgia, serif;
		font-size: 12.5px;
		color: #8A6526;
		letter-spacing: .4px;
		margin: 0 0 2px;
	}
	#ivfr-print .ivfr-p-lens { font-size: 10px; font-style: italic; color: #6E6552; margin: 0 0 6px; }
	#ivfr-print .ivfr-p-name { font-family: Fraunces, Georgia, serif; font-size: 16px; font-weight: 600; margin: 0 0 3px; }
	#ivfr-print .ivfr-p-kw { font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; color: #8A6526; margin: 0 0 7px; }
	#ivfr-print .ivfr-p-interp { font-size: 11px; line-height: 1.5; margin: 0; }
	#ivfr-print .ivfr-p-foot {
		text-align: center;
		font-size: 10px;
		color: #6E6552;
		border-top: 1px solid #C9BFA8;
		padding-top: 8px;
		margin: 4px 0 0;
	}

	/* Printing the normal page (no print block, e.g. face-down state):
	   never paint the rotated front face over the back. */
	.ivfr-card:not(.is-settled) .ivfr-face-front { display: none !important; }
}
