/*
 * Company Portal Theme - Custom Styles
 * トヨタサプライヤー企業紹介ポータルサイト
 *
 * Design System: Microsoft Fluent 2 with Toyota Brand Colors
 *
 * 主な特徴:
 * - トヨタブランドカラー（Toyota Red #EB0A1E）+ Fluent 2 ニュートラルカラー
 * - システムフォント（Segoe UI, San Francisco, etc.）
 * - 4pxグリッドシステムによるスペーシング
 * - 控えめな角丸（4px, 8px, 12px）
 * - レイヤー感のあるシャドウ（elevation system）
 * - 滑らかで自然なアニメーション
 * - アクセシビリティを考慮したフォーカススタイル
 */

/* ========================================
   カラー変数 - Toyota Brand + Fluent 2
   ======================================== */
:root {
    /* Toyota Brand Colors */
    --primary-color: #EB0A1E;
    --primary-hover: #C80918;
    --primary-pressed: #A0070F;

    --toyota-red: #EB0A1E;
    --toyota-white: #FFFFFF;
    --toyota-black: #000000;
    --toyota-gray: #58595B;

    /* Fluent 2 Neutral Colors (Toyota aligned) */
    --neutral-foreground-1: #000000;  /* Toyota Black */
    --neutral-foreground-2: #424242;
    --neutral-foreground-3: #58595B;  /* Toyota Gray */
    --neutral-background-1: #FFFFFF;  /* Toyota White */
    --neutral-background-2: #fafafa;
    --neutral-background-3: #f5f5f5;
    --neutral-stroke-1: #e0e0e0;
    --neutral-stroke-2: #d1d1d1;

    /* Semantic Colors */
    --success-color: #107c10;
    --info-color: #EB0A1E;
    --warning-color: #f7630c;
    --danger-color: #d13438;

    /* 担当領域カラー */
    --area-parts-color: #EB0A1E;      /* 部品: Toyota Red */
    --area-equipment-color: #1976d2;  /* 設備: Blue */
    --area-logistics-color: #43a047;  /* 資材・物流: Green */

    /* Legacy Support */
    --secondary-color: #58595B;  /* Toyota Gray */
    --light-color: #f5f5f5;
    --dark-color: #000000;  /* Toyota Black */
    --white: #FFFFFF;  /* Toyota White */

    /* Fluent 2 Design Tokens */
    --border-radius-small: 4px;
    --border-radius-medium: 8px;
    --border-radius-large: 12px;
    --border-radius: var(--border-radius-medium);

    /* Spacing (4px grid system) */
    --spacing-xs: 4px;
    --spacing-s: 8px;
    --spacing-m: 12px;
    --spacing-l: 16px;
    --spacing-xl: 20px;
    --spacing-xxl: 24px;
    --spacing-xxxl: 32px;

    /* Shadows - Fluent 2 elevation */
    --shadow-2: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.14);
    --shadow-4: 0 0 2px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.14);
    --shadow-8: 0 0 2px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.14);
    --shadow-16: 0 0 2px rgba(0, 0, 0, 0.12), 0 16px 32px rgba(0, 0, 0, 0.14);

    /* Transitions - Fluent 2 motion */
    --transition-fast: 100ms cubic-bezier(0.33, 0, 0.67, 1);
    --transition-normal: 200ms cubic-bezier(0.33, 0, 0.67, 1);
    --transition-slow: 300ms cubic-bezier(0.33, 0, 0.67, 1);
    --transition: var(--transition-normal);

    /* Typography - Toyota Brand Guidelines */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-100: 10px;
    --font-size-200: 12px;
    --font-size-300: 14px;
    --font-size-400: 16px;
    --font-size-500: 20px;
    --font-size-600: 24px;
    --font-size-700: 28px;
    --font-size-800: 32px;
    --font-size-900: 40px;

    --font-weight-regular: 400;   /* Toyota Type: Book/Regular */
    --font-weight-medium: 500;
    --font-weight-semibold: 600;  /* Toyota Type: Semibold */
    --font-weight-bold: 700;      /* Toyota Type: Bold */

    /* Line Heights - Toyota Guidelines */
    --line-height-heading: 0.9;   /* 90% for headings (digital) */
    --line-height-body: 1.45;     /* 145% for body text */

    /* Legacy pixel values */
    --line-height-100: 14px;
    --line-height-200: 16px;
    --line-height-300: 20px;
    --line-height-400: 22px;
    --line-height-500: 28px;
    --line-height-600: 32px;
    --line-height-700: 36px;
    --line-height-800: 40px;
    --line-height-900: 52px;
}

