/* Rakuten Link Card v1.2 */

.rlc-card {
	border: 1px solid #e3e3e3;
	border-radius: 10px;
	margin: 1.8em 0;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
	line-height: 1.5;
	overflow: hidden;
}

/* セール告知バー */
.rlc-card__sale {
	background: linear-gradient(90deg, #d70000, #ff5e00);
	color: #fff;
	font-size: 0.8em;
	font-weight: 700;
	text-align: center;
	padding: 6px 12px;
	letter-spacing: 0.05em;
}

.rlc-card__countdown {
	display: inline-block;
	background: rgba(255, 255, 255, 0.22);
	padding: 1px 10px;
	border-radius: 999px;
	margin-left: 8px;
	font-variant-numeric: tabular-nums;
}

.rlc-card__main {
	position: relative;
	display: flex;
	gap: 18px;
	align-items: flex-start;
	padding: 18px;
}

/* ランキングリボン */
.rlc-card__rank {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1;
	font-size: 0.75em;
	font-weight: 800;
	color: #fff;
	padding: 3px 10px;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
	letter-spacing: 0.05em;
}

.rlc-card__rank--1 {
	background: linear-gradient(180deg, #f2c744, #d4a017);
}

.rlc-card__rank--2 {
	background: linear-gradient(180deg, #c0c6cc, #9aa2ab);
}

.rlc-card__rank--3 {
	background: linear-gradient(180deg, #d29a6b, #b0713d);
}

.rlc-card__rank--other {
	background: #8a939c;
}

.rlc-card__image {
	flex: 0 0 148px;
	display: block;
}

.rlc-card__image img {
	width: 148px;
	height: 148px;
	object-fit: contain;
	border-radius: 6px;
	background: #fafafa;
	display: block;
	margin: 0;
	transition: transform 0.2s ease;
}

.rlc-card__image:hover img {
	transform: scale(1.03);
}

.rlc-card__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

/* バッジ */
.rlc-card__badges {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.rlc-card__badge {
	display: inline-block;
	font-size: 0.7em;
	font-weight: 700;
	padding: 2px 10px;
	border-radius: 999px;
	line-height: 1.6;
}

.rlc-card__badge--accent {
	background: #d70000;
	color: #fff;
}

.rlc-card__badge--free-shipping {
	background: #e8f5e9;
	color: #1b7a2f;
	border: 1px solid #a5d6a7;
}

.rlc-card__badge--point {
	background: #fff3e0;
	color: #c25700;
	border: 1px solid #ffcc80;
}

.rlc-card__title {
	font-weight: 700;
	font-size: 0.98em;
	color: #222;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rlc-card__title:hover {
	color: #bf0000;
	text-decoration: underline;
}

/* 書籍メタ(著者/出版社/発売日) */
.rlc-card__bookmeta {
	font-size: 0.78em;
	color: #777;
}

/* 推しポイント */
.rlc-card__note {
	margin: 0;
	font-size: 0.85em;
	color: #444;
	background: #fff9e6;
	border-left: 3px solid #f5a623;
	padding: 6px 10px;
	border-radius: 0 4px 4px 0;
}

.rlc-card__review {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.82em;
}

/* グレー星の上に金色星を評価分の幅で重ねる(小数対応) */
.rlc-card__stars {
	position: relative;
	display: inline-block;
	letter-spacing: 1px;
	line-height: 1;
}

.rlc-card__stars-bg {
	color: #d5d5d5;
}

.rlc-card__stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: #f5a623;
}

.rlc-card__review-text {
	color: #888;
}

.rlc-card__meta {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}

.rlc-card__price {
	color: #d70000;
	font-weight: 800;
	font-size: 1.45em;
	letter-spacing: 0.01em;
}

.rlc-card__yen {
	font-size: 0.55em;
	font-weight: 600;
	margin-left: 2px;
	color: #a33;
}

.rlc-card__shop {
	font-size: 0.8em;
	color: #888;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 16em;
}

.rlc-card__shop:hover {
	text-decoration: underline;
}

/* ボタン群: 複数モール横並び */
.rlc-card__buttons {
	margin-top: 6px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.rlc-card__button {
	flex: 1 1 0;
	min-width: 130px;
	position: relative;
	display: inline-block;
	padding: 12px 26px 12px 18px;
	border-radius: 8px;
	font-size: 0.9em;
	font-weight: 700;
	text-decoration: none;
	text-align: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.rlc-card__button::after {
	content: "›";
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-52%);
	font-size: 1.2em;
	opacity: 0.85;
}

.rlc-card__button:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 12px rgba(0, 0, 0, 0.18);
	filter: brightness(1.06);
	text-decoration: none;
}

.rlc-card__button--rakuten {
	background: linear-gradient(180deg, #d70000, #a50000);
	color: #fff !important;
	overflow: hidden;
}

/* メインボタンに周期的なシャイン(光の帯)を走らせる */
.rlc-card__button--rakuten::before {
	content: "";
	position: absolute;
	top: 0;
	left: -75%;
	width: 50%;
	height: 100%;
	background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
	transform: skewX(-20deg);
	animation: rlc-shine 3.5s ease infinite;
}

@keyframes rlc-shine {
	0% { left: -75%; }
	45%, 100% { left: 125%; }
}

@media (prefers-reduced-motion: reduce) {
	.rlc-card__button--rakuten::before {
		animation: none;
		display: none;
	}
}

.rlc-card__button--amazon {
	background: linear-gradient(180deg, #ffa41c, #f08804);
	color: #1a1a1a !important;
}

.rlc-card__button--yahoo {
	background: linear-gradient(180deg, #ff5c72, #e6002d);
	color: #fff !important;
}

/* 価格取得時点の注記 */
.rlc-card__updated {
	margin: 2px 0 0;
	font-size: 0.7em;
	color: #aaa;
}

/* エラーカード(編集者のみに表示) */
.rlc-card--error {
	display: block;
	border-color: #e6a23c;
	background: #fdf6ec;
	color: #b8860b;
	font-size: 0.85em;
	padding: 12px 16px;
}

/* スマホでは縦積み */
@media (max-width: 480px) {
	.rlc-card__main {
		flex-direction: column;
		align-items: center;
		padding: 14px;
	}

	.rlc-card__image {
		flex-basis: auto;
	}

	.rlc-card__image img {
		width: 200px;
		height: 200px;
	}

	.rlc-card__body {
		width: 100%;
	}

	.rlc-card__buttons {
		flex-direction: column;
	}

	.rlc-card__button {
		display: block;
		min-width: 0;
		/* 縦積み時は flex-basis:0 だと overflow:hidden のボタンが高さ0に潰れる */
		flex: 0 0 auto;
	}
}
