/*
 * AMC Secure — company logo framing (native aspect ratio preserved)
 * Only scale proportionally — never stretch width/height independently.
 */

:root {
    --amc-logo-aspect: 664 / 678;
    --header-logo-cap: 5.4rem;
    --hero-logo-max: clamp(164px, 19vw, 232px);
    --hero-logo-halo: clamp(212px, 24vw, 300px);
}

/* ── Header: logo height = wordmark block, vertically centered ── */
body:not(.admin-body) .market-brand,
body:not(.admin-body) .market-header .market-brand {
    align-items: stretch !important;
}

body:not(.admin-body) .market-brand > .logo-glow-ring,
body:not(.admin-body) .market-header .logo-glow-ring {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
}

body:not(.admin-body) .market-brand > .logo-glow-ring img,
body:not(.admin-body) .market-header .logo-glow-ring img {
    display: block !important;
    width: auto !important;
    height: 100% !important;
    max-height: var(--header-logo-cap) !important;
    max-width: calc(var(--header-logo-cap) * var(--amc-logo-aspect)) !important;
    object-fit: contain !important;
    object-position: center !important;
}

body:not(.admin-body) .market-brand .brand-wordmark,
body:not(.admin-body) .market-header .brand-wordmark {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-self: center !important;
}

/* ── Homepage hero: logo free of circular halo / 3D squash ── */
body.global-homepage .hero-galaxy-hub--logo-only {
    perspective: none !important;
    transform-style: flat !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-galaxy-tilt {
    transform: none !important;
    transform-style: flat !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-galaxy-halo {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-galaxy-halo .hero-galaxy-sun,
body.global-homepage .hero-galaxy-hub--logo-only .hero-galaxy-halo .hero-galaxy-core__shade {
    display: none !important;
    content: none !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-galaxy-core {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    z-index: 12 !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    transform: translate(-50%, -50%) !important;
    transform-style: flat !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-galaxy-core::before {
    display: none !important;
    content: none !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-logo-core,
body.global-homepage .hero-galaxy-hub--logo-only .logo-glow-ring--hero {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.global-homepage .hero-galaxy-hub--logo-only .hero-logo-core img,
body.global-homepage .hero-galaxy-hub--logo-only .logo-glow-ring--hero img {
    width: auto !important;
    height: auto !important;
    max-height: var(--hero-logo-max) !important;
    max-width: calc(var(--hero-logo-max) * var(--amc-logo-aspect)) !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
}

/* Galaxy hero with orbit ring — keep legacy core sizing hooks */
body.global-homepage .hero-galaxy-core {
    width: auto !important;
    height: auto !important;
    max-width: var(--hero-logo-max);
    max-height: var(--hero-logo-max);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.global-homepage .hero-galaxy-hub:not(.hero-galaxy-hub--logo-only) .hero-logo-core,
body.global-homepage .hero-galaxy-hub:not(.hero-galaxy-hub--logo-only) .logo-glow-ring--hero,
body.global-homepage .global-hero-visual .logo-glow-ring--hero {
    width: auto !important;
    height: auto !important;
    max-width: var(--hero-logo-max) !important;
    max-height: var(--hero-logo-max) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.global-homepage .hero-galaxy-hub:not(.hero-galaxy-hub--logo-only) .hero-logo-core img,
body.global-homepage .hero-galaxy-hub:not(.hero-galaxy-hub--logo-only) .logo-glow-ring--hero img,
body.global-homepage .hero-galaxy-banner--galaxy .hero-logo-core img,
body.global-homepage .hero-galaxy-banner--galaxy .logo-glow-ring--hero img,
body.global-homepage .global-hero-visual .logo-glow-ring--hero img {
    width: auto !important;
    height: auto !important;
    max-height: var(--hero-logo-max) !important;
    max-width: calc(var(--hero-logo-max) * var(--amc-logo-aspect)) !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* ── Compact hero corner logo ── */
body:not(.admin-body) .hero-galaxy-banner--compact .hero-compact-logo .logo-glow-ring,
body:not(.admin-body) .hero-galaxy-banner--compact .hero-compact-logo .hero-logo-core {
    width: auto !important;
    height: auto !important;
    max-height: clamp(56px, 6.5vw, 72px);
    max-width: calc(clamp(56px, 6.5vw, 72px) * var(--amc-logo-aspect));
}

body:not(.admin-body) .hero-galaxy-banner--compact .hero-compact-logo img {
    width: auto !important;
    height: auto !important;
    max-height: clamp(56px, 6.5vw, 72px) !important;
    max-width: calc(clamp(56px, 6.5vw, 72px) * var(--amc-logo-aspect)) !important;
    object-fit: contain !important;
}

/* ── Footer & other brand logos ── */
body:not(.admin-body) .footer-compact .logo-glow-ring--sm,
body:not(.admin-body) .footer-tech .footer-logo-ring {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
}

body:not(.admin-body) .footer-compact .logo-glow-ring--sm img,
body:not(.admin-body) .footer-tech .footer-logo-ring img {
    width: 100% !important;
    height: 100% !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain !important;
}

body:not(.admin-body) .logo-glow-ring--md img {
    width: auto !important;
    height: auto !important;
    max-width: 82px !important;
    max-height: 82px !important;
    object-fit: contain !important;
}

body:not(.admin-body) .footer-tech .footer-logo-ring img {
    animation: none !important;
    filter: drop-shadow(0 0 6px rgba(18, 168, 107, 0.35)) !important;
}

/* Beat app.css legacy fixed 260px hero logo */
body.global-homepage .hero-logo-core img,
body.global-homepage .logo-glow-ring--hero img {
    width: auto !important;
    height: auto !important;
    max-height: var(--hero-logo-max) !important;
    max-width: calc(var(--hero-logo-max) * var(--amc-logo-aspect)) !important;
    object-fit: contain !important;
}

@media (max-width: 900px) {
    :root {
        --header-logo-cap: 4.6rem;
        --hero-logo-max: clamp(140px, 26vw, 184px);
        --hero-logo-halo: clamp(180px, 30vw, 240px);
    }
}

@media (max-width: 720px) {
    :root {
        --header-logo-cap: 4rem;
        --hero-logo-max: clamp(124px, 28vw, 168px);
        --hero-logo-halo: clamp(160px, 34vw, 220px);
    }
}
