/* 全体共通設定 */
body {
  margin: 0;
  font-family: 'Helvetica Neue', sans-serif;
  background: #fff;
  color: #333;
}

/* ===== ヘッダー ===== */
header {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

ul a {
  text-decoration: none;
  color: #000;
}

.logo a {
  display: inline-block;
  font-size: 23px;
  color: #fff;
  text-decoration: none;
  transition: 0.3s;
  font-weight: bold;
}

.logo a:hover {
  transform: scale(1.1);
}

/* ===== イントロ ===== */
.intro {
  max-width: 900px;
}

.intro h2 {
  background: #eee;
  padding: 8px;
  border-left: 5px solid black;
}

/* ===== ジム記事 ===== */
.gym-entry {
  padding-top: 50px;
}

.gym-entry h3 {
  border-left: 5px solid black;
  padding-left: 10px;
}

.gym-entry img {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 20px 0;
}

/* ===== 情報ボックス ===== */
.info-box {
  margin-top: 30px;
}

table {
  border-collapse: collapse;
  max-width: 900px;
  width: 100%;
}

td {
  font-size: 14px;
}

.td-01 {
  width: 150px;
}

.td-02 {
  width: 350px;
}

th,
td {
  border: 2px solid #ccc;
  padding: 7px;
  text-align: left;
}

/* ===== 横スクロール防止 ===== */
html,
body {
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* ===== 記事セクション ===== */
.article-section {
  max-width: 1100px;
  margin: 40px auto;
}

.section-title {
  background: #000;
  color: #fff;
  padding: 10px 15px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
}

.icon {
  font-size: 20px;
}

.article-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.article-item {
  display: flex;
  gap: 10px;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 6px;
  transition: background 0.3s;
}

.article-item:hover {
  background: #f1f1f1;
}

.article-item img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.article-item p {
  font-size: 14px;
  margin: 0;
}

.wrapper {
  width: 94%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

.main {
  width: calc(100% - 300px);
}

.sidebar {
  width: 280px;
}

.widget+.widget {
  margin-top: 20px;
}

.widget--sticky {
  position: sticky;
  top: 20px;
  /* スクロール時にビューポートの20px位置に達すると固定 */
}


/* ===== フッター ===== */
footer {
  background-color: #373737;
  color: white;
  align-items: center;
  padding: 100px 30px;
}

.footer_nav ul {
  list-style: none;
  display: flex;
  text-align: center;
  justify-content: center;
}

.footer_nav a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  transition: 0.3s;
  display: inline-block;
  margin-left: 20px;
}

.footer_nav a:hover {
  transform: scale(1.1);
}

/* ===== レスポンシブ対応 ===== */

/* タブレットサイズ (～1024px) */
@media screen and (max-width: 1024px) {
  .wrapper {
    flex-direction: column;
    align-items: center;
  }

  .main {
    width: 100%;
  }

  .sidebar {
    width: 100%;
    margin-top: 40px;
    position: sticky;
    top: 20px;
    height: fit-content;
  }

  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
  }

  .sidebar li {
    list-style: none;
  }

  .sidebar a {
    display: block;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
  }
}

/* スマホサイズ (～768px) */
@media screen and (max-width: 768px) {
  body {
    font-size: 14px;
    line-height: 1.6;
  }

  .sidebar {
    display: none;
  }

  header {
    padding: 20px;
  }

  .logo a {
    font-size: 20px;
  }

  .intro h2 {
    font-size: 18px;
  }

  .gym-entry {
    padding-top: 30px;
  }

  .gym-entry h3 {
    font-size: 16px;
  }

  .gym-entry img {
    max-width: 100%;
    margin: 15px 0;
  }

  /* ===== info-box テーブル最適化 ===== */
  .info-box {
    width: 100%;
  }

  .info-box table {
    width: 100%;
    table-layout: fixed;
    /* 幅を親に合わせて固定 */
    font-size: 13px;
    /* 文字を小さくして表示 */
    border-collapse: collapse;
  }

  .info-box td {
    padding: 5px 6px;
    /* セルの余白を減らす */
    word-break: break-word;
    /* 長い文字列も折り返し */
  }

  .td-01,
  .td-02 {
    width: auto;
    /* 固定幅をやめて自動調整 */
  }

  /* 記事リスト */
  .article-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  footer {
    padding: 60px 20px;
  }

  .footer_nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .footer_nav a {
    margin-left: 0;
  }
}

/* スマホ小サイズ (～480px) */
@media screen and (max-width: 480px) {
  .intro h2 {
    font-size: 16px;
    padding: 6px;
  }

  .gym-entry h3 {
    font-size: 15px;
  }

  .article-item {
    flex-direction: column;
  }

  .article-item img {
    width: 100%;
    height: auto;
  }

  .sidebar h3 {
    font-size: 16px;
  }

  .sidebar a {
    font-size: 13px;
    padding: 5px 8px;
  }

  /* info-box 小画面微調整 */
  .info-box table {
    font-size: 12px;
  }

  .info-box td {
    padding: 4px 5px;
  }
}

html {
  color-scheme: only light;
}

/* ==============================
   おすすめジム・ピラティス共通カードデザイン
============================== */

.ranking {
  margin-top: 100px;
}

#ranking-pilates {
  margin-top: 100px;
  margin-bottom: 100px;
}

.card_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  justify-items: center;
  margin-top: 30px;
}

.card_container {
  display: flex;
  justify-content: center;
}

.card {
  width: 90%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  /* 正方形固定 */
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 画像部分を大きめに */
.card img.ranking_banner {
  width: 100%;
  height: 65%;
  /* ✅ 画像を広くとる */
  object-fit: cover;
  display: block;
}

/* テキスト部分をコンパクトに */
.card_content {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  overflow: hidden;
}

/* ✅ 文字サイズをカード幅に合わせて自動調整 */
.card_content h2 {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  /* 最小0.8rem〜最大1remで可変 */
  margin-bottom: 4px;
  color: #000;
  line-height: 1.3;
}

.card_content p {
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  /* カード幅で自動可変 */
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* ✅ 抜粋は2行で省略 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==============================
   レスポンシブ対応（スマホ）
============================== */
@media screen and (max-width: 768px) {

  .ranking h2 {
    text-align: center;
  }

  .card_grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .card {
    max-width: none;
    aspect-ratio: 1 / 1;
  }

  /* 自動サイズに任せるため特別な指定は不要 */
}

/* サイドバー固定 */
.sidebar {
  position: sticky;
  top: 100px;
  /* 固定開始位置（ヘッダーの高さに合わせて調整） */
  align-self: start;
  /* flex環境でも上寄せ */
  height: fit-content;
}

/* レイアウト調整（必要に応じて） */
.flex-container {
  display: flex;
  gap: 40px;
}

.content {
  flex: 1;
}

.sidebar {
  flex: 0 0 260px;
  /* サイドバーの固定幅 */
}