/* Tagesseite */

.tag { touch-action: pan-y pinch-zoom; }
body.tag-page { padding-top: 0; } /* das Titelbild reicht bis unter die Statusleiste */

/* Titelbild: Teil der Seite (scrollt und wischt mit), immer volle Breite, natürliche Höhe, nie beschnitten.
   Oben liegt das Bild unter der Statusleiste (Safe Area); dort zeigt die unscharfe Kopie die Bildfarben. */
.tag-hero { position: relative; overflow: hidden; background: var(--surface); padding-top: env(safe-area-inset-top, 0px); }
.tag-hero-blur {
	position: absolute; inset: -30px;
	background-size: cover; background-position: center;
	filter: blur(28px) brightness(0.55);
}
.tag-hero-frame { position: relative; width: 100%; }
.tag-hero-frame img { display: block; width: 100%; height: auto; }

/* Blatt: Titelbild, Titel, Text, Kommentare. Es gleitet beim Wischen und Ziehen als Ganzes. */
.tag-sheet { position: relative; background: var(--bg); padding-bottom: 56px; }
.tag-sheet--noimg { padding-top: env(safe-area-inset-top, 0px); }
body.tag-page .site-footer { margin-top: 0; background: var(--bg); }

/* Feste Bedienelemente: nur mit Maus sichtbar (Laptop), sonst für Screenreader erreichbar.
   Pfeile im Stil des früheren Plugins: dezent, mittig am Rand, bewegen sich beim Scrollen nicht mit. */
.tag-fixed { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.tag-back, .tag-side {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
	.tag-back {
		width: auto; height: auto; overflow: visible; clip: auto;
		top: calc(10px + env(safe-area-inset-top, 0px)); left: calc(10px + env(safe-area-inset-left, 0px));
		display: inline-flex; align-items: center; gap: 6px;
		min-height: 40px; padding: 0 16px;
		color: #fff; font-size: 0.95rem; font-weight: 600; text-decoration: none;
		background: rgba(14, 20, 18, 0.66);
		-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
		border-radius: 20px;
	}
	.tag-back:hover { color: #fff; background: rgba(14, 20, 18, 0.85); }
	.tag-side {
		width: 48px; height: 48px; overflow: visible; clip: auto;
		top: 50%; transform: translateY(-50%);
		display: flex; align-items: center; justify-content: center;
		color: rgba(255, 255, 255, 0.35); border-radius: 50%;
		transition: color 0.2s ease, background 0.2s ease;
	}
	.tag-side--prev { left: 10px; }
	.tag-side--next { right: 10px; }
	.tag-side-arrow { width: 36px; height: 36px; opacity: 0.6; }
	.tag-side:hover { color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.2); }
	.tag-side:focus-visible, .tag-back:focus-visible { outline: 2px solid var(--route); outline-offset: 2px; }
}

/* Text: volle Breite, am Desktop auf Lesebreite begrenzt */
.tag-body { max-width: 46rem; margin: 0 auto; padding: 22px var(--gutter) 0; }
.tag-title { margin: 0; font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.15; font-weight: 600; }
.tag-date { margin: 6px 0 20px; color: var(--muted); font-size: 0.95rem; }
.tag-body .entry-content { font-size: 1.05rem; line-height: 1.65; }
.tag-body .entry-content p { margin: 0 0 1em; }
.tag-body .entry-content :is(h2, h3) { line-height: 1.25; margin: 1.6em 0 0.5em; }

/* Vorheriger/nächster Tag am Textende */
.tag-pager {
	display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
	max-width: 46rem; margin: 36px auto 0; padding: 0 var(--gutter);
}
.tag-pager-link {
	display: block; padding: 10px 12px; min-width: 0;
	color: var(--text); text-decoration: none;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.tag-pager-link:hover { background: var(--surface-2); color: var(--text); }
.tag-pager-next { grid-column: 2; text-align: right; }
.tag-pager-label { display: block; font-size: 0.78rem; color: var(--muted); }
.tag-pager-title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	font-weight: 600; line-height: 1.3;
}

/* Wisch- und Zieh-Rückmeldung (von tag.js gesteuert) */
.tag-sheet.is-dragging { transition: none; }
.tag-sheet.is-settling { transition: transform 0.18s ease, opacity 0.18s ease; }
.tag-pull {
	position: fixed; z-index: 50; left: 50%;
	top: calc(10px + env(safe-area-inset-top, 0px));
	transform: translate(-50%, -80px); opacity: 0;
	padding: 8px 16px; font-size: 0.9rem; font-weight: 600;
	color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px;
	pointer-events: none;
}
.tag-pull.is-ready { color: #1b1405; background: var(--route); border-color: var(--route); }

@media (prefers-reduced-motion: reduce) { .tag-sheet.is-settling { transition: none; } }
