/* sheslab — 메인 탭바 6개 (Whisper / Hall / Explore / Playbook / Make-Up / Game)
 *
 * 디자인 (2026-05-27): body CSS Grid layout + position:sticky
 * - 5번 fixed 시정 실패 후 근본 디자인 전환 (docs/plans/2026-05-27-tabbar-grid-layout-design.md)
 * - body가 grid container, 탭바가 grid 마지막 row → fixed 의존 0
 * - sticky는 body scroll container 기준 → containing block 트랩 회피
 */

/* ============================================================
 * 1) body grid layout — 탭바 있는 페이지만
 * ============================================================ */
body.has-sl-tabbar {
    display: grid;
    grid-template-rows: 1fr auto;   /* main = 1fr 신축, tabbar = auto */
    min-height: 100vh;              /* 폴백 */
    min-height: 100dvh;             /* dynamic viewport — iOS Safari toolbar 대응 */
    /* padding-bottom 제거 — grid가 layout 자동 처리 (기존 64px/110px 룰 폐기) */
    padding-bottom: 0 !important;
}

/* ============================================================
 * 2) 탭바 — grid 마지막 row + sticky 보강
 * ============================================================ */
.sl-tabbar {
    /* position: sticky — body scroll 기준, fixed의 containing block 트랩 회피 */
    position: sticky !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    z-index: 9990 !important;
    /* grid item — 자동으로 body grid의 마지막 row */
    grid-row: -1;
    width: 100%;

    background: rgba(254, 252, 250, 0.92);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid rgba(181, 115, 158, 0.18);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: stretch;
    box-shadow: 0 -4px 18px rgba(142, 88, 120, 0.06);
}

/* ============================================================
 * 3) 탭바 항목
 * ============================================================ */
.sl-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    color: var(--text-muted, #888);
    text-decoration: none;
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    transition: color 0.15s;
    position: relative;
}
.sl-tabbar a:hover { color: var(--primary-dark, #8E5878); }
.sl-tabbar a.active { color: var(--primary-dark, #8E5878); }
.sl-tabbar a.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-dark, #8E5878), var(--secondary, #E8A4B8));
    border-radius: 0 0 2px 2px;
}
.sl-tab-icon {
    font-size: 1.15rem;
    line-height: 1.1;
    /* OS별 이모지 폰트 명시 — Pretendard에 없는 글리프가 빈 칸으로 뜨는 문제 방지 */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
.sl-tab-label {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}
@media (max-width: 380px) {
    .sl-tab-label { font-size: 0.58rem; letter-spacing: 0.08em; }
}

/* SVG 아이콘 (EXPLORE 등) — 이모지 미지원 환경 대응 */
.sl-tab-icon--svg { line-height: 0; }
.sl-tab-icon--svg svg { display: block; width: 1.3rem; height: 1.3rem; color: inherit; }

/* img 아이콘 (EXPLORE) — 외부 SVG, 100% 렌더 */
.sl-tab-icon--img img { display: block; width: 1.3rem; height: 1.3rem; }
