/*
 * Detailseite einer Frage, eines Films oder Medienberichts (body.tp-frage, dazu .tp-beitrag-fragen|filme|medienberichte),
 * geladen nur dort: lib/functions/theme/inc/fragen-detail.php.
 * Desktop: Titel über die ganze Breite, darunter Text links, Bild rechts. Handy: Titel, Bild, Text untereinander.
 * Farben aus den Theme-Variablen (_feinschliff.scss), mit Rückfallwerten.
 */

/* Das Theme legt .entry-content als Raster mit Randspalten an (15 px). Darum nur Zeilenabstand setzen, kein gap. */
.tp-frage {
	--tp-frage-gutter: 15px;
}

.tp-frage .entry-content {
	box-sizing: border-box;
	max-width: 1160px;
	margin-inline: auto;
	display: grid;
	row-gap: 28px;
}

.tp-frage .entry-content > * {
	min-width: 0;
	margin-block: 0;
}

/* Kopfzeile: zurück und Thema */
.tp-frage__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
}

.tp-frage__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--tp-ink, #141413);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.tp-frage__back svg {
	flex: none;
	color: var(--tp-gold, #ca9f63);
	/* Optische Mitte zwischen x-Höhe und Grossbuchstaben (gemessen, Catamaran 600 16 px). */
	transform: translateY(-1px);
}

.tp-frage__back span {
	line-height: 1;
}

