/* ============================================================
   Mobile Polish (2026-04-27)
   全ページ共通のスマートフォン最適化
   - 読みやすい文字サイズ・行間
   - タップしやすいボタン・リンク
   - 適切な余白
   - 横スクロール防止
   ============================================================ */

/* ---------- 0. ベース ---------- */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body {
    font-size: 16px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  /* 横スクロール完全防止 */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  img, video, iframe, table {
    max-width: 100%;
  }
  /* iOS タップハイライト軽減 */
  a, button {
    -webkit-tap-highlight-color: rgba(107,79,59,0.12);
  }
}

/* ---------- 1. ヘッダー / ナビ ---------- */
@media (max-width: 768px) {
  .site-header {
    padding: 12px 0 !important;
  }
  .header-inner {
    padding: 0 16px !important;
  }
  .site-logo img {
    height: 22px !important;
    width: auto !important;
  }
  .hamburger {
    width: 40px !important;
    height: 40px !important;
  }
  .nav-mobile-links a {
    padding: 16px 0 !important;
    font-size: 1rem !important;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .nav-mobile-contact-btn {
    min-height: 52px;
    font-size: 0.95rem !important;
  }
}

/* ---------- 2. ボタン共通（タップ領域確保） ---------- */
@media (max-width: 768px) {
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .fp-btn--primary,
  .fp-btn--ghost {
    min-height: 48px;
    padding: 13px 22px;
    font-size: 0.95rem;
    line-height: 1.4;
  }
  .btn-sm {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.88rem;
  }
}

/* ---------- 3. パンくず ---------- */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.72rem !important;
    padding: 12px 0 !important;
  }
  .breadcrumb .container {
    padding: 0 16px !important;
    flex-wrap: wrap;
    gap: 4px;
  }
  .breadcrumb span {
    margin: 0 2px !important;
  }
}

/* ---------- 4. メディアアーカイブ（記事一覧） ---------- */
@media (max-width: 768px) {
  .media-header {
    padding: 80px 0 24px !important;
  }
  .media-header-title {
    font-size: 1.4rem !important;
    margin-top: 12px !important;
  }
  .media-layout {
    padding: 32px 0 56px !important;
  }
  .media-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .media-featured-body {
    padding: 18px 20px !important;
  }
  .media-featured-title {
    font-size: 1.1rem !important;
    line-height: 1.55 !important;
  }
  .media-featured-excerpt {
    font-size: 0.85rem !important;
    line-height: 1.85 !important;
  }
  .media-section-title {
    font-size: 1rem !important;
    margin-bottom: 16px !important;
  }
  .media-card-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .media-card-body {
    padding: 14px 18px !important;
  }
  .media-card-title {
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
  }
  .media-sidebar {
    margin-top: 0 !important;
  }
  .media-sidebar-section {
    padding: 20px 18px !important;
    margin-bottom: 20px !important;
  }
  .media-sidebar-title {
    font-size: 0.9rem !important;
  }
  .media-tag-list {
    gap: 6px !important;
  }
  .media-tag-link {
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
    min-height: 32px;
  }
  .media-sidebar-cta {
    padding: 22px 20px !important;
  }
  .media-sidebar-cta h3 {
    font-size: 1rem !important;
  }
  .media-sidebar-cta p {
    font-size: 0.85rem !important;
  }
}

