/*
 * The shared kit of the new design's light pages (pul_website/static/css/ix_base.css): the
 * tokens, the apps' search pill, the quick-row pills, the card grids and cards
 * (pul_website/templates/index_v2/cards/), their badges and the "more" button. Scoped to
 * .ix-kit, so any page can use it: the index pages (with index_v2.css for their own layout,
 * the panel and the tabs) and the home page (with home.css).
 */

.ix-kit {
	--ix-canvas: #EEEFEB;
	--ix-paper: #F9FBF8;
	--ix-surface: #E4E6E0;
	--ix-ink: #1A2518;
	--ix-text: #454E43;
	--ix-muted: #5F6B5B;
	--ix-line: rgba(26, 37, 24, .12);
	--ix-green: #507137;      /* the apps' green.primary (pills, badges, buttons) */
	--ix-green-2: #75A153;
	--ix-green-dark: #3E5530;
	--ix-lime: #BEE378;
	--ix-mustard: #C99738;
	--ix-display: 'Cotoris Bold', 'Hind Vadodara', sans-serif;
	--ix-sans: 'Hind Vadodara', sans-serif;
	--ix-max: 80rem;
	--ix-gutter: clamp(1rem, 4vw, 2.5rem);
	--ix-nav: 0px;            /* how much the navbar covers (recipe_index_page.js) */
	--ix-ease: cubic-bezier(.2, .8, .2, 1);

	color: var(--ix-ink);
	font-family: var(--ix-sans);
	text-align: left;
}

.ix-wrap {
	max-width: var(--ix-max);
	margin-inline: auto;
	padding-inline: var(--ix-gutter);
}

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

/* The apps' search field: a white pill with a 2px green border, lighter while typing */
.ix-search {
	position: relative;
	flex: 1;
	min-width: 0;
}

.ix-kit .ix-search__input {
	width: 100%;
	height: 3rem;
	padding: .3rem 3.2rem 0 1.25rem;
	border: 2px solid var(--ix-green);
	border-radius: 999px;
	background: #fff;
	color: var(--ix-ink);
	font-family: var(--ix-display);
	font-size: 1.3rem;
	box-shadow: 0 2px 4px rgba(33, 37, 41, .12);
	-webkit-appearance: none;
	appearance: none;
}

.ix-kit .ix-search__input::-webkit-search-cancel-button {
	display: none;
}

.ix-kit .ix-search__input::placeholder {
	color: #8A9387;
	font-family: var(--ix-display);
	opacity: 1;
}

.ix-kit .ix-search__input:focus {
	border-color: var(--ix-green-2);
	outline: none;
	box-shadow: 0 0 0 4px rgba(117, 161, 83, .18);
}

.ix-kit .ix-search__btn {
	position: absolute;
	top: 50%;
	right: .45rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.3rem;
	height: 2.3rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #57701B;
	transform: translateY(-50%);
	cursor: pointer;
}

.ix-kit .ix-search__btn:hover {
	background: rgba(87, 112, 27, .1);
	color: #57701B;
}

.ix-search__btn svg {
	width: 1.15rem;
	height: 1.15rem;
}

/* The navbar's outlined lens (the index pages' pill): its strokes sit well inside the 24px grid,
   so it's drawn larger to read the same */
.ix-search__btn svg.ix-lens {
	width: 1.5rem;
	height: 1.5rem;
}

/* ---------- The quick row: toggles (recipe types, playlists) or the search's tabs ---------- */

.ix-quick {
	margin-top: 1rem;
}

.ix-quick__row {
	display: flex;
	gap: .45rem;
	overflow-x: auto;   /* phones: one row to swipe */
	padding-block: .2rem;
	scrollbar-width: none;
}

.ix-quick__row::-webkit-scrollbar {
	display: none;
}

.ix-kit .ix-pill {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: .35rem;
	min-height: 2.25rem;
	padding: .32rem 1rem .2rem;
	border: 1px solid var(--ix-line);
	border-radius: 999px;
	background: rgba(249, 251, 248, .8);
	color: var(--ix-ink);
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s, border-color .2s;
}

.ix-kit .ix-pill:hover {
	border-color: rgba(80, 113, 55, .45);
	background: #fff;
	color: var(--ix-ink);
	text-decoration: none;
}

