:root {
  --main-blue: #007BFF;
  --hover-blue: #0056b3;
  --light-blue: #eaf4fc;
  --bg-gray: #f7fafd;
  --base-font-size: 16px;
}

/* ベース設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* iOSタップハイライトを無効化 */
}
html {
  font-size: 100%; /* 1rem = 16px */
  -webkit-text-size-adjust: 100%; /* iOS Safariのフォントサイズ自動調整を無効化 */
  -ms-text-size-adjust: 100%;
}
body {
  font-family: 'Noto Sans JP', 'Zen Maru Gothic', "ヒラギノ丸ゴ Pro", "Hiragino Maru Gothic Pro", "メイリオ", "MS Ｐゴシック", "MS PGothic", sans-serif;
  background-color: #fff;
  color: #333;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased; /* iOS Safariでのフォントレンダリング改善 */
  -moz-osx-font-smoothing: grayscale;
}
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  -webkit-user-select: none; /* iOS Safariでの画像選択を無効化 */
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ヘッダー */
header {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 999;
  max-width: 100%;
  font-size: 1rem;
  height: 3.2rem;
  overflow: visible;
  -webkit-transform: translateZ(0); /* iOS Safariでのレンダリング改善 */
  transform: translateZ(0);
}
#logo img {
  height: 2.2rem;
  display: block;
}

/* ハンバーガー */
#menu-toggle {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #333;
  line-height: 1;
  min-width: 44px; /* iOS推奨タップターゲットサイズ */
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* ナビメニュー */
#menubar {
  display: flex;
  flex-wrap: wrap;
}
#menubar ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
#menubar li a {
  text-decoration: none;
  color: #333;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.3s;
  font-weight: bold;
  font-size: 1rem;
  min-height: 44px; /* iOS推奨タップターゲットサイズ */
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
#menubar li a:hover {
  background-color: var(--light-blue);
  color: #65cbf6;
}

/* ヒーロー */
.hero {
  position: relative;
  width: 100%;
  min-height: 90vh;
  overflow: hidden;
}
.hero img,
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-caption h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-align: center;
  padding: 1rem;
}
#hero-text {
  font-family: 'Yomogi', cursive;
  font-size: clamp(2rem, 5vw, 2.5rem);
  text-align: center;
  color: #fff;
}
#hero-text span {
  opacity: 0;
  display: inline-block;
  transform: translateY(10px);
  animation: fadeInUp 0.5s forwards;
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* スライド */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 1s ease-in-out;
}
.slide.active {
  opacity: 1;
  z-index: 1;
}

/* 事業一覧 */
.business {
  padding: 4rem 5%;
  background-color: #fff;
  max-width: 100%;
}
h2 {
  text-align: center;
  font-size: clamp(1.5rem, 5vw, 2rem);
  margin-bottom: 2rem;
  position: relative;
}
h2::after {
  content: '';
  display: block;
  width: 3.75rem;
  height: 0.1875rem;
  background-color: var(--main-blue);
  margin: 0.5rem auto 0;
  border-radius: 0.1875rem;
}
.business-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.contents {
  position: relative;
  border-radius: 0.625rem;
  overflow: hidden;
  min-height: 18.75rem;
  padding: 5rem 2rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  color: #fff;
}
.contents::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 0;
}
.contents h4 {
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  color: var(--main-blue);
  padding: 0.3rem 1rem;
  border-left: 0.25rem solid var(--main-blue);
  font-size: 1.5rem;
  font-weight: bold;
  z-index: 2;
}
.contents p {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  text-align: justify;
  color: #ddd;
}
.business-list a.contents {
  text-decoration: none;
  display: block;
  color: inherit;
}
.business-list a.contents:hover {
  opacity: 0.95;
}
.sports {
  background: url('images/top/sports-bg.jpg') center/cover no-repeat;
}
.houmon {
  background: url('images/top/houmon-bg.jpg') center/cover no-repeat;
}
.liefie {
  background: url('images/top/liefie-bg.jpg') center/cover no-repeat;
}

