/**
 * 4samantha-addons 前台樣式
 *
 * 配色沿用 Blocksy 色盤變數（--theme-palette-color-N），fallback 是站上實查的色值，
 * 之後客戶改色盤這裡會跟著變。
 *
 * 佈景與 WP core 會對 h3／p／figure 注入預設 margin（.entry-content h3 的 specificity
 * 是 0,0,1,1，壓得過單一 class），所以用同 class 寫兩次把 reset 提到 0,0,2,1 再自己排間距。
 *
 * 1.3.0：作品由 Before／After 兩張改為單張、移除課程分類篩選列。
 * 1.4.0：新增首頁精選區塊 [samantha_highlights]。
 */

.sama-block.sama-block h3,
.sama-block.sama-block p,
.sama-block.sama-block figure,
.sama-block.sama-block figcaption {
	margin: 0;
	padding: 0;
}

.sama-block {
	--sama-ink: var(--theme-palette-color-4, #122B32);
	--sama-body: var(--theme-palette-color-3, #314B52);
	--sama-muted: var(--theme-palette-color-2, #85A0A8);
	--sama-accent: var(--theme-palette-color-1, #536D74);
	--sama-line: var(--theme-palette-color-5, #EAEDF1);
	--sama-surface: var(--theme-palette-color-8, #ffffff);
}

/* ---------- 區塊標題（前面帶 logo 圖示，對齊首頁） ---------- */

.sama-h2.sama-h2 {
	align-items: center;
	color: var(--theme-palette-color-4, #122B32);
	display: flex;
	font-size: 26px;
	font-weight: 600;
	gap: 12px;
	letter-spacing: .08em;
	line-height: 1.6;
	margin-bottom: 24px;
	margin-top: 0;
}

.sama-h2.sama-h2::before {
	background: url("https://4samantha.cc/wp-content/uploads/2025/03/scimgLgOebI.webp") center / contain no-repeat;
	content: "";
	flex-shrink: 0;
	height: 32px;
	width: 32px;
}

@media (max-width: 782px) {
	.sama-h2.sama-h2 {
		font-size: 22px;
	}

	.sama-h2.sama-h2::before {
		height: 26px;
		width: 26px;
	}
}

/* ---------- 卡片格線 ---------- */

.sama-grid {
	display: grid;
	gap: 24px;
}

.sama-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sama-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sama-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sama-card {
	background: var(--sama-surface);
	border-radius: 12px;
	box-shadow: 0 15px 30px 0 rgba(119, 123, 146, .10);
	overflow: hidden;
}

.sama-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px 22px;
}

.sama-card__course {
	color: var(--sama-muted);
	font-size: 13px;
	letter-spacing: .04em;
	line-height: 1.6;
}

.sama-card__title {
	color: var(--sama-ink);
	font-size: 17px;
	font-weight: 600;
	letter-spacing: .02em;
	line-height: 1.7;
}

.sama-card__note {
	color: var(--sama-body);
	font-size: 15px;
	line-height: 1.85;
}

.sama-card__student {
	color: var(--sama-muted);
	font-size: 14px;
	line-height: 1.6;
}

/* ---------- 學生作品（單張） ---------- */

.sama-work__img {
	aspect-ratio: 4 / 5;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

/* ---------- 學員好評截圖 ---------- */

.sama-review__img {
	display: block;
	height: auto;
	width: 100%;
}

/* ---------- 首頁精選（作品 ＋ 好評 ＋ 查看更多） ---------- */

.sama-block--highlights {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sama-highlights-lead {
	color: var(--theme-palette-color-3, #314B52);
	font-size: 15px;
	line-height: 1.9;
	margin: -24px 0 28px;
}

.sama-work-carousel {
	overflow: hidden;
	width: 100%;
}

.sama-work-carousel__track {
	animation: sama-work-scroll 120s linear infinite;
	display: flex;
	width: max-content;
	will-change: transform;
}

.sama-work-carousel__group {
	display: flex;
	flex: 0 0 auto;
	gap: 20px;
	padding-right: 20px;
}

.sama-work-carousel .sama-work {
	box-shadow: none;
	flex: 0 0 clamp(220px, 22vw, 286px);
}

.sama-work-carousel .sama-work__img {
	border-radius: 8px;
}

.sama-work-carousel .sama-card__body {
	padding: 14px 2px 0;
}

.sama-work-carousel:hover .sama-work-carousel__track,
.sama-work-carousel:focus-within .sama-work-carousel__track {
	animation-play-state: paused;
}

@keyframes sama-work-scroll {
	to { transform: translateX(-50%); }
}

.sama-more {
	padding-top: 4px;
}

.sama-more__link {
	color: var(--sama-accent);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: .04em;
	line-height: 1.6;
	text-decoration: none;
}

.sama-more__link::after {
	content: " →";
}

.sama-more__link:hover {
	color: var(--sama-ink);
}

/* ---------- 空狀態 ---------- */

.sama-empty {
	border: 1px dashed #c9d2d6;
	border-radius: 8px;
	color: #7a8a90;
	font-size: 14px;
	padding: 16px 18px;
}

/* ---------- 響應式 ---------- */

@media (max-width: 980px) {
	.sama-grid--cols-3,
	.sama-grid--cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.sama-grid,
	.sama-grid--cols-2,
	.sama-grid--cols-3,
	.sama-grid--cols-4 {
		grid-template-columns: minmax(0, 1fr);
	}

	.sama-card__body {
		padding: 16px 18px 20px;
	}

	.sama-highlights-lead {
		font-size: 14px;
		margin-bottom: 22px;
	}

	.sama-work-carousel .sama-work {
		flex-basis: 220px;
	}

	.sama-work-carousel .sama-card__body {
		padding: 12px 2px 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sama-work-carousel {
		overflow-x: auto;
	}

	.sama-work-carousel__track {
		animation: none;
	}
}
