@charset "UTF-8";

/* ══════════════════════════════════════════════════════════════════════
   PlayPlus 作品集頁面樣式 (Portfolio Page Styles)
   檔案路徑：css/portfolio.css
   說明：作品集頁面專用樣式，包含 Hero 數據橫式展示、搜尋篩選列、
         標籤面板、作品卡片過渡動效與 RWD 響應式佈局。
   ══════════════════════════════════════════════════════════════════════ */

/* ── 1. Hero 區塊 ── */
.pf-hero {
	position: relative;
	padding: var(--space-4xl) 0 var(--space-sm);
}

.pf-hero .container {
	position: relative;
	z-index: 1;
}

.pf-hero-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 5rem);
	align-items: center;
}

.pf-hero-title {

	color: var(--swatch-slate-dark);

	margin: 0 0 var(--space-xl) 0;
}

/* 段落樣式與「專業服務」Hero 一致：一般字重、不加粗 */
.pf-hero-subtitle,
.pf-hero-desc {
	max-width: 620px;
	font-size: round(nearest, clamp(1rem, 1.25vw, 1.15rem), 2px);
	font-weight: 400;
	color: var(--swatch-slate-light);
	line-height: 1.85;
	margin: 0;
}

.pf-hero-subtitle {
	margin-bottom: var(--space-sm);
}

/* 綠色標記在第二行標題後方，進場時由左至右畫出（同專業服務 Hero） */
.pf-hero-content.visible .services-marker::before {
	transform: scaleX(1) rotate(-1deg);
}

/* 右側成果數據：以分隔線與字級建立層次。 */
.pf-hero-stats {
	list-style: none;
	margin: 0;
	padding: var(--space-2xl) 0;
	border-top: 1px solid var(--border-light);
	border-bottom: 1px solid var(--border-light);
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	container-type: inline-size;
	width: 100%;
	align-self: center;
}

.pf-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	min-width: 0;
	gap: var(--space-2xs);
	padding: var(--space-2xs);
	text-align: center;
	border-right: 1px solid rgba(21, 22, 26, 0.09);
}

.pf-stat:last-child {
	border-right: none;
}

.pf-stat-num {
	font-family: var(--font-sans);
	font-size: round(nearest, clamp(1.75rem, 9cqw, 3.5rem), 2px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--swatch-slate-dark);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pf-stat-plus {
	color: var(--swatch-brand-green);
	margin-left: 2px;
}

.pf-stat-label {
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--swatch-slate-light);
	line-height: 1.4;
	text-wrap: balance;
}

/* ── 2. 搜尋篩選列 ── */
.pf-filter {
	position: relative;
	z-index: 5;
	padding: 0 0 var(--space-xl);
	background: transparent;
}

.pf-bar {
	display: grid;
	grid-template-columns: minmax(0, 3.8fr) repeat(3, minmax(0, 1fr));
	gap: var(--space-xs);
	padding: var(--space-xs);
	background: var(--swatch-white);
	box-shadow: var(--shadow-1);
	border: none;
	border-radius: var(--radius-card);
}

.pf-search {
	position: relative;
}

.pf-search-icon {
	position: absolute;
	left: 18px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	color: var(--swatch-cloud-dark);
	pointer-events: none;
	transition: color var(--duration-fast) ease;
}

.pf-search:focus-within .pf-search-icon {
	color: var(--swatch-brand-green);
}

