/* Glotto language switcher */
.glotto-switcher {
	--glotto-bg: #fff;
	--glotto-text: #1d2327;
	--glotto-border: rgba(0, 0, 0, .12);
	--glotto-hover: rgba(0, 0, 0, .05);
	--glotto-radius: 10px;
	font-size: 14px;
	line-height: 1.2;
	color: var(--glotto-text);
	position: relative;
	display: inline-block;
}
.glotto-switcher ul { list-style: none; margin: 0; padding: 0; }
.glotto-switcher a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.glotto-switcher .glotto-flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.glotto-switcher details { position: relative; }
.glotto-switcher summary {
	list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
	padding: 9px 12px; background: var(--glotto-bg); border: 1px solid var(--glotto-border);
	border-radius: var(--glotto-radius); user-select: none; white-space: nowrap;
}
.glotto-switcher summary::-webkit-details-marker { display: none; }
.glotto-switcher summary:focus-visible, .glotto-switcher a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.glotto-caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; margin-left: 2px; opacity: .7; }
.glotto-switcher details[open] .glotto-caret { transform: translateY(1px) rotate(-135deg); }
.glotto-switcher--dropdown ul {
	position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 99999;
	background: var(--glotto-bg); border: 1px solid var(--glotto-border); border-radius: var(--glotto-radius);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .14); padding: 6px;
	animation: glotto-pop .16s ease-out;
}
.glotto-switcher--dropdown li a { padding: 8px 10px; border-radius: 7px; white-space: nowrap; }
.glotto-switcher--dropdown li a:hover { background: var(--glotto-hover); }
.glotto-switcher--list ul, .glotto-switcher--flags ul { display: flex; flex-wrap: wrap; gap: 6px; }
.glotto-switcher--list a, .glotto-switcher--flags a { padding: 6px 8px; border-radius: 8px; opacity: .75; transition: opacity .15s, background .15s; }
.glotto-switcher--list a:hover, .glotto-switcher--flags a:hover, .glotto-switcher a.glotto-current { opacity: 1; background: var(--glotto-hover); }
.glotto-switcher--flags .glotto-flag { width: 24px; height: 18px; }

/* Floating */
.glotto-floating { position: fixed; z-index: 99990; }
.glotto-floating summary { box-shadow: 0 6px 24px rgba(0, 0, 0, .15); border-radius: 999px; padding: 10px 14px; }
.glotto-floating--bottom-left { left: var(--glotto-x, 18px); bottom: var(--glotto-y, 18px); }
.glotto-floating--bottom-right { right: var(--glotto-x, 18px); bottom: var(--glotto-y, 18px); }
.glotto-floating--top-left { left: var(--glotto-x, 18px); top: var(--glotto-y, 18px); }
.glotto-floating--top-right { right: var(--glotto-x, 18px); top: var(--glotto-y, 18px); }
.glotto-floating--bottom-left ul, .glotto-floating--bottom-right ul { top: auto; bottom: calc(100% + 8px); }
.glotto-floating--bottom-right ul, .glotto-floating--top-right ul { left: auto; right: 0; }
body.admin-bar .glotto-floating--top-left, body.admin-bar .glotto-floating--top-right { top: calc(var(--glotto-y, 18px) + 32px); }
@media (max-width: 600px) {
	.glotto-floating--bottom-left, .glotto-floating--top-left { left: var(--glotto-x-m, 12px); }
	.glotto-floating--bottom-right, .glotto-floating--top-right { right: var(--glotto-x-m, 12px); }
	.glotto-floating--bottom-left, .glotto-floating--bottom-right { bottom: var(--glotto-y-m, 12px); }
	.glotto-floating--top-left, .glotto-floating--top-right { top: var(--glotto-y-m, 12px); }
	body.admin-bar .glotto-floating--top-left, body.admin-bar .glotto-floating--top-right { top: calc(var(--glotto-y-m, 12px) + 46px); }
	.glotto-floating summary { padding: 9px 12px; }
}

/* Menu items */
.glotto-menu-item .glotto-flag { width: 18px; height: 14px; border-radius: 2px; vertical-align: middle; margin-right: 6px; object-fit: cover; }

/* Language suggestion banner */
.glotto-suggest {
	position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 99995;
	display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px);
	background: #111; color: #fff; padding: 10px 10px 10px 16px; border-radius: 999px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .25); font: 14px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
	animation: glotto-rise .3s ease-out;
}
.glotto-suggest a { background: #fff; color: #111; text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.glotto-suggest button { background: none; border: 0; color: #fff; opacity: .7; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; }
@keyframes glotto-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes glotto-rise { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) {
	.glotto-switcher--dropdown ul, .glotto-suggest { animation: none; }
}
