/*
 * GoConsent theme - blog: list (home.php), topics (archive.php) and posts (single.php).
 */

/* --- Post cards --- */

.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 28px;
}

.post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-lg);
	background: var(--site-surface);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
	border-color: var(--site-green-alpha-24);
	box-shadow: var(--site-shadow);
}

.post-card__media {
	display: block;
	aspect-ratio: 1200 / 630;
	background: var(--site-bg-sunken);
}

.post-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 24px;
}

.post-card__topic {
	align-self: flex-start;
	margin-bottom: 10px;
	color: var(--site-brand-deep);
	font-size: var(--site-size-xs);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
}

.post-card__topic:hover {
	text-decoration: underline;
}

.post-card__title {
	margin: 0 0 10px;
	font-size: var(--site-size-lg);
	line-height: 1.35;
}

.post-card__title a {
	color: inherit;
	text-decoration: none;
}

/* The whole card is clickable through the title link. */
.post-card {
	position: relative;
}

.post-card__title a::after {
	position: absolute;
	inset: 0;
	content: "";
}

.post-card__topic {
	position: relative;
	z-index: 1;
}

.post-card__title a:focus-visible {
	outline: none;
}

.post-card:focus-within {
	outline: 2px solid var(--site-brand);
	outline-offset: 2px;
}

.post-card__text {
	margin: 0 0 16px;
	color: var(--site-text-muted);
	font-size: var(--site-size-sm);
	line-height: 1.6;
}

.post-card__meta {
	margin: auto 0 0;
	color: var(--site-text-faint);
	font-size: var(--site-size-xs);
}

/* --- Topics --- */

.blog-topics {
	margin-top: 24px;
}

.blog-topics__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-topics__link {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--site-border-strong);
	border-radius: var(--site-radius-pill);
	background: var(--site-surface);
	color: var(--site-text);
	font-size: var(--site-size-sm);
	font-weight: 600;
	text-decoration: none;
}

.blog-topics__link:hover,
.blog-topics__link[aria-current="page"] {
	border-color: var(--site-brand);
	background: var(--site-brand-soft);
	color: var(--site-brand-darkest);
}

/* --- Pagination (the_posts_pagination) --- */

.blog-pagination {
	margin-top: 44px;
}

.blog-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.blog-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 42px;
	min-height: 42px;
	padding: 0 14px;
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-sm);
	color: var(--site-text);
	font-weight: 600;
	text-decoration: none;
}

.blog-pagination a.page-numbers:hover {
	border-color: var(--site-brand);
	color: var(--site-brand-deep);
}

.blog-pagination .page-numbers.current {
	border-color: var(--site-brand);
	background: var(--site-brand);
	color: var(--site-white);
}

.blog-pagination .page-numbers.dots {
	border: 0;
}

.blog-empty {
	max-width: 620px;
	padding: 36px;
	border: 1px dashed var(--site-border-strong);
	border-radius: var(--site-radius-lg);
	text-align: center;
}

.blog-empty p {
	margin: 0 0 20px;
}

/* --- One post --- */

/* Post layout: the text keeps a comfortable reading width (about 75 characters a line),
   aligned with the logo; on wide screens the table of contents fills the right side. */
.blog-post__head,
.blog-post__main {
	max-width: 780px;
}

.blog-post__main {
	min-width: 0;
}

@media (min-width: 1100px) {
	.blog-post--toc .blog-post__layout {
		display: grid;
		grid-template-columns: minmax(0, 780px) 260px;
		justify-content: space-between;
		gap: 64px;
	}

	.blog-toc--inline {
		display: none;
	}
}

@media (max-width: 1099px) {
	.blog-post__side {
		display: none;
	}
}

/* Table of contents. */
.blog-toc--side {
	position: sticky;
	top: var(--site-sticky-top);
	max-height: calc(100vh - var(--site-sticky-top) - 24px);
	overflow-y: auto;
	padding-left: 18px;
	border-left: 1px solid var(--site-border);
}

.blog-toc__title {
	margin: 0 0 10px;
	color: var(--site-text);
	font-size: var(--site-size-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.blog-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-toc__link {
	display: block;
	margin-left: -19px;
	padding: 6px 0 6px 17px;
	border-left: 2px solid transparent;
	color: var(--site-text-muted);
	font-size: var(--site-size-sm);
	line-height: 1.45;
	text-decoration: none;
}

.blog-toc__link:hover {
	color: var(--site-brand-deep);
}

.blog-toc__link[aria-current="true"] {
	border-left-color: var(--site-brand);
	color: var(--site-brand-deep);
	font-weight: 600;
}

.blog-toc--inline {
	margin: 0 0 32px;
	padding: 4px 20px;
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius);
	background: var(--site-surface);
}

.blog-toc--inline .blog-toc__title {
	margin: 0;
	padding: 14px 0;
	cursor: pointer;
}

.blog-toc--inline .blog-toc__list {
	padding-bottom: 14px;
}

.blog-toc--inline .blog-toc__link {
	margin-left: 0;
	padding-left: 0;
	border: 0;
}

/* Contents links land below the sticky header through html's scroll-padding-top (style.css). */

.blog-post__title {
	font-size: var(--site-size-2xl);
	line-height: 1.2;
}

.blog-post__meta {
	margin-top: 4px;
}

.blog-post__image {
	margin: 0 0 36px;
}

.blog-post__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--site-radius);
}

