/**
 * TennisRoots Mobile Application Shell
 *
 * Manages:
 * - Mobile viewport behavior
 * - Page-level layout and flex structure
 * - Scroll snap behavior
 * - Responsive activation/hiding
 * - Desktop/tablet compatibility
 */

/* ─── Typography: TennisRoots Font Family Registrations ─── */
@font-face {
    font-family: "TR Franklin Book Condensed";
    src: url("../../assets/fonts/FranklinGothic-BookCnd.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "TR Franklin Demi";
    src: url("../../assets/fonts/FranklinGothic-Demi.otf") format("opentype");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "TR Franklin Medium Condensed";
    src: url("../../assets/fonts/FranklinGothic-MedCnd.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "TR Garamond Book Condensed";
    src: url("../../assets/fonts/Garamond-BookCondensed.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "TR Garamond Light Condensed";
    src: url("../../assets/fonts/Garamond-LightCondensed.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: "TR Parkinson Condensed Light";
    src: url("../../assets/fonts/Parkinson-CondensedLight.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
}

/* ─── Mobile Application Container ─── */
.mobile-app {
    display: none;
    position: fixed;
    inset: 0;
    padding-top: var(--tr-safe-top);
    background: var(--tr-safe-top-bg);
    color: var(--tr-color-text);
    font-family: var(--tr-font-ui);
    overflow: hidden;
    z-index: var(--tr-z-overlay);
    touch-action: pan-y;
}

/* ─── Landscape Orientation Screen ─── */
.tr-orientation-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    box-sizing: border-box;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--tr-safe-top-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    touch-action: none;
}

.tr-orientation-logo {
    width: var(--tr-header-logo-width);
    height: auto;
    display: block;
}

.tr-orientation-title {
    margin: 16px 0 0;
    font-family: var(--tr-font-franklin-demi);
    font-size: 16px;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.tr-orientation-text {
    margin: 6px 0 0;
    max-width: 320px;
    font-family: var(--tr-font-franklin-book-condensed);
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
}

/* Activate mobile app for portrait phones (<=600px) and landscape phones */
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) and (pointer: coarse) and (hover: none) {
    html,
    body {
        background: var(--tr-safe-top-bg);
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .mobile-app {
        display: flex;
        flex-direction: column;
    }

    /* Hide all legacy desktop/tablet elements */
    .site-header,
    .search-overlay,
    main:not(.mobile-main),
    .video-modal,
    .live-modal {
        display: none !important;
    }
}

/* Landscape phone: orientation screen replaces the app */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) and (hover: none) {
    .mobile-app {
        display: none;
    }

    .tr-orientation-screen {
        display: flex;
    }
}

/* ─── Mobile Main Content Area ─── */
.mobile-main {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    padding: 0;
    touch-action: pan-y;
}

/* Hide scrollbar */
.mobile-main::-webkit-scrollbar {
    display: none;
}

.mobile-main {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ─── Sections Container ─── */
.mobile-sections-container {
    display: flex;
    flex-direction: column;
}
