/**
 * DFV Gruppenreisen — trip cards, carousel, archive grid and detail page.
 * Uses the theme's design tokens (var(--dfv-*)); loaded after dfv-main.
 */

/* ---------- Section head ---------- */
.gr-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.gr-head .fe-section-title {
	margin-bottom: 0;
}
.gr-seemore {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--dfv-orange);
	text-decoration: none;
	white-space: nowrap;
}
.gr-seemore:hover {
	color: var(--dfv-orange-dark);
}

/* ---------- Carousel ---------- */
.gr-carousel {
	position: relative;
	margin-top: var(--spacing-md);
}
.gr-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 2 * 18px) / 3);
	gap: 18px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 20px;
	scrollbar-width: none;
}
.gr-track::-webkit-scrollbar { display: none; }
.gr-nav {
	display: flex;
	gap: 8px;
}
.gr-head__controls {
	display: flex;
	align-items: center;
	gap: 14px;
}
.gr-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--dfv-border);
	background: var(--dfv-bg);
	color: var(--dfv-heading);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.gr-btn:hover {
	border-color: var(--dfv-orange);
	color: var(--dfv-orange);
}

/* ---------- Archive grid ---------- */
.gr-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	margin-top: var(--spacing-md);
}

/* ---------- Card (shared by carousel + grid) ---------- */
.gr-card {
	scroll-snap-align: start;
	background: var(--dfv-bg);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	box-shadow: var(--card-shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gr-card:hover {
	box-shadow: var(--card-shadow-hover);
	transform: translateY(-2px);
}
.gr-card:hover .gr-card__title { color: var(--dfv-orange); }
.gr-card__img {
	aspect-ratio: 3 / 2;
	position: relative;
	display: flex;
	align-items: flex-end;
	padding: 12px;
	color: #fff;
	overflow: hidden;
}
.gr-card__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.gr-card__ph {
	position: relative;
	font-size: 0.78rem;
	background: rgba(0, 0, 0, 0.28);
	border-radius: 4px;
	padding: 2px 8px;
}
.gr-card__body {
	padding: 16px 17px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
}
.gr-card__title {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--dfv-heading);
	letter-spacing: -0.01em;
	margin: 0 0 3px;
}
.gr-card__date {
	color: var(--dfv-text-light);
	font-size: 0.86rem;
	margin: 0 0 10px;
}
.gr-card__tag {
	align-self: flex-start;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--dfv-orange);
	background: var(--dfv-bg-alt);
	padding: 4px 11px;
	border-radius: 999px;
	margin-bottom: 10px;
}
.gr-card__text {
	margin: 0 0 14px;
	color: var(--dfv-text-light);
	font-size: 0.92rem;
	line-height: 1.5;
}
.gr-card__more {
	margin-top: auto;
	font-weight: 700;
	color: var(--dfv-orange);
	font-size: 0.9rem;
}

/* ---------- Detail page ---------- */
.gr-detail {
	min-width: 0;
}
.gr-hero {
	position: relative;
	overflow: hidden; border-radius: var(--radius); box-shadow: var(--img-shadow);
	aspect-ratio: 21 / 8;
	margin-bottom: var(--spacing-md);
	display: flex;
	align-items: flex-end;
}
.gr-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gr-hero--ph {
	color: #fff;
	padding: 14px;
	font-size: 0.85rem;
}
.gr-detail__title {
	margin: 0 0 0.3rem;
}
.gr-detail__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: var(--spacing-md);
}
.gr-detail__date {
	color: var(--dfv-orange);
	font-weight: 600;
	font-size: 1.1rem;
	margin: 0.3rem 0 1.2rem;
}
.gr-detail__tag {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--dfv-orange);
	background: var(--dfv-bg-alt);
	padding: 4px 11px;
	border-radius: 999px;
}
.gr-back {
	margin-top: var(--spacing-lg);
}
.gr-back a {
	color: var(--dfv-orange);
	font-weight: 700;
	text-decoration: none;
}

/* Status badge (hero + card overlay) */
.gr-hero__status,
.gr-card__status {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	background: var(--dfv-orange);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 4px 11px;
	border-radius: 999px;
}
.gr-card__ph { z-index: 0; }

/* Past trips: greyed/de-emphasised, muted badge, hero + hint (matches FiF). */
.gr-card.is-past { opacity: 0.62; filter: grayscale(0.35); }
.gr-card.is-past:hover { opacity: 1; filter: none; }
.gr-card__status--past,
.gr-hero__status--past { background: var(--dfv-slate); }
.gr-detail.is-past .gr-hero { filter: grayscale(0.4); opacity: 0.85; }

