/**
 * =====================================================
 * 共通ヘッダースタイル
 * =====================================================
 * 
 * 全ページで共通のヘッダーコンポーネントスタイル
 */

/* =====================================================
   ヘッダーコンテナ
   ===================================================== */

.page-header {
    margin-bottom: 1.5rem;
    padding-top: 2rem;
}

@media (min-width: 640px) {
    .page-header {
        margin-bottom: 2rem;
    }
}

/* ヘッダー内部レイアウト */
.header-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

@media (min-width: 640px) {
    .header-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* =====================================================
   タイトル部分
   ===================================================== */

.page-title-wrapper {
    flex-grow: 1;
    text-align: left;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .page-title-wrapper {
        margin-bottom: 0;
    }
}

/* サブタイトル (信長の野望 Online) */
.page-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 0.125rem 0;
}

@media (min-width: 640px) {
    .page-subtitle {
        font-size: 0.875rem;
    }
}

/* メインタイトル */
.page-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.25;
    margin: 0;
}

@media (min-width: 640px) {
    .page-title {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    .page-title {
        font-size: 1.875rem;
    }
}

/* =====================================================
   コントロールエリア
   ===================================================== */

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 15; /* Above global-nav (z-index: 10) */
}

/* モバイルでは中央揃え */
@media (max-width: 639px) {
    .header-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (min-width: 640px) {
    .header-controls {
        justify-content: flex-end;
    }
}

/* =====================================================
   アイコンボタン共通
   ===================================================== */

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: color 0.15s, background-color 0.15s;
    min-width: 36px;
    min-height: 36px;
}

.header-icon-btn:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.header-icon-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.header-icon-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* モバイルでタッチ対応サイズ */
@media (max-width: 640px) {
    .header-icon-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* フィードバックボタン */
#feedback-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: color 0.15s;
}

#feedback-toggle-btn:hover {
    color: #374151;
}

#feedback-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* =====================================================
   言語セレクト
   ===================================================== */

.language-select-header {
    padding: 0.375rem 0.75rem;
    padding-right: 2rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    color: #374151;
    cursor: pointer;
    min-height: 36px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

.language-select-header:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* モバイルでコンパクト表示 */
@media (max-width: 640px) {
    .language-select-header {
        min-height: 32px;
        padding: 0.25rem 0.5rem;
        padding-right: 1.75rem;
        font-size: 0.75rem;
    }
}

/* ダークモード対応 */
.dark .language-select-header {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.dark .header-icon-btn {
    color: #9ca3af;
}

.dark .header-icon-btn:hover {
    color: #d1d5db;
    background-color: #374151;
}

.dark #feedback-toggle-btn {
    color: #9ca3af;
}

.dark #feedback-toggle-btn:hover {
    color: #d1d5db;
}

/* =====================================================
   アクセシビリティ
   ===================================================== */

.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;
}
