/**
 * Common Mobile Optimization
 *
 * サイト全体で共通のモバイル最適化スタイル
 * 可読性重視・堅実でプロフェッショナルなデザイン
 */

/* ==========================================================================
   Mobile Base Settings
   ========================================================================== */

/* タブレット (768px以下) */
@media (max-width: 768px) {
    /* コンテナ設定 */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* セクション共通 */
    .section-header {
        margin-bottom: 2rem;
    }

    .section-label {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
        letter-spacing: 1.5px;
        margin-bottom: 0.75rem;
    }

    .section-title {
        font-size: 1.75rem;
        line-height: 1.4;
        letter-spacing: -0.01em;
        margin-bottom: 0.75rem;
    }

    .section-description {
        font-size: 0.95rem;
        line-height: 1.8;
    }

    /* 本文テキスト可読性向上 */
    p {
        line-height: 1.85;
    }

    /* ページヒーロー共通 */
    .page-hero,
    .archive-hero,
    .single-hero {
        padding: 60px 0;
        min-height: auto;
    }

    .hero-title,
    .page-title {
        font-size: 1.75rem;
        line-height: 1.4;
    }

    .hero-subtitle,
    .page-subtitle {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    /* ボタン共通 */
    .btn,
    .button,
    a.btn,
    a.button {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* カード共通 */
    .card,
    [class*="-card"] {
        border-radius: 12px;
    }
}

/* スマホ (480px以下) */
@media (max-width: 480px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-title,
    .page-title {
        font-size: 1.5rem;
    }

    .btn,
    .button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* ==========================================================================
   Header Mobile Optimization
   ========================================================================== */
@media (max-width: 768px) {
    .site-header {
        height: auto;
        min-height: 60px;
    }

    .header-container {
        padding: 0 16px;
        min-height: 60px;
    }

    .site-logo img {
        max-height: 36px;
        width: auto;
    }

    /* モバイルメニューボタン */
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* ==========================================================================
   Footer Mobile Optimization
   ========================================================================== */
@media (max-width: 768px) {
    .site-footer {
        padding: 48px 0 24px;
    }

    .footer-main {
        padding: 40px 0;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-widget-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .footer-menu li {
        margin-bottom: 0.75rem;
    }

    .footer-menu a {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        display: block;
    }

    .footer-bottom {
        padding: 1.5rem 0;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-copyright {
        font-size: 0.8rem;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-social a {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 40px 0 20px;
    }

    .footer-main {
        padding: 32px 0;
    }

    .footer-widget-title {
        font-size: 0.95rem;
    }

    .footer-menu a {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   Page Hero Common Mobile
   ========================================================================== */
@media (max-width: 768px) {
    /* 共通ヒーローセクション */
    .page-hero,
    .archive-hero,
    [class*="-hero"]:not(.site-header) {
        padding: 48px 0;
    }

    .page-hero .container,
    .archive-hero .container {
        padding: 0 20px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-catchphrase {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* スクロールインジケーター非表示 */
    .hero-scroll {
        display: none;
    }

    /* 背景装飾を簡素化 */
    .hero-particles,
    .hero-shapes,
    [class*="hero-bg-"] {
        opacity: 0.3;
    }
}

@media (max-width: 480px) {
    .page-hero,
    .archive-hero {
        padding: 40px 0;
    }
}

/* ==========================================================================
   Card Grid Mobile
   ========================================================================== */
@media (max-width: 768px) {
    /* グリッドを1列に */
    .card-grid,
    .grid-3,
    .grid-4,
    [class*="-grid"] {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* カード内のパディング調整 */
    .card,
    [class*="-card"] {
        padding: 1.5rem;
    }

    /* カードタイトル */
    .card-title,
    [class*="-card-title"] {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    /* カード説明文 */
    .card-description,
    .card-text,
    [class*="-card-text"] {
        font-size: 0.9rem;
        line-height: 1.75;
    }

    /* アイコン */
    .card-icon,
    [class*="-icon"] {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .card,
    [class*="-card"] {
        padding: 1.25rem;
    }

    .card-title,
    [class*="-card-title"] {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Form Mobile Optimization
   ========================================================================== */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1.25rem;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        padding: 0.875rem 1rem;
        font-size: 16px; /* iOS zoom防止 */
        border-radius: 8px;
    }

    textarea {
        min-height: 120px;
    }

    /* 送信ボタン */
    input[type="submit"],
    button[type="submit"],
    .submit-button {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
        padding: 1rem 2rem;
    }
}

/* ==========================================================================
   CTA Section Mobile
   ========================================================================== */
@media (max-width: 768px) {
    .cta-section,
    [class*="-cta"] {
        padding: 48px 0;
    }

    .cta-title {
        font-size: 1.5rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .cta-text,
    .cta-description {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 1.5rem;
    }

    .cta-button,
    .cta-btn {
        width: 100%;
        max-width: 300px;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* 装飾要素を簡素化 */
    .cta-pattern,
    .cta-particles,
    .cta-glow {
        display: none;
    }
}

@media (max-width: 480px) {
    .cta-section,
    [class*="-cta"] {
        padding: 40px 0;
    }

    .cta-title {
        font-size: 1.35rem;
    }

    .cta-button,
    .cta-btn {
        max-width: 100%;
    }
}

/* ==========================================================================
   Table Mobile Optimization
   ========================================================================== */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem;
    }

    /* 横スクロール可能なテーブル */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 定義リスト形式のテーブル */
    .info-list .info-item,
    dl.info-list > div {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .info-list dt {
        font-size: 0.85rem;
    }

    .info-list dd {
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    /* ホバー効果無効化 */
    .card:hover,
    [class*="-card"]:hover,
    .btn:hover,
    a:hover {
        transform: none;
    }

    /* タッチターゲットサイズ確保 */
    a,
    button,
    .btn,
    .button,
    input[type="submit"],
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* アクティブ状態のフィードバック */
    a:active,
    button:active,
    .btn:active {
        opacity: 0.85;
        transform: scale(0.98);
    }

    /* リンクリスト */
    nav ul li a,
    .menu li a,
    .footer-menu li a {
        padding: 0.75rem 0;
        display: block;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* 装飾アニメーション完全停止 */
    .floating-shape,
    .particles,
    [class*="animate-"],
    [class*="-animation"] {
        animation: none !important;
    }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */
@media (max-width: 768px) {
    /* フォーカス状態の可視化 */
    a:focus,
    button:focus,
    input:focus,
    textarea:focus,
    select:focus,
    [tabindex]:focus {
        outline: 2px solid var(--primary-color, #00867b);
        outline-offset: 2px;
    }

    /* フォーカスリング（キーボードナビゲーション用） */
    :focus-visible {
        outline: 3px solid var(--primary-color, #00867b);
        outline-offset: 3px;
    }

    /* 十分なコントラスト確保 */
    .text-muted,
    .text-secondary,
    .text-light {
        color: #4b5563;
    }

    /* スキップリンク */
    .skip-link {
        position: absolute;
        top: -100px;
        left: 10px;
        z-index: 10000;
        padding: 1rem 1.5rem;
        background: var(--primary-color, #00867b);
        color: white;
        text-decoration: none;
        border-radius: 8px;
    }

    .skip-link:focus {
        top: 10px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    /* 印刷時の基本設定 */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    /* 不要な要素を非表示 */
    .site-header,
    .site-footer,
    .mobile-menu-toggle,
    .cta-section,
    nav,
    .skip-link {
        display: none !important;
    }

    /* リンクURLを表示 */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* 改ページ制御 */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}