.pf-input,
.pf-dd-btn {
	width: 100%;
	height: 54px;
	font-family: var(--font-sans);
	font-size: var(--text-base);
	font-weight: 400;
	color: var(--text-primary);
	background: var(--swatch-ivory-light);
	border: none;
	border-radius: var(--radius-md);
	transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.pf-input {
	padding: 0 var(--space-md) 0 48px;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.pf-input::placeholder {
	color: var(--text-muted);
	font-weight: 400;
}

.pf-input::-webkit-search-cancel-button {
	display: none;
}

.pf-input:hover,
.pf-dd-btn:hover {
	background: var(--swatch-ivory-medium);
	border-color: var(--swatch-cloud-light);
}

.pf-input:focus {
	background: var(--swatch-white);
	border-color: var(--swatch-brand-green);
	box-shadow: 0 0 0 3px rgba(51, 204, 51, 0.15);
}

/* 下拉選單組件 */
.pf-dd {
	position: relative;
}

.pf-dd-btn {
	display: flex;
	align-items: center;
	gap: var(--space-2xs);
	padding: 0 var(--space-md);
	cursor: pointer;
	text-align: left;
}

.pf-dd-label {
	flex: 1;
	white-space: nowrap;
}

.pf-dd-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--swatch-brand-green);
	color: var(--swatch-white);
	font-size: var(--text-xs);
	font-weight: 800;
}

.pf-dd-count[hidden] {
	display: none;
}

.pf-dd-chevron {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: var(--swatch-cloud-dark);
	transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast) ease;
}

.pf-dd.is-open .pf-dd-btn {
	background: var(--swatch-white);
	border-color: var(--swatch-brand-green);
	box-shadow: 0 0 0 3px rgba(51, 204, 51, 0.15);
}

.pf-dd.is-open .pf-dd-chevron {
	transform: rotate(180deg);
	color: var(--swatch-brand-green);
}

.pf-dd.is-active .pf-dd-btn {
	background: var(--state-success-bg);
	border-color: var(--swatch-brand-green);
}

.pf-dd.is-open .pf-dd-btn,
.pf-dd .pf-dd-btn:focus {
	outline: none;
	border-color: var(--swatch-brand-green);
	box-shadow: 0 0 0 3px rgba(51, 204, 51, 0.15);
}

.pf-dd-panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 20;
	min-width: 100%;
	width: max-content;
	max-width: 86vw;
	padding: var(--space-2xs);
	background: var(--bg-card);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--border-light-subtle);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-3);
	animation: pf-pop var(--duration-fast) var(--ease-out);
}

.pf-dd-panel[hidden] {
	display: none;
}

.pf-dd:last-child .pf-dd-panel {
	left: auto;
	right: 0;
}

.pf-dd-panel.is-wide {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--space-2xs);
	width: 400px;
}

.pf-dd-panel.is-wide[hidden] {
	display: none;
}

@keyframes pf-pop {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.pf-opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius-sm);
	font-size: var(--text-base);
	line-height: 24px;
	font-weight: 400;
	color: var(--text-primary);
	cursor: pointer;
	white-space: nowrap;
	transition: background var(--duration-fast) ease;
	user-select: none;
}

.pf-opt:hover {
	color: var(--swatch-brand-green);
	background: rgba(21, 22, 26, 0.035);
}

.pf-opt input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.pf-opt-box {
	position: relative;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--swatch-cloud-dark);
	border-radius: 5px;
	background: var(--swatch-white);
	transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.pf-opt-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1.5px;
	width: 5px;
	height: 10px;
	border: solid var(--swatch-white);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform var(--duration-fast) var(--ease-out);
}

.pf-opt input:checked + .pf-opt-box {
	background: var(--swatch-brand-green);
	border-color: var(--swatch-brand-green);
}

.pf-opt input:checked + .pf-opt-box::after {
	transform: rotate(45deg) scale(1);
}

.pf-opt input:focus-visible + .pf-opt-box {
	box-shadow: 0 0 0 3px rgba(51, 204, 51, 0.25);
}

/* ── 3. 已選條件 ＋ 結果數量 ── */
.pf-meta {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-lg);
	margin-top: var(--space-md);
	min-height: 36px;
}

/* 過渡從搜尋列下緣開始，隨已選條件區高度延伸至白底作品清單。 */
.pf-meta::before {
	content: "";
	position: absolute;
	top: calc(-1 * var(--space-md));
	bottom: calc(-1 * var(--space-xl));
	left: calc(50% - 50vw);
	right: calc(50% - 50vw);
	background: linear-gradient(to bottom, transparent, var(--swatch-white));
	pointer-events: none;
	z-index: -1;
}

.pf-active {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--space-2xs);
}

