/* 進星ユニット株式会社 - カスタムCSS */

/* 基本的なボックスサイジング設定 */
* {
  box-sizing: border-box;
}

/* ビューポート幅の/* プロジェクトカードのスタイル */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* モバイル版プロジェクトカード */
.project-card-mobile {
  width: 288px; /* w-72 */
  flex-shrink: 0;
  background: white;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card-mobile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-card-mobile .w-72 {
  width: 100%;
  height: 176px; /* h-44 */
}

/* 横スクロールの調整 */
.overflow-x-auto {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.overflow-x-auto::-webkit-scrollbar {
  display: none;
}ml, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ページ遷移時の確実なトップスクロール */
.page-transition {
  scroll-behavior: auto !important;
}

/* 遷移中のスクロール無効化 */
.scroll-lock {
  overflow: hidden !important;
  scroll-behavior: auto !important;
}

/* 遷移時のスクロール位置強制固定 */
.force-top-scroll {
  scroll-behavior: auto !important;
}

.force-top-scroll * {
  scroll-behavior: auto !important;
}

/* 固定ヘッダー */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(240, 243, 244, 0.8);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100vw;
}

/* メインコンテンツにパディングを追加してヘッダーと重ならないようにする */
main {
  padding-top: 80px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* フォント設定 */
body {
  font-family: "Work Sans", "Noto Sans", sans-serif;
}

/* ページ切り替えアニメーション */
.page-content {
  transition: opacity 0.3s ease-in-out;
}

.page-content.hidden {
  display: none;
}

/* ナビゲーションホバー効果 */
.nav-link {
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #19a1e5;
}

/* ボタンホバー効果 */
.btn-primary {
  background-color: #19a1e5;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: #1589c7;
}

/* カードホバー効果 */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* プロジェクトカードホバー効果 */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* グラデーション背景 */
.gradient-bg {
  background: linear-gradient(135deg, #19a1e5 0%, #1589c7 100%);
}

/* モバイルナビゲーション */
.desktop-nav {
  display: flex;
}

.mobile-nav {
  display: none;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: white;
  padding: 1.5rem;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-nav-overlay:not(.hidden) .mobile-nav-menu {
  transform: translateX(0);
}

.mobile-nav-link {
  transition: all 0.2s ease;
  border-radius: 0.75rem;
  font-weight: 500;
}

.mobile-nav-link:hover {
  background-color: #f5f5f5;
}

/* 採用情報ボタンの特別なスタイル */
.careers-btn {
  background-color: #19a1e5 !important;
  color: white !important;
  border: none;
  font-weight: 700;
}

.careers-btn:hover {
  background-color: #1589c7 !important;
}

.careers-btn.active {
  background-color: #1589c7 !important;
  box-shadow: 0 0 0 2px rgba(25, 161, 229, 0.3);
}

/* モバイル採用情報ボタン */
.mobile-nav-link.careers-btn {
  background-color: #19a1e5 !important;
  color: white !important;
}

.mobile-nav-link.careers-btn:hover {
  background-color: #1589c7 !important;
}

/* レスポンシブ調整 */
@media (max-width: 1200px) {
  .px-40 {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (max-width: 1024px) {
  .px-40 {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 800px) {
  /* 800px以下での横幅制御 */
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  /* ヘッダーの調整 - 会社名以外を非表示 */
  .desktop-nav {
    display: none !important;
  }
  
  .mobile-nav {
    display: flex !important;
  }
  
  /* 会社名のサイズ調整 */
  .company-name {
    font-size: 1rem;
    font-weight: 700;
  }
  
  /* ロゴサイズの調整 */
  .size-8 {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
  
  /* ヘッダーのパディング調整 */
  header {
    padding: 0.75rem 1rem;
  }
  
  .layout-content-container {
    max-width: 100%;
    width: 100%;
    padding: 0 1rem;
  }
  
  /* 800px以下での縦余白の調整 */
  .py-5 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  /* ホーム画面のサービス内容セクションの調整 */
  .home-section-spacing h2 {
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  /* サービス内容グリッドの調整 */
  .home-services-grid {
    padding: 0.5rem !important;
  }
  
  /* 最近のプロジェクトセクションの調整 */
  .home-projects h2 {
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  /* ヒーローセクション高さ制御 */
  .hero-container > div > div {
    min-height: 180px !important;
  }
  
  /* ヒーローセクション内部のギャップとパディング調整 */
  .hero-container .flex.flex-col.gap-4 {
    gap: 0.75rem !important;
  }
  
  .hero-container .flex.flex-col.gap-2 {
    gap: 0.5rem !important;
  }
  
  /* ヒーローセクションのパディング削減 */
  .hero-container > div > div {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    gap: 0.75rem !important;
  }
  
  /* ヒーローセクション内部の調整 */
  .hero-container > div {
    padding: 0.5rem !important;
  }
  
  .px-40 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* グリッドの調整 */
  .grid {
    width: 100%;
    max-width: 100%;
  }
  
  /* カードコンテナの調整 */
  .service-card,
  .project-card {
    width: 100%;
    max-width: 100%;
  }
  
  /* フレックスコンテナの調整 */
  .flex {
    flex-wrap: wrap;
  }
  
  /* 画像の調整 */
  img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 768px) {
  /* ヘッダー調整 */
  header {
    padding: 1rem;
    position: fixed;
    background-color: rgba(255, 255, 255, 0.98);
  }
  
  /* モバイルでのメインコンテンツのパディング調整 */
  main {
    padding-top: 70px;
  }
  
  .layout-container {
    padding: 0;
  }
  
  /* パディング調整 */
  .px-40 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  /* ヒーローセクション調整 */
  .hero-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  /* テキストサイズ調整 */
  .text-4xl {
    font-size: 2rem !important;
  }
  
  .text-3xl {
    font-size: 1.75rem !important;
  }
  
  .text-2xl {
    font-size: 1.5rem !important;
  }
  
  .text-xl {
    font-size: 1.25rem !important;
  }
  
  .text-lg {
    font-size: 1.125rem !important;
  }
  
  /* サービスグリッド調整 */
  .service-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* プロジェクトグリッド調整 */
  .project-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* ヘッダーのモバイル調整 */
  .company-name {
    font-size: 1.125rem;
    font-weight: 700;
  }
  
  /* フッターのモバイル調整 */
  footer .flex-wrap {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  footer .min-w-40 {
    min-width: auto;
    text-align: center;
    padding: 0.5rem 0;
  }
  
  /* ボタンサイズ調整 */
  button, .btn-primary {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  /* カード調整 */
  .service-card,
  .project-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 640px) {
  /* 小画面での調整 */
  html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .px-40 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .text-4xl {
    font-size: 1.875rem !important;
  }
  
  .text-3xl {
    font-size: 1.625rem !important;
  }
  
  .text-2xl {
    font-size: 1.375rem !important;
  }
  
  .text-xl {
    font-size: 1.125rem !important;
  }
  
  /* カードのモバイル調整 */
  .service-card,
  .project-card {
    margin: 0 0 1rem 0;
    border-radius: 0.75rem;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
  }
  
  /* グリッドのモバイル調整 */
  .grid {
    gap: 0.75rem;
    width: 100%;
  }
  
  /* 横スクロールコンテナの調整 */
  .overflow-x-auto {
    width: 100%;
    max-width: 100vw;
  }
  
  /* フレックスアイテムの調整 */
  .flex-shrink-0 {
    min-width: 260px;
    max-width: 90vw;
  }
  
  /* ボタンのモバイル調整 */
  .flex-wrap.gap-3 {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .flex-wrap.gap-2 {
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
  }
  
  /* フォントサイズの調整 */
  .company-name {
    font-size: 1rem;
    font-weight: 700;
  }
  
  /* プロジェクトフィルターボタン調整 */
  .project-filter {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
    flex: 1;
    max-width: none;
  }
  
  /* ヘッダーサイズ調整 */
  header {
    padding: 0.875rem 1rem;
    width: 100vw;
    max-width: 100vw;
  }
  
  #mobile-menu-btn {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  /* 極小画面での調整 */
  html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .px-40 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .mobile-nav-menu {
    width: 100vw;
    max-width: 100vw;
    right: 0;
    padding: 1.5rem 1rem;
  }
  
  /* モバイル極小画面でのヘッダー調整 */
  header {
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
  }
  
  main {
    padding-top: 60px;
    width: 100vw;
    max-width: 100vw;
  }
  
  /* レイアウトコンテナの調整 */
  .layout-content-container {
    max-width: 100%;
    width: 100%;
    padding: 0 0.5rem;
  }
  
  /* カード調整 */
  .service-card {
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.75rem 0;
  }
  
  /* モバイル版プロジェクトカードの調整 */
  .project-card-mobile {
    width: 280px;
    padding: 0.875rem;
  }
  
  .project-card-mobile .w-72 {
    width: 100%;
    height: 160px;
  }
  
  /* グリッドの調整 */
  .grid {
    width: 100%;
    gap: 0.5rem;
  }
  

  
  /* ボタン調整 */
  button, .btn-primary {
    min-height: 48px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    width: 100%;
    max-width: 100%;
  }
  
  /* プロジェクトフィルター調整 */
  .project-filter {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    flex: 1;
    min-width: 0;
  }
  
  /* テキストサイズ調整 */
  .text-4xl {
    font-size: 1.5rem !important;
  }
  
  .text-3xl {
    font-size: 1.375rem !important;
  }
  
  .text-2xl {
    font-size: 1.125rem !important;
  }
  
  .text-xl {
    font-size: 1rem !important;
  }
  
  .text-lg {
    font-size: 0.95rem !important;
  }
  
  .text-base {
    font-size: 0.875rem !important;
  }
  
  /* 極小画面での調整 */
  .company-name {
    font-size: 0.75rem;
    font-weight: 700;
  }
  
  /* フッター調整 */
  footer {
    padding: 1rem 0.5rem;
    width: 100%;
  }
}

/* 追加のモバイル最適化 */

/* スムーススクロール */
html {
  scroll-behavior: smooth;
}

/* 共通のモバイル最適化 */
@media (max-width: 768px) {
  /* ビューポートの高さ調整 */
  .min-h-screen {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
  
  /* モバイルでのタップハイライト除去 */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* カードのモバイル最適化 */
  .service-card,
  .project-card {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .service-card:active,
  .project-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* ボタンのタッチ最適化 */
  button,
  .btn-primary,
  .nav-link {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  /* モバイルナビゲーションのアニメーション改善 */
  .mobile-nav-link {
    border-radius: 12px;
    margin-bottom: 4px;
  }
  
  .mobile-nav-link:active {
    transform: scale(0.98);
    background-color: #f8f9fa;
  }
  
  /* スクロールバーのモバイル調整 */
  .overflow-x-auto {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .overflow-x-auto::-webkit-scrollbar {
    display: none;
  }
}

/* 横画面モバイル対応 */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  header {
    padding: 0.5rem 1rem;
  }
  
  .company-name {
    font-size: 0.875rem;
  }
  
  .mobile-nav-menu {
    padding: 1rem;
  }
  
  .mobile-nav-link {
    padding: 0.75rem;
  }
}

/* タッチデバイス用の調整 */
@media (hover: none) {
  .service-card:hover,
  .project-card:hover {
    transform: none;
    box-shadow: none;
  }
  
  .nav-link:hover {
    color: inherit;
  }
  
  /* タップ時の視覚フィードバック */
  .service-card:active,
  .project-card:active,
  .nav-link:active,
  button:active {
    opacity: 0.7;
    transition: opacity 0.1s ease;
  }
}

/* アクセシビリティ */
.nav-link:focus,
button:focus {
  outline: 2px solid #19a1e5;
  outline-offset: 2px;
}

/* 高解像度画面対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 高解像度での調整があれば追加 */
}

/* スクロールバーカスタマイズ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #19a1e5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1589c7;
}

/* モバイルでのスクロールバー非表示 */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 0px;
    background: transparent;
  }
}

/* 横幅制御の強化 */
.layout-container {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.page-content {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* 全体のコンテナ制御 */
.relative.flex.size-full.min-h-screen.flex-col.bg-white.group\/design-root.overflow-x-hidden {
  width: 100% !important;
  max-width: 100vw !important;
}

/* グリッドとフレックスアイテムの制御 */
.grid > * {
  min-width: 0;
  max-width: 100%;
}

.flex > * {
  min-width: 0;
}

/* 画像とメディアの制御 */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* テーブルの横スクロール対応 */
table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

@media (max-width: 800px) {
  table {
    font-size: 0.875rem;
  }
}

/* ナビゲーション状態の明確化 */
.nav-link.active,
.nav-link[data-page].active {
  color: #19a1e5 !important;
  font-weight: 600;
}

.nav-link:not(.active) {
  color: #111518 !important;
}

/* フッターナビゲーション */
footer .nav-link.active {
  color: #19a1e5 !important;
}

footer .nav-link:not(.active) {
  color: #637c88 !important;
}

/* モバイルナビゲーション */
.mobile-nav-link.active {
  color: #19a1e5 !important;
  background-color: rgba(25, 161, 229, 0.1);
}

/* 確実なスクロール制御 */
.force-scroll-top {
  scroll-behavior: auto !important;
}

/* セクションの横幅制御 */
.services-section,
.projects-section,
.quote-section {
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
}

/* サービスカードとプロジェクトカードの横幅制御 */
.service-card,
.project-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* プロジェクトセクションの横スクロール改善 */
.projects-section .overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.projects-section .overflow-x-auto::-webkit-scrollbar {
  display: none;
}

/* プロジェクトカードのモバイル調整 */
@media (max-width: 640px) {
  .projects-section .flex.items-start {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .project-card {
    min-width: 260px;
    max-width: 260px;
  }
  
  .projects-section {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 480px) {
  .project-card {
    min-width: 240px;
    max-width: 240px;
  }
  
  .projects-section .flex.items-start {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    gap: 1rem;
  }
}

/* グリッドの横幅制御 */
.services-section .grid,
.projects-section .flex {
  width: 100%;
  max-width: 100%;
}

/* コンテナの余白調整 */
@media (min-width: 1280px) {
  .services-section,
  .projects-section,
  .quote-section {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1536px) {
  .services-section,
  .projects-section,
  .quote-section {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

/* ===== プロジェクトセクション レスポンシブ最適化 ===== */

/* タブレット表示の調整 */
@media (min-width: 768px) and (max-width: 1023px) {
  .project-card {
    padding: 1rem;
  }
  
  .project-card h3 {
    font-size: 1rem;
    line-height: 1.4;
  }
  
  .project-card p {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* デスクトップ表示の最適化 */
@media (min-width: 1024px) {
  .project-card {
    padding: 1.25rem;
  }
  
  .project-card h3 {
    font-size: 1.125rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
  }
  
  .project-card p {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

/* コンテナの最大幅制御 */
.container {
  max-width: 1280px;
}

@media (min-width: 1400px) {
  .container {
    max-width: 1536px;
  }
}

/* セクション間の統一感 */
.services-section, .projects-section {
  background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
}

.services-section:nth-child(even), .projects-section:nth-child(even) {
  background: white;
}
