/* ===== カラー変数 ===== */
:root {
  --accent:      #FFD600;   /* バナーの黄色 */
  --accent-dark: #E6BE00;
  --dark:        #1A1A1A;
  --dark2:       #2C2C2C;
  --text:        #1A1A1A;
  --muted:       #666;
  --bg:          #F4F4F4;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Helvetica Neue', Arial, 'Hiragino Sans', 'Meiryo', sans-serif; background: var(--bg); color: var(--text);   display: flex; flex-direction: column; min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; }

.container { max-width: 1100px; margin: 0 auto; }

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #333;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--dark);
  border: 2px solid var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
}
.logo-img { height: 64px; width: auto; display: block; }
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Language Switcher ===== */
.lang-switcher {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 20px;
  overflow: hidden;
}
.lang-btn {
  padding: 4px 12px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  transition: background 0.2s, color 0.2s;
}
.lang-btn.active {
  background: var(--dark);
  color: var(--accent);
}
.lang-btn:hover:not(.active) { background: #f0f0f0; }

/* ===== Hamburger Button ===== */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.3s;
}

/* ===== Hero Banner ===== */
.hero-banner {
  width: 100%;
  overflow: hidden;
  background: var(--dark);
}
.hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* ===== Category Buttons ===== */
.category-section {
  background: var(--dark);
  padding: 10px 12px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cat-btn {
  background: var(--dark2);
  color: #fff;
  border: 1px solid #3a3a3a;
  padding: 10px 4px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.1s;
}
.cat-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--dark);
}
.cat-btn:active { transform: scale(0.96); }
a.cat-btn { display: flex; text-decoration: none; }
.cat-icon {
  font-size: 20px;
  line-height: 1;
}

/* ===== Recommended Items ===== */
.recommend-section {
  background: #fff;
  padding: 10px 12px;
  border-bottom: 1px solid #e8e8e8;
}
.recommend-title {
  display: inline-block;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
  background: linear-gradient(transparent 55%, var(--accent) 55%);
  padding: 0 4px 0 0;
  line-height: 1.5;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.recommend-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: background 0.18s, transform 0.1s;
}
.recommend-btn:hover { background: var(--accent); }
.recommend-btn:active { transform: scale(0.96); }
.recommend-icon {
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}
.recommend-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Search ===== */
.search-section {
  background: #fff;
  padding: 8px 12px;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid #e8e8e8;
}
.search-bar {
  display: flex;
  gap: 6px;
  max-width: 600px;
}
.search-bar input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  height: 36px;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--dark); }
.search-submit {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--dark);
  color: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.search-submit:hover { background: var(--dark2); }
.search-submit svg { width: 16px; height: 16px; }

/* ===== Main Content ===== */
main { background: #f5f5f5;   flex: 1 0 auto;
}
.main-inner { padding: 16px; }

section { margin-bottom: 24px; }
section h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  color: var(--text);
}

/* ===== Article Slider ===== */
.articles-section { overflow: hidden; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0; }
.section-header h2 { margin-bottom: 0; }
.see-more-link { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color 0.2s; }
.see-more-link:hover { color: var(--dark); }
.articles-slider-wrap {
  margin: 0 -16px;
}
.articles-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 12px;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.articles-slider:active { cursor: grabbing; }
.articles-slider::-webkit-scrollbar { display: none; }
.articles-slider a, .articles-slider img {
  -webkit-user-drag: none;
  user-drag: none;
  draggable: false;
}
.articles-slider .article-card {
  flex: 0 0 calc(100% / 2.5);
  scroll-snap-align: start;
  min-width: 0;
}
.article-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: box-shadow 0.2s;
  user-select: none;
}
.article-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.article-card .card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  pointer-events: none;
}
.article-card .card-body {
  padding: 8px 10px 10px;
}
.article-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.article-card .card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent, #f0c000);
  color: #1a1a1a;
  padding: 2px 7px;
  border-radius: 20px;
}
.article-card .card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.article-card .card-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== Popular Categories ===== */
/* ===== 特集バナー ===== */
.feature-section h2 { margin-bottom: 12px; }
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-banner {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  transition: opacity .2s, transform .2s;
  background: #eee;
}
.feature-banner:hover { opacity: .92; transform: translateY(-2px); }
.feature-banner img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

