/*
Theme Name: CORE Japan
Theme URI: https://corebodytemp.jp/
Author: CORE Japan (正規代理店)
Description: corebodytemp.com のデザインを踏襲した日本語公式サイト用テーマ。購入ボタンは外部Shopifyカート（Winspace）に接続。
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: core-jp
*/

:root {
  --core-green: #37ca95;
  --core-green-dark: #1c966b;
  --core-black: #121212;
  --core-gray: #f5f5f5;
  --core-text: #1a1a1a;
  --max-w: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--core-text);
  line-height: 1.8;
  font-size: 16px;
  background: #fff;
}

img { max-width: 100%; height: auto; }
a { color: var(--core-green-dark); }

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 800;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ボタン */
.btn {
  display: inline-block;
  background: var(--core-black);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 14px 34px;
  border-radius: 4px;
  transition: background .2s;
}
.btn:hover { background: var(--core-green-dark); color: #fff; }
.btn--green { background: var(--core-green); color: #103828; }
.btn--green:hover { background: var(--core-green-dark); color: #fff; }
.btn--outline { background: transparent; border: 2px solid var(--core-black); color: var(--core-black); }

/* 告知バー */
.announce-bar {
  background: var(--core-green);
  color: #103828;
  text-align: center;
  font-size: .875rem;
  font-weight: 700;
  padding: 8px 16px;
}
.announce-bar a { color: inherit; }

/* ヘッダー */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
}
.site-logo { font-size: 1.5rem; font-weight: 900; letter-spacing: .04em; text-decoration: none; color: var(--core-black); }
.site-logo img { max-height: 40px; width: auto; display: block; }
.main-nav { flex: 1; }
.main-nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: var(--core-text); font-weight: 600; font-size: .95rem; }
.main-nav a:hover { color: var(--core-green-dark); }
.header-cta { white-space: nowrap; }

/* ヒーロー */
.hero {
  background: linear-gradient(120deg, #0e2b21 0%, #123f2f 55%, #1c966b 100%);
  color: #fff;
  padding: 90px 0;
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; }
.hero p { font-size: 1.15rem; max-width: 34em; }
.hero-visual { text-align: center; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* 写真背景ヒーロー（本国トップ準拠） */
.hero--photo {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 110px 0;
}
.hero--photo::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,20,15,.78) 0%, rgba(10,20,15,.45) 50%, rgba(10,20,15,.15) 100%);
}
.hero--photo .wrap { position: relative; z-index: 1; }
.hero--photo .hero-visual img { max-height: 460px; width: auto; filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }

/* メディア掲載ロゴ帯 */
.press-bar { background: var(--core-black); padding: 22px 0; }
.press-bar ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 36px;
  align-items: center; justify-content: center;
}
.press-bar a {
  color: #d8d8d8; text-decoration: none;
  font-weight: 800; letter-spacing: .06em; font-size: 1.05rem;
  opacity: .8; transition: opacity .2s;
}
.press-bar a:hover { opacity: 1; color: #fff; }
.press-bar img { height: 20px; width: auto; display: block; image-rendering: -webkit-optimize-contrast; }

/* セクション共通 */
.section { padding: 80px 0; }
.section--gray { background: var(--core-gray); }
.section--dark { background: var(--core-black); color: #fff; }
.section--dark h2 { color: #fff; }
.section-lead { max-width: 46em; margin: 0 auto 2em; text-align: center; }
.center { text-align: center; }

/* 2カラム（Train Hot / Race Cool） */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split + .split { margin-top: 72px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split video, .split img { border-radius: 8px; width: 100%; }

/* 数値スタッツ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }
.stat-num { font-size: 3.5rem; font-weight: 900; color: var(--core-green); line-height: 1; }
.stat-label { font-weight: 600; margin-top: .5em; }
.stat-src { font-size: .8rem; }

/* 推薦の声 */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 900px) { .quotes { grid-template-columns: 1fr; } }
.quote-card { background: #fff; border-radius: 8px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.06); color: var(--core-text); }
.quote-card h3 { font-size: .95rem; letter-spacing: .05em; color: var(--core-green-dark); }
.quote-card blockquote { margin: 0; font-size: .95rem; color: var(--core-text); }
.quote-card p, .quote-card li, .quote-card ul { color: var(--core-text); }

/* 暗い背景セクション内でも、白いカードの中の文字は濃色にする */
.section--dark .quote-card,
.section--dark .quote-card p,
.section--dark .quote-card li,
.section--dark .quote-card blockquote { color: var(--core-text); }
.section--dark .quote-card h3 { color: var(--core-green-dark); }
.section--dark .quote-card a { color: var(--core-green-dark); }

/* FAQ */
.faq details { border-bottom: 1px solid #ddd; padding: 14px 0; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; position: relative; padding-right: 28px; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 0; font-size: 1.3rem; color: var(--core-green-dark); }
.faq details[open] summary::after { content: "−"; }
.faq .faq-a { padding-top: .5em; }

/* ブログ一覧 */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.post-card .thumb { aspect-ratio: 16/9; object-fit: cover; width: 100%; display: block; background: #e8f6f0; }
.post-card .thumb-ph {
  aspect-ratio: 16/9; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, #123f2f 0%, #1c966b 60%, #37ca95 100%);
  color: #fff; font-weight: 900; letter-spacing: .12em; font-size: 1.6rem;
}
.post-card .thumb-ph span { opacity: .9; }
.post-card .post-card-body { padding: 20px; }
.post-card h3 a { text-decoration: none; color: var(--core-text); }
.post-card time { font-size: .8rem; color: #777; }

/* 記事ページ */
.entry { max-width: 760px; margin: 0 auto; padding: 60px 20px; }
.entry-meta { color: #777; font-size: .875rem; margin-bottom: 2em; }
.entry-content h2 { margin-top: 2em; }
.entry-content figure { margin: 2em 0; }

/* 操作ガイド */
.guide-nav ul { list-style: none; display: flex; gap: 8px; margin: 0 0 40px; padding: 0; flex-wrap: wrap; counter-reset: guide; }
.guide-nav a {
  display: block; padding: 10px 20px; background: var(--core-gray);
  text-decoration: none; color: var(--core-text); font-weight: 700; border-radius: 4px;
}
.guide-nav .current a, .guide-nav a:hover { background: var(--core-green); color: #103828; }
.guide-nav--center ul { justify-content: center; }
.guide-toc { background: var(--core-gray); border-radius: 8px; padding: 20px 28px; margin-bottom: 40px; }
.guide-note { background: #fff8e1; border-left: 4px solid #f0b429; padding: 12px 18px; margin: 1.5em 0; }
.guide-caution { background: #fdecea; border-left: 4px solid #d64545; padding: 12px 18px; margin: 1.5em 0; }
.guide-steps { counter-reset: step; list-style: none; padding: 0; }
.guide-steps > li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 1.5em; }
.guide-steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--core-green); color: #103828; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
table.guide-table { border-collapse: collapse; width: 100%; margin: 1.5em 0; }
table.guide-table th, table.guide-table td { border: 1px solid #ddd; padding: 10px 14px; text-align: left; }
table.guide-table th { background: var(--core-gray); }

/* フッター */
.site-footer { background: var(--core-black); color: #ccc; padding: 60px 0 30px; margin-top: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--core-green); }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: .5em; }
.copyright { border-top: 1px solid #333; margin-top: 40px; padding-top: 20px; font-size: .8rem; text-align: center; color: #888; }

/* 参考文献（小さく掲載） */
.refs { max-width: 820px; margin: 0 auto; padding: 24px 20px 8px; border-top: 1px solid #e5e5e5; }
.refs h3 { font-size: .8rem; color: #999; font-weight: 700; letter-spacing: .08em; margin-bottom: .6em; }
.refs ol { margin: 0; padding-left: 1.4em; }
.refs li { font-size: .72rem; color: #999; line-height: 1.7; margin-bottom: .3em; }
.refs a { color: #8aa39a; text-decoration: underline; word-break: break-all; }
.refs a:hover { color: var(--core-green-dark); }
sup.ref { font-size: .7em; color: var(--core-green-dark); }

/* CTA帯 */
.cta-band { background: var(--core-green); color: #103828; text-align: center; padding: 70px 20px; }
.cta-band h2 { color: #103828; }

/* 連携ロゴ帯（本国トップ準拠） */
.connect-band { background: var(--core-green); color: #0f3a29; text-align: center; padding: 60px 20px; }
.connect-band h2 { color: #0f3a29; font-size: 1.05rem; letter-spacing: .12em; font-weight: 800; margin-bottom: 1.6em; }
.connect-logos { display: flex; flex-wrap: wrap; gap: 16px 30px; justify-content: center; align-items: center; max-width: 860px; margin: 0 auto 2em; }
.connect-logos span { color: #fff; font-weight: 800; font-size: 1.2rem; letter-spacing: .03em; }
.connect-logos img { height: 20px; width: auto; display: block; image-rendering: -webkit-optimize-contrast; }

/* YouTube サムネイル（クリックで再生） */
.yt-facade { display: block; position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #000 center/cover no-repeat; }
.yt-facade::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); transition: background .2s; }
.yt-facade:hover::after { background: rgba(0,0,0,.30); }
.yt-play { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 84px; height: 60px; border-radius: 14px; background: rgba(220,0,0,.9); display: flex; align-items: center; justify-content: center; }
.yt-play::before { content: ""; border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent #fff; margin-left: 4px; }
.yt-facade:hover .yt-play { background: #f00; }
/* 動画グリッド: 狭い画面=2列 / ワイド画面=4列 / 極小=1列 */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (min-width: 1000px) { .video-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .video-grid { grid-template-columns: 1fr; } }
.btn--outline-white { background: transparent; border: 2px solid #fff; color: #fff; }
.btn--outline-white:hover { background: #fff; color: var(--core-green-dark); }

/* 商品ラインナップカード */
.thumb--product {
	object-fit: contain;
	background: #fff;
	padding: 14px;
	box-sizing: border-box;
}
.product-price {
	font-weight: 700;
	color: var(--core-green-dark, #1c966b);
	margin-top: 4px;
}

/* 商品スライダー（横スクロール） */
.product-slider-wrap {
	position: relative;
}
.product-slider {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding: 4px 4px 18px;
}
.product-slider .post-card {
	flex: 0 0 262px;
	scroll-snap-align: start;
}
.product-slider::-webkit-scrollbar { height: 8px; }
.product-slider::-webkit-scrollbar-track { background: #eef3f0; border-radius: 4px; }
.product-slider::-webkit-scrollbar-thumb { background: #b7dfcd; border-radius: 4px; }
.slider-btn {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 2px 10px rgba(0,0,0,.15);
	cursor: pointer;
	z-index: 2;
	font-size: 20px;
	line-height: 1;
	color: #1c966b;
}
.slider-btn:hover { background: #f2faf6; }
.slider-btn--prev { left: -14px; }
.slider-btn--next { right: -14px; }
@media (max-width: 640px) {
	.product-slider .post-card { flex-basis: 78%; }
	.slider-btn { display: none; }
}

/* セール価格表示 */
.price-compare {
	text-decoration: line-through;
	color: #9aa5a0;
	font-weight: 400;
	margin-right: 6px;
	font-size: 0.9em;
}
.price-sale {
	color: #d63638;
}


/* メインナビのドロップダウン（CORE Calera®） */
.main-nav li {
	position: relative;
}
.main-nav li.has-sub > a::after {
	content: " ▾";
	font-size: 0.7em;
}
.main-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	border: 1px solid #e3e8e5;
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
	padding: 8px 0;
	min-width: 210px;
	z-index: 60;
	list-style: none;
	margin: 0;
}
.main-nav .sub-menu li {
	display: block;
	margin: 0;
}
.main-nav .sub-menu a {
	display: block;
	padding: 9px 20px;
	white-space: nowrap;
}
.main-nav .sub-menu a:hover {
	background: #f2faf6;
	color: var(--core-green-dark, #1c966b);
}
.main-nav li.has-sub:hover > .sub-menu,
.main-nav li.has-sub:focus-within > .sub-menu {
	display: block;
}


/* Caleraセクション: ヒーロー帯の統一 */
.hero--calera { padding: 70px 0; }
.hero--calera .wrap { min-height: 300px; }
.hero--calera h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
.hero--calera .hero-visual img { max-height: 320px; width: auto; }


/* ===== モバイル対応（スマホ・タブレット） ===== */
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .site-header .wrap { gap: 12px; min-height: 60px; }
  .header-cta { display: none; }
  .nav-toggle {
    display: block; margin-left: auto;
    background: none; border: 0; padding: 10px; cursor: pointer;
  }
  .nav-toggle span {
    display: block; width: 26px; height: 3px; border-radius: 2px;
    background: var(--core-black); margin: 5px 0; transition: transform .2s, opacity .2s;
  }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(82vw, 320px); background: #fff;
    box-shadow: -10px 0 30px rgba(0,0,0,.18);
    transform: translateX(105%); transition: transform .25s ease;
    overflow-y: auto; padding: 76px 22px 40px; flex: none; z-index: 250;
  }
  body.nav-open .main-nav { transform: translateX(0); }
  body.nav-open::before {
    content: ""; position: fixed; inset: 0;
    background: rgba(0,0,0,.42); z-index: 150;
  }
  body.nav-open .site-header { z-index: 300; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-bottom: 1px solid #eee; }
  .main-nav a { display: block; padding: 13px 4px; font-size: 1.02rem; }
  .main-nav .sub-menu {
    display: block; position: static; border: 0; box-shadow: none;
    padding: 0 0 10px 16px; min-width: 0; background: transparent;
  }
  .main-nav .sub-menu a { padding: 8px 4px; font-size: .93rem; white-space: normal; }
  .main-nav .sub-menu li { border-bottom: 0; }
}

@media (max-width: 700px) {
  .section { padding: 48px 0; }
  .hero { padding: 56px 0; }
  .hero .wrap { gap: 28px; }
  .hero p { font-size: 1rem; }
  .hero--photo { padding: 64px 0; }
  .hero--photo::before {
    background: linear-gradient(180deg, rgba(10,20,15,.72) 0%, rgba(10,20,15,.5) 100%);
  }
  .hero--photo .hero-visual img { max-height: 300px; }
  .hero--calera { padding: 44px 0; }
  .hero--calera .wrap { min-height: 0; }
  .hero--calera .hero-visual img { max-height: 200px; }
  .quotes { grid-template-columns: 1fr !important; gap: 20px; }
  .split { gap: 28px; }
  .split + .split { margin-top: 48px; }
  .cta-band { padding: 48px 20px; }
  .connect-band { padding: 44px 16px; }
  .press-bar ul { gap: 18px 26px; }
  .btn { padding: 12px 26px; }
  .entry { padding: 40px 20px; }
  .announce-bar { font-size: .78rem; }
  .stat-num { font-size: 2.6rem; }
  table.guide-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .guide-nav ul, .guide-nav--center ul {
    flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    -webkit-overflow-scrolling: touch; padding-bottom: 6px;
  }
  .guide-nav a { white-space: nowrap; }
  .footer-cols { gap: 28px; }
}


/* ===== 商品ページ（CORE 2）ギャラリー ===== */
.product-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: start; }
.pgal { display: flex; gap: 14px; }
.pgal-thumbs { display: flex; flex-direction: column; gap: 10px; width: 76px; flex: none; }
.pgal-thumb {
  border: 1px solid #e3e3e3; border-radius: 8px; padding: 0;
  background: #fff; cursor: pointer; overflow: hidden; aspect-ratio: 1; display: block;
}
.pgal-thumb.is-active { border-color: var(--core-green-dark); box-shadow: 0 0 0 2px rgba(28,150,107,.25); }
.pgal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pgal-main { flex: 1; min-width: 0; }
.pgal-main img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: #f5f5f5; }
.product-info h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.product-note { color: #666; font-size: .92rem; }
.product-buy { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 22px 0 26px; }
.product-price-big { font-size: 2rem; font-weight: 800; }
.product-price-big .price-sale { font-size: 1em; }
.product-cta { padding: 16px 44px; }
.pd-acc { border-top: 1px solid var(--core-green-dark); padding: 0; }
.pd-acc:last-of-type { border-bottom: 1px solid var(--core-green-dark); }
.pd-acc summary {
  cursor: pointer; font-weight: 700; padding: 14px 28px 14px 2px;
  list-style: none; position: relative;
}
.pd-acc summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.25rem; color: var(--core-green-dark); }
.pd-acc[open] summary::after { content: "\2212"; }
.pd-acc-body { padding: 0 2px 16px; }
.pd-acc-body ul { margin: 0; padding-left: 1.3em; }
@media (max-width: 860px) {
  .product-hero { grid-template-columns: 1fr; gap: 30px; }
  .pgal { flex-direction: column-reverse; }
  .pgal-thumbs { flex-direction: row; width: auto; overflow-x: auto; padding-bottom: 4px; }
  .pgal-thumb { width: 62px; flex: none; }
  .product-buy { margin: 16px 0 20px; }
  .product-price-big { font-size: 1.6rem; }
}


/* ===== モバイル仕上げ ===== */
@media (max-width: 900px) {
  /* 使用用途カードは2カラムでコンパクトに */
  .usecase-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px; }
  .usecase-grid .post-card .post-card-body { padding: 12px 14px; }
  .usecase-grid .post-card h3 { font-size: 1rem; margin-bottom: .3em; }
  .usecase-grid .post-card p { font-size: .82rem; line-height: 1.6; margin: 0; }
  .usecase-grid .post-card .thumb,
  .usecase-grid .post-card .thumb-ph { aspect-ratio: 4/3; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  h2 { font-size: 1.45rem; }
  .section-lead { font-size: .95rem; }
  .hero h1 { font-size: 2rem; }
  .hero-visual img { max-height: 340px; width: auto; }
  .site-footer { padding: 44px 0 24px; }
  .footer-cols li { margin-bottom: 0; }
  .footer-cols a { display: block; padding: 7px 0; }
  .quote-card { padding: 20px; }
  .cta-band h2 { font-size: 1.35rem; }
  .press-bar img { height: 16px; }
  .connect-logos img { height: 16px; }
  .guide-nav a { padding: 9px 14px; font-size: .9rem; }
  .btn { letter-spacing: .02em; }
  .product-cta { width: 100%; text-align: center; }
  .product-buy { flex-direction: column; align-items: stretch; }
  .product-price-big { text-align: left; }
}