/* Intro / description */
.gr-detail__intro {
	font-size: 1.1rem;
	line-height: 1.6;
	color: var(--dfv-text-light);
	margin-bottom: 2rem;
}
.gr-detail__intro p { margin-bottom: 1rem; }
.gr-detail__intro > *:last-child { margin-bottom: 0; }

/* Section kicker — caps-orange, matches .fe-section-title / FiF detail h2 */
.gr-kicker {
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dfv-orange);
	margin: var(--spacing-lg) 0 var(--spacing-sm);
}

/* Auf einen Blick — facts (same pattern as FiF .fahrt-facts) */
.gr-facts {
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--card-shadow);
	margin: 0;
}
.gr-facts div {
	display: flex;
	gap: 1rem;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid var(--dfv-border);
}
.gr-facts div:last-child { border-bottom: 0; }
.gr-facts dt {
	width: 150px;
	flex-shrink: 0;
	color: var(--dfv-text-light);
	font-size: 0.95rem;
	margin: 0;
}
.gr-facts dd { font-weight: 600; margin: 0; }

/* Preise — same card pattern; two-column money rows + orange group sub-headings */
.gr-prices {
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--card-shadow);
}
.gr-prices__gh {
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dfv-orange);
	padding: 0.9rem 1.1rem 0.3rem;
}
.gr-prices__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 1.1rem;
	border-bottom: 1px solid var(--dfv-border);
}
.gr-prices__row:last-child { border-bottom: 0; }
.gr-prices__lbl { color: var(--dfv-text-light); }
.gr-prices__val {
	font-weight: 700;
	color: var(--dfv-heading);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.gr-prices__val--free { color: var(--dfv-orange); }

/* Zuschuss strip -> Zuschussrechner */
.gr-zuschuss {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1.2rem 1.4rem;
	background: var(--dfv-bg-alt);
	border-radius: var(--radius);
	box-shadow: var(--card-shadow);
	padding: 1.3rem 1.5rem;
	margin-top: var(--spacing-md);
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gr-zuschuss:hover {
	box-shadow: var(--card-shadow-hover);
	transform: translateY(-2px);
}
.gr-zuschuss:hover .gr-zuschuss__btn { background: var(--dfv-orange-dark); }
.gr-zuschuss__icon {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--dfv-orange);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
}
.gr-zuschuss__icon svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: #fff;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.gr-zuschuss__t strong {
	display: block;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--dfv-heading);
	margin-bottom: 0.15rem;
	letter-spacing: -0.01em;
}
.gr-zuschuss__t span {
	display: block;
	color: var(--dfv-text-light);
	font-size: 0.9rem;
	line-height: 1.5;
	max-width: 52ch;
}
.gr-zuschuss__btn { white-space: nowrap; }
/* Was 620: the 3-column strip crushed the description to ~207-253px right up
   to 767 (incl. phone landscape), so the 2-column layout now holds to 767. */
@media (max-width: 767px) {
	.gr-zuschuss { grid-template-columns: auto 1fr; }
	.gr-zuschuss__btn { grid-column: 1 / -1; justify-self: start; }
}
/* ---------- Responsive ---------- */
@media (max-width: 820px) {
	.gr-track { grid-auto-columns: calc((100% - 18px) / 2); }
	.gr-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.gr-track { grid-auto-columns: 86%; }
	.gr-grid { grid-template-columns: 1fr; }
	.gr-facts div { flex-direction: column; gap: 0.1rem; }
	.gr-facts dt { width: auto; }
}

/* ---------- Model rework 1.6.0: unterkunft link, hinweise, weitere-infos, teilnahme ---------- */

/* Unterkunft name-as-link + address sub-line inside "Auf einen Blick" */
.gr-facts__link {
	color: var(--dfv-orange);
	font-weight: 600;
	text-decoration: none;
}
.gr-facts__link:hover { color: var(--dfv-orange-dark); text-decoration: underline; }
.gr-facts__sub {
	display: block;
	font-weight: 400;
	color: var(--dfv-text-light);
	font-size: 0.92rem;
	margin-top: 0.15rem;
}