/* ========================================
   全体設定 - Toyota Brand Guidelines
   ======================================== */
body {
    font-family: var(--font-family);
    font-size: var(--font-size-400);
    line-height: var(--line-height-body);  /* 145% Toyota guideline */
    color: var(--toyota-black);
    background-color: var(--neutral-background-2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);  /* Toyota: Semibold for headings */
    line-height: var(--line-height-heading);   /* 90% Toyota guideline */
    color: var(--toyota-black);
}

h1 { font-size: var(--font-size-900); }
h2 { font-size: var(--font-size-800); }
h3 { font-size: var(--font-size-700); }
h4 { font-size: var(--font-size-600); }
h5 { font-size: var(--font-size-500); }
h6 { font-size: var(--font-size-400); }

/* ========================================
   ヘッダー - Fluent 2 Navigation
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--neutral-background-1);
    border-bottom: 1px solid var(--neutral-stroke-1);
    box-shadow: var(--shadow-2);
}

.navbar-brand {
    font-size: var(--font-size-600);
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color) !important;
    transition: color var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--primary-hover) !important;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--neutral-foreground-1);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-300);
    padding: var(--spacing-s) var(--spacing-l);
    transition: all var(--transition-fast);
    border-radius: var(--border-radius-small);
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--neutral-background-3);
}

.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: var(--font-weight-semibold);
}

/* ========================================
   ヒーローセクション - Fluent 2 Hero
   ======================================== */
.hero-section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    padding: 60px 0;
}

/* 背景画像のオーバーレイ */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

/* コンテンツを前面に */
.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    padding: 20px 0;
}

.hero-title {
    color: var(--white);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-heading);  /* 90% */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--font-size-500);
    line-height: var(--line-height-body);  /* 145% */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 48px;
}

/* 統計情報 */
.hero-stats {
    margin-top: 48px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-medium);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.stat-number {
    font-size: 3rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    color: var(--white);
    margin-bottom: 8px;
}

.stat-label {
    font-size: var(--font-size-300);
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-medium);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }

    .hero-content {
        padding: 10px 0;
    }

    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 16px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .hero-stats {
        gap: 12px !important;
        margin-top: 32px;
    }

    .stat-item {
        flex: 1;
        min-width: 100px;
        padding: 16px 12px;
    }
}

/* ========================================
   掲載企業についてエリア
   ======================================== */
.about-companies {
    background-color: var(--neutral-background-2);
}

.about-companies .feature-icon {
    transition: all var(--transition-normal);
}

.about-companies .col-md-4:hover .feature-icon {
    transform: translateY(-4px);
    box-shadow: var(--shadow-8);
}

/* ========================================
   絞り込みセクション - モダンチェックボックスUI
   ======================================== */
.filter-section,
.filter-map-section {
    background-color: var(--neutral-background-2);
    padding: var(--spacing-xl) 0;
}

/* フィルターカード */
.filter-card {
    background-color: var(--neutral-background-1);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-4);
    border: 1px solid var(--neutral-stroke-1);
    overflow: hidden;
}

.filter-card-header {
    padding: var(--spacing-l) var(--spacing-xl);
    background-color: var(--neutral-background-1);
    border-bottom: 1px solid var(--neutral-stroke-1);
}

.filter-card-header h5 {
    font-size: var(--font-size-500);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-foreground-1);
}

.filter-card-header h5 i {
    color: var(--primary-color);
}

.filter-card-body {
    padding: var(--spacing-xl);
}

/* 結果バッジ */
.result-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    font-size: var(--font-size-300);
    font-weight: var(--font-weight-semibold);
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: var(--shadow-2);
}