.ix-kit .ix-pill.is-active {
	border-color: var(--ix-green);
	background: var(--ix-green);
	color: #fff;
}

.ix-pill svg {
	width: .85rem;
	height: .85rem;
	margin-top: -.1rem;
}

@media (min-width: 768px) {
	.ix-quick__row {
		flex-wrap: wrap;
		overflow: visible;
	}
}

/* The grid: 2 columns, 3 from 540px of room, 4 from 900px (the docked panel takes room, so it's
   3 beside the panel, as in the app) */
.ix-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@container (min-width: 540px) {
	.ix-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1rem;
	}
}

@container (min-width: 900px) {
	.ix-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 1.25rem;
	}
}

/* A card, as in the apps: 3:4 photo with badges on it, the name below, a paper surface */
.ix-card {
	position: relative;   /* keeps screen-reader text (.sr-only) inside the card, and inside a scrolling row */
	min-width: 0;
}

.ix-kit .ix-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: 16px;
	background: var(--ix-paper);
	color: var(--ix-ink);
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
	transition: transform .3s var(--ix-ease), box-shadow .3s var(--ix-ease);
}

.ix-kit .ix-card__link:hover {
	color: var(--ix-ink);
	text-decoration: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
	transform: translateY(-2px);
}

.ix-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background: var(--ix-surface);
}

.ix-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ix-ease);
}

.ix-card__link:hover .ix-card__img {
	transform: scale(1.04);
}

.ix-card__badges {
	position: absolute;
	left: 6%;
	right: 6%;
	bottom: 5%;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
}