/* 企業理念 */
.company {
  padding: 4rem 1.25rem;
  background-color: #f8f8f8;
  color: #333;
}
.company h2 {
  text-align: center;
  font-size: clamp(2rem, 5vw, 2.5rem);
  margin-bottom: 2.5rem;
  color: #2c3e50;
}
.company-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.company-photo {
  text-align: center;
  max-width: 300px;
  margin: 0 auto;
}

.company-photo img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto;
}

.president-name {
  margin-top: 0.75rem;
  font-weight: bold;
  font-size: 1.1rem;
  color: #555;
  text-align: center;
}
.company-text {
  flex: 2 1 600px;
}
.company-text h3 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  color: #34495e;
}
.company-text p {
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

/* フッター */
.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  background-color: #6a6462;
  padding: 2rem 1.25rem;
  font-size: 0.9rem;
  color: #f8f8f8;
  max-width: 100%;
}
.footer-left, .footer-right {
  flex: 1 1 300px;
  margin-left: 2.5rem;
}
.footer-right a {
  color: #f0f0f0;
  text-decoration: none;
}
.footer-right a:hover {
  text-decoration: underline;
}
footer {
  font-size: 0.75rem;
  color: #333;
  text-align: center;
  padding: 1rem;
}

.footer-right ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.footer-right li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* モバイル対応 */
@media screen and (max-width: 767px) {
  html {
    font-size: 16px; /* iOS Safariで最小フォントサイズを確保 */
    -webkit-text-size-adjust: 100%;
  }
  body {
    line-height: 1.7;
    padding: 0;
    margin: 0;
    -webkit-overflow-scrolling: touch; /* iOS Safariでのスムーズスクロール */
  }
  header {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    height: 3.2rem;
    overflow: visible;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  #logo img {
    height: 2.2rem;
  }
  .hero {
    min-height: 60vh;
    height: auto;
    padding: 0;
  }
  .hero-caption h1 {
    font-size: 1.1rem;
    padding: 0.5rem;
    -webkit-text-size-adjust: 100%;
  }
  .hero-caption {
    padding: 0.5rem;
  }
  .slide img,
  .hero img {
    height: 100%;
    min-height: 60vh;
    max-height: none;
    object-fit: cover;
  }
  .container {
    width: 98vw;
    max-width: 100vw;
    padding: 0.5rem;
    font-size: 0.95rem;
    -webkit-overflow-scrolling: touch;
  }
  .contents h4 {
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
  }
  .footer-container {
    flex-direction: column;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
    row-gap: 8px;
  }
  .footer-left,
  .footer-right {
    margin-left: 0;
    margin-bottom: 10px;
    flex: 1 1 120px;
  }
  /* ナビメニュー */
  #menubar {
    display: none;
    flex-direction: column;
    background-color: #fff;
    position: absolute;
    top: 3.5rem;
    right: 0;
    width: 80vw;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 1rem;
    border-radius: 0.625rem;
    z-index: 1000;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  #menubar.active {
    display: block;
  }
  #menubar ul {
    flex-direction: column;
    gap: 1rem;
  }
  #menubar li a {
    min-height: 44px; /* iOS推奨タップターゲットサイズ */
    padding: 0.75rem 1rem;
    font-size: 1rem;
    -webkit-text-size-adjust: 100%;
  }
  #menu-toggle {
    display: flex;
    align-items: flex-start;
    margin-top: 0.2rem;
    position: static;
    z-index: auto;
    min-width: 44px;
    min-height: 44px;
  }
}

/* iOS Safari特有の調整 */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari専用の調整 */
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* タップターゲットの最小サイズ確保 */
  a, button, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* フォーカス時のアウトライン調整 */
  a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
  }
}

@media screen and (min-width: 768px) {
  #menu-toggle {
    display: none !important;
  }
}