/*
 * 商品ページのデータ中心の部品（順位・平均との比較・成分の内訳・成分が近い商品・たたむ）
 * 既存の public-style.css が .post_content .haircare-db ... !important で強く指定しているので、同じ強さで書く。
 */
.post_content .haircare-db {
	--pp-primary: var(--hc-primary, #31584b);
	--pp-soft: var(--hc-primary-soft, #e8efeb);
	--pp-bg: var(--hc-bg-soft, #f7f7f2);
	--pp-text: var(--hc-text, #252d29);
	--pp-muted: var(--hc-text-muted, #66716b);
	--pp-line: var(--hc-border, #e4e9e4);
	--pp-up: #2f6b4f;
	--pp-down: #9a5b2e;
}

/* ---------- 上部の数字：3つ並べる ---------- */
.post_content .haircare-db .prod-hero-summary { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.post_content .haircare-db .prod-hero-rank {
	background: #f8fbf8 !important;
	border: 1px solid rgba(47, 117, 111, .16) !important;
	border-radius: 8px !important;
	padding: 10px 12px !important;
	display: grid !important;
	gap: 2px;
	align-content: start;
	min-width: 0;
}
.post_content .haircare-db .prod-hero-rank-label { font-size: 11px; color: var(--pp-muted); line-height: 1.3; }
.post_content .haircare-db .prod-hero-rank-num { font-size: 24px; font-weight: 700; color: var(--pp-primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.post_content .haircare-db .prod-hero-rank-num small { font-size: 12px; margin-left: 2px; }
.post_content .haircare-db .prod-hero-rank-sub { font-size: 11px; color: var(--pp-muted); }
@media (max-width: 600px) {
	.post_content .haircare-db .prod-hero-summary { gap: 6px !important; }
	.post_content .haircare-db .prod-hero-score,
	.post_content .haircare-db .prod-hero-review,
	.post_content .haircare-db .prod-hero-rank { padding: 8px !important; }
	.post_content .haircare-db .prod-hero-score-num,
	.post_content .haircare-db .prod-hero-rank-num { font-size: 20px !important; }
	.post_content .haircare-db .prod-hero-review-num { font-size: 13px !important; }
}

/* ---------- 評価の内訳（平均と比べる） ---------- */
.post_content .haircare-db .hc-axes { margin: 16px 0; padding: 14px; border: 1px solid var(--pp-line); border-radius: 12px; background: #fff; display: grid; gap: 8px; }
.post_content .haircare-db .hc-axes__head { font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.post_content .haircare-db .hc-axes__head span { font-weight: 400; font-size: 12px; color: var(--pp-muted); }
.post_content .haircare-db .hc-axis { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 2.6em 4.6em; gap: 8px; align-items: center; font-size: 12.5px; }
.post_content .haircare-db .hc-axis__label { line-height: 1.3; }
.post_content .haircare-db .hc-axis__track { position: relative; height: 9px; border-radius: 5px; background: var(--pp-bg); }
.post_content .haircare-db .hc-axis__fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--pp-primary); }
.post_content .haircare-db .hc-axis__avg { position: absolute; top: -4px; width: 2px; height: 17px; margin-left: -1px; background: var(--pp-text); border-radius: 1px; }
.post_content .haircare-db .hc-axis__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.post_content .haircare-db .hc-axis__avgval { font-size: 11px; color: var(--pp-muted); font-variant-numeric: tabular-nums; }
.post_content .haircare-db .hc-axis.is-up .hc-axis__val { color: var(--pp-up); }
.post_content .haircare-db .hc-axis.is-down .hc-axis__val { color: var(--pp-down); }
.post_content .haircare-db .hc-axes__legend { display: flex; gap: 14px; font-size: 11px; color: var(--pp-muted); }
.post_content .haircare-db .hc-axes__legend i { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.post_content .haircare-db .hc-axes__legend i.is-me { width: 14px; height: 9px; border-radius: 3px; background: var(--pp-primary); }
.post_content .haircare-db .hc-axes__legend i.is-avg { width: 2px; height: 12px; background: var(--pp-text); }
@media (max-width: 480px) {
	.post_content .haircare-db .hc-axis { grid-template-columns: 6.5em minmax(0, 1fr) 2.4em; }
	.post_content .haircare-db .hc-axis__avgval { display: none; }
}

/* ---------- 成分の内訳と有無 ---------- */
.post_content .haircare-db .hc-comp { margin: 4px 0 14px; padding: 14px; border: 1px solid var(--pp-line); border-radius: 12px; background: #fff; display: grid; gap: 10px; }
.post_content .haircare-db .hc-comp__head { font-weight: 700; font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.post_content .haircare-db .hc-comp__head span { font-weight: 400; font-size: 12px; color: var(--pp-muted); }
.post_content .haircare-db .hc-comp__head--sub { margin-top: 4px; font-size: 13px; }
.post_content .haircare-db .hc-comp__bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--pp-bg); }
.post_content .haircare-db .hc-comp__seg { display: block; height: 100%; }
.post_content .haircare-db .is-c0 { background: #31584b; }
.post_content .haircare-db .is-c1 { background: #6f9c8a; }
.post_content .haircare-db .is-c2 { background: #a9c6b9; }
.post_content .haircare-db .is-c3 { background: #b08a4a; }
.post_content .haircare-db .is-c4 { background: #dcc59a; }
.post_content .haircare-db .is-c5 { background: #d9ddd6; }
.post_content .haircare-db .hc-comp__legend,
.post_content .haircare-db .hc-comp__flags { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; font-size: 12.5px; }
.post_content .haircare-db .hc-comp__legend li,
.post_content .haircare-db .hc-comp__flags li { display: flex; align-items: center; gap: 6px; padding: 0; margin: 0; border: 0; }
.post_content .haircare-db .hc-comp__legend li::before,
.post_content .haircare-db .hc-comp__flags li::before { display: none; }
.post_content .haircare-db .hc-comp__legend i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; }
.post_content .haircare-db .hc-comp__legend span,
.post_content .haircare-db .hc-comp__flags span { flex: 1; min-width: 0; }
.post_content .haircare-db .hc-comp__legend b { font-variant-numeric: tabular-nums; }
.post_content .haircare-db .hc-comp__flags { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.post_content .haircare-db .hc-comp__flags li { padding: 7px 9px; border-radius: 8px; background: var(--pp-bg); flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.35; }
.post_content .haircare-db .hc-comp__flags span { font-size: 11.5px; color: var(--pp-muted); }
.post_content .haircare-db .hc-comp__flags b { font-size: 12.5px; }
.post_content .haircare-db .hc-comp__flags li.is-on b { color: var(--pp-down); }
.post_content .haircare-db .hc-comp__flags li.is-off b { color: var(--pp-muted); font-weight: 400; }

/* ---------- たたむ ---------- */
.post_content .haircare-db .hc-fold.is-folded { max-height: var(--fold-h, 150px); overflow: hidden; position: relative; }
.post_content .haircare-db .hc-fold.is-folded::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.post_content .haircare-db .hc-fold__btn {
	display: block;
	width: 100%;
	margin: 8px 0 0;
	min-height: 42px;
	border: 1px solid var(--pp-line);
	border-radius: 10px;
	background: var(--pp-bg);
	color: var(--pp-primary);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}
.post_content .haircare-db .hc-fold__btn:focus-visible { outline: 2px solid var(--pp-primary); outline-offset: 2px; }

/* ---------- 成分が近い商品・点数が高い商品 ---------- */
.post_content .haircare-db .hc-related__note { margin: 0 0 8px; font-size: 12px; color: var(--pp-muted); }
.post_content .haircare-db .hc-related__h { font-size: 14px; margin: 14px 0 8px; padding: 0; border: 0; background: none; }
.post_content .haircare-db .hc-related__h::before,
.post_content .haircare-db .hc-related__h::after { display: none; }
.post_content .haircare-db .hc-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.post_content .haircare-db .hc-card { margin: 0; padding: 0; border: 0; }
.post_content .haircare-db .hc-card::before { display: none; }
.post_content .haircare-db .hc-card a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid var(--pp-line); border-radius: 10px; background: #fff; color: var(--pp-text); text-decoration: none; height: 100%; box-sizing: border-box; }
.post_content .haircare-db .hc-card a:hover { border-color: var(--pp-primary); }
.post_content .haircare-db .hc-card img,
.post_content .haircare-db .hc-card__noimg { width: 64px; height: 64px; border-radius: 8px; object-fit: contain; background: var(--pp-bg); display: block; }
.post_content .haircare-db .hc-card__body { display: grid; gap: 3px; min-width: 0; align-content: start; }
.post_content .haircare-db .hc-card__name { font-size: 12.5px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post_content .haircare-db .hc-card__meta,
.post_content .haircare-db .hc-card__compat { font-size: 11.5px; color: var(--pp-muted); line-height: 1.5; }
.post_content .haircare-db .hc-card__meta b,
.post_content .haircare-db .hc-card__compat b { color: var(--pp-primary); font-size: 13px; }
.post_content .haircare-db .hc-card__compat .is-hit { color: var(--pp-down); font-weight: 700; }
@media (max-width: 600px) {
	.post_content .haircare-db .hc-cards { grid-template-columns: minmax(0, 1fr); }
}