.blog-post__image figcaption,
.blog-post__content figcaption {
	margin-top: 10px;
	color: var(--site-text-faint);
	font-size: var(--site-size-sm);
	text-align: center;
}

.blog-post__content {
	font-size: var(--site-size-md);
	line-height: 1.75;
}

.blog-post__content > * + * {
	margin-top: 1.2em;
}

.blog-post__content img,
.blog-post__content video {
	max-width: 100%;
	height: auto;
	border-radius: var(--site-radius-sm);
}

.blog-post__content figure {
	margin: 2em 0;
}

.blog-post__content blockquote {
	margin: 1.8em 0;
	padding: 4px 0 4px 22px;
	border-left: 4px solid var(--site-brand);
	color: var(--site-text);
	font-size: var(--site-size-lg);
}

.blog-post__content blockquote cite {
	display: block;
	margin-top: 8px;
	color: var(--site-text-faint);
	font-size: var(--site-size-sm);
	font-style: normal;
}

.blog-post__content code {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--site-bg-sunken);
	font-family: var(--site-font-mono);
	font-size: 0.88em;
}

.blog-post__content pre {
	padding: 16px 18px;
	overflow-x: auto;
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-sm);
	background: var(--site-bg-sunken);
	line-height: 1.6;
}

.blog-post__content pre code {
	padding: 0;
	background: none;
	font-size: 0.85em;
}

.blog-post__content hr {
	margin: 2.5em 0;
	border: 0;
	border-top: 1px solid var(--site-border);
}

.blog-post__content .wp-block-embed iframe {
	max-width: 100%;
}

.blog-post__content .alignwide,
.blog-post__content .alignfull {
	max-width: 100%;
}

.blog-post__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
}

.blog-post__tags .chip {
	text-decoration: none;
}

.blog-post__note {
	margin-top: 36px;
}

.blog-related__title {
	margin: 0 0 28px;
	font-size: var(--site-size-xl);
}

/* --- Post elements (block styles from partials/blog.php; also shown in the editor) --- */

.is-style-gcs-keypoints,
.is-style-gcs-callout,
.is-style-gcs-warning {
	margin: 2em 0;
	padding: 22px 26px;
	border-radius: var(--site-radius);
}

.is-style-gcs-keypoints {
	border: 1px solid var(--site-green-alpha-24);
	background: var(--site-brand-soft);
}

.is-style-gcs-keypoints > :first-child:not(.wp-block-group__inner-container),
.is-style-gcs-keypoints > .wp-block-group__inner-container > :first-child {
	margin-top: 0;
	color: var(--site-brand-darkest);
	font-size: var(--site-size-sm);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.is-style-gcs-keypoints ul {
	margin: 10px 0 0;
	text-transform: none;
	letter-spacing: normal;
	padding: 0;
	list-style: none;
}

.is-style-gcs-keypoints li {
	position: relative;
	margin: 0 0 8px;
	padding-left: 28px;
}

.is-style-gcs-keypoints li::before {
	position: absolute;
	top: 0.35em;
	left: 0;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--site-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat;
	content: "";
}

.is-style-gcs-callout {
	border-left: 4px solid var(--site-info);
	background: var(--site-info-soft);
}

.is-style-gcs-warning {
	border-left: 4px solid var(--site-warn);
	background: var(--site-warn-soft);
}

/* Classic themes wrap Group content in .wp-block-group__inner-container: cover both. */
.is-style-gcs-keypoints > :last-child,
.is-style-gcs-callout > :last-child,
.is-style-gcs-warning > :last-child,
.is-style-gcs-keypoints > .wp-block-group__inner-container > :last-child,
.is-style-gcs-callout > .wp-block-group__inner-container > :last-child,
.is-style-gcs-warning > .wp-block-group__inner-container > :last-child {
	margin-bottom: 0;
}

.is-style-gcs-callout > :first-child,
.is-style-gcs-warning > :first-child,
.is-style-gcs-callout > .wp-block-group__inner-container > :first-child,
.is-style-gcs-warning > .wp-block-group__inner-container > :first-child {
	margin-top: 0;
}

/* Numbered steps. */
ol.is-style-gcs-steps {
	margin: 1.5em 0;
	padding: 0;
	list-style: none;
	counter-reset: gcs-step;
}

ol.is-style-gcs-steps > li {
	position: relative;
	margin: 0 0 16px;
	padding-left: 48px;
	counter-increment: gcs-step;
}

ol.is-style-gcs-steps > li::before {
	position: absolute;
	top: -2px;
	left: 0;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--site-brand);
	color: var(--site-white);
	font-size: 15px;
	font-weight: 700;
	content: counter(gcs-step);
}