/* Hinweise — trip-specific notes, clean bordered box */
.gr-notice {
	border: 1px solid var(--dfv-border);
	border-left: 3px solid var(--dfv-orange);
	border-radius: var(--radius);
	background: var(--dfv-bg-alt);
	padding: 0.9rem 1.2rem;
	margin-top: var(--spacing-md);
}
.gr-notice__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gr-notice__list li {
	position: relative;
	padding-left: 1.6rem;
	color: var(--dfv-text);
	font-size: 0.95rem;
	line-height: 1.5;
}
.gr-notice__list li + li { margin-top: 0.4rem; }
.gr-notice__list li::before {
	content: "\2192";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--dfv-orange);
	font-weight: 700;
}

/* Weitere Infos — contained free-text, uses site typography */
.gr-info {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--dfv-text);
}
.gr-info > *:first-child { margin-top: 0; }
.gr-info > *:last-child { margin-bottom: 0; }
.gr-info p { margin: 0 0 1rem; }
.gr-info ul, .gr-info ol { margin: 0 0 1rem 1.3rem; }
.gr-info li { margin-bottom: 0.35rem; }
.gr-info a { color: var(--dfv-orange); font-weight: 600; }

/* Voraussetzung für die Teilnahme — site-wide participation block */
.gr-teilnahme {
	margin-top: var(--spacing-lg);
}
.gr-teilnahme__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gr-teilnahme__list li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.5rem;
	color: var(--dfv-text);
	line-height: 1.55;
}
.gr-teilnahme__list li:last-child { margin-bottom: 0; }
.gr-teilnahme__list li::before {
	content: "\2192";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--dfv-orange);
	font-weight: 700;
}

/* ==========================================================================
   RESPONSIVE AUDIT FIXES (Aug 2026)
   ========================================================================== */

/* At <=620px .gr-zuschuss is `auto 1fr`. The 1fr track takes its minimum from
   min-content, and "Einkommensabhaengiger" alone is ~194px, so below 365px the
   whole text column was pushed outside the tinted card and onto the white page.
   Page scrollWidth stayed correct, which is why an overflow-only check missed
   it. Stacking is preferred over just shrinking: shrinking leaves the text
   column at ~150px, well under a readable line length. */
@media (max-width: 365px) {
	.gr-zuschuss {
		grid-template-columns: 1fr;
		gap: 1rem;
		padding: 1.15rem 1.2rem;
	}
	.gr-zuschuss__t { min-width: 0; }
	.gr-zuschuss__t strong { overflow-wrap: break-word; }
	.gr-zuschuss__btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   BATCH 1 (Aug 2026): tap targets, touch contrast, pasted-HTML hardening
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.gr-btn {
		width: 44px;
		height: 44px;
		font-size: 1.25rem;
	}
	/* 44px arrows make the head row 314px, wider than the content column at
	   320 (272px) and 360 (312px), so the row has to be allowed to wrap. */
	.gr-head__controls {
		flex-wrap: wrap;
		row-gap: 10px;
		max-width: 100%;
	}

	.gr-seemore,
	.gr-back a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	/* The Unterkunft name sits directly above its address, so a 44px min-height
	   pushed the two apart and broke the visual grouping. Pseudo-element hit
	   area instead: same 44px target, natural row height. */
	.gr-facts__link {
		position: relative;
	}
	.gr-facts__link::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: 50%;
		height: 44px;
		transform: translateY(-50%);
	}

	/* Past trips are dimmed to 0.62 and only restored on hover, which never
	   fires on touch, so their body text sits at about 3:1 contrast forever. */
	.gr-card.is-past {
		opacity: 1;
	}
}

/* Beschreibung and Weitere Infos print pasted wp_editor HTML through
   wp_kses_post(), which permits tables, <pre>, width attributes and raw URLs. */
@media (max-width: 768px) {
	.gr-detail__intro,
	.gr-info {
		overflow-wrap: break-word;
	}

	.gr-info table,
	.gr-detail__intro table {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
	}

	.gr-info pre {
		overflow-x: auto;
	}
}

/* --------------------------------------------------------------------------
   BATCH 6 (Aug 2026)
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
	/* same letterbox problem as the FiF hero: 125px at 375px, 104px at 320px */
	.gr-hero {
		aspect-ratio: 16 / 9;
	}
}

/* The Zuschuss CTA is the same kind of block as .fb-cta and
   .fe-ov__offer--accent, so it gets the same phone treatment: icon above,
   everything centred. It was still icon-beside-text with a left-aligned button. */