.result-badge span {
    font-size: var(--font-size-400);
    margin-right: 2px;
}

/* フィルターラベル */
.filter-label {
    display: block;
    font-size: var(--font-size-300);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-foreground-2);
    margin-bottom: var(--spacing-s);
}

.filter-label i {
    color: var(--primary-color);
    margin-right: 4px;
}

/* セレクトボックス */
.filter-card .form-select {
    border-radius: var(--border-radius-medium);
    border-color: var(--neutral-stroke-2);
    padding: 10px 14px;
    font-size: var(--font-size-300);
    transition: all var(--transition-fast);
}

.filter-card .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(235, 10, 30, 0.1);
}

/* チェックボックスグループ */
.filter-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* モダンチェックボックス */
.filter-card .form-check {
    padding-left: 0;
    margin-bottom: 0;
}

.filter-card .form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid var(--neutral-stroke-2);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    float: none;
    margin-left: 0;
    margin-top: 0;
    vertical-align: middle;
}

.filter-card .form-check-input:hover {
    border-color: var(--primary-color);
}

.filter-card .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-card .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(235, 10, 30, 0.15);
    border-color: var(--primary-color);
}

.filter-card .form-check-label {
    font-size: var(--font-size-300);
    color: var(--neutral-foreground-2);
    cursor: pointer;
    transition: color var(--transition-fast);
    vertical-align: middle;
}

.filter-card .form-check-label:hover {
    color: var(--neutral-foreground-1);
}

.filter-card .form-check-input:checked + .form-check-label {
    color: var(--primary-color);
    font-weight: var(--font-weight-medium);
}

/* 職場環境フィルターセクション */
.workplace-filter-section {
    padding-top: var(--spacing-l);
    border-top: 1px solid var(--neutral-stroke-1);
}

/* フィルターカテゴリ */
.filter-category {
    background-color: var(--neutral-background-1);
    border-radius: var(--border-radius-medium);
    padding: var(--spacing-l);
    height: 100%;
    border: 1px solid var(--neutral-stroke-1);
}

.filter-category-title {
    display: block;
    font-size: var(--font-size-200);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-foreground-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-m);
    padding-bottom: var(--spacing-s);
    border-bottom: 2px solid var(--primary-color);
}

/* リセットボタン */
#filterReset {
    border-radius: var(--border-radius-medium);
    font-size: var(--font-size-200);
    padding: 6px 12px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .filter-card-header {
        flex-direction: column;
        gap: var(--spacing-m);
        align-items: stretch !important;
    }

    .filter-card-header h5 {
        text-align: center;
    }

    .filter-card-header > div {
        justify-content: center !important;
        flex-wrap: wrap;
    }

    .filter-card-body .row > div {
        margin-bottom: var(--spacing-m);
    }

    .workplace-filter-container .row > div {
        margin-bottom: var(--spacing-m);
    }

    .filter-category {
        margin-bottom: 0;
    }
}

/* ========================================
   フィルター＋マップ統合セクション
   ======================================== */
.filter-map-section {
    background-color: var(--neutral-background-2);
    padding: var(--spacing-xl) 0;
}

/* マップカード */
.map-card {
    background-color: var(--neutral-background-1);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-4);
    border: 1px solid var(--neutral-stroke-1);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.map-card-header {
    padding: var(--spacing-l) var(--spacing-xl);
    background-color: var(--neutral-background-1);
    border-bottom: 1px solid var(--neutral-stroke-1);
}

.map-card-header h5 {
    font-size: var(--font-size-500);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-foreground-1);
}

.map-card-header h5 i {
    color: var(--primary-color);
}

#companiesMap {
    width: 100%;
    height: 680px;
    border: none;
    border-radius: 0;
}

/* レスポンシブ: マップ */
@media (max-width: 991.98px) {
    .map-card {
        position: static;
    }

    #companiesMap {
        height: 500px;
    }
}

@media (max-width: 767.98px) {
    #companiesMap {
        height: 400px;
    }
}

/* ========================================
   企業一覧セクション
   ======================================== */
.companies-list {
    background-color: var(--neutral-background-2);
}

/* ========================================
   会社カード - Fluent 2 Card Component
   ======================================== */
