/**
 * GM Theme – blog overview: editorial magazine layout.
 *
 * Used by templates/page-blog.html, archive.html, search.html and
 * category-*.html. One Query Loop (pagination keeps working); layout from
 * CSS only: the first post is a wide feature (image left, text right), the
 * others form an even grid of three columns with 3:2 photos.
 *
 * 4.0.4: the title sits centred at the same place as on all other pages
 * (e.g. Galerien), categories and search centred below it, no dividing
 * lines. Works with a Site Editor copy of the templates too (CSS only).
 */

.gm-news {
	--gm-news-fg: var(--gm-ink, #1d1d1f);
	--gm-news-muted: var(--gm-muted, #6e6e73);
	--gm-news-faint: var(--gm-faint, #86868b);
	--gm-news-line: var(--gm-line, #d2d2d7);
	--gm-news-gap: var(--gm-gap, 1.5rem);

	box-sizing: border-box;
	max-width: calc(var(--gm-wide, 1200px) + 2 * var(--wp--preset--spacing--50, 1.5rem));
	margin-inline: auto;
	margin-block-start: 0 !important;
	/* No top padding: the title starts right below the header like the
	   page titles (Galerien, Biografie, …). */
	padding: 0 var(--wp--preset--spacing--50, 1.5rem) clamp(4rem, 8vw, 7rem) !important;
	background: none;
	color: var(--gm-news-fg);
}

.gm-news .wp-block-group {
	padding: 0;
	background: none;
}

/* Global styles give every Heading block 2.25rem padding; reset here. */
.gm-news :is(.wp-block-heading, .wp-block-post-title, .wp-block-query-title) {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* ---------- Head ---------- */

.gm-news__head {
	margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
	text-align: center;
}

/* Same size and place as the page titles (typography.css, h1 in pages). */
.gm-news .gm-news__head .gm-news__title {
	margin: 0;
	padding: var(--wp--preset--spacing--40, 1rem) 0 0 !important;
	font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.018em;
	text-align: center;
	color: var(--gm-news-fg);
}

.gm-news .gm-news__lead {
	max-width: 36rem;
	margin: 0.9rem auto 0;
	font-size: var(--gm-fs-base, 1rem);
	line-height: 1.6;
	text-align: center;
	color: var(--gm-news-muted);
}

.gm-news .gm-news__tabs {
	justify-content: center;
	justify-content: safe center; /* centred, but scrollable from the start if too wide */
	gap: 0.35rem;
	margin-top: clamp(1.5rem, 3vw, 2.25rem);
	border: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.gm-news__tabs::-webkit-scrollbar {
	display: none;
}

.gm-news .gm-news__tab {
	flex: 0 0 auto;
	margin: 0;
	font-size: var(--gm-fs-sm, 0.875rem);
	font-weight: 400;
}

/* Categories as quiet pills, the current one filled (no lines). */
.gm-news .gm-news__tab a {
	display: block;
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: 999px;
	color: var(--gm-news-muted);
	line-height: 1.3;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.gm-news .gm-news__tab a:hover {
	color: var(--gm-news-fg);
	background: var(--gm-surface, #f5f5f7);
}

.gm-news .gm-news__tab.is-active a {
	color: var(--gm-news-fg);
	font-weight: 500;
	background: var(--gm-surface, #f5f5f7);
}

.gm-news .gm-news__tab a:focus-visible {
	outline: 2px solid var(--gm-news-fg);
	outline-offset: 2px;
}

/* ---------- Grid ---------- */

.gm-news .gm-news__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(2.5rem, 5vw, 4rem) var(--gm-news-gap);
	width: auto;
	max-width: none; /* core sets max-width:100% */
	margin: 0;
	padding: 0;
	list-style: none;
}

.gm-news__grid > li {
	position: relative;
	min-width: 0;
	margin: 0;
}

.gm-news .gm-card__media {
	margin: 0 0 1.1rem;
	overflow: hidden;
	background: var(--gm-surface, #f5f5f7);
}

.gm-news .gm-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gm-news__grid > li:hover .gm-card__media img {
	transform: scale(1.03);
}

.gm-news .gm-card__kicker {
	margin: 0 0 0.5rem;
	font-size: var(--gm-fs-xs, 0.75rem);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gm-news-muted);
}

.gm-news .gm-card__kicker a {
	position: relative;
	z-index: 2;
	color: inherit;
	text-decoration: none;
}

.gm-news .gm-card__kicker a:hover {
	color: var(--gm-news-fg);
}

.gm-news .gm-card__title {
	margin: 0 0 0.5rem;
	font-size: var(--gm-fs-md, 1.0625rem);
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: -0.008em;
	text-align: left;
}

.gm-news .gm-card__title a {
	color: var(--gm-news-fg);
	text-decoration: none;
}

/* Whole card clickable. */
.gm-news .gm-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.gm-news__grid > li:hover .gm-card__title a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

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

.gm-news__grid > li:has(.gm-card__title a:focus-visible) {
	outline: 2px solid var(--gm-news-fg);
	outline-offset: 6px;
}

.gm-news .gm-card__excerpt {
	margin: 0 0 0.75rem;
	font-size: var(--gm-fs-sm, 0.875rem);
	line-height: 1.6;
	color: var(--gm-news-muted);
}

.gm-news .gm-card__excerpt p {
	margin: 0;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.gm-news .gm-card__meta {
	gap: 0 0.5rem;
	font-size: 0.8125rem;
	color: var(--gm-news-faint);
}

.gm-news .gm-card__meta > * {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: inherit;
	font-weight: 400;
	color: inherit;
}

.gm-news .gm-card__meta > * + *::before {
	content: "·";
}

.gm-news .gm-card__meta > :empty {
	display: none;
}

/* ---------- Feature (first post) ---------- */

.gm-news__grid > li:first-child {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: center;
}

.gm-news__grid > li:first-child .gm-card__media {
	margin: 0;
}

.gm-news__grid > li:first-child .gm-card__title {
	margin-bottom: 0.85rem;
	font-size: var(--gm-fs-2xl, 2rem);
	line-height: 1.2;
	letter-spacing: -0.015em;
}

.gm-news__grid > li:first-child .gm-card__excerpt {
	font-size: var(--gm-fs-base, 1rem);
	margin-bottom: 1rem;
}

.gm-news__grid > li:first-child .gm-card__excerpt p {
	-webkit-line-clamp: 4;
	line-clamp: 4;
}

/* Page 2 and later (categories: body.paged; blog page with its own Query
   Loop: body.gm-paged, see functions.php): all posts the same size. */
:is(body.paged, body.gm-paged) .gm-news__grid > li:first-child {
	grid-column: auto;
	display: block;
}

:is(body.paged, body.gm-paged) .gm-news__grid > li:first-child .gm-card__media {
	margin: 0 0 1.1rem;
}

:is(body.paged, body.gm-paged) .gm-news__grid > li:first-child .gm-card__title {
	margin-bottom: 0.5rem;
	font-size: var(--gm-fs-md, 1.0625rem);
	line-height: 1.35;
	letter-spacing: -0.008em;
}

:is(body.paged, body.gm-paged) .gm-news__grid > li:first-child .gm-card__excerpt {
	margin-bottom: 0.75rem;
	font-size: var(--gm-fs-sm, 0.875rem);
}

:is(body.paged, body.gm-paged) .gm-news__grid > li:first-child .gm-card__excerpt p {
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* ---------- Tablet / mobile ---------- */

@media (max-width: 1023.5px) {

	.gm-news .gm-news__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767.5px) {

	.gm-news .gm-news__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 2.5rem;
	}

	.gm-news__grid > li:first-child {
		display: block;
	}

	.gm-news__grid > li:first-child .gm-card__media {
		margin: 0 0 1.1rem;
	}

	.gm-news__grid > li:first-child .gm-card__title {
		font-size: var(--gm-fs-xl, 1.5rem);
	}
}

/* ---------- Pagination, empty state ---------- */

.gm-news .gm-news__pagination {
	margin-top: clamp(3rem, 6vw, 4.5rem);
	gap: 0.35rem;
	font-size: var(--gm-fs-sm, 0.875rem);
}

.gm-news .gm-news__pagination a,
.gm-news .gm-news__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.7rem;
	box-sizing: border-box;
	border-radius: 999px;
	color: var(--gm-news-fg);
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.gm-news .gm-news__pagination a:hover {
	background: var(--gm-surface, #f5f5f7);
}

.gm-news .gm-news__pagination .page-numbers.current {
	background: var(--gm-news-fg);
	color: #fff;
}

.gm-news .gm-news__empty {
	margin: 0 0 2rem;
	color: var(--gm-news-muted);
}

/* ---------- Topics (tag cloud) ---------- */

.gm-news .gm-news__section {
	margin-top: clamp(4rem, 8vw, 6rem);
	text-align: center;
}

.gm-news .gm-news__section-title {
	margin: 0 0 1.25rem;
	font-size: var(--gm-fs-lg, 1.25rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	text-align: center;
}

.gm-news .gm-news__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 0;
}

.gm-news .gm-news__tags a {
	display: inline-block;
	margin: 0 !important;
	padding: 0.35rem 0.85rem;
	border: 1px solid var(--gm-news-line);
	border-radius: 999px;
	font-size: 0.8125rem !important;
	line-height: 1.4;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.gm-news .gm-news__tags a:hover {
	border-color: var(--gm-news-fg);
	color: var(--gm-news-fg) !important;
}

@media (prefers-reduced-motion: reduce) {

	.gm-news .gm-card__media img {
		transition: none;
	}

	.gm-news__grid > li:hover .gm-card__media img {
		transform: none;
	}
}

/* ---------- Category tabs + search (3.1.0) ---------- */

/* Categories and search: one centred row below the title. */
.gm-news .gm-news__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75rem 1.5rem;
	margin-top: clamp(1.5rem, 3vw, 2.25rem);
	border: 0;
}

.gm-news .gm-news__bar .gm-news__tabs {
	margin-top: 0;
	border: 0;
}

.gm-news .gm-news__search {
	flex: 0 1 15rem;
	margin: 0;
}

.gm-news .gm-news__search .wp-block-search__inside-wrapper {
	position: relative;
	border: 0;
	padding: 0;
}

.gm-news .gm-news__search .wp-block-search__inside-wrapper::before {
	content: "";
	position: absolute;
	left: 0.8rem;
	top: 50%;
	width: 15px;
	height: 15px;
	margin-top: -7.5px;
	background: var(--gm-news-faint);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
	pointer-events: none;
}

.gm-news .gm-news__search .wp-block-search__input {
	height: 2.5rem;
	padding: 0 1rem 0 2.3rem !important;
	border: 1px solid var(--gm-news-line) !important;
	border-radius: var(--gm-radius, 15px) !important;
	font-size: 0.875rem !important;
}

.gm-news .gm-news__search .wp-block-search__input:focus {
	border-color: var(--gm-news-fg) !important;
	box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.08);
	outline: none;
}

@media (max-width: 767.5px) {

	.gm-news .gm-news__bar {
		flex-direction: column;
		align-items: center;
	}

	.gm-news .gm-news__tabs {
		max-width: 100%;
	}

	.gm-news .gm-news__search {
		flex: 1 1 auto;
		width: 100%;
		max-width: 22rem;
		margin: 0;
	}
}

/* ---------- Search results (4.0.9, templates/search.html) ----------
   The search covers the whole site, so pages and posts form one list:
   picture left; label (category or parent page), title, excerpt and – for
   posts – date and reading time right. The field above the list is the
   one from the header (inc/search.php, styles in header.css). */

.gm-results .gm-search-page {
	max-width: 36rem;
	margin: clamp(1.5rem, 3vw, 2.25rem) auto 0;
	text-align: left;
}

.gm-results .gm-search__count {
	margin: 0.9rem 0 0;
	color: var(--gm-news-faint);
	font-size: 0.875rem;
	text-align: center;
}

/* Suggestions float over the list as a card, like the menu dropdowns. */
.gm-results .gm-search-page .gm-search__box {
	position: relative;
}

.gm-results .gm-search-page .gm-search__results {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	z-index: 20;
	margin: 0;
	padding: 8px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.05);
}

.gm-results .gm-search-page .gm-search__heading {
	padding-top: 0.35rem;
}

.gm-results .gm-results__list {
	display: flex;
	flex-direction: column;
	gap: clamp(1.75rem, 3.5vw, 2.5rem);
	max-width: 54rem;
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.gm-results .gm-results__list > li {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
	align-items: center;
	gap: clamp(1.25rem, 3vw, 2rem);
	margin: 0;
}

.gm-results .gm-result__media {
	margin: 0;
	overflow: hidden;
	background: var(--gm-surface, #f5f5f7);
}

.gm-results .gm-result__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gm-results .gm-results__list > li:hover .gm-result__media img {
	transform: scale(1.03);
}

/* Without a picture the text takes the whole row. */
.gm-results .gm-results__list > li:not(:has(.gm-result__media)) .gm-result__body {
	grid-column: 1 / -1;
}

.gm-results .gm-result__label {
	margin: 0 0 0.45rem;
	color: var(--gm-news-muted);
	font-size: var(--gm-fs-xs, 0.75rem);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.gm-results .gm-result__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.01em;
	text-align: left;
}

.gm-results .gm-result__title a {
	color: var(--gm-news-fg);
	text-decoration: none;
}

/* The whole row is clickable, as the blog cards. */
.gm-results .gm-result__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.gm-results .gm-results__list > li:hover .gm-result__title a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.gm-results .gm-result__title a:focus-visible {
	outline: none;
}

.gm-results .gm-results__list > li:has(.gm-result__title a:focus-visible) {
	outline: 2px solid var(--gm-news-fg);
	outline-offset: 6px;
}

.gm-results .gm-result__excerpt {
	margin: 0 0 0.6rem;
	color: var(--gm-news-muted);
	font-size: var(--gm-fs-sm, 0.875rem);
	line-height: 1.6;
}

.gm-results .gm-result__excerpt p {
	margin: 0;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.gm-results .gm-result__meta {
	margin: 0;
	color: var(--gm-news-faint);
	font-size: 0.8125rem;
}

.gm-results .gm-result__label:empty,
.gm-results .gm-result__meta:empty {
	display: none;
}

.gm-results .gm-results__empty {
	max-width: 36rem;
	margin: 0 auto 2rem;
	color: var(--gm-news-muted);
	text-align: center;
}

/* Phones: small picture left, no excerpt – a compact list. */
@media (max-width: 599.5px) {

	.gm-results .gm-results__list > li {
		grid-template-columns: 7rem minmax(0, 1fr);
		align-items: start;
		gap: 1rem;
	}

	.gm-results .gm-result__label {
		margin-bottom: 0.3rem;
	}

	.gm-results .gm-result__title {
		margin-bottom: 0.35rem;
		font-size: 1.0625rem;
	}

	.gm-results .gm-result__excerpt {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.gm-results .gm-result__media img {
		transition: none;
	}

	.gm-results .gm-results__list > li:hover .gm-result__media img {
		transform: none;
	}
}