.tp-frage__back:hover span,
.tp-frage__back:focus-visible span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tp-frage__back:focus-visible {
	outline: 2px solid var(--tp-focus-ring, #141413);
	outline-offset: 4px;
	border-radius: 4px;
}

.tp-frage__topic {
	margin: 0;
	color: var(--tp-gold-text, #8a6a35);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.tp-frage__topic a {
	color: inherit;
	text-decoration: none;
}

.tp-frage__topic a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tp-frage .entry-content > h1 {
	max-width: 30ch;
	text-wrap: balance;
}

/* Text links, Bild rechts */
.tp-frage__split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
	gap: 48px;
	align-items: start;
}

.tp-frage__split.is-ohne-bild {
	grid-template-columns: minmax(0, 1fr);
}

.tp-frage__text {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
}

.tp-frage__text > * {
	margin-block: 0;
	max-width: 68ch;
}

.tp-frage__text > * + * {
	margin-top: 1em;
}

.tp-frage__text p,
.tp-frage__text li {
	font-size: 18px;
	line-height: 1.75;
	color: var(--tp-text, #55524d);
}

.tp-frage__media {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	box-sizing: border-box;
	max-width: 100%;
	aspect-ratio: 4 / 3;
	border: 5px solid var(--tp-gold, #ca9f63);
	border-radius: 24px;
	overflow: hidden;
}

.tp-frage__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 40%;
	border-radius: 19px;
}

.tp-frage .entry-content > .tp-frage__split {
	margin-top: 16px;
}

.tp-frage .entry-content > .tp-frage__back-bottom {
	margin-top: 24px;
}

.tp-frage__back-bottom {
	padding-top: 22px;
	border-top: 1px solid var(--tp-line, #ebe5dc);
}

/* Filme: Video über die ganze Breite unter dem Titel, Text darunter */
.tp-frage .entry-content > .tp-frage__video {
	margin-top: 8px;
}

.tp-frage__video .video-facade {
	margin: 0;
}

/* Vorschlags-Karten der Filme mit Play-Symbol über dem Bild (nur wo das Bild über der Karte steht) */
@media (min-width: 768px) {
	.tp-frage-card.is-film:not(.is-ohne-bild) {
		position: relative;
	}

	.tp-frage-card.is-film:not(.is-ohne-bild)::after {
		content: "";
		position: absolute;
		inset: 0 0 auto;
		aspect-ratio: 3 / 2;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='31' fill='%23141413' fill-opacity='.72' stroke='%23CA9F63' stroke-width='2'/%3E%3Cpath fill='%23CA9F63' d='M25.3 18.7v26.6L46.7 32z'/%3E%3C/svg%3E") center / 64px no-repeat;
		pointer-events: none;
	}
}

/* Weitere Fragen zum Thema */
.tp-frage-more {
	box-sizing: border-box;
	width: min(1130px, calc(100% - 2 * var(--tp-frage-gutter)));
	margin: 56px auto 0;
	display: grid;
	gap: 24px;
}

.tp-frage-more h2 {
	margin: 0;
	color: var(--tp-ink, #141413);
	font-size: 28px;
	font-weight: 500;
	line-height: 1.2;
}

.tp-frage-more h2 span {
	color: var(--tp-gold-text-lg, #9c7a43);
}

.tp-frage-more__cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.tp-frage-card {
	display: grid;
	grid-template-rows: auto 1fr;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--tp-line, #ebe5dc);
	border-radius: 24px;
	color: inherit;
	text-decoration: none;
	transition: box-shadow 200ms ease-out, transform 200ms ease-out;
}

.tp-frage-card:hover {
	box-shadow: 0 8px 24px rgba(20, 20, 19, 0.08);
	transform: translateY(-2px);
}

.tp-frage-card:focus-visible {
	outline: 2px solid var(--tp-focus-ring, #141413);
	outline-offset: 3px;
}

.tp-frage-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.tp-frage-card__body {
	display: grid;
	align-content: space-between;
	gap: 12px;
	padding: 18px 20px 20px;
}

.tp-frage-card__title {
	color: var(--tp-ink, #141413);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
}

.tp-frage-card__more {
	color: var(--tp-gold-text, #8a6a35);
	font-size: 15px;
	font-weight: 600;
}

.tp-frage-card.is-ohne-bild {
	grid-template-rows: 1fr;
}

/* Fragen-Box (Blockstil aus dem Theme) */
.tp-frage-cta {
	box-sizing: border-box;
	width: min(1130px, calc(100% - 2 * var(--tp-frage-gutter)));
	margin: 56px auto 72px;
}

.tp-frage-cta .wp-block-group.is-style-fragen-box {
	max-width: none;
}

@media (prefers-reduced-motion: reduce) {
	.tp-frage-card {
		transition: none;
	}

	.tp-frage-card:hover {
		transform: none;
	}
}

/* Handy und kleines Tablet: stapeln */
@media (max-width: 767px) {
	.tp-frage .entry-content {
		row-gap: 22px;
	}

	.tp-frage .entry-content > .tp-frage__split {
		margin-top: 6px;
	}

	.tp-frage .entry-content > .tp-frage__back-bottom {
		margin-top: 14px;
	}

	.tp-frage__crumbs {
		flex-direction: column;
		align-items: flex-start;
	}

	.tp-frage__split {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.tp-frage__media {
		grid-column: 1;
		grid-row: 1;
		aspect-ratio: 16 / 9;
		border-width: 4px;
		border-radius: 19px;
	}

	.tp-frage__media img {
		border-radius: 15px;
	}

	.tp-frage__text {
		grid-row: 2;
	}

	.tp-frage__text p,
	.tp-frage__text li {
		font-size: 17px;
		line-height: 1.7;
	}

	.tp-frage-more {
		margin-top: 40px;
		gap: 18px;
	}

	.tp-frage-more h2 {
		font-size: 24px;
	}

	.tp-frage-more__cards {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}

	.tp-frage-card {
		grid-template-columns: 112px minmax(0, 1fr);
		grid-template-rows: none;
		border-radius: 19px;
	}

	.tp-frage-card.is-ohne-bild {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Bildhöhe folgt dem Text, nicht der Originalgrösse des Bildes. */
	.tp-frage-card__img {
		height: 0;
		min-height: 100%;
		aspect-ratio: auto;
	}

	.tp-frage-card__body {
		padding: 14px 16px;
	}

	.tp-frage-card__title {
		font-size: 16px;
	}

	.tp-frage-cta {
		margin: 40px auto 52px;
	}
}

/* Tablet quer: Bild etwas schmaler */
@media (min-width: 768px) and (max-width: 1023px) {
	.tp-frage__split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
		gap: 32px;
	}

	.tp-frage-more__cards {
		gap: 16px;
	}
}
