/* ============================================================================
   AMI theme-aware logo — color on light, white on dark / dark surfaces
   Uses /a1.png + /a1_white_logo.png
   Images are stacked in one grid cell so only one size applies.
   ========================================================================== */

.ami-theme-logo {
    --ami-logo-height: 50px;
    display: inline-grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: start;
    line-height: 0;
    height: var(--ami-logo-height);
    max-width: 100%;
    overflow: hidden;
}

.ami-theme-logo img {
    grid-area: 1 / 1;
    height: var(--ami-logo-height) !important;
    width: auto !important;
    max-height: var(--ami-logo-height) !important;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

.ami-theme-logo .ami-logo-white {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.ami-theme-logo .ami-logo-color {
    visibility: visible;
    opacity: 1;
}

/* Dark theme → white logo */
[data-bs-theme="dark"] .ami-theme-logo .ami-logo-color,
html.dark-mode .ami-theme-logo .ami-logo-color,
body.dark-mode .ami-theme-logo .ami-logo-color,
body.s-dark .ami-theme-logo .ami-logo-color {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

[data-bs-theme="dark"] .ami-theme-logo .ami-logo-white,
html.dark-mode .ami-theme-logo .ami-logo-white,
body.dark-mode .ami-theme-logo .ami-logo-white,
body.s-dark .ami-theme-logo .ami-logo-white {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Force white on dark bands (footer, etc.) */
.ami-theme-logo--on-dark .ami-logo-color {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ami-theme-logo--on-dark .ami-logo-white {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Landing header logo sizes */
body.landing-page .landing-logo .ami-theme-logo {
    --ami-logo-height: 70px;
}

body.landing-page .landing-header.scrolled .landing-logo .ami-theme-logo {
    --ami-logo-height: 55px;
}

/* Landing: transparent header over dark hero → always white logo */
body.landing-page .landing-header:not(.scrolled) .ami-theme-logo .ami-logo-color {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.landing-page .landing-header:not(.scrolled) .ami-theme-logo .ami-logo-white {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Landing footer — compact white logo */
body.landing-page .landing-footer-brand .ami-theme-logo {
    --ami-logo-height: 48px;
    margin-bottom: 14px;
}

body.landing-page .landing-footer-brand .ami-theme-logo img {
    max-width: 160px;
}

/* Login / Privacy / Biography defaults */
body.login-page .login-logo .ami-theme-logo {
    --ami-logo-height: 50px;
}

body.biography-page .bio-logo .ami-theme-logo {
    --ami-logo-height: 52px;
}

body.privacy-page .privacy-logo .ami-theme-logo {
    --ami-logo-height: 52px;
}
