/*PC・スマホ共通スタイル*/
* {
  box-sizing: border-box;
}

p {
  font-size: 15px;
}

body {
  max-width: 1080px;
  margin: 0 auto;
  font-family: "Montserrat", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/*ヘッダー*/
header {
  display: flex; /*中にある要素を横並びに配置する*/
  justify-content: space-between; /* 横並びにした要素同士の感覚を均等にし、両端へ振り分けて配置*/
}

/* id="logo"がついた要素（ロゴ全体のリンクタグ）に対するスタイル */
#logo {
  margin: 20px 0;
  display: inline-flex; /* 中の要素（画像と文字）を横並びにする */
  align-items: center; /* 横並びにした要素の上下の中心を揃える */
  text-decoration: none; /* リンク特有の下線を消す */
  gap: 12px; /* アイコン画像とテキストブロックの間の余白を12px空ける */
}

/* class="logo-icon"がついた要素（ゴルフボールの画像）に対するスタイル */
.logo-icon {
  width: 45px;  /* 画像の横幅を45pxに指定する */
  height: 45px; /* 画像の高さを45pxに指定する */
  object-fit: contain; /* 縦横比を崩さずに枠内に収まるよう画像を自動調整する */
}

/* class="logo-text"がついた要素（タイトルとサブタイトルを囲む枠）に対するスタイル */
.logo-text {
  display: flex; /* 中のテキスト（メインタイトルとサブタイトル）の配置モードを有効化する */
  flex-direction: column; /* 中のテキストを上から下へ縦並びにする */
  text-align: left; /* テキストを左揃えにする */
}

/* class="main-title"がついた要素（TEAM SAHO のテキスト）に対するスタイル */
.main-title {
  font-family: 'Montserrat', sans-serif; /* フォントの種類をMontserrat（無ければ標準のサンセリフ体）に指定する */
  font-size: 30px; /* 文字サイズ30px */
  font-weight: 800; /* 文字の太さをかなり太め（800）にする */
  color: #222222; /* 文字の色を黒色にする */
  letter-spacing: 1px; /* 文字と文字の間の間隔を1px広げる */
  line-height: 1.1; /* 行の高さ（上下の詰まり具合）を1.1倍に調整する */
}

/* class="sub-title"がついた要素（- Official Site - のテキスト）に対するスタイル */
.sub-title {
  font-size: 15px; 
  color: #222222; /* 文字の色 黒 */
  letter-spacing: 1.5px; /* 文字と文字の間の間隔を1.5px広げてスタイリッシュにする */
  margin-top: 2px; /* 上のメインタイトルとの間に2pxの余白を作る */
}

/*ナビゲーションのレイアウト*/
#nav-pc {
  font-size: 20px;
  margin-top: 15px;
}

#nav-pc ul {
  display: flex;
  padding-left: 0;
}

#nav-pc li {
  list-style: none;
}

/* ナビゲーションのリンクの装飾設定（ホバー時アンダーラインアニメーション対応） */
#nav-pc a {
  position: relative;
  text-decoration: none;
  margin-left: 20px;
  color: #222222;
  transition: opacity 0.3s ease;
}

#nav-pc a:hover {
  text-decoration: none;
  opacity: 0.6;
}

#nav-pc a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #222222;
  transition: width 0.3s ease;
}

#nav-pc a:hover::after {
  width: 100%;
}

/* スマホ用ナビを非表示 */
#nav-sp, #menu-sp {
  display: none;
}

/*メインビジュアル*/
#main-visual {
  position: relative;
  height: 400px;
  width: 100%;
  overflow: hidden; /* 画像のはみ出し防止 */
}

/* 背景画像 */
#main-visual img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像比率を保ったまま領域を埋める */
  z-index: 1;
}

/* 画像の上に重ねるグラデーション */
#main-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 26, 114, 0.1) 100%
  );
  z-index: 2;
}

