/* ========================================
   GLOBAL STYLES & VARIABLES - ROYAL HERITAGE
   ======================================== */

:root {
    --bl-primary: #7a2336;          /* Heritage Burgundy (from the logo) */
    --bl-primary-hover: #5f1a2a;    /* Deep Burgundy hover */
    --bl-secondary: #b2483f;        /* Terracotta */
    --bl-secondary-hover: #c75a50;
    --bl-accent: #d4893f;           /* Warm Amber */
    --bl-accent-hover: #b36f2a;
    --bl-accent-soft: #fdebd6;      /* Soft Peach Glow */
    --bl-deep-slate: #2a1f1c;       /* Espresso */
    --bl-bg: #fbf7f2;               /* Warm Ivory */
    --bl-surface: #ffffff;          /* Crisp White Surface */
    --bl-surface-subtle: #f5ede4;   /* Parchment Tint */
    --bl-text-primary: #2a1f1c;     /* High-contrast Espresso */
    --bl-text-secondary: #4b3b36;
    --bl-text-muted: #7d6a63;
    --bl-border: #eadfd3;           /* Warm Sand Border */
    --bl-border-focus: #d9c8b8;
    --bl-gradient-main: linear-gradient(180deg, #fbf7f2 0%, #f5ede4 100%);
    --bl-gradient-brand: linear-gradient(135deg, #7a2336 0%, #b2483f 60%, #d4893f 100%);
    --bl-glass: rgba(255, 255, 255, 0.92);
    --bl-glass-border: rgba(234, 223, 211, 0.9);

    /* ---- Design tokens (single source of truth; use these instead of hard-coded values) ---- */
    /* Typography */
    --bl-font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bl-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --bl-text-xs: 0.75rem;
    --bl-text-sm: 0.875rem;
    --bl-text-md: 1rem;
    --bl-text-lg: 1.125rem;
    --bl-text-xl: 1.35rem;
    --bl-text-2xl: 1.75rem;
    /* Spacing (4px scale) */
    --bl-space-1: 4px;
    --bl-space-2: 8px;
    --bl-space-3: 12px;
    --bl-space-4: 16px;
    --bl-space-5: 24px;
    --bl-space-6: 32px;
    /* Radius */
    --bl-radius-sm: 8px;
    --bl-radius-md: 12px;
    --bl-radius-lg: 16px;
    --bl-radius-pill: 999px;
    /* Elevation */
    --bl-shadow-sm: 0 1px 2px rgba(42, 31, 28, 0.06), 0 1px 3px rgba(42, 31, 28, 0.08);
    --bl-shadow-md: 0 4px 12px rgba(42, 31, 28, 0.10);
    --bl-shadow-lg: 0 12px 32px rgba(42, 31, 28, 0.16);
    /* Status colours */
    --bl-success: #15803d;
    --bl-success-soft: #dcfce7;
    --bl-danger: #b91c1c;
    --bl-danger-soft: #fee2e2;
    --bl-warning: #b45309;
    --bl-warning-soft: #fef3c7;
    --bl-info: #2c6e8f;
    --bl-info-soft: #dcecf3;
    /* Focus ring (keyboard accessibility) */
    --bl-focus-ring: 0 0 0 3px rgba(178, 72, 63, 0.35);
    /* Heritage / tree palette (used inside the tree canvas and cards) */
    --bl-bark: #6b4a2f;
    --bl-bark-dark: #3e2a18;
    --bl-leaf: #4f7f2f;
    --bl-leaf-light: #7fb04c;
    --bl-parchment: #f6ecd3;
    --bl-parchment-dark: #e6d4ac;
    /* Golden-hour scenery: warm sky, hazy far ridge, sage-to-olive hills */
    --bl-sky-top: #f4dcc2;
    --bl-sky-bottom: #fbf0de;
    --bl-sky-ground: #e9deb9;
    --bl-hill-far: #cdd2a6;
    --bl-hill-1: #a3b47a;
    --bl-hill-2: #7f9257;
    /* Layout */
    --bl-nav-height: 65px;
}

/* ---- Shell tokens (nav / footer) ---- */
:root {
    --bl-midnight: #0b1329;
    --bl-midnight-2: #111d42;
    --bl-midnight-3: #070c1a;
    --bl-on-dark: #eadfd3;
    --bl-on-dark-muted: #d9c8b8;
    --bl-hairline-dark: rgba(255, 255, 255, 0.14);
    --bl-nav-icon: 40px;
}

/* ========================================
   RESET, BODY, TYPOGRAPHY
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--bl-font-body);
    font-size: var(--bl-text-md);
    line-height: 1.5;
    background: var(--bl-sky-bottom);   /* fallback colour under the fixed scenery below */
    color: var(--bl-text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   APP BACKDROP — the same sky and rolling hills as the family tree,
   fixed behind every page (pointer-events none, below all content)
   ======================================== */
body::before,
body::after {
    content: "";
    position: fixed;
    left: 0; right: 0;
    pointer-events: none;
    z-index: -1;
}
body::before {
    top: 0; bottom: 0;
    background:
        radial-gradient(circle at 82% 8%, rgba(255, 214, 140, 0.85) 0, rgba(255, 214, 140, 0) 26%),
        linear-gradient(180deg, var(--bl-sky-top) 0%, var(--bl-sky-bottom) 62%, var(--bl-sky-ground) 100%);
}
body::after {
    bottom: 0;
    height: 30vh;
    background:
        /* near, darkest hill (left + right edges) */
        radial-gradient(ellipse 45% 62% at 6% 100%, var(--bl-hill-2) 0 62%, transparent 63%),
        radial-gradient(ellipse 50% 52% at 96% 100%, var(--bl-hill-2) 0 62%, transparent 63%),
        /* middle hills */
        radial-gradient(ellipse 55% 82% at 24% 100%, var(--bl-hill-1) 0 62%, transparent 63%),
        radial-gradient(ellipse 60% 70% at 78% 100%, var(--bl-hill-1) 0 62%, transparent 63%),
        /* far, hazy ridge */
        radial-gradient(ellipse 75% 100% at 50% 100%, var(--bl-hill-far) 0 62%, transparent 63%);
}

img,
video,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

a {
    color: var(--bl-secondary);
}

h1, .h1, .page-title, .brand-title {
    font-family: var(--bl-font-display);
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--bl-primary);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h2, .h2, .section-title {
    font-family: var(--bl-font-body);
    font-size: var(--bl-text-xl);
    font-weight: 700;
    color: var(--bl-deep-slate);
    line-height: 1.3;
}

h3, .h3 {
    font-family: var(--bl-font-body);
    font-size: var(--bl-text-lg);
    font-weight: 600;
    color: var(--bl-text-secondary);
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link: visible only on keyboard focus */
.skip-link {
    position: fixed;
    top: var(--bl-space-2);
    left: var(--bl-space-2);
    z-index: 11000;
    padding: var(--bl-space-3) var(--bl-space-4);
    background: var(--bl-surface);
    color: var(--bl-primary);
    font-weight: 700;
    border-radius: var(--bl-radius-sm);
    box-shadow: var(--bl-shadow-lg);
    transform: translateY(-200%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* ========================================
   ICONS — one uniform set from static/img/icons.svg
   <svg class="icon"><use href="/static/img/icons.svg#i-user"></use></svg>
   Inherits text colour; size with font-size or .icon-sm/.icon-lg.
   ======================================== */
.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.25em;
    pointer-events: none;
}
.icon-sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.4em; height: 2.4em; }

/* Visible keyboard focus everywhere, without affecting mouse users */
:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--bl-focus-ring);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Scroll lock used by modals/lightbox (class toggled from JS).
   Locks both viewport and body without changing height, so the page does not jump. */
.body-no-scroll,
html:has(body.body-no-scroll) {
    overflow: hidden;
}

.body-no-scroll {
    overscroll-behavior: none;
}

main:focus {
    outline: none;
}

/* ========================================
   LAYOUT CONTAINERS
   ======================================== */

.page-container,
.profile-page-container,
.calendar-container,
.error-monitor-page,
.analytics-page,
.feed-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 20px;
}

@media (max-width: 768px) {
    .page-container,
    .profile-page-container,
    .calendar-container,
    .error-monitor-page,
    .analytics-page,
    .feed-container {
        padding: 16px 12px;
    }

    h1, .h1, .page-title, .brand-title {
        font-size: 1.6rem;
    }

    h2, .h2, .section-title {
        font-size: 1.2rem;
    }
}

.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    padding-top: calc(var(--bl-nav-height) + env(safe-area-inset-top, 0px));
    overflow-x: hidden;
    overflow-y: visible;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

/* ========================================
   SCROLLBARS
   ======================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--bl-border-focus) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bl-border-focus);
    border-radius: var(--bl-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bl-text-muted);
}

/* ========================================
   BADGES (also used by JS-rendered search results)
   ======================================== */

.badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: var(--bl-radius-sm);
    margin-left: 5px;
    vertical-align: middle;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-registered {
    background: var(--bl-success-soft);
    color: var(--bl-success);
    border: 1px solid var(--bl-success-soft);
}

.badge-unregistered {
    background: var(--bl-surface-subtle);
    color: var(--bl-text-secondary);
    border: 1px solid var(--bl-border-focus);
}

.reaction-names-list {
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-md);
    padding: var(--bl-space-3);
    margin-top: 10px;
    font-size: var(--bl-text-sm);
    box-shadow: var(--bl-shadow-md);
    z-index: 1000;
    position: relative;
    display: block;
}

.reaction-names-list.hidden {
    display: none !important;
}

.reaction-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.names-list {
    color: var(--bl-text-primary);
    font-weight: 600;
}

/* ========================================
   GLOBAL NAVIGATION (Midnight Sapphire)
   ======================================== */

.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--bl-nav-height) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
    background: linear-gradient(135deg, var(--bl-midnight) 0%, var(--bl-midnight-2) 50%, var(--bl-primary) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--bl-space-3);
    z-index: 2000;
    border-bottom: 1px solid rgba(199, 90, 80, 0.25);
    box-shadow: var(--bl-shadow-md);
    overflow: visible;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    min-height: var(--bl-nav-icon);
    border-radius: var(--bl-radius-sm);
}

