/*
Theme Name: SWELL CHILD
Theme URI: https://swell-theme.com/
Description: SWELL の子テーマ。STORK から移行した独自ショートコードを保持する。
Template: swell
Version: 1.0.0
Author: shiba-teire
Text Domain: swell_child
*/

/* =========================================================
   Amazon 商品リンク（.amazon-box）
   ─ .post_content 内・サイドバーウィジェットの両方で利用
   ========================================================= */

.amazon-box {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	align-items: stretch;
	padding: 16px;
	margin: 1.5em 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
	overflow: hidden;
}

/* 商品画像 */
.amazon-box__image {
	flex: 0 0 140px;
	max-width: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.amazon-box__image a {
	display: block;
	width: 100%;
}

.amazon-box__image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 160px;
	object-fit: contain;
	border-radius: 6px;
	background: #f9fafb;
}

/* テキスト情報カラム */
.amazon-box__info {
	flex: 1 1 240px;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* 商品名 */
.amazon-box__name {
	margin: 0 0 6px;
	line-height: 1.4;
}

.amazon-box__name a {
	font-size: 1rem;
	font-weight: 700;
	color: #1f2937;
	text-decoration: none;
}

.amazon-box__name a:hover {
	color: var(--color_link, #1176d4);
	text-decoration: underline;
}

/* メーカー・販売元 */
.amazon-box__brand {
	font-size: 0.85em;
	color: #6b7280;
	margin: 0 0 12px;
}

/* ボタン行 */
.amazon-box__actions {
	margin-top: auto;
	padding-top: 4px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.amazon-box__shop {
	display: inline-block;
}

.amazon-box__shop a {
	display: inline-block;
	padding: 8px 18px;
	background: linear-gradient(180deg, #ffb84d 0%, #ff9900 100%);
	color: #fff;
	font-weight: 700;
	font-size: 0.9em;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.amazon-box__shop a:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(255, 153, 0, 0.35);
	color: #fff;
	text-decoration: none;
}

.amazon-box__shop a:focus-visible {
	outline: 2px solid #1f2937;
	outline-offset: 3px;
}

/* サイドバー内では余白を詰める */
#sidebar .amazon-box,
.c-widget .amazon-box {
	padding: 12px;
	gap: 12px;
	margin: 0 0 12px;
}

#sidebar .amazon-box .amazon-box__image,
.c-widget .amazon-box .amazon-box__image {
	flex: 0 0 90px;
	max-width: 90px;
}

#sidebar .amazon-box .amazon-box__name a,
.c-widget .amazon-box .amazon-box__name a {
	font-size: 0.9em;
}

/* モバイル：縦積み */
@media (max-width: 599px) {
	.amazon-box__image {
		flex: 1 1 100%;
		max-width: 100%;
	}
	.amazon-box__image img {
		max-height: 220px;
		width: auto;
		margin: 0 auto;
	}
}
