/* ===========================================================================
   lg.footer — the site footer (includes/footer.php) and the edition picker
   in the header for guests (_components/lg-editions.php)
   ---------------------------------------------------------------------------

     details.lg-edition                 header picker, guests only
       summary.lg-edition__button       "EN" + chevron
       ul.lg-edition__list              all public editions, current ticked

     .lg-version-hint                   bar under the header: "Your native
                                        language is German? → German version"

     .footer.lg-footer                  data-* attributes are read by main2025.js
       .lg-footer__inner
         .lg-footer__top                brand | languages | Lingua.com
         .lg-footer__bottom             "All versions" row + copyright

   Colours from tokens.css, so dark mode follows on its own. The legacy .footer
   rules (a.css, a-dark.css: grey band, 0.9em) are overridden through the
   extra class.
   =========================================================================== */

/* --- Header: edition picker --------------------------------------------- */
.versionright--editions {
	position: relative;
	vertical-align: middle;
}

.lg-edition {
	position: relative;
	display: inline-block;
	font-family: var(--lg-font);
}

.lg-edition__button {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	/* The height of the header's other buttons: 41px on desktop (a.css
	   .header .button), 40px in the phone bar (below). */
	height: 41px;
	padding: 0 0.6rem 0 0.85rem;
	/* Quiet, like the header's Log out (lg.header.css --quiet): no frame,
	   no fill until hovered or open. The border stays, transparent, so the
	   size does not change. */
	border: 1px solid transparent;
	border-radius: 999px;
	background-color: transparent;
	color: var(--lg-text-soft);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	list-style: none;
	user-select: none;
	box-sizing: border-box;
}

.lg-edition__button::-webkit-details-marker {
	display: none;
}

.lg-edition__button:hover,
.lg-edition[open] .lg-edition__button {
	background-color: var(--lg-surface-alt);
	color: var(--lg-text);
}

.lg-edition__button:focus-visible {
	outline: 2px solid var(--lg-red);
	outline-offset: 2px;
}

.lg-edition__chevron {
	width: 0.9rem;
	height: 0.9rem;
	color: var(--lg-text-muted);
	transition: transform 0.15s ease;
}

.lg-edition[open] .lg-edition__chevron {
	transform: rotate(180deg);
}

.lg-edition__list {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 30;
	min-width: 220px;
	max-height: min(70vh, 460px);
	overflow-y: auto;
	margin: 0;
	padding: 0.35rem;
	border: 1px solid var(--lg-border);
	border-radius: var(--lg-radius-card);
	background-color: var(--lg-surface);
	box-shadow: 0 12px 32px rgba(var(--lg-shadow-rgb), 0.14);
	list-style: none;
	text-align: left;
	box-sizing: border-box;
}

.lg-edition__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-edition__item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.7rem;
	border-radius: var(--lg-radius-sm);
	color: var(--lg-text);
	font-size: 0.95rem;
	line-height: 1.3;
	text-decoration: none;
}

.lg-edition__item:hover,
.lg-edition__item:focus-visible {
	background-color: var(--lg-surface-alt);
	color: var(--lg-text);
	outline: none;
}

.lg-edition__item.is-current {
	font-weight: 700;
}

.lg-edition__name {
	flex: 1 1 auto;
}

.lg-edition__tag {
	color: var(--lg-text-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.lg-edition__check {
	width: 1rem;
	height: 1rem;
	color: var(--lg-red);
}

/* Phones: "EN" and its chevron as the last button of the
   header row, right of the account circle (order: the other children of
   .versionselector keep 0). a.css "phone header bar" hid the old globe and
   circles; this shows the picker again. */
@media (max-width: 649.98px) {

	.header .versionright.versionright--editions {
		display: block;
		order: 1;
	}

	/* 40px like the language pill and the premium pill next to it. */
	.lg-edition__button {
		justify-content: center;
		min-width: 40px;
		height: 40px;
		padding: 0 0.45rem 0 0.6rem;
	}
}

/* Narrow phones: no room for the picker in the header row. The footer's
   "All versions" row still links every edition where the footer is shown.
   Except on the start pages (index.php, de.php …, --start in header.php):
   that is where a visitor picks their edition. */
@media (max-width: 479.98px) {

	.header .versionright.versionright--editions:not(.versionright--start) {
		display: none;
	}
}

/* --- Version hint bar --------------------------------------------------- */
/* Between the header and the page, start pages only, for guests whose browser
   asks for another edition (header.php, $lg_version_hint). */
.lg-version-hint {
	border-bottom: 1px solid var(--lg-border);
	background-color: var(--lg-surface-alt);
	color: var(--lg-text);
	font-family: var(--lg-font);
	font-size: 0.95rem;
}

.lg-version-hint__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.4rem 0.9rem;
	max-width: 1150px;
	margin: 0 auto;
	/* Left padding = .content's (a.css: 2rem, 1.5rem up to 750px, 1rem up to
	   576px), so the text starts where the h1 below does. */
	padding: 0.6rem 3.25rem 0.6rem 2rem;
	position: relative;
	box-sizing: border-box;
}

.lg-version-hint__text {
	color: var(--lg-text-soft);
}

.lg-version-hint__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 36px;
	padding: 0 1rem 0 0.75rem;
	border: 1px solid var(--lg-border);
	border-radius: 999px;
	background-color: var(--lg-surface);
	color: var(--lg-text);
	font-weight: 700;
	text-decoration: none;
	box-sizing: border-box;
}