.nav-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
}

.nav-brand-text,
.app-nav .logo-text {
    font-family: var(--bl-font-body);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--bl-info-soft) 60%, var(--bl-accent-soft) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.nav-search-container {
    display: flex;
    align-items: center;
    background: rgba(42, 31, 28, 0.55);
    border: 1px solid var(--bl-hairline-dark);
    border-radius: var(--bl-radius-pill);
    padding: 0 var(--bl-space-3);
    max-width: 400px;
    min-width: 140px;
    min-height: 38px;
    flex: 1;
    margin: 0 var(--bl-space-3);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search-container:focus-within {
    background: rgba(42, 31, 28, 0.85);
    border-color: #e08a80;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--bl-space-2);
    width: 100%;
}

.nav-search-icon {
    flex-shrink: 0;
    color: #ad9a92;
}

#global-search-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    box-shadow: none;
    font-size: var(--bl-text-sm);
    padding: 8px 4px;
}

#global-search-input:focus,
#global-search-input:focus-visible {
    outline: none;
    box-shadow: none;
}

#global-search-input::placeholder {
    color: #a8b4c6;
}

.nav-icon-btn.nav-search-close,
.nav-icon-btn.nav-search-toggle {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--bl-space-3);
    flex: 2;
    justify-content: flex-end;
    min-width: 0;
    overflow: visible;           /* nothing is scrolled or clipped: admin tools live in one menu */
    padding: 5px var(--bl-space-2);
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.nav-actions::-webkit-scrollbar,
.app-nav::-webkit-scrollbar {
    display: none;
}

