/*
 * The eBook index (ebook-index.html, ebook_index/), scoped .eb, on the index pages' kit
 * (ix_base.css: --ix-* tokens, .ix-wrap). The home page's forest hero with its glows and curved
 * bottom, the eBooks as light cards rising out of it, and readers' reviews. Greens and lime
 * only; each cover brings its own colour. Text on the forest: cream 16:1, sage 10.9:1, lime
 * 11.3:1.
 */

.eb {
	--eb-forest: #1A2116;
	--eb-cream: #F8FFF6;
	--eb-sage: #C4D7C1;
	--eb-rise: clamp(5.5rem, 13vw, 8rem);   /* how far the cards rise into the hero */
	--eb-radius: 28px;

	/* Clear of the footer's curved top, which sits 36px over the page (site_app.css) */
	padding-bottom: calc(clamp(2.75rem, 6vw, 4.5rem) + 36px);
	background: var(--ix-canvas);
	color: var(--ix-ink);
}

.eb :focus-visible {
	outline: 3px solid var(--ix-green);
	outline-offset: 3px;
}

.eb-eyebrow {
	margin: 0 0 .6rem;
	color: var(--ix-green);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.eb-eyebrow--light {
	color: var(--ix-lime);
}

.eb .eb-h2 {
	margin: 0 0 1.25rem;
	color: var(--ix-ink);
	font-family: var(--ix-display);
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	font-weight: normal;
	line-height: 1.1;
	letter-spacing: -.01em;
}

/* ---------- The hero (the forest band: ix_base.css, .ix-forest) ---------- */

.eb-hero {
	padding: clamp(2rem, 6vw, 4rem) 0 calc(var(--eb-rise) + clamp(1.5rem, 4vw, 2.5rem));
	text-align: center;
}

.eb-hero__inner {
	max-width: 46rem;
}

.eb .eb-title {
	margin: 0 0 .9rem;
	color: var(--eb-cream);
	font-family: var(--ix-display);
	font-size: clamp(2.4rem, 8vw, 4rem);
	font-weight: normal;
	line-height: 1;
	letter-spacing: -.02em;
	text-wrap: balance;
}

.eb-title__lime {
	color: var(--ix-lime);
}

.eb-lede {
	max-width: 32rem;
	margin: 0 auto;
	color: var(--eb-sage);
	font-size: 1.0625rem;
	line-height: 1.5;
	text-wrap: pretty;
}

.eb-proof {
	margin: 1rem 0 0;
	color: var(--eb-sage);
	font-size: .875rem;
	font-weight: 600;
}

.eb-proof__star {
	color: var(--ix-lime);
}

/* ---------- The eBooks ---------- */

.eb-shelf {
	position: relative;
	margin-top: calc(-1 * var(--eb-rise));
}

.eb-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(1.25rem, 3vw, 2rem);
	max-width: 66rem;
	margin: 0 auto;
	list-style: none;
}

.eb-grid--one {
	max-width: 34rem;
}

@media (min-width: 900px) {
	.eb-grid:not(.eb-grid--one) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.eb-card {
	border-radius: var(--eb-radius);
	background: var(--ix-paper);
	box-shadow: 0 1px 0 rgba(26, 37, 24, .04), 0 18px 50px rgba(26, 37, 24, .12);
	transition: transform .35s var(--ix-ease), box-shadow .35s var(--ix-ease);
}

.eb .eb-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--eb-radius);
	color: var(--ix-ink);
	text-decoration: none;
}

.eb-card__media {
	position: relative;
	display: grid;
	place-items: center;
	padding: clamp(1.75rem, 5vw, 2.5rem) 1rem clamp(1.5rem, 4vw, 2rem);
	border-radius: var(--eb-radius) var(--eb-radius) 0 0;
	background:
		radial-gradient(55% 60% at 50% 40%, rgba(190, 227, 120, .45), transparent 72%),
		linear-gradient(180deg, #DCE8D5, #EDF2E9);
}

/* The cover on the iPad: the frame (ipad_mockup_760.webp, its screen black) with the cover on
   its screen, cut to the screen's rounded corners */
.eb-device {
	position: relative;
	display: block;
	width: min(62%, 17.5rem);
	aspect-ratio: 760 / 1048;
	filter: drop-shadow(0 18px 26px rgba(26, 37, 24, .25));
	transition: transform .5s var(--ix-ease);
}

.eb-device__screen {
	position: absolute;
	z-index: 1;
	top: 3.2%;
	left: 3.5%;
	width: 92.5%;
	height: 94.3%;
	overflow: hidden;
	border-radius: 4% / 3%;
	background: #DCE2D8;
}

.eb-device__screen img,
.eb-device__frame {
	display: block;
	width: 100%;
	height: 100%;
}

.eb-device__screen img {
	object-fit: cover;
}

.eb-device__frame {
	position: absolute;
	inset: 0;
}

/* Tablets: one card a row, so the cover beside its text rather than over it */
@media (min-width: 600px) and (max-width: 899.98px) {
	.eb-grid:not(.eb-grid--one) .eb-card__link {
		flex-direction: row;
	}

	.eb-grid:not(.eb-grid--one) .eb-card__media {
		flex: 0 0 42%;
		padding: 1.75rem 1rem;
		border-radius: var(--eb-radius) 0 0 var(--eb-radius);
	}

	.eb-grid:not(.eb-grid--one) .eb-device {
		width: min(86%, 15rem);
	}
}

.eb-card__deal {
	position: absolute;
	top: 1rem;
	left: 1rem;
	padding: .4rem .85rem .3rem;
	border-radius: 999px;
	background: var(--eb-forest);
	color: var(--ix-lime);
	font-size: .875rem;
	font-weight: 700;
}

.eb-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: .7rem;
	padding: clamp(1.25rem, 4vw, 2rem);
}