@media (max-width: 600px) {
	.gr-zuschuss {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
		gap: var(--spacing-sm);
	}

	.gr-zuschuss__t span {
		max-width: none;
	}

	.gr-zuschuss__btn {
		grid-column: 1;
		justify-self: center;
		white-space: normal;
	}
}

@media (max-width: 1024px) {
	.gr-back {
		margin-bottom: 0;
	}
}

/* --------------------------------------------------------------------------
   BATCH 7 (Aug 2026): trip page tightening
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.gr-hero {
		margin-top: 0;
	}

	/* matches the site lead (1.05rem); was 1.1rem, larger than anything else */
	.gr-detail__intro {
		font-size: 1.05rem;
		margin-bottom: var(--spacing-md);
	}
}

@media (max-width: 1024px) {
	.gr-back {
		margin-top: var(--spacing-md);
	}
}

/* "See all" now sits below the cards, not in the head (Evie, 4 Aug). */
.gr-foot {
	margin-top: 0;
}

/* Carousel peek on touch tablets. From 640 to 1024 the track showed exactly N
   whole cards flush to the edge, so on a touch device nothing signalled that the
   row scrolls at all. 2.3 cards leaves a visible sliver of the next one.
   Deliberately starts at 640: below that a peek would push the card text column
   under 200px, and 561-639 is a band no device in the matrix uses. */
@media (min-width: 640px) and (max-width: 1024px) {
	.gr-track {
		grid-auto-columns: calc((100% - 2 * 18px) / 2.3);
	}
}

/* Price table on the narrowest phones. The label column is squeezed to 153px at
   320, which wraps "Eigenes Bad (optional, pro Aufenthalt)" onto three lines. */
@media (max-width: 400px) {
	.gr-prices__row {
		padding-left: 0.85rem;
		padding-right: 0.85rem;
		gap: 0.75rem;
	}

	.gr-prices__gh {
		padding-left: 0.85rem;
		padding-right: 0.85rem;
	}

	.gr-prices__lbl {
		min-width: 0;
		overflow-wrap: break-word;
	}
}

/* The Preis value is free text a colleague types, and it is white-space:nowrap
   inside a .gr-prices box with overflow:hidden, so a wordy one such as "Preis
   auf Anfrage" was silently CUT rather than wrapped. Letting the row wrap drops
   an over-long value onto its own line. The 60% basis is what makes the
   decision: a short price like "311,50 EUR" still sits inline. */
@media (max-width: 480px) {
	.gr-prices__row {
		flex-wrap: wrap;
	}

	.gr-prices__lbl {
		flex: 1 1 60%;
		min-width: 0;
		overflow-wrap: break-word;
	}

	.gr-prices__val {
		margin-left: auto;
	}
}

/* --------------------------------------------------------------------------
   BATCH 2 (Aug 2026)
   -------------------------------------------------------------------------- */

/* Flick-past-the-last-card no longer chains into a page/browser gesture. */
@media (max-width: 1024px) {
	.gr-track { overscroll-behavior-x: contain; }
}

/* Price-table group headings were 11.84px, the smallest text on the page.
   Desktop keeps the designed size. */
@media (max-width: 1024px) {
	.gr-prices__gh { font-size: 13px; }
}

/* The see-all link below the cards read as a footnote after the big shadowed
   cards (Evie: it gets lost). Centered ghost button instead, visuals copied
   from the theme's .btn / .btn--ghost. Twin rule in fahrten.css. */
.gr-foot { text-align: center; }
.gr-foot .gr-seemore {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.4rem;
	border: 1px solid var(--dfv-orange);
	border-radius: var(--radius);
	background: transparent;
	color: var(--dfv-orange);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	min-height: 44px;
}
.gr-foot .gr-seemore:hover {
	background: var(--dfv-orange);
	color: #fff;
}

/* Breadcrumb-to-photo gap (Evie's loose end): breadcrumb bottom spacing is
   zeroed for trip singles in main.css; the hero carries one clean 1.5rem top
   margin instead (it had none, the old 40px came from the breadcrumb). */
.gr-hero { margin-top: 1.5rem; }

/* BATCH 2b (Aug 2026): below 1025 the sidebar accordion already separates
   breadcrumb and photo, so the hero's 1.5rem top margin read as a double
   gap (Evie). Desktop keeps the 24px. */
@media (max-width: 1024px) {
	.gr-hero { margin-top: 0; }
}