.ix-badge {
	display: inline-flex;
	align-items: center;
	gap: .2rem;
	height: 22px;
	padding: 1px 6px 0 5px;
	border-radius: 6px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.ix-badge svg {
	width: 11px;
	height: 11px;
	margin-top: -1px;
}

.ix-badge--time { background: var(--ix-green); }
.ix-badge--premium { background: var(--ix-mustard); }

/* An article's reading time: the book a little bigger than the other marks, so its lines of text
   show (Robin: the plain book was hard to make out) */
.ix-badge .ix-icon-read {
	width: 13px;
	height: 13px;
}

.ix-badge--premium svg {
	width: 13px;
	height: 11px;
}

/* A glass badge for the PDF guide */
.ix-badge--guide {
	background: rgba(26, 33, 22, .6);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

/* Video: the same glass, cut to the shape of YouTube's button (a mask; a rounded rectangle where
   masks aren't supported), with the white play in the middle */
.ix-badge--video {
	justify-content: center;
	width: 30px;
	padding: 0;
	border-radius: 7px;
	background: rgba(26, 33, 22, .6);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 5 20 14' preserveAspectRatio='none'%3E%3Cpath d='M21.6 7.2a2.5 2.5 0 0 0-1.8-1.8C18.2 5 12 5 12 5s-6.2 0-7.8.4a2.5 2.5 0 0 0-1.8 1.8C2 8.8 2 12 2 12s0 3.2.4 4.8a2.5 2.5 0 0 0 1.8 1.8C5.8 19 12 19 12 19s6.2 0 7.8-.4a2.5 2.5 0 0 0 1.8-1.8C22 15.2 22 12 22 12s0-3.2-.4-4.8z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 5 20 14' preserveAspectRatio='none'%3E%3Cpath d='M21.6 7.2a2.5 2.5 0 0 0-1.8-1.8C18.2 5 12 5 12 5s-6.2 0-7.8.4a2.5 2.5 0 0 0-1.8 1.8C2 8.8 2 12 2 12s0 3.2.4 4.8a2.5 2.5 0 0 0 1.8 1.8C5.8 19 12 19 12 19s6.2 0 7.8-.4a2.5 2.5 0 0 0 1.8-1.8C22 15.2 22 12 22 12s0-3.2-.4-4.8z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* The triangle's box sits right of its middle (the point is narrow): pulled back so it looks
   centred in the button */
.ix-badge--video svg {
	width: 10px;
	height: 10px;
	margin: 0 0 0 -1px;
}

/* Two lines at most; the bottom space is a margin, as overflow clips at the padding edge */
.ix-card__name {
	display: -webkit-box;
	min-height: calc(2 * 1.15em + .7rem);
	margin-bottom: .75rem;
	padding: .7rem .85rem 0;
	overflow: hidden;
	font-family: var(--ix-display);
	font-size: 1.05rem;
	line-height: 1.15;
	letter-spacing: -.005em;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

@container (min-width: 540px) {
	.ix-card__name { font-size: 1.2rem; }
}

@container (min-width: 900px) {
	.ix-card__name {
		min-height: calc(2 * 1.15em + .8rem);
		margin-bottom: .85rem;
		padding: .8rem 1rem 0;
		font-size: 1.35rem;
	}
}

/* The star line (the home page's favourites), close under the name */
.ix-card__rating {
	margin: -.45rem 0 .8rem;
	padding: 0 .85rem;
	color: var(--ix-ink);
	font-size: .875rem;
	font-weight: 600;
}

.ix-card__rating > span:first-child {
	color: #FF912C;
}

.ix-card__rating-count {
	color: var(--ix-muted);
	font-weight: 500;
}

@container (min-width: 900px) {
	.ix-card__rating { padding: 0 1rem; }
}

/* A subtitle (articles, videos, shop items), close under the name */
.ix-card__sub {
	display: -webkit-box;
	margin: -.5rem 0 .85rem;
	padding: 0 .85rem;
	overflow: hidden;
	color: var(--ix-muted);
	font-size: .9375rem;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Videos: a play mark in the middle of the thumbnail */
.ix-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: rgba(26, 33, 22, .55);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	transform: translate(-50%, -50%);
	transition: transform .3s var(--ix-ease), background-color .2s;
}

/* No nudge: the triangle already sits right of centre in its 16px box, which puts its centre of
   mass on the circle's centre (it had a margin as well, and looked pushed right) */
.ix-card__play svg {
	width: 1.15rem;
	height: 1.15rem;
}

.ix-card__link:hover .ix-card__play {
	background: rgba(26, 33, 22, .75);
	transform: translate(-50%, -50%) scale(1.08);
}

/* Articles (3:2) and videos (16:9): one a row on phones, 2 from 540px of room, 3 from 900px.
   The names don't keep two lines of room: subtitles vary anyway. */
.ix-grid--article,
.ix-grid--video {
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}

.ix-grid--article .ix-card__media,
.ix-shape--article .ix-card__media { aspect-ratio: 3 / 2; }   /* the shape anywhere else (a carousel row) */
.ix-grid--video .ix-card__media,
.ix-shape--video .ix-card__media { aspect-ratio: 16 / 9; }

.ix-grid--article .ix-card__name,
.ix-grid--video .ix-card__name,
.ix-shape--article .ix-card__name,
.ix-shape--video .ix-card__name {
	min-height: 0;
	font-size: 1.25rem;
}

@container (min-width: 540px) {
	.ix-grid--article,
	.ix-grid--video {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ix-grid--article .ix-card__name,
	.ix-grid--video .ix-card__name {
		font-size: 1.2rem;
	}
}

@container (min-width: 900px) {
	.ix-grid--article,
	.ix-grid--video {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.25rem;
	}

	.ix-grid--article .ix-card__name,
	.ix-grid--video .ix-card__name {
		font-size: 1.3rem;
	}
}

/* Shop items: the product contained on white, at its own scale */
.ix-card--shop .ix-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	padding: 10%;
	background: #fff;
}

.ix-card--shop .ix-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ix-card--shop .ix-card__badges {
	top: 5%;
	bottom: auto;
}

/* The shop's own badges (Robin: better than the plain tags): rounder, with a mark. PUL pick in
   the site's forest with a lime heart (our favourites), New in lime with a spark */
.ix-badge--pick,
.ix-badge--new {
	gap: .25rem;
	padding: 1px 8px 0 6px;
	border-radius: 999px;
	box-shadow: 0 1px 3px rgba(26, 33, 22, .14);
	letter-spacing: .01em;
}

.ix-badge--pick {
	background: var(--ix-forest, #1A2116);
	color: #F8FFF6;
}

.ix-badge--pick svg {
	width: 11px;
	height: 11px;
	margin-top: -1px;
	color: var(--ix-lime);
}

.ix-badge--new {
	background: var(--ix-lime);
	color: var(--ix-ink);
}

.ix-badge--new svg {
	width: 10px;
	height: 10px;
	margin-top: -1px;
}

.ix-card--shop .ix-card__name {
	min-height: 0;
}

/* Show more / the end */
.ix-more-row {
	display: flex;
	justify-content: center;
	margin-top: 1.75rem;
}

.ix-kit .ix-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 3rem;
	padding: .75rem 1.6rem .62rem;
	border-radius: 999px;
	background: var(--ix-green);
	color: #fff;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .2s;
}

.ix-kit .ix-more:hover {
	background: var(--ix-green-dark);
	color: #fff;
	text-decoration: none;
}

.ix-kit .ix-more[aria-busy="true"] {
	opacity: .7;
	pointer-events: none;
}

.ix-kit .ix-end {
	margin: 0;
	color: var(--ix-muted);
	font-size: .9375rem;
}

@media (prefers-reduced-motion: reduce) {
	.ix-kit .ix-card__link,
	.ix-card__img {
		transition: none;
	}

	.ix-kit .ix-card__link:hover,
	.ix-card__link:hover .ix-card__img {
		transform: none;
	}
}

/* ---------- The forest band: a page's dark top ----------
 * The home page's hero colours (main/static/css/home.css, .hm-hello): the footer's forest with
 * the landing page's glows, and a bottom that is the footer's curved top turned over. The eBook
 * index and the pages layer (pages.css) open with it. Text: cream 16:1, sage 10.9:1, lime
 * 11.3:1 on the green. */
.ix-forest {
	--ix-forest: #1A2116;
	--ix-cream: #F8FFF6;
	--ix-sage: #C4D7C1;

	border-radius: 0 0 50% 50% / 0 0 36px 36px;
	background-color: var(--ix-forest);
	background-image:
		radial-gradient(70% 70% at 8% 0, rgba(114, 160, 106, .26), transparent 62%),
		radial-gradient(55% 65% at 88% 30%, rgba(190, 227, 120, .14), transparent 66%),
		radial-gradient(60% 50% at 50% 110%, rgba(114, 160, 106, .16), transparent 70%);
	background-repeat: no-repeat;
	color: var(--ix-cream);
}

.ix-forest :focus-visible {
	outline-color: var(--ix-lime);
}

/* ---------- A row of cards to swipe through (ix_carousel.js) ----------
 * The recipe page's similar recipes as a shared part: the heading and, from 768px, the arrows in
 * the page's width; the row the full width, its first card in line with the heading, each card
 * snapping into place. Markup: [data-ix-carousel] > .ix-carousel__head (heading, arrows with
 * data-ix-scroll="-1" / "1"), ul.ix-carousel__row[data-ix-row] of cards (.ix-card). The cards'
 * width: --ix-carousel-card. */
.ix-carousel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.ix-kit .ix-carousel__title {
	margin: 0;
	color: var(--ix-ink);
	font-family: var(--ix-display);
	font-size: clamp(1.75rem, 5vw, 2.4rem);
	font-weight: normal;
	line-height: 1.1;
}

.ix-carousel__arrows {
	display: none;
	flex: none;
	gap: .5rem;
}

@media (min-width: 768px) {
	.ix-carousel__arrows {
		display: flex;
	}
}

.is-static .ix-carousel__arrows {
	display: none;   /* everything fits (ix_carousel.js) */
}

.ix-kit .ix-carousel__arrow {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid var(--ix-line);
	border-radius: 50%;
	background: #fff;
	color: var(--ix-ink);
	cursor: pointer;
	transition: background-color .2s, border-color .2s, opacity .2s;
}

.ix-kit .ix-carousel__arrow:hover:not(:disabled) {
	border-color: transparent;
	background: var(--ix-lime);
}

.ix-kit .ix-carousel__arrow:disabled {
	opacity: .35;
	cursor: default;
}

.ix-carousel__arrow svg {
	width: 1rem;
	height: 1rem;
}

.ix-carousel__row {
	--ix-row-pad: max(var(--ix-gutter), calc((100% - var(--ix-max)) / 2 + var(--ix-gutter)));
	display: grid;
	grid-auto-columns: var(--ix-carousel-card, min(78vw, 20rem));
	grid-auto-flow: column;
	gap: 1rem;
	margin: 1.25rem 0 0;
	padding: .35rem var(--ix-row-pad) 1rem;   /* room for the cards' lift and shadow */
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-padding-inline: var(--ix-row-pad);
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.ix-carousel__row::-webkit-scrollbar {
	display: none;
}

.ix-carousel__row > * {
	scroll-snap-align: start;
}
