@charset "UTF-8";
/* CSS Document */

/*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ランキング（PC・タブレット・スマホ共通）

  ・レイアウト：上段 1・2位 ／ 下段 3?5位
  ・画像は 500×500px で作成。最大500pxで表示し、画面幅に合わせて縮小
  ・端末ごとの大きさは、下の3か所の「変数」で調整できます
      PC       … 1025px以上      （.ranking-section）
      タブレット … 768?1024px    （@media 1つめ）
      スマホ    … 767px以下       （@media 2つめ）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/

/* ---------------- 変数（PC） ----------------
   見出し（RANKING／旬のおすすめアイテムなど）の大きさは、
   ランキング以外のブロック（.items-sectionなど）でも共通で使うため、
   .block-title を使うセクションすべてに対して指定しています。 */
.ranking-section,
.items-section {
	--rank-title-size: 46px;    /* 英語タイトルの大きさ */
	--rank-title-ja-size: 15px; /* 日本語タイトルの大きさ */
	--rank-title-gap: 32px;     /* タイトルと中身の間隔 */
}
.ranking-section {
	--rank-max: 500px;          /* 画像の最大表示サイズ */
	--rank-gap: 20px;           /* 画像どうしの横の間隔 */
	--rank-row-gap: 40px;       /* 上段と下段の間隔 */
	--rank-name-size: 15px;     /* 商品名の大きさ */
	--rank-name-gap: 14px;      /* 画像と商品名の間隔 */
	--rank-label-lg: 64px;      /* No.ラベル（1・2位） */
	--rank-label-sm: 48px;      /* No.ラベル（3?5位） */

	--rank-color-1: #a9832a;    /* 1位 */
	--rank-color-2: #7f8a91;    /* 2位 */
	--rank-color-3: #a06a3d;    /* 3位 */
	--rank-color-other: #292929;/* 4・5位 */

	/* 上段2枚が最大500pxになる幅（500×2＋間隔） */
	width: min(calc(var(--rank-max) * 2 + var(--rank-gap)), 100%);
}

/* ---------------- タイトル：RANKING ／ ランキング ---------------- */
.block-title {
	display: flex;
	align-items: baseline;
	gap: 0 calc(var(--rank-title-size) * .3);
	margin: 0 0 var(--rank-title-gap);
	color: #292929;
	font-weight: 400;
	line-height: 1;
}
.block-title-en {
	font-family: "Jost", "Futura", "Century Gothic", "Zen Kaku Gothic New", sans-serif;
	font-size: var(--rank-title-size);
	font-weight: 400;
	letter-spacing: .06em;
	line-height: 1;
}
/* 斜線（／） */
.block-title-slash {
	flex: 0 0 auto;
	width: calc(var(--rank-title-size) * .62);
	height: calc(var(--rank-title-size) * .72);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' preserveAspectRatio='none'%3E%3Cline x1='0' y1='10' x2='10' y2='0' stroke='%23292929' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.block-title-ja {
	font-size: var(--rank-title-ja-size);
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1;
}

/* ---------------- 並び：上段2枚／下段3枚 ---------------- */
.ranking-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center; /* 表示が5件未満のときは中央寄せ */
	gap: var(--rank-row-gap) var(--rank-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}
.ranking-item {
	--rank-label: var(--rank-label-sm);
	flex: 0 0 auto;
	min-width: 0;
	/* 下段：3枚 */
	width: calc((100% - var(--rank-gap) * 2) / 3);
	max-width: var(--rank-max);
}
/* 上段：1位・2位（2枚） */
.ranking-item:nth-child(-n+2) {
	--rank-label: var(--rank-label-lg);
	width: calc((100% - var(--rank-gap)) / 2);
}
.ranking-link {
	display: block;
	color: #292929;
	text-decoration: none;
}
.ranking-link:focus-visible {
	outline: 3px solid #e8452e;
	outline-offset: 3px;
}

/* ---------------- 画像 ---------------- */
.ranking-thumb {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	border-radius: 4px;
	background: #eee;
	box-shadow: 0 5px 16px rgba(22,42,53,.14);
}
.ranking-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.ranking-link:hover .ranking-thumb img,
.ranking-link:focus-visible .ranking-thumb img {
	transform: scale(1.05);
}

/* ---------------- No.ラベル（画像の左上） ---------------- */
.ranking-label {
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: var(--rank-label);
	height: var(--rank-label);
	background: var(--rank-color-other);
	color: #fff;
	font-family: "Jost", "Futura", "Century Gothic", "Zen Kaku Gothic New", sans-serif;
	font-size: var(--rank-label); /* 中の文字は em で連動 */
	line-height: 1;
}
.ranking-label-no {
	font-size: max(9px, .22em);
	letter-spacing: .06em;
}
.ranking-label-num {
	margin-top: .04em;
	font-size: .5em;
	font-weight: 500;
}
.ranking-item:nth-child(1) .ranking-label { background: var(--rank-color-1); }
.ranking-item:nth-child(2) .ranking-label { background: var(--rank-color-2); }
.ranking-item:nth-child(3) .ranking-label { background: var(--rank-color-3); }

/* ---------------- 商品名（画像の下） ---------------- */
.ranking-name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3; /* 3行を超える部分は「…」で省略 */
	overflow: hidden;
	margin-top: var(--rank-name-gap);
	font-size: var(--rank-name-size);
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: .02em;
	overflow-wrap: anywhere;
	word-break: auto-phrase; /* 対応ブラウザでは文節で折り返し */
	text-wrap: pretty;       /* 1文字だけの行を避ける */
	font-size:1.2em;
}
.ranking-link:hover .ranking-name,
.ranking-link:focus-visible .ranking-name {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------------- タブレット：768?1024px ---------------- */
@media (min-width: 768px) and (max-width: 1024px) {
	.ranking-section,
	.items-section {
		--rank-title-size: 38px;
		--rank-title-ja-size: 14px;
		--rank-title-gap: 24px;
	}
	.ranking-section {
		--rank-gap: 16px;
		--rank-row-gap: 32px;
		--rank-name-size: 14px;
		--rank-name-gap: 12px;
		--rank-label-lg: 56px;
		--rank-label-sm: 44px;
	}
}

/* ---------------- スマートフォン：767px以下 ---------------- */
@media (max-width: 767px) {
	.ranking-section,
	.items-section {
		--rank-title-size: 30px;
		--rank-title-ja-size: 12px;
		--rank-title-gap: 18px;
	}
	.ranking-section {
		--rank-gap: 10px;
		--rank-row-gap: 22px;
		--rank-name-size: 12px;
		--rank-name-gap: 8px;
		--rank-label-lg: 46px;
		--rank-label-sm: 38px;
	}
	/* 下段3枚は幅が狭いため、商品名を少し小さく */
	.ranking-item:nth-child(n+3) .ranking-name {
		font-size: 12px;
		line-height: 1.5;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ranking-thumb img {
		transition: none;
	}
}
