/* =======================================================
   RESPONSIVE WEB DESIGN - MOBILE FIRST APPROACH
   新日本ツール - レスポンシブウェブデザイン
   ======================================================= */

/* =======================================================
   BASE MOBILE STYLES (320px and up)
   ======================================================= */

/* リセットとベース設定 */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-weight: 400;
    background-color: #fff;
    overflow-x: hidden;
}

/* タッチデバイス向けの調整 */
.touch-device {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.touch-device input,
.touch-device textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 基本レイアウト */
#wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.inner-block {
    max-width: 1200px;
    padding: 0 15px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

/* ヘッダー - 完全削除済み（header-footer-styles.cssに統合） */

/* モバイルメニューボタン - 削除済み（header-footer-styles.cssに統合） */
/* 統合済み - header-footer-styles.cssで管理 */

/* 統合済み - header-footer-styles.cssで管理 */

/* ビジュアルエリア（モバイル） */
#visual {
    padding: 0;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 200px;
}

/* ホームページ以外の#visualは200px固定 */
#visual:not(.top #visual) {
    height: 200px;
}

#visual .inner-block {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 0;
}

/* #visual内のネストされた.inner-blockのパディングをリセット */
#visual .inner-block .inner-block {
    padding: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* #visual内のコンテンツに適切な間隔を設定 */
#visual .h2-title {
    margin: 15px 0 5px 0;
    color: #fff;
    text-shadow: 0px 0px 7px rgba(24,24,24,0.7);
}

#visual .sub-text {
    color: #fff;
    text-shadow: 0px 0px 5px rgba(24,24,24,0.7);
    margin: 5px 0 0 0;
}

#visual .bread-ul {
    position: absolute;
    top: 15px;
    left: 15px;
    margin: 0;
    text-align: left;
    z-index: 3;
}

.lead-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #013567;
    line-height: 1.4;
    margin: 20px 0;
}

.h2-title {
    font-size: 1.8rem;
    color: #333;
    margin: 20px 0 10px;
    line-height: 1.3;
    font-weight: bold;
}

.sub-text {
    font-size: 1rem;
    color: #666;
    margin: 10px 0;
    line-height: 1.5;
}

/* bread-ul - 旧パンくずナビゲーション（モバイル） */
.bread-ul {
    padding: 0;
    margin: 0;
    text-align: left;
}

.bread-ul li {
    color: #fff;
    font-size: 0.8rem;
    display: inline-block;
    padding: 0 8px 0 0;
    text-shadow: 0px 0px 5px rgba(24,24,24,0.7);
}

.bread-ul li a {
    color: #fff;
    text-decoration: underline;
    text-shadow: 0px 0px 5px rgba(24,24,24,0.7);
}

.bread-ul li + li:before {
    content: ">";
    display: inline-block;
    padding: 0 8px 0 0;
    vertical-align: 1px;
}

/* メインコンテンツ */
#main-wrap {
    padding: 20px 0;
}

.content-block {
    margin-bottom: 30px;
}

/* フォーム要素（タッチ対応） */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px; /* iOS Safariでのズーム防止 */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: #013567;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

button,
.button,
input[type="submit"] {
    min-height: 44px; /* Apple推奨のタッチターゲットサイズ */
    padding: 12px 20px;
    background: #013567;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background: #0052a3;
}

/* リンクのタッチターゲット */
a {
    min-height: 44px;
    display: inline-block;
    line-height: 1.4;
    color: #013567;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 画像の最適化 */
img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* テーブル（横スクロール対応） */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* 会社概要ページのテーブル（モバイル特化） */
.company .normal-table,
.page-id-company .normal-table,
table.normal-table {
    width: 100% !important;
    min-width: auto !important;
    font-size: 0.85rem !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
}

.company .normal-table th,
.page-id-company .normal-table th,
table.normal-table th {
    width: 25% !important;
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    background-color: #f8f9fa !important;
    font-weight: bold !important;
    text-align: left !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    vertical-align: top !important;
    border: 1px solid #ddd !important;
    line-height: 1.3 !important;
}

.company .normal-table td,
.page-id-company .normal-table td,
table.normal-table td {
    width: 75% !important;
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    vertical-align: top !important;
    border: 1px solid #ddd !important;
    line-height: 1.5 !important;
}

th,
td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    font-weight: 600;
}

/* ユーティリティクラス */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

/* =======================================================
   TABLET STYLES (576px and up)
   ======================================================= */

