/* Page shell and the top bar: brand, language switch, theme toggle, login
   button and the collapsed mobile menu — plus the footer. */

#issuemap-app {
    font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    /* clip, not hidden: hidden would turn this into a scroll container and
       stop the sticky footer from following the window. */
    overflow-x: clip;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
}

.brand svg {
    width: 24px;
    height: 24px;
    color: var(--teal);
    flex: none;
}

.brand .b-issue {
    color: var(--ink);
}

.brand .b-map {
    color: var(--orange);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: .82rem;
    font-weight: 600;
}

.lang-switch .lang-sep {
    color: var(--border);
}

.lang-option {
    color: var(--ink-dim);
    text-decoration: none;
    transition: color .15s ease;
}

.lang-option:hover {
    color: var(--ink);
}

.lang-option.is-active {
    color: var(--teal-ink);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    flex: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--ink-dim);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.theme-toggle:hover {
    color: var(--ink);
    background: var(--border);
}

.theme-toggle svg {
    width: 1rem;
    height: 1rem;
}

.theme-icon--sun,
.theme-toggle.is-dark .theme-icon--moon {
    display: none;
}

.theme-toggle.is-dark .theme-icon--sun {
    display: block;
}

.btn-login {
    border: 1px solid var(--teal);
    background: transparent;
    color: var(--teal-ink);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s ease, color .15s ease;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    flex: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--ink-dim);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.menu-toggle:hover {
    color: var(--ink);
}

.menu-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
}

.menu-toggle.dropdown-toggle::after {
    display: none;
}

.topbar-actions--mobile {
    gap: 8px;
}

.topbar-menu {
    min-width: 210px;
    padding: 8px 0;
}

.topbar-menu .accessibility-widget {
    position: static;
}

.topbar-menu .accessibility-panel {
    top: calc(100% + .5rem);
    right: 0;
}

.topbar-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 16px 10px;
}

.topbar-menu-username {
    display: block;
    padding: 6px 16px;
    font-weight: 600;
    color: var(--ink-dim);
    font-size: .85rem;
}

.btn-login:hover {
    background: var(--teal);
    color: #fff;
}

/* ---------- Footer ---------- */

/* Mirrors the top bar — same surface, border and side padding — so the links
   line up with the top bar's right-hand controls at the edge of the page. */
.site-footer {
    /* Pinned to the bottom of the browser window: short pages push it down
       there (see the #app shell below), long pages scroll underneath it. */
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 24px;
    padding: 12px 24px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.site-footer a {
    font-size: .875rem;
    font-weight: 600;
    color: var(--ink-dim);
    text-decoration: none;
    transition: color .15s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Pages on the shared layout fill the window so the footer never floats
   mid-screen under short content. */
#app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#app > main {
    flex: 1;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .sheet,
    .add-panel,
    .toast,
    .fab,
    .image-gallery {
        transition: none !important;
    }
}