/* ---------- 5. About ページ ---------- */
@media (max-width: 768px) {
  .about-hero,
  .about-section,
  .about-mission-vision,
  .about-company-info {
    padding: 56px 0 !important;
  }
  .about-hero h1,
  .about-hero-title {
    font-size: 1.6rem !important;
    line-height: 1.5 !important;
  }
  .about-hero p,
  .about-hero-sub {
    font-size: 0.95rem !important;
    line-height: 1.85 !important;
  }
  .about-mission-vision {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .about-company-info table,
  .about-company-info th,
  .about-company-info td {
    display: block !important;
    width: 100% !important;
  }
  .about-company-info th {
    font-size: 0.78rem !important;
    color: var(--og-brown-mid, #6B4F3B);
    padding: 16px 0 4px !important;
    border: none !important;
  }
  .about-company-info td {
    font-size: 0.95rem !important;
    padding: 0 0 12px !important;
    border-bottom: 1px solid rgba(107,79,59,0.12) !important;
    line-height: 1.85 !important;
  }
}

/* ---------- 6. Service ページ ---------- */
@media (max-width: 768px) {
  .service-section {
    padding: 56px 0 !important;
  }
  .service-section-inner {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .service-section-text h2,
  .heading-lg {
    font-size: 1.5rem !important;
    line-height: 1.5 !important;
  }
  .service-section-text small {
    font-size: 0.78rem !important;
    margin-top: 6px !important;
  }
  .service-section-text .lead,
  .lead {
    font-size: 0.95rem !important;
    line-height: 1.85 !important;
  }
  .service-hero-badge {
    font-size: 0.7rem !important;
  }
}

/* ---------- 7. Contact ページ ---------- */
@media (max-width: 768px) {
  .contact-form-wrap {
    padding: 24px 20px !important;
  }
  .contact-form label {
    font-size: 0.88rem !important;
    margin-bottom: 6px !important;
  }
  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    font-size: 16px !important; /* iOS zoom防止 */
    padding: 12px 14px !important;
    min-height: 48px;
  }
  .contact-form textarea {
    min-height: 140px;
  }
  .contact-form button,
  .contact-submit {
    width: 100% !important;
    min-height: 52px !important;
    font-size: 1rem !important;
  }
}

/* ---------- 8. AI診断 / フォーム ---------- */
@media (max-width: 768px) {
  .diag-question,
  .diag-question-text {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }
  .diag-options label,
  .diag-option {
    padding: 14px 16px !important;
    font-size: 0.92rem !important;
    min-height: 52px;
    line-height: 1.5 !important;
  }
  .diag-progress {
    font-size: 0.78rem !important;
  }
  input, select, textarea {
    font-size: 16px !important; /* iOS zoom防止 */
  }
}

/* ---------- 9. フッター ---------- */
@media (max-width: 768px) {
  .site-footer {
    padding: 56px 0 32px !important;
  }
  .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .footer-brand .site-logo img {
    height: 24px !important;
  }
  .footer-tagline {
    font-size: 0.82rem !important;
    line-height: 1.85 !important;
  }
  .footer-nav-title {
    font-size: 0.78rem !important;
    margin-bottom: 12px !important;
  }
  .footer-nav-list a,
  .footer-nav a {
    font-size: 0.88rem !important;
    padding: 6px 0 !important;
    min-height: 32px;
    display: inline-block;
  }
  .footer-bottom {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: flex-start !important;
    padding-top: 24px !important;
  }
  .footer-copyright,
  .footer-legal a {
    font-size: 0.78rem !important;
  }
}

/* ---------- 10. AI診断 CTA カード ---------- */
@media (max-width: 768px) {
  .fp-cta-final h2,
  .cta-title {
    font-size: 22px !important;
    line-height: 1.5 !important;
  }
  .fp-cta-final p,
  .cta-sub {
    font-size: 0.92rem !important;
    line-height: 1.85 !important;
  }
}

/* ---------- 11. AIK (AI Knowledge) ページ ---------- */
@media (max-width: 768px) {
  .aik-hero {
    padding: 80px 0 48px !important;
  }
  .aik-hero-title {
    font-size: 1.6rem !important;
    line-height: 1.5 !important;
  }
  .aik-hero-sub {
    font-size: 0.95rem !important;
    line-height: 1.85 !important;
  }
  .aik-section {
    padding: 56px 0 !important;
  }
  .aik-section-title {
    font-size: 1.4rem !important;
    line-height: 1.5 !important;
  }
  .aik-section-subtitle {
    font-size: 0.92rem !important;
    line-height: 1.85 !important;
  }
}

/* ---------- 12. ケーススタディ ---------- */
@media (max-width: 768px) {
  .cs-stats-bar {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
  .cs-stat-num {
    font-size: 1.6rem !important;
  }
  .cs-stat-label {
    font-size: 0.75rem !important;
  }
  .case-card,
  .cs-card {
    padding: 24px 20px !important;
  }
  .case-card h3,
  .cs-card h3 {
    font-size: 1.05rem !important;
    line-height: 1.55 !important;
  }
}

/* ---------- 13. 縦書き Founder Quote モバイル ---------- */
@media (max-width: 768px) {
  .fp-about-quote {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .fp-about-quote span {
    height: 220px !important;
    letter-spacing: 0.2em !important;
    font-size: 0.92rem !important;
  }
}

/* ---------- 14. 380px以下（小型iPhone等） ---------- */
@media (max-width: 380px) {
  body {
    font-size: 15.5px;
  }
  .fp-hero-title {
    font-size: 22px !important;
  }
  .fp-section-title {
    font-size: 19px !important;
  }
  .media-header-title {
    font-size: 1.25rem !important;
  }
  .media-featured-title {
    font-size: 1rem !important;
  }
  .btn,
  .fp-btn--primary {
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
  }
  .container,
  .fp-container {
    padding: 0 16px !important;
  }
}