.lg-version-hint__link:hover {
	border-color: var(--lg-border-strong);
	color: var(--lg-text);
	text-decoration: none;
}

.lg-version-hint__flag {
	display: block;
	width: 24px;
	height: auto;
	border-radius: 2px;
}

.lg-version-hint__link:focus-visible,
.lg-version-hint__close:focus-visible {
	outline: 2px solid var(--lg-red);
	outline-offset: 2px;
}

.lg-version-hint__close {
	position: absolute;
	top: 50%;
	right: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--lg-text-muted);
	cursor: pointer;
	transform: translateY(-50%);
}

.lg-version-hint__close:hover {
	background-color: var(--lg-surface-muted);
	color: var(--lg-text);
}

.lg-version-hint__close svg {
	width: 1.1rem;
	height: 1.1rem;
}

@media (max-width: 750px) {

	.lg-version-hint__inner {
		padding-left: 1.5rem;
	}
}

@media (max-width: 576px) {

	.lg-version-hint__inner {
		padding-right: 3rem;
		padding-left: 1rem;
	}
}

/* --- Footer ------------------------------------------------------------- */
.footer.lg-footer {
	border-top: 1px solid var(--lg-border);
	background-color: var(--lg-surface-alt);
	color: var(--lg-text-soft);
	font-family: var(--lg-font);
	font-size: 0.95rem;
	line-height: 1.5;
}

.lg-footer__inner {
	max-width: 1150px;
	margin: 0 auto;
	padding: 3rem 1.5rem 1.5rem;
	box-sizing: border-box;
}

.lg-footer__top {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 2.2fr) minmax(0, 1fr);
	gap: 2rem 2.5rem;
	padding-bottom: 2.25rem;
}

.lg-footer__logo {
	display: inline-block;
}

.lg-footer__logo img {
	display: block;
	width: auto;
	height: 32px;
}

.lg-footer__tagline {
	max-width: 30ch;
	margin: 0.9rem 0 0;
	color: var(--lg-text-muted);
	font-size: 0.9rem;
}

.lg-footer__heading {
	margin: 0 0 0.85rem;
	color: var(--lg-text);
	font-family: var(--lg-font);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.lg-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-footer__list li {
	margin: 0 0 0.5rem;
	padding: 0;
	background: none;
	list-style: none;
}

/* Three columns of languages on desktop and tablet, two on phones. */
.lg-footer__list--columns {
	column-count: 3;
	column-gap: 1.5rem;
}

.lg-footer__list--columns li {
	break-inside: avoid;
}

.lg-footer a {
	color: var(--lg-text-soft);
	text-decoration: none;
}

.lg-footer a:hover {
	color: var(--lg-red);
	text-decoration: underline;
}

.lg-footer a:focus-visible {
	outline: 2px solid var(--lg-red);
	outline-offset: 2px;
	border-radius: 2px;
}

.lg-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--lg-border);
}

.lg-footer__editions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.9rem;
}

.lg-footer__editions-label {
	color: var(--lg-text);
	font-size: 0.85rem;
	font-weight: 700;
}

.lg-footer__editions-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-footer__editions-list li {
	margin: 0;
	padding: 0;
	background: none;
	list-style: none;
}

.lg-footer__editions-list a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4rem;
	min-height: 1.9rem;
	padding: 0 0.45rem;
	border: 1px solid var(--lg-border);
	border-radius: var(--lg-radius-sm);
	color: var(--lg-text-soft);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	box-sizing: border-box;
}

.lg-footer__editions-list a:hover {
	border-color: var(--lg-red);
	text-decoration: none;
}

.lg-footer__editions-list a.is-current {
	border-color: var(--lg-text);
	color: var(--lg-text);
}

.lg-footer__copyright {
	margin: 0;
	color: var(--lg-text-muted);
	font-size: 0.85rem;
}

/* Section page (footer.php): brand | the language's sections | the section
   in other languages | Lingua.com - four columns. */
.lg-footer__top--sections {
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}

/* The current section in its column: named, not linked. */
.lg-footer__current {
	color: var(--lg-text);
	font-weight: 700;
}

/* Tablets: brand across the top, then the two columns. */
@media (max-width: 899.98px) {

	.lg-footer__top {
		grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
	}

	.lg-footer__brand {
		grid-column: 1 / -1;
	}

	.lg-footer__top--sections {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Phones (only where there is no bottom navigation - with it the footer is
   hidden, lg.bottom-nav.css): one column, languages in two. */
@media (max-width: 599.98px) {

	.lg-footer__inner {
		padding: 2.25rem 1rem 1.25rem;
	}

	.lg-footer__top {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 1.75rem 1.5rem;
	}

	.lg-footer__col--languages {
		grid-column: 1 / -1;
	}

	.lg-footer__list--columns {
		column-count: 2;
	}

	.lg-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}