/* Tables and figures. */
.wp-block-table {
	margin: 2em 0;
	overflow-x: auto;
}

.wp-block-table table {
	margin: 0;
}

.wp-block-table thead th {
	border-bottom: 2px solid var(--site-border-strong);
	background: var(--site-bg-sunken);
}

.wp-block-table figcaption,
.wp-block-image figcaption {
	margin-top: 10px;
	color: var(--site-text-faint);
	font-size: var(--site-size-sm);
	text-align: center;
}

/* FAQs: Details blocks. */
.wp-block-details {
	margin: 0;
	border-bottom: 1px solid var(--site-border);
}

.wp-block-details + .wp-block-details {
	margin-top: 0;
}

.wp-block-details summary {
	position: relative;
	padding: 18px 40px 18px 0;
	color: var(--site-text);
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	position: absolute;
	top: 50%;
	right: 6px;
	width: 10px;
	height: 10px;
	border-right: 2px solid var(--site-brand);
	border-bottom: 2px solid var(--site-brand);
	content: "";
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.2s ease;
}

.wp-block-details[open] summary::after {
	transform: translateY(-30%) rotate(-135deg);
}

.wp-block-details summary:focus-visible {
	outline: 2px solid var(--site-brand);
	outline-offset: 2px;
}

.wp-block-details > :not(summary) {
	margin: 0 0 18px;
}

/* Timeline (List block, Timeline style): each item's first bold text is its date.
   One column on phones; date beside the event on wider screens. */
.is-style-gcs-timeline {
	position: relative;
	margin: 2em 0;
	padding: 0;
	list-style: none;
}

.is-style-gcs-timeline > li {
	position: relative;
	margin: 0;
	padding: 0 0 26px 34px;
}

.is-style-gcs-timeline > li::before {
	position: absolute;
	top: 5px;
	left: 0;
	z-index: 1;
	width: 14px;
	height: 14px;
	border: 4px solid var(--site-brand-tint);
	border-radius: 50%;
	background: var(--site-brand);
	box-sizing: content-box;
	content: "";
}

.is-style-gcs-timeline > li::after {
	position: absolute;
	top: 14px;
	bottom: -6px;
	left: 10px;
	width: 2px;
	background: var(--site-border);
	content: "";
}

.is-style-gcs-timeline > li:last-child {
	padding-bottom: 0;
}

.is-style-gcs-timeline > li:last-child::after {
	content: none;
}

.is-style-gcs-timeline > li > strong:first-child {
	display: block;
	margin-bottom: 2px;
	color: var(--site-brand-deep);
	font-size: var(--site-size-sm);
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

@media (min-width: 600px) {
	.is-style-gcs-timeline > li {
		padding-left: 190px;
	}

	.is-style-gcs-timeline > li::before {
		left: 150px;
	}

	.is-style-gcs-timeline > li::after {
		left: 160px;
	}

	.is-style-gcs-timeline > li > strong:first-child {
		position: absolute;
		top: 1px;
		left: 0;
		width: 132px;
		text-align: right;
	}
}

/* On phones, wide tables scroll sideways with the first column held in place. */
@media (max-width: 760px) {
	.blog-post__content .wp-block-table th:first-child,
	.blog-post__content .wp-block-table td:first-child {
		position: sticky;
		left: 0;
		z-index: 1;
		min-width: 120px;
		background: var(--site-surface);
		box-shadow: 1px 0 0 var(--site-border);
	}

	.blog-post__content .wp-block-table thead th:first-child {
		background: var(--site-bg-sunken);
	}
}

/* Phone and tablet contents: same open/close arrow as the FAQs. */
.blog-toc--inline .blog-toc__title {
	position: relative;
	list-style: none;
}

.blog-toc--inline .blog-toc__title::-webkit-details-marker {
	display: none;
}

.blog-toc--inline .blog-toc__title::after {
	position: absolute;
	top: 50%;
	right: 4px;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--site-brand);
	border-bottom: 2px solid var(--site-brand);
	content: "";
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.2s ease;
}

.blog-toc--inline[open] .blog-toc__title::after {
	transform: translateY(-30%) rotate(-135deg);
}