.pf-active[hidden] {
	display: none;
}

.pf-active-title {
	font-size: var(--text-sm);
	font-weight: 700;
	color: var(--swatch-slate-light);
	margin-right: var(--space-3xs);
}

.pf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 6px 0 var(--space-xs);
	background: var(--swatch-white);
	border: 1px solid var(--swatch-cloud-light);
	border-radius: var(--radius-full);
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--swatch-slate-dark);
	animation: pf-pop var(--duration-fast) var(--ease-out);
}

.pf-chip-key {
	color: var(--swatch-cloud-dark);
	font-weight: 600;
}

.pf-chip-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--swatch-slate-light);
	cursor: pointer;
	transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.pf-chip-x:hover {
	background: transparent;
	color: var(--swatch-brand-green);
}

.pf-chip-x svg {
	width: 10px;
	height: 10px;
}

.pf-clear {
	display: inline-flex;
	align-items: center;
	height: auto;
	min-height: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	border: none;

	box-shadow: none;
	font-family: inherit;
	font-size: var(--text-xs);
	font-weight: 700;
	color: var(--text-secondary);
	cursor: pointer;
	line-height: 1.2;
	text-decoration: none;
	transition: color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

.pf-clear:hover {
	border-color: transparent;
	color: var(--swatch-brand-green);
	background: transparent;
	text-decoration: underline;
}

.pf-clear[hidden] {
	display: none;
}

.pf-count {
	flex-shrink: 0;
	margin-left: auto;
	padding-top: 6px;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--swatch-slate-light);
	white-space: nowrap;
}

.pf-count strong {
	color: var(--swatch-slate-dark);
	font-size: var(--text-md);
	font-weight: 800;
	margin: 0 2px;
}

/* ── 4. 作品集清單 ── */
.pf-list-section {
	position: relative;
	z-index: 1;
	padding-top: var(--space-md);
	background: var(--bg-surface-white, var(--swatch-white));
}

.pf-list-section .portfolio-card[hidden] {
	display: none;
}

.pf-list-section .portfolio-card.pf-enter {
	animation: pf-card-in 0.55s var(--ease-out) both;
}

@keyframes pf-card-in {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* 關鍵字命中：文字變紅色 */
.pf-hit {
	background: transparent;
	color: var(--state-error);
	font-weight: 800;
}

/* 無結果狀態 */
.pf-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: var(--space-9xl) var(--space-lg);
}

.pf-empty[hidden] {
	display: none;
}

.pf-empty-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: var(--space-lg);
	border-radius: 50%;
	background: var(--swatch-white);
	border: 1px solid var(--swatch-cloud-light);
	color: var(--swatch-cloud-dark);
	box-shadow: var(--shadow-1);
}

.pf-empty-icon svg {
	width: 30px;
	height: 30px;
}

.pf-empty-title {
	font-size: var(--text-xl);
	font-weight: 700;
	color: var(--swatch-slate-dark);
	margin: 0 0 var(--space-2xs) 0;
}

.pf-empty-desc {
	font-size: var(--text-base);
	color: var(--swatch-slate-light);
	line-height: 1.7;
	margin: 0 0 var(--space-xl) 0;
}

/* ── 5. RWD 響應式 ── */
@media (max-width: 1100px) {
	.pf-bar {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.pf-search {
		grid-column: 1 / -1;
	}

	.pf-dd:last-child .pf-dd-panel {
		right: 0;
	}
}

@media (max-width: 991px) {
	.pf-hero {
		padding: var(--space-2xl) 0 var(--space-lg);
	}

	.pf-hero-inner {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-3xl);
	}

	.pf-hero-title {

		margin-bottom: var(--space-lg);
	}

	.pf-hero-stats {
		justify-self: stretch;
		max-width: none;
	}
}

