/* ========================================
   Responsive - レスポンシブ
======================================== */

/* ========================================
   タブレット (1024px以下)
======================================== */
@media screen and (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-sidebar,
    .sidebar-content {
        grid-template-columns: 1fr;
    }

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

/* ========================================
   スマートフォン (768px以下)
======================================== */
@media screen and (max-width: 768px) {
    /* 基本設定 */
    html {
        font-size: 56.25%;
    }

    :root {
        --header-height: var(--header-height-sp);
        --container-padding: 16px;
    }

    /* タイポグラフィ */
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.4rem; }
    h3 { font-size: 2.0rem; }

    /* セクション */
    .section {
        padding: 60px 0;
    }

    .section-lg {
        padding: 80px 0;
    }

    /* グリッド */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    /* ヘッダー */
    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--color-bg);
        transform: translateX(-100%);
        transition: var(--transition);
        overflow-y: auto;
        z-index: 999;
    }

    .main-nav.is-active {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: 0;
    }

    .main-nav li {
        border-bottom: 1px solid var(--color-border);
    }

    .main-nav > ul > li > a {
        padding: 15px 0;
    }

    .main-nav > ul > li > a::after {
        display: none;
    }

    .main-nav .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 var(--spacing-md);
        background-color: var(--color-bg-light);
    }

    .header-actions {
        display: none;
    }

    /* メインビジュアル */
    .main-visual {
        min-height: 500px;
        height: auto;
        padding: 100px 0;
    }

    .main-visual h1 {
        font-size: 3.2rem;
    }

    .main-visual p {
        font-size: 1.6rem;
    }

    /* ページヘッダー */
    .page-header {
        padding: 40px 0;
    }

    .page-title {
        font-size: 2.4rem;
    }

    /* パンくずリスト */
    .breadcrumb {
        margin-top: var(--header-height-sp);
    }

    .breadcrumb ol {
        font-size: 1.2rem;
    }

    /* カード */
    .card-horizontal {
        flex-direction: column;
    }

    .card-horizontal .card-image {
        width: 100%;
        aspect-ratio: 16 / 10;
    }

    /* ニュースリスト */
    .news-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-date {
        width: auto;
        margin-bottom: var(--spacing-xs);
    }

    /* 投稿 */
    .entry-title {
        font-size: 2.4rem;
    }

    .post-navigation {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    /* フッター */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-nav ul {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    /* ページトップ */
    .page-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    /* 404 */
    .error-404 h1 {
        font-size: 8rem;
    }

    /* テーブル */
    .company-table th,
    .company-table td {
        display: block;
        width: 100%;
    }

    .company-table th {
        border-bottom: none;
    }

    /* モーダル */
    .modal {
        width: 95%;
        max-height: 85vh;
    }

    /* ボタン */
    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }
}

/* ========================================
   小型スマートフォン (480px以下)
======================================== */
@media screen and (max-width: 480px) {
    :root {
        --container-padding: 12px;
    }

    html {
        font-size: 50%;
    }

    .container {
        padding: 0 var(--container-padding);
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .btn {
        display: block;
        width: 100%;
    }

    .btn-sm {
        padding: 12px 20px;
    }

    .main-visual h1 {
        font-size: 2.8rem;
    }

    .section-title h2 {
        font-size: 2.2rem;
    }

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

    .pagination ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination li a,
    .pagination li span {
        min-width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
}

/* ========================================
   メニューオープン時
======================================== */
body.menu-open {
    overflow: hidden;
}

/* ========================================
   プリント
======================================== */
@media print {
    .site-header,
    .site-footer,
    .breadcrumb,
    .page-top,
    .post-navigation,
    .pagination {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .section {
        padding: 20px 0;
    }
}

/* ========================================
   ホバー対応デバイスのみ
======================================== */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-5px);
    }

    .card:hover .card-image img {
        transform: scale(1.05);
    }
}

/* ========================================
   プリファレンス
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
