/* 文章精選頁 */
.articles-page {
	--article-accent: #c8a063;
	--article-accent-dark: #a8864f;
	--article-ink: #1a1a1a;
	--article-muted: #6b6b6b;
	--article-line: #e8e4dc;
	--article-surface: #fff;
	--article-bg: #eceae5;
	--article-radius: 0;
	--article-shadow: 0 8px 28px rgba(26, 26, 26, 0.06);
	--article-shadow-hover: 0 16px 40px rgba(26, 26, 26, 0.1);
}

.articles-page {
	background-color: var(--article-bg);
}

.articles-page .portfolio-wrap {
	padding-top: 8px;
}

/* 文章卡片網格 */
.articles-page .articles-grid {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -12px;
}

.articles-page .articles-grid-col {
	box-sizing: border-box;
	padding: 0 12px 28px;
	flex: 0 0 50%;
	max-width: 50%;
}

@media (min-width: 1280px) {
	.articles-page .articles-grid-col {
		flex: 0 0 33.333333%;
		max-width: 33.333333%;
	}
}

@media (max-width: 575px) {
	.articles-page .articles-grid-col {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

.articles-page .article-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--article-surface);
	border-radius: var(--article-radius);
	overflow: hidden;
	box-shadow: var(--article-shadow);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.articles-page .article-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--article-shadow-hover);
}

.articles-page .article-card__media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #ddd8d0;
}

.articles-page .article-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(26, 26, 26, 0.18) 100%);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.articles-page .article-card:hover .article-card__media::after {
	opacity: 1;
}

.articles-page .article-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.articles-page .article-card:hover .article-card__media img {
	transform: scale(1.06);
}

.articles-page .article-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b5aea2;
	background: linear-gradient(135deg, #f5f3ef 0%, #e6e2da 100%);
}

.articles-page .article-card__placeholder svg {
	width: 28%;
	max-width: 56px;
	height: auto;
}

.articles-page .article-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 18px 20px 20px;
	letter-spacing: 0;
}

.articles-page .article-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin: 0 0 10px;
}

.articles-page .article-card__date {
	display: inline-block;
	width: fit-content;
	margin: 0;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.04em;
	color: var(--article-accent-dark);
	background: rgba(200, 160, 99, 0.14);
	border-radius: 0;
}

.articles-page .article-card__category {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--article-muted);
	background: #f0eeea;
	text-decoration: none;
	border-radius: 0;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.articles-page .article-card__category:hover {
	color: var(--article-accent-dark);
	background: rgba(200, 160, 99, 0.14);
}

.articles-page .article-card__title {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--article-ink);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.articles-page .article-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.25s ease;
}

.articles-page .article-card:hover .article-card__title a {
	color: var(--article-accent-dark);
}

.articles-page .article-card__excerpt {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.65;
	color: var(--article-muted);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.articles-page .article-card__more {
	margin-top: auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--article-ink);
	text-decoration: none;
	letter-spacing: 0.02em;
	transition: color 0.25s ease, letter-spacing 0.25s ease;
}

.articles-page .article-card__more::after {
	content: " →";
	color: var(--article-accent);
}

.articles-page .article-card__more:hover {
	color: var(--article-accent-dark);
	letter-spacing: 0.06em;
}

@media (max-width: 768px) {
	.articles-page .article-card__title {
		font-size: 15px;
	}

	.articles-page .article-card__body {
		padding: 16px 16px 18px;
	}
}

/* 分頁（沿用原本 .pagination 樣式） */
.articles-page .pagination {
	margin: auto;
	width: fit-content;
	display: flex;
	align-items: center;
}

.articles-page .pagination select {
	border: 1px solid #c1c1c1;
	padding: 2px 20px;
	border-radius: 5px;
}

.articles-page .pagination a {
	display: flex;
	align-items: center;
}

.articles-page .pagination a.disabled {
	display: none;
}

/* 空狀態 */
.articles-page .articles-empty {
	min-height: 320px;
	margin: 24px 12px;
	padding: 48px 24px;
	text-align: center;
	background: var(--article-surface);
	border-radius: var(--article-radius);
	box-shadow: var(--article-shadow);
}

.articles-page .articles-empty__title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--article-ink);
}

.articles-page .articles-empty__text {
	margin: 0;
	font-size: 14px;
	color: var(--article-muted);
}

/* 側欄 */
.articles-page .articles-sidebar-panel {
	background: var(--article-surface);
	border-radius: var(--article-radius);
	box-shadow: var(--article-shadow);
	overflow: hidden;
}

.articles-page .articles-sidebar-panel .card-body {
	padding: 24px 22px 28px;
	letter-spacing: 0;
	line-height: 1.7;
}

.articles-page .articles-sidebar__intro {
	margin-bottom: 28px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--article-line);
	text-align: center;
}

.articles-page .articles-sidebar__logo {
	display: block;
	max-width: 56px;
	width: 100%;
	margin: 0 auto 12px;
}

.articles-page .articles-sidebar__brand {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 700;
	color: var(--article-ink);
}

.articles-page .articles-sidebar__desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.75;
	color: var(--article-muted);
	text-align: justify;
}

.articles-page .articles-sidebar__section {
	margin-bottom: 26px;
}

.articles-page .articles-sidebar__section:last-child {
	margin-bottom: 0;
}