.nav-icon-group {
    display: flex;
    align-items: center;
    gap: var(--bl-space-3);
    padding: 0 var(--bl-space-2);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-icon-group:last-of-type {
    border-right: none;
}

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--bl-nav-icon);
    height: var(--bl-nav-icon);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--bl-hairline-dark);
    border-radius: var(--bl-radius-md);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    color: var(--bl-on-dark);
    flex-shrink: 0;
}

.nav-icon-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

/* One consistent state model for every nav icon (buttons AND links, public AND admin pages):
   - icon is always white
   - hover / keyboard focus / current page all share the same amber treatment
   The doubled selectors (.app-nav a.nav-icon-btn:link ...) out-rank Django admin's global
   `a:link / a:visited / a:hover` colours, which used to turn some icons red or burgundy. */
.app-nav .nav-icon-btn,
.app-nav a.nav-icon-btn:link,
.app-nav a.nav-icon-btn:visited,
.app-nav .nav-icon-btn--danger {
    color: #ffffff;
}

.app-nav .nav-icon-btn:hover,
.app-nav a.nav-icon-btn:hover,
.app-nav .nav-icon-btn:focus-visible,
.app-nav .nav-icon-btn.is-active,
.app-nav .nav-icon-btn[aria-current="page"],
.app-nav a.nav-icon-btn.is-active,
.app-nav a.nav-icon-btn[aria-current="page"],
.app-nav .nav-icon-btn--danger:hover,
.app-nav .btn-signout:hover {
    background: rgba(212, 137, 63, 0.28);
    border-color: var(--bl-accent);
    color: #ffffff;
}