/* ===== Ranking Tabs ===== */
.ranking-tabs-header {
  display: flex;
  border-bottom: 2px solid #e8e8e8;
  margin-bottom: 12px;
}
.ranking-tab-btn {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #aaa;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.ranking-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.ranking-tab-btn:hover:not(.active) { color: #555; }
.ranking-tab-pane { display: none; }
.ranking-tab-pane.active { display: block; }

/* ===== Ranking ===== */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.2s;
}
.ranking-item:hover { transform: translateX(4px); }
.rank-badge {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}
.rank-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-num {
  font-size: 18px;
  font-weight: 900;
  color: #bbb;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.rank-num.gold {
  position: relative;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(255,160,0,0.5);
}
.rank-num.gold::before {
  content: '👑';
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  line-height: 1;
}
.rank-num.silver {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e0e0 0%, #9E9E9E 100%);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(158,158,158,0.4);
}
.rank-num.bronze {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFCC80 0%, #A1887F 100%);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(161,136,127,0.35);
}
.ranking-item:first-child { padding-top: 22px; }
.rank-title { font-size: 14px; color: #333; font-weight: 500; }

/* ===== Footer ===== */
footer {
  background: #2c2c2c;
  color: #ccc;
  margin-top: 8px;
}
.footer-inner {
  padding: 32px 16px 16px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.footer-logo .logo-icon { background: var(--dark); border-color: var(--accent); }
.footer-logo span { color: #fff; font-weight: 700; font-size: 16px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.footer-col h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col ul { list-style: none; }
.footer-col ul li + li { margin-top: 6px; }
.footer-col ul li a {
  color: #aaa;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: #666;
}

/* ===== Hamburger Drawer ===== */
.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
}
.menu-backdrop.open { display: block; }
.menu-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: #fff;
  z-index: 200;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.menu-drawer.open { right: 0; }
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
}
.menu-header span { font-weight: 700; font-size: 16px; }
.menu-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #666;
  line-height: 1;
}
.menu-body {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

/* ===== Menu Category Accordion ===== */
.menu-cat-item {
  border-bottom: 1px solid #f0f0f0;
}
.menu-cat-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.menu-cat-header:hover { background: #f8f8f8; }
.menu-cat-icon {
  width: 36px;
  height: 36px;
  background: var(--dark);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.menu-cat-icon svg { width: 20px; height: 20px; }
.menu-cat-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.menu-cat-badge {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.menu-cat-name {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}
.menu-cat-arrow {
  font-size: 14px;
  color: #aaa;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.menu-cat-header[aria-expanded="true"] .menu-cat-arrow {
  transform: rotate(-180deg);
}
.menu-sub-list {
  list-style: none;
  overflow: hidden;
  max-height: 400px;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px 10px 62px;
  background: #fafafa;
}
.menu-sub-list.closed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.menu-sub-list li + li { margin-top: 2px; }
.menu-sub-list li a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: #555;
  border-bottom: 1px solid #eee;
  transition: color 0.2s;
}
.menu-sub-list li:last-child a { border-bottom: none; }
.menu-sub-list li a:hover { color: var(--dark); font-weight: 600; }

/* ===== PC Layout (768px+) ===== */
@media (min-width: 768px) {
  .header-inner { padding: 6px 24px; }
  .logo { font-size: 20px; }

  .hero-img { aspect-ratio: 152 / 49; object-position: center 40%; }

  .category-section { padding: 12px 24px; }
  .category-grid { grid-template-columns: repeat(9, 1fr); gap: 8px; }
  .cat-btn { font-size: 13px; padding: 12px 6px; }
  .cat-icon { font-size: 22px; }

  .recommend-section { padding: 12px 24px; }
  .recommend-btn { font-size: 14px; padding: 16px 12px; }
  .recommend-icon { font-size: 32px; }

  .search-section { padding: 10px 24px; }

  .main-inner { padding: 24px; }

  .articles-slider-wrap { margin: 0 -24px; }
  .articles-slider { padding: 4px 24px 12px; scroll-padding-left: 24px; }
  .articles-slider .article-card { flex: 0 0 calc(100% / 3.5); }

.ranking-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .footer-inner { padding: 40px 24px 20px; }
  .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 32px; }
}


/* スマホのみ「トレーニング／グッズ」間の改行を表示 */
.sp-br { display: none; }
@media (max-width: 767px) { .sp-br { display: inline; } }