.company-card {
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid var(--neutral-stroke-1);
    border-radius: var(--border-radius-medium);
    overflow: hidden;
    background-color: var(--neutral-background-1);
    box-shadow: var(--shadow-2);
}

.company-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-8);
    border-color: var(--neutral-stroke-2);
}

.company-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.company-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-2);
}

.card-img-top-wrapper {
    height: 200px;
    overflow: hidden;
    background-color: var(--neutral-background-3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--neutral-stroke-1);
}

.card-img-top-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-card .card-title {
    color: var(--neutral-foreground-1);
    font-size: var(--font-size-500);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-s);
}

.company-card .card-text {
    font-size: var(--font-size-300);
    line-height: var(--line-height-body);  /* 145% */
    color: var(--toyota-gray);  /* Toyota Gray for secondary text */
}

.company-card .card-body {
    padding: var(--spacing-l);
}

.company-detail-btn {
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    border-radius: var(--border-radius-small);
    padding: var(--spacing-s) var(--spacing-l);
    font-size: var(--font-size-300);
}

.company-detail-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-4);
}

.company-detail-btn:active {
    transform: translateY(0);
}

/* Fluent 2 Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-primary:active {
    background-color: var(--primary-pressed);
    border-color: var(--primary-pressed);
}

/* ========================================
   モーダル - Fluent 2 Dialog
   ======================================== */
.modal-xl {
    max-width: 1200px;
}

.modal-content {
    border-radius: var(--border-radius-large);
    border: 1px solid var(--neutral-stroke-1);
    box-shadow: var(--shadow-16);
}

.modal-header {
    background-color: var(--neutral-background-1);
    color: var(--neutral-foreground-1);
    border-bottom: 1px solid var(--neutral-stroke-1);
    padding: var(--spacing-l) var(--spacing-xxl);
}

.modal-header .btn-close {
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    font-size: var(--font-size-600);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-foreground-1);
}

.modal-body {
    padding: var(--spacing-xxl);
}

.modal-footer {
    border-top: 1px solid var(--neutral-stroke-1);
    padding: var(--spacing-l) var(--spacing-xxl);
}

/* モーダル内セクション */
.modal-section {
    margin-bottom: var(--spacing-xxl);
    padding-bottom: var(--spacing-xxl);
    border-bottom: 1px solid var(--neutral-stroke-1);
}

.modal-section:last-child {
    border-bottom: none;
}

.modal-section h3 {
    font-size: var(--font-size-600);
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
    margin-bottom: var(--spacing-l);
    padding-bottom: var(--spacing-s);
    border-bottom: 2px solid var(--primary-color);
}

.modal-section h4 {
    font-size: var(--font-size-500);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-foreground-1);
    margin-bottom: var(--spacing-m);
}

/* 職場環境チェックリスト */
.workplace-benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-s);
    list-style: none;
    padding: 0;
}

.workplace-benefits-list li {
    display: flex;
    align-items: center;
    padding: var(--spacing-s) var(--spacing-m);
    background-color: var(--neutral-background-3);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--neutral-stroke-1);
    transition: background-color var(--transition-fast);
}

.workplace-benefits-list li:hover {
    background-color: var(--neutral-background-2);
}

.workplace-benefits-list li i {
    margin-right: var(--spacing-s);
    color: var(--success-color);
}

/* 社員インタビュー */
.employee-interview {
    background-color: var(--neutral-background-1);
    border: 1px solid var(--neutral-stroke-1);
    padding: var(--spacing-xxl);
    border-radius: var(--border-radius-medium);
    margin-bottom: var(--spacing-l);
    box-shadow: var(--shadow-2);
}

.employee-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--spacing-l);
    border: 2px solid var(--neutral-stroke-1);
}

.employee-info {
    margin-bottom: var(--spacing-l);
}

.employee-name {
    font-size: var(--font-size-500);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
    color: var(--neutral-foreground-1);
}

.employee-position,
.employee-year {
    font-size: var(--font-size-300);
    color: var(--toyota-gray);  /* Toyota Gray */
}