.app-nav .nav-icon-btn:hover,
.app-nav .btn-signout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 137, 63, 0.3);
}

.nav-icon-btn:focus-visible,
.nav-brand:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Notification / chat badge positioning inside nav buttons.
   Display is toggled from JS via inline style. */
.nav-icon-btn .notif-badge {
    top: -6px;
    right: -6px;
    border-color: var(--bl-midnight-2);
    align-items: center;
    justify-content: center;
}

/* Search dropdown (global search in nav) */
.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-md);
    box-shadow: var(--bl-shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
}

.search-dropdown.hidden {
    display: none;
}

.search-dropdown .search-result-item {
    display: flex;
    align-items: center;
    gap: var(--bl-space-3);
    padding: 10px var(--bl-space-4);
    min-height: 48px;
    cursor: pointer;
    color: var(--bl-text-primary);
    border-bottom: 1px solid var(--bl-surface-subtle);
    transition: background 0.15s;
}

.search-dropdown .search-result-item:last-child {
    border-bottom: none;
}

.search-dropdown .search-result-item:hover,
.search-dropdown .search-result-item:focus-visible {
    background: var(--bl-bg);
}

.search-dropdown .search-result-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-dropdown .result-name {
    display: block;
    font-weight: 600;
    font-size: var(--bl-text-sm);
    color: var(--bl-text-primary);
}

.search-dropdown .result-meta {
    display: block;
    font-size: var(--bl-text-xs);
    color: var(--bl-text-muted);
}

/* ---- Nav: tablet / mobile ---- */
@media (max-width: 768px) {
    .app-nav {
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        gap: var(--bl-space-2);
    }

    /* Auth pages give the space to search/actions, so drop the wordmark */
    .app-nav--auth .nav-brand-text {
        display: none;
    }

    .nav-actions {
        flex: 1;
        gap: var(--bl-space-1);
        padding: 5px 0;
    }

    .nav-icon-group {
        gap: var(--bl-space-1);
        padding: 0 var(--bl-space-1);
    }

    /* Search collapses into an icon; opens as a full-width bar over the nav */
    .nav-icon-btn.nav-search-toggle {
        display: flex;
    }

    .nav-search-container {
        display: none;
        margin: 0;
        max-width: none;
    }

    .app-nav.is-search-open .nav-search-container {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--bl-nav-height);
        padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
        border: none;
        border-radius: 0;
        background: linear-gradient(135deg, var(--bl-midnight) 0%, var(--bl-midnight-2) 100%);
        z-index: 3;
    }

    .app-nav.is-search-open .nav-icon-btn.nav-search-close {
        display: flex;
        flex-shrink: 0;
        margin-left: var(--bl-space-2);
    }

    .nav-search-container,
    .search-input-wrapper {
        position: static;
    }

    #global-search-input {
        font-size: 16px; /* prevents iOS focus zoom */
    }

    .search-dropdown {
        position: fixed;
        top: calc(var(--bl-nav-height) + env(safe-area-inset-top, 0px) + var(--bl-space-2));
        left: var(--bl-space-3);
        right: var(--bl-space-3);
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: 55vh;
        max-height: 55dvh;
    }
}

