/**
 * Single article (single-blog.php): the header (breadcrumbs, H1 next to the cover, byline over a line), the sticky
 * table of contents with the reading progress next to the article, share links, the author box, "Read More Blogs".
 * The article's sections (Text, Media, Key Takeaways) lose their own section spacing and width here: the column sets them.
 * Editor canvas: editor--article.css.
 */

/* Header */
.article-header {
	padding-top: 32px;
}

.article-header__crumbs .breadcrumbs {
	font-size: var(--wp--preset--font-size--x-small);
}

.article-header__crumbs .breadcrumbs a {
	font-weight: 400;
	text-decoration: none;
}

.article-header__crumbs .breadcrumbs__item + .breadcrumbs__item::before {
	color: inherit;
	content: ">";
}

.article-header__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px clamp(32px, 4vw, 60px);
	margin-top: 32px;
	padding-bottom: 48px;
	border-bottom: 1px solid #eef0ff;
}

.article-header__grid--text {
	grid-template-columns: minmax(0, 860px);
}

.article-header__content {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.article-header__title {
	font-size: clamp(32px, 3.4vw, 48px);
	line-height: 1.08;
}

.article-header__image {
	width: 100%;
	aspect-ratio: 580 / 360;
	border-radius: var(--qq-radius);
	object-fit: cover;
}

/* Byline: author photo and name, the date and reading time. */
.article-byline {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: auto;
	color: var(--wp--preset--color--heading);
	font-size: var(--wp--preset--font-size--medium);
}

.article-byline__photo {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
}

.article-byline__author {
	display: block;
	color: inherit;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	font-weight: 800;
	text-decoration: none;
}

.article-byline__author:hover {
	color: var(--wp--preset--color--primary);
}

.article-byline__date {
	display: block;
	margin-top: 4px;
}

/* Layout: table of contents left, article right. */
.article {
	display: grid;
	grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
	gap: clamp(32px, 4.6vw, 66px);
	align-items: start;
	padding-block: clamp(40px, 5.6vw, 80px);
}

.article--single {
	grid-template-columns: minmax(0, 900px);
	justify-content: center;
}

.article__aside {
	position: sticky;
	top: calc(var(--qq-header-height) + 24px);
	display: grid;
	gap: 32px;
}

.admin-bar .article__aside {
	top: calc(var(--qq-header-height) + 56px);
}

.article__content > .section {
	padding-block: 0;
}

.article__content > .section + .section {
	margin-top: 1.6em;
}

.article__content > .section > .container {
	max-width: none;
	padding-inline: 0;
}

.article__content .prose h2 {
	scroll-margin-top: calc(var(--qq-header-height) + 24px);
}

.article-toc__title {
	color: var(--wp--preset--color--heading);
	font-size: 16px;
	font-weight: 700;
}

.article-toc__list {
	display: grid;
	gap: 16px;
	margin: 32px 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
}

.article-toc__list a {
	display: block;
	padding-left: 16px;
	border-left: 4px solid transparent;
	color: var(--wp--preset--color--text);
	text-decoration: none;
	transition: color 0.2s, border-color 0.2s;
}

.article-toc__list a:hover,
.article-toc__list a:focus-visible {
	color: var(--wp--preset--color--primary);
}

.article-toc__list a[aria-current="true"] {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--heading);
	font-weight: 700;
}

.article-progress {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	padding: 20px 16px;
	border-radius: 12px;
	background-color: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--heading);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
}

.article-progress__bar {
	grid-column: 1 / -1;
	height: 4px;
	overflow: hidden;
	border-radius: 4px;
	background-color: var(--wp--preset--color--periwinkle);
}

.article-progress__bar span {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background-color: var(--wp--preset--color--primary);
	transform: scaleX(var(--progress, 0));
	transform-origin: left;
}

/* Share links. */
.article-share {
	margin-top: clamp(48px, 6vw, 80px);
}

.article-share__label {
	color: var(--wp--preset--color--heading);
}

.article-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.article-share__link {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--base);
	transition: background-color 0.3s;
}

.article-share__link:hover {
	background-color: var(--wp--preset--color--primary);
}

.article-share__link .icon {
	width: 20px;
	height: 20px;
}

/* Author box after the article. */
.article-author {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	margin-top: clamp(48px, 6vw, 80px);
}

.article-author__photo {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	object-fit: cover;
}

.article-author__label {
	color: var(--wp--preset--color--heading);
}

.article-author__name {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 500;
}

.article-author__name a {
	color: var(--wp--preset--color--heading);
}

.article-author__name a:hover {
	color: var(--wp--preset--color--primary);
}

.article-author__position {
	margin-top: 4px;
	color: var(--wp--preset--color--slate);
}

.article-author__bio {
	margin-top: 24px;
	color: var(--wp--preset--color--heading);
}

/* Read More Blogs. */
.article-more__heading {
	margin-bottom: 32px;
}

.article-more__actions {
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

@media (max-width: 900px) {
	.article-header__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.article {
		grid-template-columns: minmax(0, 1fr);
	}

	.article__aside {
		position: static;
	}

	.article-progress {
		display: none;
	}
}

@media (max-width: 600px) {
	.article-author {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.article-author__photo {
		width: 96px;
		height: 96px;
	}
}
