/**
 * Der Teilen-Knopf (ua-orte 0.62.0, includes/teilen.php).
 *
 * EIGENSTÄNDIG: Termin, Gewinnspiel, Quiz, Kalender und Baustellen laden
 * ua-orte.css nicht. Die Form des Knopfs (Stufe tertiär, klein, aus dem
 * Knopfsystem .ua-btn) steht deshalb hier ein weiteres Mal, an
 * `.ua-tk .ua-tk__knopf` gebunden — ändert sich die Stufe in ua-orte.css,
 * hier nachziehen (wie die Spiegel in ua-360, ua-shop, ua-redaktion).
 *
 * Entwurf Alex (Artifact „Teilen-Knopf“): umrandet, klein, Symbol (seit
 * 0.62.1 Kästchen mit Pfeil, Strich 1,7) 20 px, Text „Teilen“ immer; Hover gefüllt Navy; „Link kopiert“ mit Haken in
 * Sage für 2 s. Das Wort steht immer (0.62.1) — Ausnahme seit ua-orte 0.70.1:
 * im Profilkopf am Handy nur das Symbol (ua-orte.css, Block 0.70.1);
 * `symbol` (nur das Symbol, aria-label) gibt es noch, benutzt es aber keine Stelle. Aufklappfeld: weiß, Rand Sand
 * 1 px, Radius 10, oben eine Zeile Vorschau (15 px grau), darunter
 * WhatsApp, E-Mail, Link kopieren als Zeilen mit Symbol.
 *
 * Harte Werte ohne Paletteneintrag: Weiß #fff (Feld), Grau #6b6b6b
 * (Vorschau), Schatten im Navy-tief-Tripel rgba(18, 49, 67, .12). Bei der
 * Farbrunde mitziehen.
 */

.ua-tk {
	position: relative;
	display: inline-flex;
	flex: none;
	vertical-align: middle;
}

.ua-tk [hidden] {
	display: none !important;
}

/* ------------------------------------------------------------ Knopf */

.ua-tk .ua-tk__knopf.ua-tk__knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 32px;
	margin: 0;
	padding: 5px 12px;
	border: 1px solid var(--ua-sand, #d9cdb8);
	border-radius: 999px;
	background-color: var(--ua-cream, #f7f2ea);
	color: var(--ua-navy, #184058);
	font-family: var(--ua-sans, inherit);
	font-size: 0.84rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ua-tk .ua-tk__knopf.ua-tk__knopf:hover,
.ua-tk .ua-tk__knopf.ua-tk__knopf:active,
.ua-tk .ua-tk__knopf.ua-tk__knopf[aria-expanded="true"] {
	background-color: var(--ua-navy, #184058);
	border-color: var(--ua-navy, #184058);
	color: var(--ua-cream, #f7f2ea);
}

.ua-tk .ua-tk__knopf.ua-tk__knopf:focus-visible {
	outline: 2px solid var(--ua-amber, #e8a020);
	outline-offset: 2px;
}

.ua-tk__symbol {
	flex: none;
	display: block;
}

/* Hauptknopf (Termin): gefüllt Navy. */
.ua-tk--haupt .ua-tk__knopf.ua-tk__knopf {
	min-height: 44px;
	padding: 10px 20px;
	font-size: 0.95rem;
	background-color: var(--ua-navy, #184058);
	border-color: var(--ua-navy, #184058);
	color: var(--ua-cream, #f7f2ea);
}

.ua-tk--haupt .ua-tk__knopf.ua-tk__knopf:hover,
.ua-tk--haupt .ua-tk__knopf.ua-tk__knopf[aria-expanded="true"] {
	background-color: var(--ua-navy-tief, #123143);
	border-color: var(--ua-navy-tief, #123143);
}

/* Nur das Symbol — nur mit `symbol` (heute nirgends). Seit 0.62.1 (Alex)
   steht das Wort überall, auch am Handy (Ausnahme seit 0.70.1: Profilkopf
   unter 600 px, Regel in ua-orte.css); wird es eng, bricht der Knopf in
   die nächste Zeile (unten), statt das Wort zu verlieren. */
.ua-tk--symbol .ua-tk__wort {
	display: none;
}

.ua-tk--symbol .ua-tk__knopf.ua-tk__knopf {
	min-width: 32px;
	padding: 5px 7px;
}

/* „Link kopiert“: der Knopf kurz mit Rand in Sage. */
.ua-tk--kopiert .ua-tk__knopf.ua-tk__knopf {
	border-color: var(--ua-sage, #5a8a6a);
}

/* ------------------------------------------------------- Aufklappfeld */

.ua-tk__feld {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 60;
	display: flex;
	flex-direction: column;
	width: 260px;
	max-width: calc(100vw - 32px);
	padding: 8px;
	background: #fff;
	border: 1px solid var(--ua-sand, #d9cdb8);
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(18, 49, 67, .12);
	text-align: left;
}

.ua-tk--rechts .ua-tk__feld {
	left: auto;
	right: 0;
}

.ua-tk__vorschau {
	display: block;
	padding: 4px 8px 8px;
	font-family: var(--ua-sans, inherit);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	color: #6b6b6b;
	overflow-wrap: anywhere;
}

.ua-tk .ua-tk__zeile.ua-tk__zeile {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 8px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--ua-navy, #184058);
	font-family: var(--ua-sans, inherit);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
}

.ua-tk .ua-tk__zeile.ua-tk__zeile:hover,
.ua-tk .ua-tk__zeile.ua-tk__zeile:focus-visible {
	background: var(--ua-cream, #f7f2ea);
	color: var(--ua-navy, #184058);
}

.ua-tk .ua-tk__zeile.ua-tk__zeile:focus-visible {
	outline: 2px solid var(--ua-amber, #e8a020);
	outline-offset: -2px;
}

/* Haken in Sage: statt des Link-Symbols, 2 s lang (Skript). */
.ua-tk .ua-tk__haken,
.ua-tk .ua-tk__zeile--kopiert .ua-tk__symbol {
	display: none;
}

.ua-tk .ua-tk__zeile--kopiert .ua-tk__haken {
	display: block;
}

.ua-tk .ua-tk__zeile--kopiert.ua-tk__zeile--kopiert,
.ua-tk .ua-tk__zeile--kopiert.ua-tk__zeile--kopiert:hover {
	color: var(--ua-sage-tief, #4d755a);
}

.ua-tk__status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ------------------------------------------------- Kopfknöpfe (Kästen)
   Teilen neben „Zuklappen“ / „Ganze Karte“ im Kopf eines Kastens. */
.ua-kopfknoepfe {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: none;
}

/* Profil-Kopf: Teilen steht seit 0.70.0 rechts in der Kicker-Zeile
   (.ua-kopf__kickerzeile in ua-orte.css), nicht mehr neben dem Namen. */

/* Kasten-Köpfe (Mittagstisch, Speisekarte): ebenso umbrechen statt
   quetschen. */
.ua-mittag__kopf:has(.ua-tk),
.ua-sk__kopf:has(.ua-tk) {
	flex-wrap: wrap;
}

/* Der Text darf neben den Knöpfen umbrechen, bevor die Knöpfe in die
   nächste Zeile rutschen — sonst stünden sie am Desktop schon bei einer
   langen Unterzeile darunter (Gegenlesung B2). */
.ua-mittag__kopf:has(.ua-tk) > .ua-mittag__titel,
.ua-sk__kopf:has(.ua-tk) > .ua-sk__kopftext {
	flex: 1 1 240px;
	min-width: 0;
}
