/**
 * ========================================================
 * XT Category Gallery Styles
 * Page ID: 2933
 *
 * 文件位置：
 * wp-content/themes/elementra/xt-custom/assets/css/xt-gallery.css
 *
 * 说明：
 * 1. 修复主题按钮样式干扰
 * 2. 修复弹窗关闭按钮变形
 * 3. 重做整体配色，走简约高端暖中性色
 * 4. 优化 PC / Tablet / Mobile 三端
 * ========================================================
 */

/* ========================================================
   Page base reset
   ======================================================== */

body.page-id-2933 .page_title_wrap,
body.page-id-2933 .top_panel_title,
body.page-id-2933 .sc_layouts_title,
body.page-id-2933 .post_header,
body.page-id-2933 .entry-header,
body.page-id-2933 .entry-title,
body.page-id-2933 .page_title,
body.page-id-2933 h1.page_title,
body.page-id-2933 h1.entry-title,
body.page-id-2933 .wp-block-post-title,
body.page-id-2933 .trx_addons_page_title,
body.page-id-2933 .sc_item_title {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

body.page-id-2933 .page_content_wrap,
body.page-id-2933 .content_wrap,
body.page-id-2933 .content,
body.page-id-2933 .site-content,
body.page-id-2933 .entry-content,
body.page-id-2933 .post_content,
body.page-id-2933 .post_item_single {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

body.page-id-2933 .page_content_wrap > .content_wrap,
body.page-id-2933 .content_wrap,
body.page-id-2933 .content {
	width: 100% !important;
	max-width: none !important;
}

body.page-id-2933 header.top_panel .elementor-element-133f72e,
body.page-id-2933 .top_panel_custom_266 .elementor-element-133f72e,
body.page-id-2933 .elementor-element-133f72e {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

/* ========================================================
   Theme button isolation
   彻底隔离主题 button 样式干扰
   ======================================================== */

.xt-gallery-page button,
.xt-gallery-page .xt-gallery-play,
.xt-gallery-page .xt-gallery-static,
.xt-gallery-page .xt-gallery-close {
	appearance: none;
	-webkit-appearance: none;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	background-image: none !important;
	color: inherit !important;
	font-family: inherit !important;
	font-size: inherit;
	line-height: normal;
	text-transform: none !important;
	text-decoration: none !important;
}

.xt-gallery-page .xt-gallery-play:hover,
.xt-gallery-page .xt-gallery-play:focus,
.xt-gallery-page .xt-gallery-play:active,
.xt-gallery-page .xt-gallery-static:hover,
.xt-gallery-page .xt-gallery-static:focus,
.xt-gallery-page .xt-gallery-static:active,
.xt-gallery-page .xt-gallery-close:hover,
.xt-gallery-page .xt-gallery-close:focus,
.xt-gallery-page .xt-gallery-close:active {
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

/* ========================================================
   Design tokens
   ======================================================== */

.xt-gallery-page {
	--xt-gallery-bg: #f6f1ea;
	--xt-gallery-paper: #fffdfa;
	--xt-gallery-soft: #efe4d6;
	--xt-gallery-soft-2: #e8d8c6;
	--xt-gallery-dark: #171412;
	--xt-gallery-text: #4f4741;
	--xt-gallery-muted: #786f66;
	--xt-gallery-line: rgba(23, 20, 18, 0.10);
	--xt-gallery-line-strong: rgba(23, 20, 18, 0.16);
	--xt-gallery-accent: #b58c5a;
	--xt-gallery-accent-dark: #8a633d;
	--xt-gallery-accent-soft: rgba(181, 140, 90, 0.12);
	--xt-gallery-shadow: 0 18px 50px rgba(45, 34, 24, 0.08);
	--xt-gallery-shadow-hover: 0 26px 72px rgba(45, 34, 24, 0.14);
	--xt-gallery-max: 1200px;

	background: var(--xt-gallery-bg);
	color: var(--xt-gallery-text);
	font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
	overflow: hidden;
}

.xt-gallery-page * {
	box-sizing: border-box;
}

.xt-gallery-page a {
	color: inherit;
	text-decoration: none;
}

.xt-gallery-container {
	width: min(var(--xt-gallery-max), calc(100% - 40px));
	margin: 0 auto;
}

/* ========================================================
   Hero
   ======================================================== */

.xt-gallery-hero {
	padding: 86px 0 42px;
	background:
		radial-gradient(circle at 12% 10%, rgba(181, 140, 90, 0.18), transparent 32%),
		radial-gradient(circle at 88% 10%, rgba(23, 20, 18, 0.05), transparent 28%),
		linear-gradient(180deg, #fbf8f4 0%, var(--xt-gallery-bg) 100%);
}

.xt-gallery-hero-inner {
	max-width: 860px;
	margin: 0 auto;
	text-align: center;
}

.xt-gallery-kicker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 14px;
	color: var(--xt-gallery-accent-dark);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.xt-gallery-kicker::before,
.xt-gallery-kicker::after {
	content: "";
	width: 30px;
	height: 1px;
	background: var(--xt-gallery-accent);
}

.xt-gallery-hero h1 {
	margin: 0 0 18px;
	color: var(--xt-gallery-dark);
	font-size: clamp(38px, 5vw, 66px);
	line-height: 1.05;
	letter-spacing: -0.055em;
	font-weight: 850;
}

.xt-gallery-hero p {
	max-width: 760px;
	margin: 0 auto;
	color: var(--xt-gallery-muted);
	font-size: 16px;
	line-height: 1.8;
}

/* ========================================================
   Section
   ======================================================== */

.xt-gallery-section {
	padding: 36px 0 96px;
}

.xt-gallery-toolbar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 28px;
}

.xt-gallery-toolbar h2 {
	margin: 0;
	color: var(--xt-gallery-dark);
	font-size: clamp(26px, 3vw, 42px);
	line-height: 1.15;
	letter-spacing: -0.04em;
	font-weight: 850;
}

.xt-gallery-toolbar p {
	max-width: 430px;
	margin: 0;
	color: var(--xt-gallery-muted);
	font-size: 14px;
	line-height: 1.75;
}

/* ========================================================
   Grid / Card
   ======================================================== */

.xt-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.xt-gallery-card {
	position: relative;
	border-radius: 28px;
	background: var(--xt-gallery-paper);
	border: 1px solid var(--xt-gallery-line);
	box-shadow: var(--xt-gallery-shadow);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.xt-gallery-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--xt-gallery-shadow-hover);
	border-color: rgba(181, 140, 90, 0.24);
}

.xt-gallery-play,
.xt-gallery-static {
	display: block;
	width: 100%;
	padding: 0 !important;
	margin: 0 !important;
	text-align: left;
	cursor: pointer;
	border-radius: 0 !important;
}

.xt-gallery-static {
	cursor: default;
}

.xt-gallery-image {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: linear-gradient(145deg, #d9c9b7 0%, #b6a18b 48%, #746555 100%);
	overflow: hidden;
}

.xt-gallery-image img {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s ease, opacity 0.25s ease;
}

.xt-gallery-card:hover .xt-gallery-image img {
	transform: scale(1.055);
}

.xt-gallery-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background:
		linear-gradient(180deg, rgba(23, 20, 18, 0.06) 0%, rgba(23, 20, 18, 0.40) 100%);
	pointer-events: none;
}

.xt-gallery-fallback {
	position: absolute;
	left: 18px;
	top: 18px;
	z-index: 0;
	color: rgba(255, 255, 255, 0.90);
	font-size: 16px;
	font-weight: 800;
}

.xt-gallery-play-icon {
	position: absolute;
	right: 18px;
	bottom: 18px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	min-width: 58px;
	min-height: 58px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--xt-gallery-dark);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
	transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.xt-gallery-play-icon svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.xt-gallery-card:hover .xt-gallery-play-icon {
	transform: scale(1.08);
	background: var(--xt-gallery-accent);
	color: #ffffff;
}

.xt-gallery-image-label {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.90);
	color: var(--xt-gallery-dark);
	font-size: 12px;
	font-weight: 800;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.xt-gallery-body {
	display: block;
	padding: 22px;
	background: var(--xt-gallery-paper);
}

.xt-gallery-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.xt-gallery-meta b {
	color: var(--xt-gallery-accent-dark);
	font-size: 13px;
	letter-spacing: 0.08em;
	font-weight: 800;
}

.xt-gallery-meta em {
	color: var(--xt-gallery-muted);
	font-size: 12px;
	font-style: normal;
}

.xt-gallery-body strong {
	display: block;
	margin-bottom: 10px;
	color: var(--xt-gallery-dark);
	font-size: 22px;
	line-height: 1.24;
	letter-spacing: -0.02em;
	font-weight: 850;
}

.xt-gallery-body small {
	display: block;
	color: var(--xt-gallery-muted);
	font-size: 14px;
	line-height: 1.72;
}

/* image only card */
.xt-gallery-card--image-only .xt-gallery-body {
	background: #fcfaf7;
}

/* missing image fallback */
.xt-gallery-image-missing {
	background: linear-gradient(145deg, #d9c9b7 0%, #b6a18b 48%, #746555 100%) !important;
}

.xt-gallery-image-missing img {
	opacity: 0 !important;
}

/* ========================================================
   Modal
   ======================================================== */

.xt-gallery-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.xt-gallery-modal.is-open {
	display: flex;
}

.xt-gallery-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 13, 12, 0.72);
	backdrop-filter: blur(6px);
}

.xt-gallery-modal-panel {
	position: relative;
	z-index: 2;
	width: min(980px, 100%);
	border-radius: 28px;
	background: #12100f;
	color: #ffffff;
	overflow: hidden;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.xt-gallery-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.10);
	background: #12100f;
}

.xt-gallery-modal-head .xt-gallery-kicker {
	margin-bottom: 6px;
	color: #d7b07a;
}

.xt-gallery-modal-head .xt-gallery-kicker::before,
.xt-gallery-modal-head .xt-gallery-kicker::after {
	display: none;
}

.xt-gallery-modal-head h2 {
	margin: 0;
	color: #ffffff;
	font-size: 24px;
	line-height: 1.2;
	font-weight: 850;
}

/* 修复关闭按钮 */
.xt-gallery-close {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 46px !important;
	height: 46px !important;
	min-width: 46px !important;
	min-height: 46px !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.10) !important;
	color: #ffffff !important;
	cursor: pointer;
	flex-shrink: 0;
	transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.xt-gallery-close span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 28px;
	line-height: 1;
	font-weight: 400;
}