.articles-page .articles-sidebar__heading {
	position: relative;
	margin: 0 0 14px;
	padding-left: 12px;
	font-size: 15px;
	font-weight: 700;
	color: var(--article-ink);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.articles-page .articles-sidebar__heading::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15em;
	bottom: 0.15em;
	width: 3px;
	border-radius: 0;
	background: var(--article-accent);
}

.articles-page .articles-sidebar__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.articles-page .articles-sidebar__list li {
	padding: 0;
	border-bottom: 1px solid var(--article-line);
}

.articles-page .articles-sidebar__list li:last-child {
	border-bottom: 0;
}

.articles-page .articles-sidebar__list a {
	display: block;
	padding: 11px 4px;
	font-size: 14px;
	line-height: 1.5;
	color: #444;
	text-decoration: none;
	transition: color 0.2s ease, padding-left 0.2s ease;
}

.articles-page .articles-sidebar__list a:hover {
	color: var(--article-accent-dark);
	padding-left: 8px;
}

.articles-page .articles-sidebar-search-input {
	display: block;
	width: 100%;
	height: 36px;
	padding: 6px 12px;
	box-sizing: border-box;
	border: 1px solid var(--article-line);
	border-radius: 0;
	background: #faf9f7;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.articles-page .articles-sidebar-search-input:focus {
	border-color: var(--article-accent);
	box-shadow: 0 0 0 3px rgba(200, 160, 99, 0.2);
	outline: 0;
}

.articles-page .articles-sidebar__search-btn {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 10px 16px;
	border: 0;
	border-radius: 0;
	background: var(--article-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.articles-page .articles-sidebar__search-btn:hover {
	background: var(--article-accent-dark);
}

/* 側欄版面與抽屜 */
.articles-page .articles-layout-row {
	display: flex;
	flex-wrap: wrap;
	margin-left: -15px;
	margin-right: -15px;
}

.articles-page .articles-main,
.articles-page .articles-sidebar {
	position: relative;
	width: 100%;
	padding-left: 15px;
	padding-right: 15px;
	box-sizing: border-box;
}

@media (min-width: 1025px) {
	.articles-page .articles-main {
		flex: 0 0 75%;
		max-width: 75%;
	}

	.articles-page .articles-sidebar {
		flex: 0 0 25%;
		max-width: 25%;
	}

	.articles-page .articles-sidebar-panel {
		margin-bottom: 3rem;
	}

	.articles-page .articles-sidebar-toggle,
	.articles-page .articles-sidebar-backdrop,
	.articles-page .articles-sidebar-close {
		display: none !important;
	}
}

@media (max-width: 1024px) {
	.articles-page .articles-main {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.articles-page .articles-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 1001;
		flex: none;
		max-width: none;
		width: min(300px, 88vw);
		height: 100vh;
		height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		margin: 0;
		padding: 0;
		transform: translateX(-100%);
		transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
		overflow: hidden;
		display: flex;
		flex-direction: column;
		background: var(--article-surface);
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.14);
		pointer-events: none;
	}

	.articles-page .articles-sidebar.is-open {
		transform: translateX(0);
		pointer-events: auto;
	}

	.articles-page .articles-sidebar-scroll {
		flex: 1 1 auto;
		min-height: 0;
		padding: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: var(--article-surface);
	}

	.articles-page .articles-sidebar .articles-sidebar-panel {
		margin: 0;
		min-height: 100%;
		border-radius: 0;
		box-shadow: none;
		background: var(--article-surface);
	}

	.articles-page .articles-sidebar .articles-sidebar-panel .card-content,
	.articles-page .articles-sidebar .articles-sidebar-panel .card-body {
		background: var(--article-surface);
	}

	.articles-page .articles-sidebar .articles-sidebar-panel .card-body {
		padding: 56px 22px 28px;
	}

	.articles-page .articles-sidebar .articles-sidebar-search-input {
		background: #fff;
	}

	.articles-page .articles-sidebar-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1000;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
			visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	}

	.articles-page .articles-sidebar-backdrop.is-visible {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.articles-page .articles-sidebar-toggle {
		position: fixed;
		left: 25px;
		bottom: 25px;
		z-index: 999;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-width: 48px;
		height: 48px;
		padding: 0 14px;
		border: 0;
		border-radius: 0;
		background: #555;
		color: #fff;
		font-size: 14px;
		font-weight: 600;
		line-height: 1;
		cursor: pointer;
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
		transition: background-color 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
			opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	}

	.articles-page .articles-sidebar-toggle:hover {
		background: var(--article-accent);
	}

	.articles-page .articles-sidebar-toggle svg {
		display: block;
		width: 20px;
		height: 20px;
		flex-shrink: 0;
	}

	.articles-page .articles-sidebar-close {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 12px;
		right: 20px;
		left: auto;
		width: 36px;
		height: 36px;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: rgba(0, 0, 0, 0.06);
		color: #333;
		cursor: pointer;
		z-index: 2;
		transition: background-color 0.2s ease;
	}

	.articles-page .articles-sidebar-close:hover {
		background: rgba(200, 160, 99, 0.35);
	}
}

body.articles-sidebar-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.articles-page .article-card,
	.articles-page .article-card__media img,
	.articles-page .articles-sidebar,
	.articles-page .articles-sidebar-backdrop,
	.articles-page .articles-sidebar-toggle {
		transition: none;
	}

	.articles-page .article-card:hover {
		transform: none;
	}
}