#main-message {
  color: #ffffff;
  position: absolute;
  top: 40px;
  left: 40px;
  max-width: 620px;
  z-index: 3;
}

#main-message h1 {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#main-message p {
  font-size: 1.1rem;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* PC用・スマホ用の表示制御デフォルト */
.sp-only {
  display: none;
}

.pc-only {
  display: block;
}

/*-----------------
  CONTENTSセクション
-----------------*/
#contents {
  margin-top: 50px;
  padding: 0 20px;
}

#contents h2 {
  font-size: 30px;
  color: #222222;
}

.contents-container {
  display: flex; 
  justify-content: center;
  gap: 120px;
  align-items: flex-start;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.contents-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: #222222;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.contents-icon:hover {
  transform: translateY(-8px);
  opacity: 0.6;
  cursor: pointer;
}

.contents-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.contents-icon:hover .contents-img {
  transform: scale(1.08);
}

.contents-icon h3 {
  font-size: 20px;
  margin: 0;
}

/* コピーライト */
.copyright {
  font-size: 18px;
  color: #666666;
  margin-top: 80px;
  text-align: right;
}

/*-----------------
  PROFILE セクション
-----------------*/
#profile {
  padding: 40px 20px 80px;
}

.page-title {
  font-family: "Montserrat", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 36px;
  font-weight: normal;
  color: #222222;
  margin-bottom: 40px;
}

.profile-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.profile-text {
  flex: 1;
  max-width: 480px;
}

.profile-name {
  font-size: 24px;
  font-weight: bold;
  color: #222222;
  margin-bottom: 27px;
}

.profile-spec {
  display: grid;
  grid-template-columns: 100px 1fr;
  row-gap: 12px;
  font-size: 16px;
  color: #333333;
  margin-bottom: 30px;
}

.profile-spec dt {
  font-weight: normal;
}

.profile-spec dd {
  margin: 0;
}

.profile-sns a {
  display: inline-block;
  transition: opacity 0.3s ease;
}

.profile-sns a:hover {
  opacity: 0.6;
}

.profile-sns img {
  width: 28px;
  height: 28px;
}

.profile-image {
  flex: 1;
  max-width: 520px;
}

.profile-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/*-----------------
  CLUB SETTING 調整
-----------------*/

#club-setting-section .profile-container {
  flex-direction: row-reverse;
}

#club-setting-section .profile-spec {
  row-gap: 30px;
  font-size: 19px;
  line-height: 1.8;
}

/*-----------------
  RESULT セクション
-----------------*/
#result-section {
  padding: 40px 20px 80px;
}

.accordion-item {
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: 15px 20px;
  background-color: #f8f9fa;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
  color: #222222;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background-color: #eee;
}

.accordion-content {
  display: none;
  padding: 20px;
  background-color: #ffffff;
}

.accordion-content.open {
  display: block;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  text-align: center;
  font-size: 14px;
}

.result-table th,
.result-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #e0e0e0;
}

.result-table th {
  background-color: #f1f3f5;
  color: #333333;
  font-weight: bold;
  white-space: nowrap;
}

.score-bold {
  font-weight: bold;
  color: #000000;
}

.btn-detail {
  padding: 6px 12px;
  background-color: #222222;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-detail:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/*-----------------
  モーダルウィンドウ
-----------------*/
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: #ffffff;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 20px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666666;
}

.detail-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
}

.detail-table th,
.detail-table td {
  border: 1px solid #e0e0e0;
  padding: 8px 2px;
  word-break: break-all;
}

.detail-table thead th,
.detail-table tbody th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.detail-table th:first-child {
  width: 18%;
}

.modal-review {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed #e0e0e0;
}

/* ============================================================
   試合結果カード（DynamoDB API連携データ）のスタイル
   ============================================================ */
#results-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}

.match-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.match-card h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #333;
}

.match-card p {
  font-size: 0.95rem;
  color: #555;
  margin: 6px 0;
  line-height: 1.6;
}