.xt-gallery-close:hover {
	background: var(--xt-gallery-accent) !important;
	color: #ffffff !important;
	transform: rotate(90deg);
}

.xt-gallery-video-wrap {
	background: #0b0b0b;
}

.xt-gallery-video-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000000;
}

.xt-gallery-video-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.xt-gallery-video-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px 18px;
	background: #151311;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.xt-gallery-video-note {
	color: rgba(255, 255, 255, 0.64);
	font-size: 13px;
	line-height: 1.6;
}

.xt-gallery-video-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--xt-gallery-accent);
	color: #ffffff !important;
	font-size: 13px;
	font-weight: 800;
	transition: transform 0.22s ease, background 0.22s ease;
}

.xt-gallery-video-link:hover {
	transform: translateY(-2px);
	background: var(--xt-gallery-accent-dark);
}

/* ========================================================
   Reveal
   ======================================================== */

.xt-gallery-reveal {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.xt-gallery-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ========================================================
   Tablet
   ======================================================== */

@media (max-width: 1100px) {
	.xt-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.xt-gallery-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.xt-gallery-toolbar p {
		max-width: none;
	}
}

/* ========================================================
   Mobile
   ======================================================== */

@media (max-width: 767px) {
	.xt-gallery-container {
		width: min(100% - 28px, var(--xt-gallery-max));
	}

	.xt-gallery-hero {
		padding: 62px 0 30px;
	}

	.xt-gallery-hero h1 {
		font-size: 40px;
	}

	.xt-gallery-hero p {
		font-size: 15px;
	}

	.xt-gallery-section {
		padding: 28px 0 72px;
	}

	.xt-gallery-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.xt-gallery-card {
		border-radius: 24px;
	}

	.xt-gallery-body {
		padding: 20px;
	}

	.xt-gallery-body strong {
		font-size: 21px;
	}

	.xt-gallery-play-icon {
		width: 54px;
		height: 54px;
		min-width: 54px;
		min-height: 54px;
	}

	.xt-gallery-modal {
		padding: 14px;
	}

	.xt-gallery-modal-panel {
		border-radius: 22px;
	}

	.xt-gallery-modal-head {
		padding: 18px;
	}

	.xt-gallery-modal-head h2 {
		font-size: 20px;
	}

	.xt-gallery-close {
		width: 42px !important;
		height: 42px !important;
		min-width: 42px !important;
		min-height: 42px !important;
	}

	.xt-gallery-video-actions {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ========================================================
   Small mobile
   ======================================================== */

@media (max-width: 390px) {
	.xt-gallery-hero h1 {
		font-size: 34px;
	}

	.xt-gallery-body {
		padding: 18px;
	}
}