/* ==========================================================
   Xrosswave VoiceSupporter — common.css
   全ページ共通スタイル
   ========================================================== */

/* --- Google Fonts: Noto Sans JP --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;300;400;500;700&display=swap');

/* --- カスタムフォント --- */
@font-face {
    font-family: 'SmartFontUI';
    src: url('/static/03SmartFontUI.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================
   CSS カスタムプロパティ（デザイントークン）
   ========================================== */
:root {
    /* カラー */
    --color-bg:          #252525;
    --color-header-bg:   rgba(71, 10, 114, 0.5);
    --color-footer-bg:   rgba(71, 10, 114, 0.5);
    --color-card-bg:     rgba(255, 255, 255, 0.05);
    --color-dropdown-bg: #e6d1eb;
    --color-border:      rgba(255, 255, 255, 0.12);

    /* テキスト */
    --color-text:        #e8e0f0;
    --color-text-sub:    rgba(232, 224, 240, 0.7);
    --color-text-dark:   #1a0a2e;

    /* アクセント */
    --color-accent-pink: #ffb6c1;
    --color-accent-purple: #8b5cf6;
    --color-accent-violet: #470a72;
    --color-accent-glow:   rgba(139, 92, 246, 0.4);

    /* フォント */
    --font-smart:  'SmartFontUI', sans-serif;
    --font-noto:   'Noto Sans JP', sans-serif;

    /* ヘッダー */
    --header-height: 68px;

    /* トランジション */
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==========================================
   リセット & ベース
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-noto);
    font-weight: 400;
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ==========================================
   ヘッダー
   ========================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 20px;
}

/* ロゴ */
.site-header__logo {
    font-family: var(--font-smart);
    font-size: 1.35rem;
    color: #fff;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity var(--transition-base);
}

.site-header__logo:hover {
    opacity: 0.8;
}

/* ナビゲーション */
.site-header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 1;
    min-width: 0;
}

/* ナビアイテム（通常） */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    cursor: pointer;
    transition: opacity var(--transition-base);
    color: #fff;
}

.nav-item:hover {
    opacity: 0.75;
}

.nav-item__label-ja {
    font-family: var(--font-noto);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1;
}

.nav-item__label-en {
    font-family: var(--font-smart);
    font-size: 0.72rem;
    opacity: 0.65;
    line-height: 1;
}

/* Tips ドロップダウン */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__menu {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 12px;
    min-width: 220px;
    z-index: 100;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateY(-6px);
    /* 背景・影はメニュー自体に設定（padding-topの領域は透明） */
    background: transparent;
}

/* padding-topの領域を覆う倍長のボックス—​paddingを利用して継続するホバー領域を確保 */
.nav-dropdown__menu::before {
    content: '';
    display: block;
    height: 12px;
    margin-top: -12px;
}

/* 実際のメニューボックス — アイテムの親をwrapper divとして使う */
.nav-dropdown__item:first-child { border-radius: 12px 12px 0 0; }
.nav-dropdown__item:last-child  { border-radius: 0 0 12px 12px; }
.nav-dropdown__item:only-child  { border-radius: 12px; }

/* 実際に死ぬほどシンプルな解決：ペアレントに afterプソ for bridge */
.nav-dropdown:hover .nav-dropdown__menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown__menu__inner {
    background: var(--color-dropdown-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    color: var(--color-text-dark);
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-dropdown__item:hover {
    background: rgba(71, 10, 114, 0.1);
    border-left-color: var(--color-accent-violet);
}

.nav-dropdown__item .item-accent {
    width: 4px;
    height: 4px;
    background: var(--color-accent-violet);
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-dropdown__item-title {
    font-weight: 600;
    display: block;
}

.nav-dropdown__item-sub {
    font-size: 0.72rem;
    opacity: 0.65;
    display: block;
}

/* ログインボタン */
.btn-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 22px;
    padding: 7px 18px;
    color: #fff;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
    font-family: inherit;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   フッター
   ========================================== */
.site-footer {
    background: var(--color-footer-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 28px 48px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    font-family: var(--font-smart);
    font-size: 1.5rem;
    color: #fff;
    transition: opacity var(--transition-base);
}

.footer-logo:hover {
    opacity: 0.75;
}

.footer-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.footer-links a:hover {
    color: #fff;
}

.footer-sep {
    color: rgba(255, 255, 255, 0.3);
}

.footer-copy {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

.footer-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.footer-sns {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    transition: color var(--transition-base);
}

.footer-sns:hover {
    color: #fff;
}

.footer-sns svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ==========================================
   ユーティリティ
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================
   レスポンシブ (SP)
   ========================================== */
@media (max-width: 768px) {
    /* ヘッダー */
    .site-header {
        flex-direction: column;
        padding: 15px 20px;
        height: auto;
        gap: 15px;
    }
    .site-header__logo {
        font-size: 1.2rem;
        white-space: normal;
        text-align: center;
    }
    .site-header__nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    /* 認証ステータスバー */
    .auth-bar {
        justify-content: center;
        text-align: center;
        padding: 8px 16px;
    }

    /* フッター */
    .site-footer {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 15px;
        text-align: center;
    }
    .footer-right {
        justify-content: center;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer-logo {
        font-size: 1.3rem;
    }
}
