/* Palmer Affiliate Produkte – Frontend
   Look angelehnt an das TechFocus-Mockup: cleanes weißes Grid,
   Pastell-Filter-Pills, schwarze Vollbreite-Buttons. */

.pap-wrap {
	--pap-rahmen: #e6e6e6;
	--pap-text: #17181a;
	--pap-text-soft: #5f6368;
	--pap-label: #8a8f98;
	--pap-akzent: #101113;
	--pap-akzent-text: #ffffff;
	--pap-radius: 6px;
	--pap-bild-bg: #fafafa;

	width: 100%;
	max-width: 100%;
	margin: 0;
	overflow-wrap: break-word;
}

/* ---------- Grundlegender Overflow-Schutz (Mobile) ----------
   Erzwingt border-box unabhängig vom Theme, damit Innenabstände
   die Breite nie über 100 % hinaus schieben. Bilder und lange
   Wörter werden zusätzlich abgesichert. */

.pap-wrap,
.pap-wrap *,
.pap-wrap *::before,
.pap-wrap *::after {
	box-sizing: border-box;
	min-width: 0;
}

.pap-wrap {
	overflow-wrap: break-word;
	word-break: break-word;
}

.pap-wrap img {
	max-width: 100%;
	height: auto;
}

.pap-kopf__kicker,
.pap-kopf__titel,
.pap-card__titel,
.pap-hinweis__titel {
	overflow-wrap: break-word;
	hyphens: auto;
}

.pap-card__text,
.pap-hinweis__text {
	overflow-wrap: anywhere;
}

/* ---------- Filter-Pills ---------- */

.pap-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 32px;
}

.pap-pill {
	appearance: none;
	border: 1px solid var(--pap-rahmen);
	background: #f2f3f5;
	color: var(--pap-text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	padding: 10px 18px;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Dezente Pastelltöne, rotieren nach Reihenfolge der Kategorien */
.pap-pill--c0 { background: #e3edf7; border-color: #d3e2f0; }
.pap-pill--c1 { background: #e4f0e2; border-color: #d4e5d1; }
.pap-pill--c2 { background: #f1efe6; border-color: #e5e2d3; }
.pap-pill--c3 { background: #f0e6ee; border-color: #e3d3e0; }
.pap-pill--c4 { background: #e6eef0; border-color: #d3e0e3; }

.pap-pill:hover,
.pap-pill:focus-visible {
	border-color: var(--pap-akzent);
}

.pap-pill:focus-visible {
	outline: 2px solid var(--pap-akzent);
	outline-offset: 2px;
}

.pap-pill.is-active {
	background: var(--pap-akzent);
	border-color: var(--pap-akzent);
	color: var(--pap-akzent-text);
}

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

.pap-grid {
	display: grid;
	grid-template-columns: repeat(var(--pap-spalten, 4), minmax(0, 1fr));
	gap: 24px;
}

/* Elementor-Standard-Breakpoints: Tablet <= 1024px, Mobile <= 767px.
   Gleiche max-width-Werte wie Elementor, damit der Umbruch synchron
   mit der Geraete-Vorschau im Editor laeuft. */

@media (max-width: 1024px) {
	.pap-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.pap-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.pap-card {
		padding: 16px;
	}

	.pap-hinweis {
		padding: 16px 44px 16px 16px;
	}
}

/* ---------- Karte ---------- */

.pap-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid var(--pap-rahmen);
	border-radius: var(--pap-radius);
	padding: 20px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pap-card:hover {
	box-shadow: 0 8px 24px rgba(16, 17, 19, 0.08);
	transform: translateY(-2px);
}

.pap-card.is-hidden {
	display: none;
}

.pap-card__bild {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background: var(--pap-bild-bg);
	border-radius: calc(var(--pap-radius) - 2px);
	margin: -8px -8px 14px;
	overflow: hidden;
}

.pap-card__bild img {
	max-width: 96%;
	max-height: 96%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.pap-card__bild--leer {
	background:
		linear-gradient(135deg, transparent 49.5%, var(--pap-rahmen) 49.5%, var(--pap-rahmen) 50.5%, transparent 50.5%),
		var(--pap-bild-bg);
}

.pap-card__inhalt {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: var(--pap-card-gap, 10px);
}

.pap-card__label {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pap-label);
}

.pap-card__titel {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--pap-text);
}

.pap-card__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--pap-text-soft);
}

.pap-card__button {
	display: block;
	text-align: center;
	margin-top: var(--pap-button-gap, var(--pap-card-gap, 10px));
	background: var(--pap-akzent);
	color: var(--pap-akzent-text) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	padding: 13px 16px;
	border-radius: 4px;
	transition: opacity 0.15s ease;
}

.pap-card__button:hover,
.pap-card__button:focus-visible {
	opacity: 0.85;
	color: var(--pap-akzent-text) !important;
}

.pap-card__button:focus-visible {
	outline: 2px solid var(--pap-akzent);
	outline-offset: 2px;
}

/* ---------- Sanftes Einblenden beim Filtern ---------- */

@media (prefers-reduced-motion: no-preference) {
	.pap-card.is-eingeblendet {
		animation: pap-fade-in 0.25s ease both;
	}

	@keyframes pap-fade-in {
		from {
			opacity: 0;
			transform: translateY(6px);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}

/* ---------- Kopfbereich (Kicker, Überschrift, Text) ---------- */

.pap-kopf {
	text-align: center;
	margin: 0 0 40px;
}

.pap-kopf__kicker {
	margin: 0;
	font-size: clamp(42px, 7vw, 76px);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--pap-text, #17181a);
}

.pap-kopf__titel {
	margin: 4px 0 0;
	font-size: clamp(22px, 3vw, 34px);
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--pap-text, #17181a);
}

.pap-kopf__text {
	margin: 18px 0 0;
	text-align: left;
	font-size: 17px;
	line-height: 1.6;
	color: var(--pap-text-soft, #5f6368);
}

/* ---------- Hinweisboxen ---------- */

.pap-hinweis {
	position: relative;
	margin: 0 0 20px;
	padding: 18px 48px 18px 20px;
	border-radius: 4px;
}

.pap-hinweis--gruen { background: #ddeed2; color: #2e5424; }
.pap-hinweis--blau  { background: #d6e6f5; color: #1f4d75; }
.pap-hinweis--gelb  { background: #faf0cd; color: #6b5410; }
.pap-hinweis--grau  { background: #ececec; color: #3c3c3c; }

.pap-hinweis__titel {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
}

.pap-hinweis__text {
	font-size: 14px;
	line-height: 1.6;
}

.pap-hinweis__text p {
	margin: 0 0 8px;
}

.pap-hinweis__text p:last-child {
	margin-bottom: 0;
}

.pap-hinweis__schliessen {
	position: absolute;
	top: 12px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 0;
	height: auto;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	text-transform: none;
	font-family: inherit;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	padding: 4px;
	margin: 0;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.pap-hinweis__schliessen:hover,
.pap-hinweis__schliessen:focus-visible {
	background-color: rgba(0, 0, 0, 0.06);
}

.pap-hinweis__schliessen:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pap-hinweis.is-hidden {
	display: none;
}