.eb .eb-card__name {
	margin: 0;
	color: var(--ix-ink);
	font-family: var(--ix-display);
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	font-weight: normal;
	line-height: 1.05;
}

.eb-card__rating {
	font-weight: 600;
}

.eb-card__rating > span:first-child {
	color: var(--ix-mustard);
}

.eb-card__count {
	color: var(--ix-muted);
	font-weight: 400;
}

.eb-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
}

.eb-tag {
	padding: .35rem .8rem .25rem;
	border-radius: 999px;
	background: rgba(80, 113, 55, .1);
	color: var(--ix-green-dark);
	font-size: .8125rem;
	font-weight: 600;
}

.eb-card__desc {
	color: var(--ix-text);
	line-height: 1.55;
}

.eb-card__buy {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1rem;
	width: 100%;
	margin-top: auto;
	padding-top: .5rem;
}

.eb-price {
	color: var(--ix-ink);
	font-family: var(--ix-display);
	font-size: 1.75rem;
	line-height: 1;
}

.eb-price__was {
	margin-right: .3rem;
	color: var(--ix-muted);
	font-size: 1.15rem;
}

.eb-price__was + .eb-price__now {
	color: var(--ix-green);
}

/* Until ebook_index.js has the visitor's currency: the place kept, the US price unseen */
.eb-js .eb-price:not(.is-set) {
	visibility: hidden;
	animation: eb-price-show 0s 3s forwards;
}

@keyframes eb-price-show {
	to {
		visibility: visible;
	}
}

.eb-card__go {
	display: inline-flex;
	align-items: center;
	padding: .8rem 1.4rem .7rem;
	border-radius: 999px;
	background: var(--eb-forest);
	color: var(--eb-cream);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .2s, color .2s;
}

.eb-card__draft {
	color: #A3261E;
	font-size: .875rem;
	font-weight: 600;
}

.eb-empty {
	padding-block: 2rem;
	text-align: center;
}

@media (hover: hover) {
	.eb-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 1px 0 rgba(26, 37, 24, .04), 0 26px 60px rgba(26, 37, 24, .16);
	}

	.eb-card:hover .eb-device {
		transform: translateY(-6px) rotate(-1.5deg);
	}

	.eb-card:hover .eb-card__go {
		background: var(--ix-lime);
		color: var(--ix-ink);
	}
}

/* ---------- Readers' reviews ---------- */

.eb-section {
	padding-top: clamp(2.75rem, 6vw, 4.5rem);
}

.eb-reviews__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 900px) {
	.eb-reviews__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.eb-review figure {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	height: 100%;
	margin: 0;
	padding: 1.4rem 1.5rem;
	border-radius: 22px;
	background: var(--ix-paper);
	box-shadow: 0 1px 0 rgba(26, 37, 24, .04), 0 10px 30px rgba(26, 37, 24, .07);
}

.eb-review__stars {
	color: var(--ix-mustard);
	letter-spacing: .1em;
}

.eb-review__title {
	margin: 0;
	font-family: var(--ix-display);
	font-size: 1.3rem;
	line-height: 1.15;
}

.eb-review__text {
	margin: 0;
	color: var(--ix-text);
	line-height: 1.55;
}

.eb-review__text p {
	margin: 0;
}

.eb-review__by {
	margin-top: auto;
	padding-top: .25rem;
	color: var(--ix-muted);
	font-size: .9375rem;
}

.eb .eb-review__by a {
	color: var(--ix-green-dark);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: rgba(80, 113, 55, .35);
	text-underline-offset: .2em;
}

@media (prefers-reduced-motion: reduce) {
	.eb-card,
	.eb-device {
		transition: none;
	}

	.eb-card:hover,
	.eb-card:hover .eb-device {
		transform: none;
	}
}
