/**
 * Modul 14: Vor und Zurück.
 *
 * Absichtlich zurückhaltend: keine Schriftgrössen in Pixeln, keine festen
 * Farben ausser dem halbdurchsichtigen Grund der schwebenden Pfeile, damit
 * sich die Navigation in jedes Theme einfügt.
 */

/* ----------------------------------------------------------------
 * Schwebende Pfeile am Bildschirmrand
 * ---------------------------------------------------------------- */

.alp-pn-float {
	position: fixed;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 900;
}

/*
 * Weisse runde Schaltflächen, wie die Pfeile in der Lightbox – auf hellen wie
 * auf dunklen Seiten gut zu sehen, weil der Schatten sie absetzt.
 */
.alp-pn-arrow {
	position: absolute;
	display: flex;
	align-items: center;
	pointer-events: auto;
	box-sizing: border-box;
	max-width: calc(50% - 1em);
	min-height: 48px;
	padding: 0.5em;
	color: #16181c;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 999px;
	text-decoration: none;
	line-height: 1;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.alp-pn-arrow:hover,
.alp-pn-arrow:focus-visible {
	color: #16181c;
	background: #fff;
	box-shadow: 0 3px 16px rgba(0, 0, 0, 0.36);
	text-decoration: none;
}

.alp-pn-arrow:focus-visible {
	outline: 2px solid #16181c;
	outline-offset: 2px;
}

.alp-pn-arrow-prev {
	left: 12px;
}

.alp-pn-arrow-next {
	right: 12px;
	flex-direction: row-reverse;
}

.alp-pn-arrow .alp-pn-icon {
	flex: 0 0 auto;
}

/* Der Titel klappt beim Überfahren auf. */
.alp-pn-label {
	display: block;
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	transition: max-width 0.25s ease;
}

.alp-pn-label-inner {
	display: block;
	padding: 0 0.6em 0 0.2em;
	font-size: 0.85em;
	overflow: hidden;
	text-overflow: ellipsis;
}

.alp-pn-arrow-next .alp-pn-label-inner {
	padding: 0 0.2em 0 0.6em;
}

.alp-pn-arrow:hover .alp-pn-label,
.alp-pn-arrow:focus-visible .alp-pn-label {
	max-width: 18em;
}

/* ----------------------------------------------------------------
 * Kurze Zeile über dem Titel
 * ---------------------------------------------------------------- */

.alp-pn-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
	margin: 0 0 1em;
	flex-wrap: wrap;
}

.alp-pn-top-link {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	padding: 0.3em 0.75em 0.3em 0.5em;
	font-size: 0.85em;
	line-height: 1.6;
	text-decoration: none;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-radius: 999px;
	transition: background-color 0.2s ease;
}

.alp-pn-top-next {
	padding: 0.3em 0.5em 0.3em 0.75em;
	margin-left: auto;
}

.alp-pn-top-link:hover,
.alp-pn-top-link:focus-visible {
	background: rgba(128, 128, 128, 0.14);
	text-decoration: none;
}

.alp-pn-top-link .alp-pn-icon {
	width: 16px;
	height: 16px;
	opacity: 0.7;
}

/* ----------------------------------------------------------------
 * Block unter dem Beitrag
 * ---------------------------------------------------------------- */

.alp-pn-block {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em;
	margin: 2.5em 0 0.5em;
	padding-top: 1.5em;
	border-top: 1px solid rgba(128, 128, 128, 0.3);
	clear: both;
}

.alp-pn-card {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.5em;
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 0.2s ease;
}

.alp-pn-card:hover,
.alp-pn-card:focus-visible {
	background: rgba(128, 128, 128, 0.12);
	text-decoration: none;
}

.alp-pn-card-next {
	flex-direction: row-reverse;
	text-align: right;
}

.alp-pn-card .alp-pn-icon {
	flex: 0 0 auto;
	opacity: 0.55;
}

/*
 * Höhe frei, Breite gedeckelt: So behält das Vorschaubild sein Seitenverhältnis
 * – ein Hochformat bleibt hochkant, ein Querformat breit. Kein Zuschnitt, keine
 * Verzerrung. !important, weil manche Themes img-Regeln sehr breit setzen.
 */
.alp-pn-block .alp-pn-thumb {
	flex: 0 0 auto;
	width: auto !important;
	height: auto !important;
	max-width: 88px;
	max-height: 72px;
	object-fit: contain;
	border-radius: 3px;
	margin: 0;
}

.alp-pn-text {
	display: block;
	min-width: 0;
}

.alp-pn-dir {
	display: block;
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.6;
}

.alp-pn-title {
	display: block;
	font-weight: 600;
	line-height: 1.3;
}

.alp-pn-empty {
	display: block;
}

/* ----------------------------------------------------------------
 * Schmale Bildschirme
 * ---------------------------------------------------------------- */

@media (max-width: 782px) {
	.alp-pn-arrow {
		min-height: 40px;
		padding: 0.4em;
	}

	.alp-pn-arrow-prev {
		left: 6px;
	}

	.alp-pn-arrow-next {
		right: 6px;
	}

	/* Am Handy bleibt der Titel aus, der Platz fehlt. */
	.alp-pn-label {
		display: none;
	}

	.alp-pn-desktop {
		display: none;
	}

	.alp-pn-block {
		grid-template-columns: 1fr;
	}

	.alp-pn-block .alp-pn-empty {
		display: none;
	}

	.alp-pn-card-next {
		flex-direction: row;
		text-align: left;
	}

	/* Der Pfeil nach vorn bleibt rechts, sonst zeigen beide nach links. */
	.alp-pn-card-next .alp-pn-icon {
		order: 3;
		margin-left: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.alp-pn-arrow,
	.alp-pn-card,
	.alp-pn-top-link,
	.alp-pn-label {
		transition: none;
	}
}

@media print {
	.alp-pn-float,
	.alp-pn-top {
		display: none;
	}
}
