/*
 * Articles (templates/single.html) and the /artiklar/ list page
 * (templates/articles-archive.html). Loaded only on those views (inc/article.php),
 * after refresh.css, and every rule is scoped under .is-article. Colours are the
 * refresh-* presets only (no hex values), corners are square and buttons take the
 * 4px radius from refresh.css.
 */

/* Head: breadcrumb, eyebrow, title, intro, the two buttons. */
.is-article .refresh-article__head {
	padding-top: 2rem;
}

.is-article .refresh-article__head > * {
	margin-block: 0;
}

.is-article .refresh-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem;
	margin-bottom: 1.25rem;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

.is-article .refresh-breadcrumb > * {
	margin: 0;
}

.is-article .refresh-breadcrumb a {
	color: var(--wp--preset--color--brown);
	text-decoration: none;
}

.is-article .refresh-article__eyebrow {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.75rem;
	margin-bottom: 0.75rem;
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brown);
}

.is-article .refresh-article__eyebrow > * {
	margin: 0;
}

.is-article .refresh-article__title {
	max-width: 48rem;
	margin-bottom: 1rem;
	font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
	line-height: 1.1;
}

.is-article .refresh-article__intro {
	max-width: 44rem;
	margin-bottom: 1.5rem;
	font-size: 1.25rem;
	line-height: 1.5;
}

.is-article .refresh-article__intro > p {
	margin: 0;
}

.is-article .refresh-article__actions {
	gap: 0.75rem 1rem;
	margin-top: 0;
}

/* Hero image: the full content width, square. */
.is-article .refresh-article__hero {
	margin: 2rem 0 0;
}

.is-article .refresh-article__hero img {
	display: block;
	width: 100%;
	height: auto;
}

/* Two columns: the article, and a sticky sidebar (contents list + measuring card). */
.is-article .refresh-article__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20rem;
	gap: 4rem;
	align-items: start;
	padding-block: 3rem var(--wp--preset--spacing--section);
}

.is-article .refresh-article__content {
	max-width: 46rem;
}

.is-article .refresh-article__content > * {
	margin-block: 0 1.25rem;
}

.is-article .refresh-article__content > h2 {
	margin-top: 2.5rem;
}

.is-article .refresh-article__content figure,
.is-article .refresh-article__figure {
	margin: 2rem 0;
}

.is-article .refresh-article__content img {
	display: block;
	width: 100%;
	height: auto;
}

.is-article .refresh-article__aside {
	position: sticky;
	top: calc(var(--header-height, 5.5rem) + 1.5rem);
}

/* Smaller headings inside the article body. */
.is-article .refresh-article__content h2 {
	font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
	line-height: 1.2;
}