@media (min-width: 576px) {
    .inner-block {
        padding: 0 20px;
    }
    
    /* header-top統合済み */
    
    .lead-text {
        font-size: 1.4rem;
    }
    
    .h2-title {
        font-size: 2.2rem;
    }
    
    /* 2カラムレイアウトの導入 */
    .two-column {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .three-column {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

/* =======================================================
   TABLET STYLES (up to 1024px)
   ======================================================= */
@media (max-width: 1024px) {
    /* ハンバーガーメニュー表示 - header-footer-styles.cssで管理 */
}

/* =======================================================
   DESKTOP STYLES (1025px and up)
   ======================================================= */

@media (min-width: 1025px) {
    .inner-block {
        padding: 0 35px;
    }
    
    /* ヘッダー - header-footer-styles.cssで管理 */
    
    /* ビジュアルエリア */
    #visual {
        padding: 40px 0;
    }
    
    .lead-text {
        font-size: 1.6rem;
    }
    
    .h2-title {
        font-size: 2.5rem;
    }
    
    /* メインコンテンツ */
    #main-wrap {
        padding: 40px 0;
    }
    
    /* 3カラムレイアウト */
    .three-column {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* サイドバーレイアウト */
    .main-sidebar-layout {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 40px;
    }
}

/* =======================================================
   MEDIUM DESKTOP STYLES (992px and up)
   ======================================================= */

@media (min-width: 992px) {
    .inner-block {
        padding: 0 30px;
    }
    
    /* ビジュアルエリアの調整 */
    #visual {
        padding: 0;
        min-height: 200px;
    }
    
    #visual .inner-block {
        padding: 0;
        height: 100%;
    }
    
    #visual .h2-title {
        margin: 20px 0 8px 0;
    }
    
    #visual .bread-ul {
        top: 20px;
        left: 30px;
    }
    
    #visual .bread-ul li {
        font-size: 0.9rem;
    }
    
    /* header-top統合済み */
    
    .nav-text {
        font-size: 0.9rem;
    }
    
    .lead-text {
        font-size: 1.8rem;
    }
    
    .h2-title {
        font-size: 2.8rem;
        margin: 30px 0 15px;
    }
    
    .sub-text {
        font-size: 1.1rem;
    }
    
    /* bread-ulのスタイル調整 */
    .bread-ul li {
        font-size: 0.9rem;
    }
    
    /* 4カラムレイアウト */
    .four-column {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* =======================================================
   LARGE DESKTOP STYLES (1200px and up)
   ======================================================= */

@media (min-width: 1200px) {
    .inner-block {
        padding: 0 40px;
    }
    
    /* ビジュアルエリアの最終調整 */
    #visual {
        padding: 0;
        min-height: 200px;
    }
    
    #visual .inner-block {
        padding: 0;
        height: 100%;
    }
    
    #visual .h2-title {
        margin: 25px 0 10px 0;
    }
    
    #visual .bread-ul {
        top: 25px;
        left: 40px;
    }
    
    #visual .bread-ul li {
        font-size: 0.95rem;
    }
    
    /* header-top統合済み */
    
    .lead-text {
        font-size: 2rem;
    }
    
    .h2-title {
        font-size: 3rem;
        margin: 40px 0 20px;
    }
    
    .sub-text {
        font-size: 1.2rem;
    }
    
    /* bread-ulのスタイル調整 */
    .bread-ul li {
        font-size: 0.95rem;
    }
    
    /* より大きなレイアウト */
    .five-column {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 30px;
    }
}

/* =======================================================
   EXTRA LARGE DESKTOP STYLES (1400px and up)
   ======================================================= */

@media (min-width: 1400px) {
    .inner-block {
    }
    
    .desktop-nav {
        gap: 20px;
    }
    
    .nav-link {
        padding: 20px 30px;
    }
}

/* =======================================================
   HIGH RESOLUTION DISPLAY SUPPORT
   ======================================================= */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Retinaディスプレイ用の最適化 */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 極小画面での会社概要テーブル対応 */
@media (max-width: 480px) {
    .company .normal-table th,
    .page-id-company .normal-table th,
    table.normal-table th {
        width: 30% !important;
        font-size: 0.75rem !important;
        padding: 8px 4px !important;
        line-height: 1.2 !important;
    }
    
    .company .normal-table td,
    .page-id-company .normal-table td,
    table.normal-table td {
        width: 70% !important;
        font-size: 0.75rem !important;
        padding: 8px 6px !important;
        line-height: 1.4 !important;
    }
}

/* =======================================================
   PRINT STYLES
   ======================================================= */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .mobile-menu-toggle,
    .mobile-nav-overlay,
    .desktop-nav {
        display: none !important;
    }
    
    .inner-block {
        max-width: none;
        padding: 0;
    }
    
    img {
        max-width: 100% !important;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
}

/* =======================================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================================= */

/* フォーカス表示の強化 */
*:focus {
    outline: 2px solid #013567;
    outline-offset: 2px;
}

/* スクリーンリーダー用の隠しテキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 動きを減らす設定への対応 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =======================================================
   PERFORMANCE OPTIMIZATIONS
   ======================================================= */

/* GPU加速の有効化 */
.mobile-nav-content,
.hamburger-line {
    will-change: transform;
    transform: translateZ(0);
}

/* 滑らかなスクロール */
html {
    scroll-behavior: smooth;
}

/* タッチスクロールの最適化 */
.scrollable {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* フォント読み込みの最適化 */
@font-face {
    font-display: swap;
}

/* 画像の最適化 */
img {
    loading: lazy;
}

/* =======================================================
   MODERN BROWSER FEATURES
   ======================================================= */

/* CSS Grid のフォールバック */
@supports not (display: grid) {
    .two-column,
    .three-column,
    .four-column,
    .five-column {
        display: flex;
        flex-wrap: wrap;
    }
    
    .two-column > *,
    .three-column > *,
    .four-column > *,
    .five-column > * {
        flex: 1;
        min-width: 250px;
    }
}

/* Flexbox Gapのフォールバック */
@supports not (gap: 20px) {
    .desktop-nav li {
        margin-right: 10px;
    }
    
    .desktop-nav li:last-child {
        margin-right: 0;
    }
}

/* カスタムプロパティのフォールバック */
@supports not (color: var(--primary-color)) {
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}