.employee-interview-content {
    white-space: pre-wrap;
    line-height: var(--line-height-body);  /* 145% */
    color: var(--toyota-gray);  /* Toyota Gray */
}

/* 代表者メッセージ - Fluent 2 Callout */
.representative-message {
    background-color: var(--neutral-background-1);
    border: 1px solid var(--neutral-stroke-1);
    padding: var(--spacing-xxl);
    border-radius: var(--border-radius-medium);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-2);
}

.representative-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: var(--spacing-l);
    border: 2px solid var(--neutral-stroke-1);
}

.representative-info {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-l);
}

.representative-name {
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
    color: var(--neutral-foreground-1);
    font-size: var(--font-size-400);
}

.representative-title {
    font-size: var(--font-size-300);
    color: var(--toyota-gray);  /* Toyota Gray */
}

.message-content {
    white-space: pre-wrap;
    line-height: var(--line-height-body);  /* 145% */
    color: var(--toyota-gray);  /* Toyota Gray */
}

/* Google Map */
.google-map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--border-radius-medium);
    overflow: hidden;
    margin-top: var(--spacing-l);
    border: 1px solid var(--neutral-stroke-1);
}

/* 採用リンク - Fluent 2 Links/Buttons */
.recruitment-links {
    display: flex;
    gap: var(--spacing-l);
    margin-top: var(--spacing-xxl);
}

.recruitment-link {
    flex: 1;
    text-align: center;
    padding: var(--spacing-m) var(--spacing-l);
    border-radius: var(--border-radius-medium);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-400);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-2);
}

.recruitment-link:hover {
    box-shadow: var(--shadow-4);
    transform: translateY(-1px);
}

.recruitment-link:active {
    transform: translateY(0);
}

.recruitment-link-fresh {
    background-color: var(--success-color);
    color: var(--white);
    border: 1px solid var(--success-color);
}

.recruitment-link-fresh:hover {
    background-color: #0e6b0e;
    border-color: #0e6b0e;
    color: var(--white);
}

.recruitment-link-career {
    background-color: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--primary-color);
}

.recruitment-link-career:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
}

/* ギャラリー */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-l);
    margin-top: var(--spacing-l);
}

.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid var(--neutral-stroke-1);
    box-shadow: var(--shadow-2);
    position: relative;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-4);
}

.gallery-item:active {
    transform: scale(1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ライトボックスモーダルのカスタムスタイル */
#galleryLightbox .modal-dialog {
    max-width: 95%;
    width: 95%;
    margin: auto;
}

#galleryLightbox .modal-content {
    background: rgba(0, 0, 0, 0.9) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#galleryLightbox .modal-body {
    min-height: 300px;
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#galleryLightbox #lightboxImage {
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    #galleryLightbox #lightboxImage {
        max-height: 70vh !important;
    }

    #galleryLightbox .modal-body {
        padding: 30px 10px 10px 10px !important;
    }
}

/* ========================================
   フッター
   ======================================== */
.site-footer {
    background-color: var(--neutral-foreground-1);
}

.site-footer h5 {
    font-size: var(--font-size-500);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-l);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--white);
}

/* ========================================
   ページネーション - Fluent 2 Pagination
   ======================================== */
.pagination {
    justify-content: center;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-s) var(--spacing-m);
    margin: 0 var(--spacing-xs);
    border: 1px solid var(--neutral-stroke-1);
    border-radius: var(--border-radius-small);
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-fast);
    background-color: var(--neutral-background-1);
    font-size: var(--font-size-300);
    font-weight: var(--font-weight-medium);
}