/* Contents list. */
.is-article .refresh-toc__title {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.is-article .refresh-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.is-article .refresh-toc__list a {
	display: block;
	padding: 0.5rem 0.75rem;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
	text-decoration: none;
}

.is-article .refresh-toc__list a:hover {
	text-decoration: underline;
}

/* The current section in the contents list is a marker, not a button: brown with linen text (8.2:1). */
.is-article .refresh-toc__list a.is-active {
	background-color: var(--wp--preset--color--brown);
	color: var(--wp--preset--color--linen);
	font-weight: 600;
}

.is-article .refresh-article__card {
	margin-top: 1.5rem;
	padding: 1.5rem;
}

.is-article .refresh-article__card > * {
	margin-block: 0;
}

.is-article .refresh-article__card-title {
	margin-bottom: 0.5rem;
	font-size: 1.25rem;
}

.is-article .refresh-article__card-line {
	margin-bottom: 1rem;
	font-size: var(--wp--preset--font-size--small);
}

/* "Kort sagt" box. */
.is-article .refresh-kort {
	padding: 1.5rem;
}

.is-article .refresh-kort > * {
	margin-block: 0;
}

.is-article .refresh-kort__title {
	margin-bottom: 0.75rem;
	font-weight: 700;
}

.is-article .refresh-kort__list {
	margin: 0;
	padding-left: 1.25rem;
}

.is-article .refresh-kort__list li + li {
	margin-top: 0.5rem;
}

/* Inline product card. */
.is-article .refresh-product {
	display: grid;
	grid-template-columns: 12rem minmax(0, 1fr);
	gap: 1.5rem;
	align-items: center;
	padding: 1rem;
	background-color: var(--wp--preset--color--sand-light);
}

.is-article .refresh-product > * {
	margin-block: 0;
}

.is-article .refresh-product__image {
	margin: 0;
}

.is-article .refresh-product__image img {
	aspect-ratio: 1;
	object-fit: cover;
}

.is-article .refresh-product__body > * {
	margin-block: 0 0.5rem;
}

.is-article .refresh-product__eyebrow {
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.is-article .refresh-product__title {
	font-size: 1.375rem;
}

/* Callout. */
.is-article .refresh-callout {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	padding: 1.5rem;
}

.is-article .refresh-callout > * {
	margin: 0;
}

.is-article .refresh-callout__text {
	flex: 1 1 16rem;
	font-weight: 600;
}

/* FAQ: native details, answers are in the HTML; a refresh-sand panel on the cream ground. */
.is-article .refresh-faq {
	padding: 1.5rem;
	background-color: var(--wp--preset--color--sand-light);
}

.is-article .refresh-faq .wp-block-details {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--wp--preset--color--sand);
}

.is-article .refresh-faq .wp-block-details:last-child {
	border-bottom: 1px solid var(--wp--preset--color--sand);
}

.is-article .refresh-faq summary {
	padding: 1rem 0;
	font-weight: 600;
	cursor: pointer;
}

.is-article .refresh-faq .wp-block-details > :not(summary) {
	margin-block: 0 1rem;
}

/* Read more + the /artiklar/ list: cards. */
.is-article .refresh-article-related-section,
.is-article .refresh-articles-page {
	padding-block: var(--wp--preset--spacing--section);
}

.is-article .refresh-related__title,
.is-article .refresh-articles__title {
	margin: 0 0 1.5rem;
}

.is-article .refresh-articles__intro {
	margin: 0 0 2rem;
	font-size: 1.125rem;
}

.is-article .refresh-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.is-article .refresh-card > * {
	margin-block: 0 0.5rem;
}

.is-article .refresh-card__image {
	margin-bottom: 0.75rem;
}

.is-article .refresh-card__image img {
	display: block;
	width: 100%;
}

.is-article .refresh-card__date {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

.is-article .refresh-card__title {
	font-size: 1.25rem;
	line-height: 1.25;
}

.is-article .refresh-card__title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.is-article .refresh-card__title a:hover {
	color: var(--wp--preset--color--brown-dark);
	text-decoration: none;
}

.is-article .refresh-card__line {
	font-size: var(--wp--preset--font-size--small);
}

.is-article .refresh-card__line > p {
	margin: 0;
}

/* Bottom bar: phones only. */
.is-article .refresh-article-bar {
	display: none;
}

.is-article .refresh-toc-mobile {
	display: none;
}

@media (max-width: 47.99rem) {
	.is-article .refresh-article__head {
		padding-top: 1.25rem;
	}

	.is-article .refresh-article__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.is-article .refresh-article__actions .wp-block-button,
	.is-article .refresh-article__actions .wp-block-button__link {
		display: block;
		width: 100%;
		box-sizing: border-box;
		text-align: center;
	}

	.is-article .refresh-article__hero {
		margin-top: 1.5rem;
	}

	.is-article .refresh-article__hero img {
		aspect-ratio: 4 / 3 !important;
	}

	.is-article .refresh-article__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		padding-block: 2rem var(--wp--preset--spacing--section);
	}

	.is-article .refresh-article__aside {
		display: none;
	}

	.is-article .refresh-toc-mobile {
		display: block;
		margin: 1.5rem 0 0;
		border: 1px solid var(--wp--preset--color--ink);
	}

	.is-article .refresh-toc-mobile summary {
		padding: 0.75rem 1rem;
		font-weight: 600;
		cursor: pointer;
	}

	.is-article .refresh-toc-mobile .refresh-toc__list {
		padding: 0 0.5rem 0.75rem;
	}

	.is-article .refresh-toc-mobile .refresh-toc__list a {
		padding: 0.625rem 0.5rem;
		font-size: var(--wp--preset--font-size--body);
	}

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

	.is-article .refresh-product__image img {
		aspect-ratio: 16 / 10;
	}

	.is-article .refresh-callout .wp-block-buttons,
	.is-article .refresh-callout .wp-block-button,
	.is-article .refresh-callout .wp-block-button__link {
		display: block;
		width: 100%;
		box-sizing: border-box;
		text-align: center;
	}

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

	.is-article .refresh-article-bar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 9000;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		padding: 0.75rem 1rem;
		background-color: var(--wp--preset--color--cream);
		border-top: 1px solid var(--wp--preset--color--sand);
	}

	.is-article .refresh-article-bar > *,
	.is-article .refresh-article-bar > .wp-block-buttons {
		margin: 0;
	}

	.is-article .refresh-article-bar__text {
		font-weight: 600;
	}

	/* Hidden while the closing band (and anything after it) is on screen: assets/js/article.js. */
	html.is-article-bar-hidden .is-article .refresh-article-bar {
		display: none;
	}

	/* The round floating buttons (back to top, cookie settings) sit above the bar while it is shown.
	   Complianz writes its button's position with !important, so this does too. */
	html:not(.is-article-bar-hidden) body:not(.article-cta-partner) .scroll-to-top {
		bottom: 5.25rem;
	}

	html:not(.is-article-bar-hidden) body:not(.article-cta-partner) #cmplz-manage-consent .cmplz-manage-consent,
	html:not(.is-article-bar-hidden) body:not(.article-cta-partner) #cmplz-manage-consent .cmplz-manage-consent:hover {
		bottom: 5.25rem !important;
	}
}

/* Partner mode: the closing band is two equal columns, partner first, a 1px line between them. */
.is-article .refresh-closing-split__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.is-article .refresh-closing-split__half {
	padding: 4.5rem 3rem;
}

.is-article .refresh-closing-split__half {
	position: relative;
}

/* The divider: 1px refresh-ink at 25%, 70% of the band's height, centred; horizontal when the halves stack. */
.is-article .refresh-closing-split__half + .refresh-closing-split__half::before {
	content: "";
	position: absolute;
	top: 15%;
	left: 0;
	width: 1px;
	height: 70%;
	background-color: color-mix(in srgb, var(--wp--preset--color--linen) 25%, transparent);
}

.is-article .refresh-closing-split__half .refresh-closing__title {
	font-size: 2rem;
}

@media (max-width: 47.99rem) {
	.is-article .refresh-closing-split__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.is-article .refresh-closing-split__half {
		padding: 3rem 0;
	}

	.is-article .refresh-closing-split__half + .refresh-closing-split__half::before {
		top: 0;
		left: 15%;
		width: 70%;
		height: 1px;
	}

	.is-article .refresh-closing-split__half .refresh-closing__title {
		font-size: 1.625rem;
	}
}

/* The single "Bli partner" button is as tall as the booking and phone buttons in the other half (a 1px border in its own fill colour, set in refresh.css). */
.is-article .refresh-closing-split__half .wp-block-button.is-style-primary-button .wp-block-button__link {
	border-width: 1px;
}