@media (max-width: 640px) {
	.pf-hero-stats {
		padding: var(--space-md) 0;
		gap: 0;
	}

	.pf-stat {
		padding: var(--space-3xs) var(--space-2xs);
	}

	.pf-stat-label {
		font-size: var(--text-xs);
		white-space: normal;
	}

	.pf-bar {
		grid-template-columns: 1fr 1fr;
	}

	.pf-dd:nth-child(4) {
		grid-column: 1 / -1;
	}

	.pf-dd-panel,
	.pf-dd-panel.is-wide {
		width: min(86vw, 340px);
	}

	.pf-dd:nth-child(3) .pf-dd-panel,
	.pf-dd:nth-child(4) .pf-dd-panel {
		left: auto;
		right: 0;
	}

	.pf-dd-panel.is-wide {
		grid-template-columns: 1fr;
	}

	.pf-meta {
		flex-direction: column-reverse;
		gap: var(--space-xs);
	}

	.pf-count {
		margin-left: 0;
		padding-top: 0;
	}
}

/* ── 6. 偏好減少動效 ── */
@media (prefers-reduced-motion: reduce) {
	.pf-dd-panel,
	.pf-chip,
	.pf-list-section .portfolio-card.pf-enter {
		animation: none;
	}
}

/* 自適應已選條件：收合時依實際寬度保留一列，展開後自然換行。 */
.pf-active-list {
	display: flex;
	flex: 1;
	min-width: 0;
	align-items: center;
	gap: var(--space-2xs);
}
.pf-active-list.is-expanded { flex-wrap: wrap; }
.pf-chip {
	flex-shrink: 0;
	max-width: 100%;
	font-weight: 400;
}
.pf-chip-value {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pf-chip-x { flex-shrink: 0; }
.pf-chip[hidden], .pf-more[hidden] { display: none; }
.pf-more {
	flex-shrink: 0;
	border: 0;
	background: transparent;
	color: var(--text-secondary);
	padding: 6px 0;
	font: inherit;
	font-size: var(--text-sm);
	white-space: nowrap;
	cursor: pointer;
}
.pf-more:hover { color: var(--swatch-brand-green); }
.pf-clear { flex-shrink: 0; min-height: 34px; white-space: nowrap; }
.pf-more:focus-visible, .pf-clear:focus-visible, .pf-chip-x:focus-visible {
	outline: 2px solid var(--swatch-brand-green);
	outline-offset: 2px;
}
@media (max-width: 768px) {
	.pf-active { width: 100%; }
}

/* 保留已選狀態，標籤、清除操作與結果數共用垂直中線。 */
.pf-meta { align-items: center; }
.pf-active-title { flex-shrink: 0; white-space: nowrap; margin-right: 0; }
.pf-active .pf-clear {
	align-self: center;
	align-items: center;
	justify-content: center;
	height: 34px;
	line-height: normal;
}
.pf-count { padding-top: 0; }
@media (max-width: 640px) {
	.pf-meta { align-items: stretch; }
	.pf-active {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
	}
	.pf-active[hidden] { display: none; }
	.pf-active-title { grid-column: 1 / -1; }
}

/* 寬螢幕（1200px 以上）：左側文案 60%、右側數據 40%，文案不受舊的寬度上限限制 */
@media (min-width: 1200px) {
	.pf-hero-inner {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.pf-hero-subtitle,
	.pf-hero-desc {
		max-width: none;
	}
}

/* 桌機：與知識筆記 Hero 等高（同一高度基準） */
@media (min-width: 992px) {
	.pf-hero-inner {
		min-height: clamp(340px, 26vw, 380px);
	}

	.pf-hero-content {
		align-self: start;
	}
}

/* 作品集清單：列與列之間的垂直間距加大，避免卡片過於擁擠 */
.portfolio-grid {
  row-gap: var(--space-7xl);
}

/* 手機版單欄排列時，64px 的列距會讓使用者要滑很久，減半為 32px */
@media (max-width: 768px) {
  .portfolio-grid {
    row-gap: 32px;
  }
}

/* ── 作品集列表：外層包裝的底部留白會露出米色漸層，改由白底清單區承接 ── */
.hero-scenarios-wrapper:has(.pf-list-section) {
	padding-bottom: 0;
}

.pf-list-section {
	padding-bottom: 3.5rem;
}
