@charset "UTF-8";

/* ============================================================================
 * Private Sun Yat-sen Memorial Hall — Apple Native Tab Bar (tab-bar.css)
 * ============================================================================
 * COMMENTING STANDARDS
 * 1. Block comments only. Inline comments are strictly prohibited.
 * 2. Section dividers use the === banner format.
 * 3. All prose is written in English.
 * ============================================================================ */

@layer components {
    /* ========================================================================
     * Mobile & Tablet Component Definitions
     * ======================================================================== */
    /* Fixed Apple Native Top Navigation Bar (Authentic Frosted Glass Header) */
    .apple-top-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(44px + env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        background: var(--sys-surface-glass, rgba(22, 22, 24, 0.86));
        backdrop-filter: blur(25px) saturate(190%);
        -webkit-backdrop-filter: blur(25px) saturate(190%);
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        border-bottom: 0.5px solid var(--sys-border, rgba(255, 255, 255, 0.14));
        z-index: 25000;
        box-sizing: border-box;
        user-select: none;
        -webkit-user-select: none;
        transition: opacity 0.18s ease;
    }

    .apple-top-nav .nav-title {
        font-size: 16px;
        font-weight: 600;
        letter-spacing: -0.3px;
        color: var(--sys-ink-strong, #ffffff);
        font-family: var(--sys-font-family);
        margin: 0;
        padding: 0 116px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        height: 44px;
        line-height: 44px;
        display: block;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: none;
    }

    /* Fixed Apple Native UITabBar Container (Authentic Translucent Frosted Glass) */
    .apple-tab-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(52px + env(safe-area-inset-bottom, 34px));
        padding-top: 3px;
        padding-bottom: env(safe-area-inset-bottom, 34px);
        padding-left: 6px;
        padding-right: 6px;
        display: flex;
        align-items: flex-start;
        justify-content: space-around;
        background: var(--sys-surface-glass, rgba(22, 22, 24, 0.86));
        backdrop-filter: blur(25px) saturate(190%);
        -webkit-backdrop-filter: blur(25px) saturate(190%);
        border-top: 0.5px solid var(--sys-border, rgba(255, 255, 255, 0.14));
        box-sizing: border-box;
        z-index: 10000;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Standalone WebApp CSS: Anchor cleanly to device bottom */
    @media all and (display-mode: standalone) {
        .apple-tab-bar {
            bottom: 0;
        }
    }

    html.is-standalone .apple-tab-bar {
        bottom: 0;
    }

    /* Individual Tab Button Item (Anchored to top 49-52px content zone) */
    .apple-tab-bar .tab-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        height: 48px;
        text-decoration: none;
        color: var(--sys-text-secondary, #8e8e93);
        transition: color 0.18s ease, opacity 0.12s ease;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        padding: 2px 0 0 0;
        box-sizing: border-box;
    }

    /* Icon Container & Apple SF Symbol Silhouette Standard */
    .apple-tab-bar .tab-item .tab-icon {
        width: 30px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 2px;
    }

    .apple-tab-bar .tab-item .tab-icon svg {
        width: 25px;
        height: 25px;
        fill: currentColor;
        stroke: none;
    }

    /* Tab Label Typography (Apple 10.5pt Standard Specification) */
    .apple-tab-bar .tab-item .tab-label {
        font-size: 10.5px;
        font-weight: 500;
        letter-spacing: -0.24px;
        font-family: var(--sys-font-family);
        line-height: 1.15;
        margin-top: 1px;
    }

    /* Active Selected State (Authentic Apple iOS System Blue Tint) */
    .apple-tab-bar .tab-item.active {
        color: var(--sys-accent, #0a84ff);
    }

    .apple-tab-bar .tab-item.active .tab-label {
        font-weight: 600;
    }

    /* iOS Tap Press Animation: subtle opacity transition without scale twitch */
    .apple-tab-bar .tab-item:active {
        opacity: 0.7;
    }

    /* ========================================================================
     * Light Theme Color Overrides
     * ======================================================================== */
    @media (prefers-color-scheme: light) {
        .apple-top-nav {
            background: rgba(255, 255, 255, 0.84);
            backdrop-filter: blur(25px) saturate(190%);
            -webkit-backdrop-filter: blur(25px) saturate(190%);
            border-bottom-color: rgba(0, 0, 0, 0.10);
        }

        .apple-top-nav .nav-title {
            color: #1d1d1f;
        }

        .apple-tab-bar {
            background: rgba(255, 255, 255, 0.84);
            backdrop-filter: blur(25px) saturate(190%);
            -webkit-backdrop-filter: blur(25px) saturate(190%);
            border-top-color: rgba(0, 0, 0, 0.10);
        }

        .apple-tab-bar .tab-item {
            color: #6e6e73;
        }

        .apple-tab-bar .tab-item.active {
            color: #007aff;
        }
    }
}

@layer overrides {
    /* Desktop Isolation: Completely Hide Mobile Shell Bars on Desktop Viewports */
    @media (min-width: 769px) {
        html:not(.device-mobile) .apple-tab-bar,
        html:not(.device-mobile) .apple-top-nav {
            display: none;
        }
    }

    html.device-desktop .apple-tab-bar,
    html.device-desktop .apple-top-nav {
        display: none;
    }

    .apple-top-nav.nav-hidden {
        display: none;
    }

    /* Cleanly unload and hide Home page dropdown navigation bar and arrow hint */
    body.tab-navigating .top-hover-trigger,
    body.tab-navigating .mobile-arrow-hint,
    body.tab-navigating .dropdown-nav-bar,
    body.tab-navigating .memorial-banner,
    body.tab-navigating .status-banner,
    .top-hover-trigger.nav-hidden,
    .mobile-arrow-hint.nav-hidden,
    .dropdown-nav-bar.nav-hidden,
    .memorial-banner.nav-hidden,
    .status-banner.nav-hidden {
        display: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Subpage Bottom Bar Hiding: completely hide tab bar when pushing into any subpage */
    body.is-subpage .apple-tab-bar,
    body.is-subpage #apple-tab-bar,
    body:has(.nav-back-link) .apple-tab-bar,
    body:has(.nav-back-link) #apple-tab-bar {
        display: none;
        visibility: hidden;
        pointer-events: none;
    }

    @media (max-width: 768px) {
        body.is-subpage,
        body:has(.nav-back-link) {
            padding-bottom: calc(20px + env(safe-area-inset-bottom, 16px));
        }
    }

    html.device-mobile body.is-subpage,
    html.device-mobile body:has(.nav-back-link) {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 16px));
    }
}
