/* Guest language picker (apps/guests/templates/guests/_language_picker.html).
   Check-in + guest portal. 44px tap targets; works at 375px; logical
   properties so it mirrors on right-to-left pages. */

.glp {
    position: relative;
    display: inline-block;
    font-size: 14px;
    line-height: 1.2;
    z-index: 30;
}
.glp[open] .glp__panel { z-index: 1000; }
.glp__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding-block: 0;
    padding-inline: 12px 10px;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.glp__btn::-webkit-details-marker { display: none; }
.glp__btn::marker { content: ""; }
.glp__btn:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}
.glp__name {
    max-width: 11em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.glp__chev { transition: transform 0.15s ease; flex: 0 0 auto; }
.glp[open] .glp__chev { transform: rotate(180deg); }
.glp__globe { flex: 0 0 auto; }
.glp__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Card variant — light pages (check-in card, plain portal pages) */
.glp--card .glp__btn {
    background: #fff;
    color: #1f2937;
    border: 1px solid #d1d5db;
}
.glp--card .glp__btn:hover { border-color: #9ca3af; }

/* Hero variant — glass chip on a photo */
.glp--hero .glp__btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.glp--hero .glp__btn:hover { background: rgba(255, 255, 255, 0.3); }

.glp__panel {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    width: max-content;
    min-width: 220px;
    max-width: min(300px, calc(100vw - 32px));
    max-height: min(70vh, 480px);
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    text-align: start;
    text-shadow: none;
}
.glp__title {
    margin: 4px 10px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.02em;
}
.glp__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.glp__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    color: #111827;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}
.glp__opt:hover,
.glp__opt:focus-visible {
    background: #f3f4f6;
    outline: none;
}
.glp__opt:focus-visible { box-shadow: inset 0 0 0 2px #2563eb; }
.glp__opt--on {
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
}

/* Rows that hold the picker */
.glp-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 12px;
}
.portal-hero-lang {
    position: absolute;
    top: calc(16px + var(--portal-hero-offset, 0px));
    inset-inline-start: 16px;
    z-index: 5;
}
.ci2-hero__lang {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 5;
}

@media (max-width: 420px) {
    .glp { font-size: 13px; }
    .glp__btn { padding-inline: 10px 8px; gap: 5px; }
    .glp__name { max-width: 7.5em; }
}

@media (prefers-reduced-motion: reduce) {
    .glp__chev { transition: none; }
}
/* Keep the hero's words below the picker (short step hero on phones). */
.ci2-hero:has(> .ci2-hero__lang) {
    padding-top: 64px;
}
/* The heroes are their own stacking layer (isolation); while the list is
   open lift the hero above the card that overlaps it. */
.pv-hero:has(.glp[open]),
.portal-hero:has(.glp[open]),
.ci2-hero:has(.glp[open]) {
    z-index: 60;
}