@media (max-width: 480px) {
    :root {
        --bl-nav-icon: 38px;
    }

    .nav-logo {
        height: 30px;
    }

    .nav-icon-group.nav-signout-group {
        padding-right: 0;
    }

}

/* ========================================
   GLOBAL FOOTER
   ======================================== */

.app-footer {
    position: relative;
    clear: both;
    background: linear-gradient(180deg, var(--bl-midnight) 0%, var(--bl-midnight-3) 100%);
    border-top: 1px solid rgba(199, 90, 80, 0.2);
    padding: var(--bl-space-5) var(--bl-space-5) calc(var(--bl-space-5) + env(safe-area-inset-bottom, 0px));
    margin-top: auto;
    width: 100%;
    color: var(--bl-on-dark-muted);
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--bl-space-5);
}

.app-footer .logo {
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: var(--bl-space-2);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* The wordmark text is transparent (gradient fill), so any underline would show as a stray coloured line */
.app-footer .logo,
.app-footer .logo:hover,
.app-footer .logo:focus-visible,
.app-footer .logo .logo-text {
    text-decoration: none;
}

.app-footer .logo-img {
    height: 30px;
}

.app-footer .logo-text {
    background: linear-gradient(135deg, #ffffff 0%, var(--bl-info-soft) 60%, var(--bl-accent-soft) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--bl-space-2) var(--bl-space-5);
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--bl-on-dark-muted);
    text-decoration: none;
    font-size: var(--bl-text-sm);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #dea39a;
    text-decoration: underline;
}

.footer-links a.footer-link-accent {
    color: #fbbf24;
    font-weight: 700;
}

.footer-links a.footer-link-accent:hover {
    color: #fde68a;
}

.footer-socials {
    display: flex;
    gap: var(--bl-space-3);
}

.footer-socials a {
    color: var(--bl-on-dark-muted);
    transition: transform 0.2s, color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bl-radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bl-hairline-dark);
}

.footer-socials a:hover {
    color: #ffffff;
    background: rgba(178, 72, 63, 0.35);
    border-color: #e08a80;
    transform: translateY(-2px);
}

.footer-bottom {
    max-width: 1200px;
    margin: var(--bl-space-5) auto 0;
    padding-top: var(--bl-space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    gap: var(--bl-space-2);
    font-size: var(--bl-text-xs);
    color: #ad9a92;
}

@media (max-width: 768px) {
    .app-footer {
        padding: var(--bl-space-5) var(--bl-space-4) calc(var(--bl-space-5) + env(safe-area-inset-bottom, 0px));
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--bl-space-4);
    }

    .footer-links {
        justify-content: center;
        gap: var(--bl-space-1) var(--bl-space-4);
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: var(--bl-space-4);
        padding-top: var(--bl-space-3);
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .nav-icon-btn,
    .footer-socials a,
    .skip-link,
    .nav-search-container {
        transition: none;
    }

    .nav-icon-btn:hover,
    .app-nav .nav-icon-btn:hover,
    .app-nav .btn-signout:hover,
    .footer-socials a:hover {
        transform: none;
    }
}


/* ---- Nav: admin menu (single button + popover) ---- */
.nav-menu { position: relative; }
.nav-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    padding: var(--bl-space-2);
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-lg);
    box-shadow: var(--bl-shadow-lg);
    z-index: 10005;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-menu-panel.hidden { display: none; }
.nav-menu-panel a {
    display: flex;
    align-items: center;
    gap: var(--bl-space-3);
    min-height: 44px;
    padding: 0 var(--bl-space-3);
    border-radius: var(--bl-radius-md);
    color: var(--bl-text-primary);
    font-size: var(--bl-text-sm);
    font-weight: 600;
    text-decoration: none;
}
.nav-menu-panel a .icon { color: inherit; }
.nav-menu-panel a:link,
.nav-menu-panel a:visited { color: var(--bl-text-primary); }
.nav-menu-panel a:hover,
.nav-menu-panel a:focus-visible,
.nav-menu-panel a[aria-current="page"] { background: var(--bl-surface-subtle); color: var(--bl-primary); }
@media (max-width: 480px) {
    .nav-menu-panel { position: fixed; top: calc(var(--bl-nav-height) + env(safe-area-inset-top, 0px) + 8px); right: 12px; }
}