.page-numbers:hover {
    background-color: var(--neutral-background-3);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-numbers:active {
    background-color: var(--neutral-background-2);
}

.page-numbers.current {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-numbers.current:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 768px) {
    .company-archive-hero h1 {
        font-size: 2rem;
    }

    .company-archive-hero .lead {
        font-size: 1rem;
    }

    /* 職場環境をコンパクトなバッジスタイルに */
    .workplace-benefits-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .workplace-benefits-list li {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: 20px;
    }

    .workplace-benefits-list li i {
        font-size: 0.75rem;
        margin-right: 4px;
    }

    .recruitment-links {
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-xl {
        max-width: 100%;
        margin: 0;
    }
}

/* ========================================
   アニメーション - Fluent 2 Motion
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.company-card {
    animation: fadeIn 0.3s cubic-bezier(0.33, 0, 0.67, 1);
}

.company-card:nth-child(1) { animation-delay: 0.05s; }
.company-card:nth-child(2) { animation-delay: 0.1s; }
.company-card:nth-child(3) { animation-delay: 0.15s; }
.company-card:nth-child(4) { animation-delay: 0.2s; }
.company-card:nth-child(5) { animation-delay: 0.25s; }
.company-card:nth-child(6) { animation-delay: 0.3s; }

.modal.fade .modal-dialog {
    animation: fadeInScale 0.2s cubic-bezier(0.33, 0, 0.67, 1);
}

/* ========================================
   ユーティリティ
   ======================================== */
.text-pre-wrap {
    white-space: pre-wrap;
}

.info-row {
    display: flex;
    padding: var(--spacing-m) 0;
    border-bottom: 1px solid var(--neutral-stroke-1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 0 0 120px;
    font-weight: var(--font-weight-semibold);
    color: var(--toyota-gray);  /* Toyota Gray */
    font-size: var(--font-size-300);
}

.info-value {
    flex: 1;
    color: var(--toyota-black);
    font-size: var(--font-size-300);
    line-height: var(--line-height-body);  /* 145% */
}

/* ========================================
   フローティング絞り込みボタン
   ======================================== */
#floatingFilterBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    width: 180px;
    height: 56px;
    font-size: 14px;
    border-radius: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-8);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

#floatingFilterBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#floatingFilterBtn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-16);
}

#floatingFilterBtn i {
    font-size: 1.5rem;
    margin-right: 0.5em;
}

/* フローティング絞り込みパネル */
#floatingFilterPanel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1049;
    width: 350px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 150px);
    background-color: var(--neutral-background-1);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-16);
    border: 1px solid var(--neutral-stroke-1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    overflow: hidden;
}

#floatingFilterPanel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-filter-header {
    padding: var(--spacing-m) var(--spacing-l);
    border-bottom: 1px solid var(--neutral-stroke-1);
    background-color: var(--neutral-background-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.floating-filter-header h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
}

.floating-filter-body {
    padding: var(--spacing-l);
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.floating-filter-footer {
    padding: var(--spacing-m) var(--spacing-l);
    border-top: 1px solid var(--neutral-stroke-1);
    background-color: var(--neutral-background-2);
}

@media (max-width: 576px) {
    #floatingFilterPanel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 80px;
    }

    #floatingFilterBtn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
}

/* Fluent 2 Focus Styles */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Fluent 2 Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-background-2);
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-stroke-2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-foreground-3);
}

/* ========================================
   TOPへ戻るボタン
   ======================================== */
#scrollToTopBtn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1051;
    width: 50px;
    height: 50px;
    font-size: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-8);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollToTopBtn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.1);
    box-shadow: var(--shadow-16);
}

#scrollToTopBtn:active {
    transform: scale(1);
}

@media (max-width: 576px) {
    #scrollToTopBtn {
        bottom: 80px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* ========================================
   モーダル内H3スタイル修正（TOPページの影響を防ぐ）
   ======================================== */
#companyModal .modal-body h3 {
    font-size: var(--font-size-600) !important;
    font-weight: var(--font-weight-semibold) !important;
    color: var(--primary-color) !important;
    margin-bottom: 32px !important;
    padding-bottom: var(--spacing-s) !important;
    border-bottom: 2px solid var(--primary-color) !important;
    line-height: 1.3 !important;
}

#companyModal .modal-body h3:after {
    display: none !important;
}

/* ========================================
   担当領域バッジスタイル
   ======================================== */
.area-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

.area-badge--parts {
    background-color: var(--area-parts-color);
}

.area-badge--equipment {
    background-color: var(--area-equipment-color);
}

.area-badge--logistics {
    background-color: var(--area-logistics-color);
}

/* ========================================
   職場写真サムネイル
   ======================================== */
.work-photo-thumb {
    width: calc(50% - 4px);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--neutral-stroke-1);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.work-photo-thumb:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-8);
}

