/*
 * Copyright (c) 2026 Angelsportverein Zeven e.V.
 * Autor: Yannik Mühlthaler
 * Alle Rechte vorbehalten.
 */

.asv-news {
	background: #fff;
	padding-top: 3rem;
	padding-bottom: 3rem;
}

.asv-news .is-layout-flex {
	gap: 0;
}

@media (min-width: 640px) {
	.asv-news {
		padding-top: 4rem;
		padding-bottom: 4rem;
	}
}

@media (min-width: 1024px) {
	.asv-news {
		padding-top: 6rem;
		padding-bottom: 6rem;
	}
}

.asv-news__inner {
	max-width: 85rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

@media (min-width: 640px) {
	.asv-news__inner {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.asv-news__inner {
		padding-left: 2rem;
		padding-right: 2rem;
	}
}

/* Intro – Abstand zum Grid per padding (WP setzt margin-block auf 0) */
.asv-news__inner > .asv-news__intro {
	max-width: 48rem;
	margin-inline: auto;
	margin-block: 0;
	padding-block-end: 2rem;
	text-align: center;
}

@media (min-width: 640px) {
	.asv-news__inner > .asv-news__intro {
		padding-block-end: 2.5rem;
	}
}

.asv-news__intro .wp-block-heading {
	color: #1f2937;
	font-size: 1.875rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 1rem;
}

.asv-news__intro .wp-block-heading::after {
	content: "";
	display: block;
	width: 3rem;
	height: 0.1875rem;
	margin: 1rem auto 0;
	border-radius: 9999px;
	background: #166534;
}

@media (min-width: 640px) {
	.asv-news__intro .wp-block-heading {
		font-size: 2.25rem;
		margin-bottom: 1.5rem;
	}

	.asv-news__intro .wp-block-heading::after {
		margin-top: 1.5rem;
	}
}

.asv-news__intro p {
	color: #4b5563;
	font-size: 1rem;
	line-height: 1.6;
	max-width: 42rem;
	margin: 0 auto;
}

@media (min-width: 640px) {
	.asv-news__intro p {
		font-size: 1.125rem;
	}
}

/*
 * Grid-Items sind <li> aus dem Post-Template.
 * Neueste Meldung (= erstes li) rechts, die drei folgenden links untereinander.
 */
.asv-news__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.asv-news__grid > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.asv-news__grid {
		/* Hauptmeldung rechts breiter; linke Spalte gleiche Gesamthöhe */
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		grid-template-rows: repeat(3, minmax(0, 1fr));
		column-gap: 2rem;
		row-gap: 0.25rem;
		align-items: stretch;
	}

	.asv-news__grid > li:first-child {
		grid-column: 2;
		grid-row: 1 / span 3;
		display: flex;
		min-height: 0;
		align-self: stretch;
	}

	.asv-news__grid > li:nth-child(2),
	.asv-news__grid > li:nth-child(3),
	.asv-news__grid > li:nth-child(4) {
		display: flex;
		min-height: 0;
		height: 100%;
	}

	.asv-news__grid > li:nth-child(2) {
		grid-column: 1;
		grid-row: 1;
	}

	.asv-news__grid > li:nth-child(3) {
		grid-column: 1;
		grid-row: 2;
	}

	.asv-news__grid > li:nth-child(4) {
		grid-column: 1;
		grid-row: 3;
	}

	/* Fallback bei mehr als 4 Beiträgen in der Abfrage */
	.asv-news__grid > li:nth-child(n + 5) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1024px) {
	.asv-news__grid {
		grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
		column-gap: 2.5rem;
	}
}

/* Karten-Basis */
.asv-news__card {
	display: flex;
	flex-direction: column;
	gap: 0;
	background: transparent;
	overflow: visible;
}

/* —— Hauptmeldung (rechts) —— */
.asv-news__grid > li:first-child .asv-news__card {
	height: 100%;
	width: 100%;
}

.asv-news__grid > li:first-child:only-child {
	grid-column: 1 / -1;
}

.asv-news__grid > li:first-child .asv-news__image {
	margin: 0;
	border-radius: 0.75rem;
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
	.asv-news__grid > li:first-child .asv-news__image {
		max-height: 15rem;
	}
}

@media (min-width: 1024px) {
	.asv-news__grid > li:first-child .asv-news__image {
		max-height: 17.5rem;
	}
}

.asv-news__grid > li:first-child .asv-news__image a {
	display: block;
	height: 100%;
}

.asv-news__grid > li:first-child .asv-news__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.asv-news__grid > li:first-child .asv-news__card-body {
	margin-top: 0.875rem;
}

@media (min-width: 768px) {
	.asv-news__grid > li:first-child .asv-news__card-body {
		margin-top: 0.75rem;
		gap: 0.5rem;
	}
}

/* Abstände zwischen Textelementen (nicht zum Seitenrand) */
.asv-news__card-body {
	--wp--style--block-gap: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0;
	flex: 1 1 auto;
	background: transparent;
}

.asv-news__grid > li:first-child .asv-news__card-body {
	gap: 0.625rem;
}

.asv-news__card-body > .asv-news__category,
.asv-news__card-body > .wp-block-post-title,
.asv-news__card-body > .asv-news__meta,
.asv-news__card-body > .wp-block-post-excerpt,
.asv-news__card-body > .asv-news__read-more,
.asv-news__card .wp-block-post-title,
.asv-news__card .wp-block-post-excerpt,
.asv-news__card .wp-block-post-terms {
	margin: 0;
}

.asv-news__grid > li:first-child .asv-news__category a {
	padding: 0;
	border-radius: 0;
	background: transparent;
	color: #166534;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.asv-news__grid > li:first-child .asv-news__category a:hover,
.asv-news__grid > li:first-child .asv-news__category a:focus-visible {
	background: transparent;
	color: #14532d;
	text-decoration: underline;
}

.asv-news__grid > li:first-child .wp-block-post-title {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	color: #1f2937;
}

@media (min-width: 1024px) {
	.asv-news__grid > li:first-child .wp-block-post-title {
		font-size: 1.5rem;
	}
}

.asv-news__grid > li:first-child .wp-block-post-excerpt {
	font-size: 1rem;
	line-height: 1.5;
	color: #4b5563;
}

@media (min-width: 640px) {
	.asv-news__grid > li:first-child .wp-block-post-excerpt {
		font-size: 1.0625rem;
	}
}

@media (min-width: 768px) {
	.asv-news__grid > li:first-child .wp-block-post-title {
		font-size: 1.375rem;
	}

	.asv-news__grid > li:first-child .wp-block-post-excerpt {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		overflow: hidden;
	}
}

/* —— Weitere Meldungen (links) —— */
.asv-news__grid > li:not(:first-child) .asv-news__card {
	flex-direction: row;
	align-items: center;
	gap: 0.875rem;
	width: 100%;
	height: auto;
	padding: 0.5rem 0.75rem;
	margin: 0;
	border-radius: 0.625rem;
	transition: background-color 200ms ease;
}

@media (min-width: 768px) {
	.asv-news__grid > li:not(:first-child) .asv-news__card {
		height: 100%;
		padding: 0.5rem 0.625rem;
	}
}

.asv-news__grid > li:not(:first-child) .asv-news__card:hover,
.asv-news__grid > li:not(:first-child) .asv-news__card:focus-within {
	background: #f9fafb;
}

.asv-news__grid > li:not(:first-child) .asv-news__image {
	flex: 0 0 6.25rem;
	width: 6.25rem;
	height: 4.6875rem;
	margin: 0;
	align-self: center;
	border-radius: 0.625rem;
	overflow: hidden;
	aspect-ratio: auto;
}

@media (min-width: 1024px) {
	.asv-news__grid > li:not(:first-child) .asv-news__image {
		flex-basis: 6.75rem;
		width: 6.75rem;
		height: 5.0625rem;
	}
}

.asv-news__grid > li:not(:first-child) .asv-news__image:not(:has(img)) {
	display: none;
}

.asv-news__grid > li:not(:first-child) .asv-news__image a {
	display: block;
	height: 100%;
}

.asv-news__grid > li:not(:first-child) .asv-news__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}

.asv-news__grid > li:not(:first-child) .asv-news__card:hover .asv-news__image img,
.asv-news__grid > li:not(:first-child) .asv-news__card:focus-within .asv-news__image img {
	transform: scale(1.04);
}

.asv-news__grid > li:not(:first-child) .asv-news__card-body {
	flex: 1 1 auto;
	min-width: 0;
	gap: 0.25rem;
	justify-content: center;
}

.asv-news__grid > li:not(:first-child) .wp-block-post-title {
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.asv-news__grid > li:not(:first-child) .wp-block-post-title a {
	display: block;
}

.asv-news__grid > li:not(:first-child) .wp-block-post-excerpt {
	font-size: 0.875rem;
	line-height: 1.45;
	color: #6b7280;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

@media (min-width: 768px) {
	.asv-news__grid > li:not(:first-child) .asv-news__meta {
		font-size: 0.8125rem;
	}
}

@media (min-width: 768px) {
	.asv-news__grid > li:not(:first-child) .asv-news__read-more {
		display: none;
	}
}

/* Kategorie-Badge */
.asv-news__category {
	margin: 0;
}

.asv-news__category .wp-block-post-terms__separator {
	display: none;
}

.asv-news__category a {
	display: inline-block;
	padding: 0.2rem 0.625rem;
	border-radius: 9999px;
	background: #ecfdf5;
	color: #166534;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 200ms ease, color 200ms ease;
}

.asv-news__category a:hover,
.asv-news__category a:focus-visible {
	background: #166534;
	color: #fff;
}

.asv-news__category a + a {
	margin-left: 0.375rem;
}

/* Meta: Datum & Autor */
.asv-news__meta.is-layout-flex {
	gap: 0.25rem 0.5rem;
	align-items: center;
}

.asv-news__meta .wp-block-post-date,
.asv-news__meta .wp-block-post-author-name {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #6b7280;
}

.asv-news__grid > li:first-child .asv-news__meta .wp-block-post-date,
.asv-news__grid > li:first-child .asv-news__meta .wp-block-post-author-name {
	font-size: 0.875rem;
}

.asv-news__meta .wp-block-post-date {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

.asv-news__meta .wp-block-post-date::before {
	content: "";
	flex-shrink: 0;
	width: 0.875rem;
	height: 0.875rem;
	background-color: #9ca3af;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
}

.asv-news__meta .wp-block-post-author-name {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

.asv-news__meta .wp-block-post-author-name::before {
	content: "";
	flex-shrink: 0;
	width: 0.875rem;
	height: 0.875rem;
	background-color: #9ca3af;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
}

.asv-news__meta .wp-block-post-date::after {
	content: "·";
	margin: 0 0.5rem;
	color: #d1d5db;
	font-weight: 700;
}

.asv-news__meta a {
	color: inherit;
	text-decoration: none;
}

.asv-news__meta a:hover,
.asv-news__meta a:focus-visible {
	color: #166534;
}

/* Titel */
.asv-news__card .wp-block-post-title a {
	color: #1f2937;
	text-decoration: none;
	transition: color 200ms ease;
}

.asv-news__card .wp-block-post-title a:hover,
.asv-news__card .wp-block-post-title a:focus-visible {
	color: #166534;
}

.asv-news__card .wp-block-post-excerpt p {
	margin: 0;
}

/* Weiterlesen */
.asv-news__read-more {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	color: #166534;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	transition: color 200ms ease, gap 200ms ease;
}

.asv-news__grid > li:first-child .asv-news__read-more {
	font-size: 1rem;
}

@media (min-width: 640px) {
	.asv-news__grid > li:first-child .asv-news__read-more {
		font-size: 1.0625rem;
	}
}

.asv-news__read-more:hover,
.asv-news__read-more:focus-visible {
	color: #14532d;
	gap: 0.625rem;
}

.asv-news__read-more::after {
	content: "";
	width: 0.875rem;
	height: 0.875rem;
	flex-shrink: 0;
	background-color: currentColor;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	transition: transform 200ms ease;
}

.asv-news__read-more:hover::after,
.asv-news__read-more:focus-visible::after {
	transform: translateX(0.125rem);
}

.asv-news__read-more:focus-visible {
	outline: 2px solid #166534;
	outline-offset: 2px;
	border-radius: 0.25rem;
}

.asv-news__empty {
	padding: 3rem 1.5rem;
	text-align: center;
	background: #f9fafb;
	border-radius: 0.75rem;
}

.asv-news__empty p {
	color: #4b5563;
	font-size: 1.125rem;
	margin: 0;
}

/* Mobil */
@media (max-width: 767px) {
	.asv-news {
		padding-top: 2rem;
		padding-bottom: 2rem;
	}

	.asv-news__inner > .asv-news__intro {
		padding-block-end: 1.5rem;
	}

	.asv-news__grid {
		gap: 1.25rem;
	}

	.asv-news__grid > li:first-child .wp-block-post-title {
		font-size: 1.375rem;
	}

	.asv-news__category a {
		font-size: 0.75rem;
	}

	.asv-news__meta.is-layout-flex {
		flex-wrap: wrap;
		row-gap: 0.25rem;
	}

	.asv-news__grid > li:not(:first-child) .asv-news__card {
		flex-direction: row;
		align-items: center;
		gap: 0.75rem;
		padding: 0.5rem 0;
		margin: 0;
	}

	.asv-news__grid > li:not(:first-child) .asv-news__card:hover,
	.asv-news__grid > li:not(:first-child) .asv-news__card:focus-within {
		background: #f9fafb;
	}

	.asv-news__grid > li:not(:first-child) .asv-news__image {
		flex: 0 0 5.5rem;
		width: 5.5rem;
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.asv-news__grid > li:not(:first-child) .asv-news__card-body {
		padding: 0;
	}

	.asv-news__grid > li:not(:first-child) + li:not(:first-child) {
		margin-top: 0;
		padding-top: 0.75rem;
		border-top: 1px solid #e5e7eb;
	}

	.asv-news__inner > .wp-block-buttons.asv-news__more {
		padding-block-start: 2.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asv-news__grid > li:not(:first-child) .asv-news__image img,
	.asv-news__read-more,
	.asv-news__read-more::after,
	.asv-news__grid > li:not(:first-child) .asv-news__card,
	.asv-news__category a {
		transition: none;
	}

	.asv-news__grid > li:not(:first-child) .asv-news__card:hover .asv-news__image img,
	.asv-news__grid > li:not(:first-child) .asv-news__card:focus-within .asv-news__image img {
		transform: none;
	}
}

/* Startseite: Button zur Neuigkeiten-Übersicht */
.asv-news__inner > .wp-block-buttons.asv-news__more {
	margin-block-start: 0;
	margin-top: 0;
	padding-block-start: 3.5rem;
}

@media (min-width: 640px) {
	.asv-news__inner > .wp-block-buttons.asv-news__more {
		padding-block-start: 4.5rem;
	}
}

.asv-news__more .wp-block-button {
	margin: 0;
}

.asv-news__more-btn .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: unset;
	padding: 0.625rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 0.5rem;
	background: #166534;
	box-shadow: none;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	transition: background-color 200ms ease, gap 200ms ease;
}

.asv-news__more-btn .wp-block-button__link::after {
	content: "";
	width: 0.875rem;
	height: 0.875rem;
	flex-shrink: 0;
	background-color: currentColor;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	transition: transform 200ms ease;
}

.asv-news__more-btn .wp-block-button__link:hover,
.asv-news__more-btn .wp-block-button__link:focus-visible {
	background: #14532d;
	color: #fff;
	gap: 0.625rem;
}

.asv-news__more-btn .wp-block-button__link:hover::after,
.asv-news__more-btn .wp-block-button__link:focus-visible::after {
	transform: translateX(0.125rem);
}

.asv-news__more-btn .wp-block-button__link:focus-visible {
	outline: 2px solid #166534;
	outline-offset: 2px;
}

/* Neuigkeiten-Archiv: einheitliches Kartenraster */
.asv-news--archive .asv-news__grid--archive {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 640px) {
	.asv-news--archive .asv-news__grid--archive {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.asv-news--archive .asv-news__grid--archive {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.asv-news--archive .asv-news__grid--archive > li .asv-news__card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.asv-news--archive .asv-news__grid--archive > li .asv-news__image {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.asv-news--archive .asv-news__grid--archive > li .asv-news__image img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.asv-news--archive .asv-news__grid--archive > li .wp-block-post-title {
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
}

.asv-news--archive .wp-block-query-pagination {
	margin-top: 3rem;
}
