/*
 * The article page in the new design (article-detail.html, article_v2/), scoped .ar, on the index
 * kit (ix_base.css: --ix-* tokens, .ix-wrap, .ix-forest, the index cards). The text itself is
 * article_body.css (.ab), shared with the admin's editor.
 *
 * The forest top (title, subtitle, reading time, date) with the main image rising out of its
 * curved bottom, sharing on the image. Then the reading column (42rem) on paper, with more
 * articles and an ad beside it from 1,000px and an ad on the left from 1,920px, as on the old
 * page. Then suggested articles, the bottom ad and the comments.
 */

.ar {
	--ar-rise: clamp(4.5rem, 14vw, 10rem);   /* how far the image rises into the forest */
	--ar-read: 42rem;
	--ar-radius: 28px;

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

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

/* ---------- The top ---------- */

.ar-hero {
	padding: clamp(2rem, 6vw, 3.75rem) 0 calc(var(--ar-rise) + clamp(1.75rem, 4vw, 2.75rem));
	text-align: center;
}

.ar-hero--draft {
	padding-bottom: clamp(3rem, 8vw, 5rem);
}

.ar-hero__inner {
	max-width: 54rem;
}

.ar-draft {
	margin: 0 0 1rem;
	color: var(--ix-lime);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.ar-topics {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .45rem;
	margin: 0 0 1.25rem;
}

.ar .ar-topic {
	padding: .35rem .9rem .25rem;
	border: 1px solid rgba(248, 255, 246, .24);
	border-radius: 999px;
	color: var(--ix-cream);
	font-size: .8125rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color .2s, background-color .2s, color .2s;
}

.ar .ar-title {
	margin: 0;
	color: var(--ix-cream);
	font-family: var(--ix-display);
	font-size: clamp(2.3rem, 7vw, 4.25rem);
	font-weight: normal;
	line-height: 1.02;
	letter-spacing: -.02em;
	text-wrap: balance;
}

.ar-sub {
	max-width: 40rem;
	margin: .6rem auto 0;
	color: var(--ix-lime);
	font-family: var(--ix-display);
	font-size: clamp(1.35rem, 3.6vw, 1.9rem);
	line-height: 1.2;
	text-wrap: balance;
}

.ar-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .4rem 1.25rem;
	margin: 1.4rem 0 0;
	color: var(--ix-sage);
	font-size: .9375rem;
	font-weight: 600;
}

.ar-meta__item {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
}

.ar-meta__item svg {
	flex: none;
	width: 1rem;
	height: 1rem;
}

.ar .ar-meta__pdf {
	color: var(--ix-cream);
	text-decoration: underline;
	text-decoration-color: rgba(190, 227, 120, .6);
	text-underline-offset: .2em;
}

/* ---------- The main image, rising out of the top ---------- */

.ar-media {
	position: relative;
	max-width: calc(66rem + 2 * var(--ix-gutter));
	margin-top: calc(-1 * var(--ar-rise));
}

.ar-media__frame {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	border-radius: 20px;
	background: #DCE2D8;
	box-shadow: 0 24px 60px rgba(26, 37, 24, .22);
}

@media (min-width: 600px) {
	.ar-media__frame {
		aspect-ratio: 16 / 9;
		border-radius: var(--ar-radius);
	}
}

.ar-media__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Sharing on the image, in the recipe page's dark glass (recipe_page.css, .rp-glass) */
.ar-share {
	position: absolute;
	top: .85rem;
	right: .85rem;
	display: flex;
	gap: .45rem;
}

.ar .ar-glass {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 50%;
	background: rgba(26, 33, 22, .55);
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	transition: background-color .2s;
}

.ar .ar-glass:hover {
	background: rgba(26, 33, 22, .78);
	color: #fff;
}

.ar .ar-glass:focus {
	outline: none;
}

.ar .ar-glass:focus-visible {
	outline: 3px solid var(--ix-lime);
	outline-offset: 2px;
}

.ar-glass svg {
	width: 1.05rem;
	height: 1.05rem;
}

.ar-glass svg[viewBox="0 0 32 32"] {
	width: 1.35rem;
	height: 1.35rem;
}

/* "Link copied", where the browser has no share sheet */
.ar-glass__toast {
	position: absolute;
	top: calc(100% + .5rem);
	right: 0;
	padding: .35rem .7rem .25rem;
	border-radius: 999px;
	background: rgba(26, 33, 22, .85);
	color: #fff;
	font-size: .8125rem;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
}

/* ---------- The reading column, and what's beside it ---------- */

.ar-layout {
	display: grid;
	grid-template-columns: minmax(0, var(--ar-read));
	grid-template-areas: "main";
	justify-content: center;
	gap: 3.5rem;
	padding-top: clamp(2rem, 5vw, 3.25rem);
}

.ar-main {
	grid-area: main;
	min-width: 0;
}

.ar-rail {
	display: none;
}

@media (min-width: 1000px) {
	.ar-layout {
		grid-template-columns: minmax(0, var(--ar-read)) 300px;
		grid-template-areas: "main right";
		max-width: calc(var(--ar-read) + 300px + 3.5rem + 2 * var(--ix-gutter));
	}

	.ar-rail--right {
		display: flex;
		flex-direction: column;
		gap: 2rem;
		grid-area: right;
	}
}

@media (min-width: 1920px) {
	.ar-layout {
		grid-template-columns: 300px minmax(0, var(--ar-read)) 300px;
		grid-template-areas: "left main right";
		max-width: calc(var(--ar-read) + 600px + 7rem + 2 * var(--ix-gutter));
	}

	.ar-rail--left {
		display: block;
		grid-area: left;
	}
}

/* The abstract, as the text's lede */
.ar-lede {
	margin: 0 0 2rem;
	padding-bottom: 1.75rem;
	border-bottom: 1px solid var(--ix-line);
	color: var(--ix-ink);
	font-size: clamp(1.2rem, 2.6vw, 1.375rem);
	line-height: 1.55;
	text-wrap: pretty;
}

.ar-video {
	position: relative;
	overflow: hidden;
	margin: 0 0 2.5rem;
	aspect-ratio: 16 / 9;
	border-radius: 18px;
	background: #1A2116;
	box-shadow: 0 14px 34px rgba(26, 37, 24, .14);
}

.ar-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* The PDF guides, after the text */
.ar-guides {
	display: grid;
	gap: 1rem;
	margin-top: 3rem;
	scroll-margin-top: 6rem;
}

.ar-guide {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	align-items: center;
	padding: clamp(1.25rem, 4vw, 1.75rem);
	border-radius: 22px;
	background-color: #1A2116;
	background-image: radial-gradient(70% 90% at 0 0, rgba(114, 160, 106, .28), transparent 65%);
	color: #F8FFF6;
}

@media (min-width: 560px) {
	.ar-guide {
		grid-template-columns: 9rem minmax(0, 1fr);
	}
}

.ar-guide__cover img {
	display: block;
	width: 100%;
	max-width: 12rem;
	height: auto;
	margin: 0 auto;
	border-radius: 8px;
	box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
	transform: rotate(-3deg);
}

/* The PDF's cover a fair bit bigger (Robin), so its pages read as something to get. Not the
   video page's audiobook card, whose cover is square */
.ar-guides .ar-guide__cover img {
	max-width: 15rem;
}

@media (min-width: 560px) {
	.ar-guides .ar-guide {
		grid-template-columns: 11rem minmax(0, 1fr);
		gap: 1.75rem;
	}
}

@media (min-width: 768px) {
	.ar-guides .ar-guide {
		grid-template-columns: 14rem minmax(0, 1fr);
		gap: 2.25rem;
	}
}

.ar-guide__eyebrow {
	margin: 0 0 .35rem;
	color: var(--ix-lime);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.ar .ar-guide__title {
	margin: 0 0 .5rem;
	color: #F8FFF6;
	font-family: var(--ix-display);
	font-size: 1.6rem;
	font-weight: normal;
	line-height: 1.15;
}

.ar-guide__desc {
	margin: 0 0 1.1rem;
	color: #C4D7C1;
	line-height: 1.55;
}

.ar .ar-guide__btn {
	display: inline-flex;
	padding: .75rem 1.4rem .65rem;
	border-radius: 999px;
	background: var(--ix-lime);
	color: var(--ix-ink);
	font-weight: 700;
	text-decoration: none;
	transition: box-shadow .3s var(--ix-ease);
}

/* More articles, beside the text */
.ar-rail__title {
	margin: 0 0 .9rem;
	color: var(--ix-green);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.ar-more-list {
	display: grid;
	gap: 1.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ar .ar-more-item {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	column-gap: .9rem;
	align-items: start;
	color: var(--ix-ink);
	text-decoration: none;
}

.ar-more-item img {
	grid-row: 1 / span 2;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 12px;
}

.ar-more-item__title {
	font-family: var(--ix-display);
	font-size: 1.15rem;
	line-height: 1.15;
	transition: color .2s;
}

.ar-more-item__sub {
	margin-top: .2rem;
	color: var(--ix-muted);
	font-size: .875rem;
	line-height: 1.35;
}

.ar-ad {
	flex: 1;
	width: 300px;
	margin: 0;
}

/* ---------- Below the text ---------- */

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

.ar-similar {
	padding-top: clamp(3rem, 7vw, 5rem);
}


/* The bottom ad (article-detail-ad-bottom.html, the old layout's): in the page's flow, not
   shifted 3rem down over the comments */
.ar-bottom-ad {
	padding-top: clamp(2.5rem, 6vw, 4rem);
}

.ar-bottom-ad > .container-fluid {
	top: 0 !important;
}

.ar-comments {
	max-width: calc(50rem + 2 * var(--ix-gutter));
	padding-top: clamp(2.5rem, 6vw, 4rem);
}

/* comment-section.html is the old layout's (Bootstrap columns): one column here */
.ar-comments .row {
	margin: 0;
}

.ar-comments .row > [class*="col-"] {
	flex: 0 0 100%;
	max-width: 100%;
	padding: 0;
}

.ar-comments .row > .col-md-1 {
	display: none;
}

@media (hover: hover) {
	.ar .ar-topic:hover {
		border-color: var(--ix-lime);
		background: rgba(190, 227, 120, .12);
		color: var(--ix-cream);
	}

	.ar .ar-more-item:hover .ar-more-item__title {
		color: var(--ix-green);
	}

	.ar .ar-guide__btn:hover {
		color: var(--ix-ink);
		box-shadow: 0 0 0 5px rgba(190, 227, 120, .25), 0 0 22px 4px rgba(190, 227, 120, .3);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ar .ar-topic,
	.ar .ar-glass,
	.ar .ar-guide__btn,
	.ar-more-item__title {
		transition: none;
	}
}