/* ========================================
   モバイルレイアウト最適化
   ======================================== */

/* iOS自動ズーム防止（フォーム要素のフォントサイズを16px以上に） */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    input[type="password"],
    textarea,
    select,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* チェックボックスのタップターゲット拡大 */
    .filter-card .form-check {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 8px 0;
    }

    .filter-card .form-check-input {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        flex-shrink: 0;
    }

    .filter-card .form-check-label {
        font-size: 15px;
        line-height: 1.4;
        padding: 4px 0;
    }

    /* ナビゲーションボタンのタップターゲット確保 */
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }

    /* ハンバーガーメニュー内のナビゲーションリンク */
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }

    .navbar-nav .nav-link {
        font-size: 1.1rem !important;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #eee;
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }

    /* 使い方ボタンのタップターゲット確保 */
    .btn-sm {
        min-height: 44px;
        padding: 8px 16px;
        display: inline-flex;
        align-items: center;
    }

    /* インタビューセクション：モバイルで写真+プロフィール横並び、本文はフル幅 */
    .employee-interview {
        padding: 16px !important;
    }

    .employee-interview .interview-header {
        display: flex !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .employee-interview .interview-photo {
        width: 40% !important;
        flex-shrink: 0 !important;
    }

    .employee-interview .employee-photo {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    .employee-interview .interview-content {
        margin-top: 12px !important;
    }

    /* ヒーローセクション：モバイルでテキストが黒枠からはみ出さないよう調整 */
    .hero-title .line {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
        padding: 0.15em 0.4em !important;
    }

    .hero-title .line:nth-child(2) {
        margin-left: 1em !important;
    }

    /* 企業カード「詳しく見る」ボタンのタップターゲット確保 */
    .company-detail-btn,
    .btn-dark.btn-lg,
    .companies-list .btn {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* ピックアップ企業のボタンを中央・フル幅に */
    .pickup-section .card-body > .company-detail-btn {
        display: block;
        width: 100%;
    }

    /* モーダル内SNSボタンをモバイルでコンパクトに */
    .sns-links .btn {
        padding: 12px 20px !important;
        font-size: 16px !important;
        gap: 10px !important;
        flex: 1 1 auto;
    }
    .sns-links .btn i {
        font-size: 22px !important;
    }

    /* モバイルで「使い方」ボタンを非表示 */
    .navbar .btn-sm,
    [data-bs-target="#howToUseModal"] {
        display: none !important;
    }

    /* モバイルで「企業を選ぶ」ボタンをアイコンのみに */
    #floatingFilterBtn {
        font-size: 0;
        padding: 0;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #floatingFilterBtn i {
        font-size: 20px;
        margin-right: 0;
    }

    /* ヒーローセクション：モバイルで背景画像エリアを16:9に */
    .hero-section {
        min-height: auto !important;
        height: auto !important;
        padding-top: 60px !important;
        padding-bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .hero-section .hero-content {
        position: relative !important;
        width: 100% !important;
        min-height: 56.25vw !important; /* 16:9 アスペクト比 */
        padding: 1rem !important;
    }

    /* 説明文を背景画像の下（半透明白背景）に配置 */
    .hero-description {
        position: relative !important;
        padding-top: 2rem !important;
        background: rgba(255, 255, 255, 0.85) !important;
        padding: 2rem 1rem !important;
        margin-top: 2rem !important;
        width: 100% !important;
    }

    .hero-description p {
        color: #333 !important;
        font-size: 0.9rem !important;
        line-height: 1.7 !important;
    }
}

/* ページ内リンクのオフセット（ヘッダー高さ分） */
html {
    scroll-padding-top: 80px;
}

#features,
#pickup,
#filter,
#map,
#companies {
    scroll-margin-top: 120px;
}

/* PC画面ではページ内ナビゲーション（ハンバーガーメニュー）を非表示 */
@media (min-width: 769px) {
    .site-header .navbar-toggler,
    .site-header .navbar-collapse,
    .navbar-expand-lg .navbar-collapse,
    #navbarNav {
        display: none !important;
    }
}