.match-card strong {
  color: #222;
}

/* ==================================================
   レスポンシブ最終調整 (タブレット & スマホ)
   ================================================== */

/* --- タブレット表示用（1024px以下）--- */
@media screen and (max-width: 1024px) {
  main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .page-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }
}

/* --- スマホ表示用（767px以下）--- */
@media screen and (max-width: 767px) {
  body {
    font-size: 14px;
    line-height: 1.6;
  }

  /* ヘッダー・ナビゲーション */
  #nav-pc {
    display: none;
  }

  header {
    padding: 0 15px;
  }

  #menu-sp {
    display: block;
    background-color: transparent;
    float: right;
    padding: 0;
    border: none;
  }

  #menu-sp img {
    width: 40px;
    height: 40px;
  }

  #nav-sp {
    background-color: #222222;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 100;
  }

  /* 閉じるボタンのサイズ・位置調整 */
  #close {
    position: absolute;
    top: 25px;
    right: 15px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
  }

  #close img {
    width: 28px;
    height: 28px;
  }

  #nav-sp nav ul {
    padding-left: 0;
  }

  #nav-sp nav li {
    list-style: none;
  }

  /* スマホナビ内のロゴ調整（中央寄せ） */
  #nav-sp #logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    margin: 40px auto 20px;
    width: 100%;
    padding: 0 50px;
  }

  .logo-icon-sp {
    width: 45px;
    height: 45px;
    object-fit: contain;
  }

  #nav-sp .logo-text {
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  #nav-sp .main-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
    line-height: 1.1;
  }

  #nav-sp .sub-title {
    font-size: 14px;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin-top: 2px;
  }

  #nav-sp nav ul li:not(:first-child) a {
    display: block;
    color: #ffffff;
    padding: 40px 0;
    text-decoration: none;
    text-align: center;
    font-size: 25px;
    height: 44px;
  }

  #nav-sp nav ul li:not(:first-child) a:hover {
    text-decoration: underline;
  }

  /* メインビジュアル */
  #main-visual {
    height: 330px;
  }

  #main-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.2) 60%,
      rgba(0, 0, 0, 0) 100%
    );
  }

  #main-message {
    top: 20px;
    left: 20px;
  }

  #main-visual h1 {
    font-size: 24px;
    line-height: 1.2;
    margin-bottom: 4px;
  }

  /* スマホ用改行と非表示設定（強力に適用） */
  .sp-only {
    display: inline !important;
  }

  .pc-only {
    display: none !important;
  }

  /* CONTENTS セクション */
  #contents h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 35px;
  }

  .contents-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px 20px;
    max-width: 400px;
    margin: 0 auto;
    padding: 0;
  }

  .contents-img {
    width: 90px;
    height: 90px;
  }

  .contents-icon h3 {
    font-size: 20px;
  }

  /* PROFILE / CLUB SETTING セクション（画像を上に配置） */
  #profile, #result-section {
    padding: 20px 15px 50px;
  }

  .profile-container,
  #club-setting-section .profile-container {
    flex-direction: column-reverse; /* スマホでは画像を上に配置 */
    gap: 24px;
  }

  .profile-text,
  .profile-image {
    max-width: 100%;
    width: 100%;
  }

  .profile-image img {
    width: 100%;
    height: auto;
  }

  .profile-spec {
    grid-template-columns: 90px 1fr;
    row-gap: 10px;
    font-size: 14px;
  }

  #club-setting-section .profile-spec {
    row-gap: 16px;
    font-size: 15px;
  }

  /* RESULT テーブル・アコーディオン・モーダル */
  .accordion-header {
    font-size: 16px;
    padding: 12px 15px;
  }

  .table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eee;
    margin-bottom: 16px;
  }

  .result-table {
    min-width: 600px;
    font-size: 12px;
  }

  .result-table th,
  .result-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  .modal-content {
    padding: 25px 15px;
  }
}