/* ==========================================================================
   師傅展示 Masseur Showcase — frontend
   ========================================================================== */

.mtm-empty {
	padding: 24px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	color: #666;
	text-align: center;
	font-size: 14px;
}

.mtm-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: #f1f1f1;
	color: #999;
	font-size: 13px;
}

/* ------------------------------------------------------------------ 主圖牆 */

.mtm-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.mtm-grid-item {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
	transition: transform .35s ease, box-shadow .35s ease;
}

.mtm-grid-item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.mtm-grid-media {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background: #f5f5f5;
}

.mtm-grid-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition: transform .5s ease;
}

.mtm-grid-overlay {
	position: absolute;
	inset: 0;
	background-color: transparent;
	transition: background-color .35s ease;
	pointer-events: none;
}

.mtm-grid-info {
	display: block;
	padding: 12px 8px 8px;
	text-align: center;
}

/* inline-flex：讓姓名列跟著 .mtm-grid-info 的文字對齊走，不必另設控制項 */
.mtm-grid-names {
	display: inline-flex;
	flex-wrap: wrap;
	gap: var(--mtm-name-gap, 10px);
	max-width: 100%;
}

.mtm-grid-names--inline {
	flex-direction: row;
	align-items: baseline;
}

.mtm-grid-names--stack {
	flex-direction: column;
	align-items: stretch;
}

.mtm-grid-name,
.mtm-grid-en,
.mtm-grid-stats {
	display: block;
	line-height: 1.4;
	transition: color .3s ease;
}

.mtm-grid-name {
	font-size: 18px;
	font-weight: 600;
}

.mtm-grid-en {
	font-size: 14px;
	opacity: .85;
	margin: 0;
}

.mtm-grid-stats {
	font-size: 13px;
	opacity: .75;
}

/* 原始比例（不裁切）：讓圖片以自身高度顯示 */
.mtm-ratio-original .mtm-grid-media {
	aspect-ratio: auto;
}

.mtm-ratio-original .mtm-grid-media img {
	height: auto;
	object-fit: contain;
}

/* hover effects */
.mtm-hover-zoom .mtm-grid-item:hover .mtm-grid-media img,
.mtm-hover-both .mtm-grid-item:hover .mtm-grid-media img {
	transform: scale(1.06);
}

.mtm-hover-lift .mtm-grid-item:hover,
.mtm-hover-both .mtm-grid-item:hover {
	transform: translateY(-6px);
}

/* overlay text mode */
.mtm-grid--overlay .mtm-grid-item {
	overflow: hidden;
}

.mtm-grid--overlay .mtm-grid-info {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, .55);
	color: #fff;
	transform: translateY(100%);
	opacity: 0;
	transition: transform .35s ease, opacity .35s ease;
}

.mtm-grid--overlay .mtm-grid-item:hover .mtm-grid-info,
.mtm-grid--overlay .mtm-grid-item:focus-within .mtm-grid-info {
	transform: translateY(0);
	opacity: 1;
}

/* ------------------------------------------------------------------ 卡片 */

.mtm-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px;
}

.mtm-card {
	position: relative;
	overflow: hidden;
	scroll-margin-top: 100px;
}

/* highlight briefly after an anchor jump */
.mtm-card.mtm-is-target {
	animation: mtm-flash 1.6s ease;
}

@keyframes mtm-flash {
	0%   { box-shadow: 0 0 0 0 rgba(201, 162, 39, .55); }
	40%  { box-shadow: 0 0 0 8px rgba(201, 162, 39, .28); }
	100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
}

.mtm-card--side {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

.mtm-card--side .mtm-card-media {
	flex: 0 0 45%;
	max-width: 45%;
}

.mtm-card--side .mtm-card-body {
	flex: 1 1 0;
	min-width: 0;
}

.mtm-card-media {
	position: relative;
}

.mtm-card-body {
	padding: 20px 20px 24px;
}

/* 姓名列：中英文可並排或分兩行，位置可在照片上方或下方 */
.mtm-card-names {
	display: flex;
	flex-wrap: wrap;
	gap: var(--mtm-name-gap, 16px);
}

.mtm-names--inline {
	flex-direction: row;
	align-items: baseline;
	justify-content: var(--mtm-name-align, center);
}

.mtm-names--stack {
	flex-direction: column;
	align-items: var(--mtm-name-align, center);
}

.mtm-card-head {
	padding: 18px 16px 16px;
}

/* 照片在左的版型時，姓名列橫跨整張卡片 */
.mtm-card--side .mtm-card-head {
	flex: 0 0 100%;
	max-width: 100%;
}

.mtm-card-name {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
}

.mtm-card-en {
	margin: 0;
	font-size: 16px;
	letter-spacing: .04em;
	opacity: .8;
}

.mtm-card-stats {
	margin-top: 10px;
	font-size: 15px;
	opacity: .8;
}

.mtm-card-intro {
	margin-top: 12px;
	line-height: 1.75;
}

.mtm-card-intro p {
	margin: 0 0 .6em;
}

.mtm-card-intro p:last-child {
	margin-bottom: 0;
}

.mtm-card-intro-1 {
	margin-top: 16px;
}

/* ------------------------------------------------------------------ Slider */

.mtm-slider {
	position: relative;
	overflow: hidden;
	background: #f5f5f5;
}

.mtm-slides {
	display: flex;
	will-change: transform;
	transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}

.mtm-slider.mtm-no-anim .mtm-slides {
	transition: none;
}

.mtm-slide {
	flex: 0 0 100%;
	width: 100%;
	aspect-ratio: 3 / 4;
	position: relative;
}

.mtm-slide a,
.mtm-slide img {
	display: block;
	width: 100%;
	height: 100%;
}

.mtm-slide img {
	object-fit: cover;
	object-position: center center;
}

/* 原始比例（不裁切）：每張照片保留自己的高度，容器高度由 JS 跟著當前這張走 */
.mtm-slider--auto .mtm-slides {
	align-items: flex-start;
	transition: transform .45s cubic-bezier(.4, 0, .2, 1), height .35s ease;
}

.mtm-slider--auto .mtm-slide {
	aspect-ratio: auto;
	align-self: flex-start;
}

.mtm-slider--auto .mtm-slide a,
.mtm-slider--auto .mtm-slide img {
	height: auto;
}

.mtm-slider--auto .mtm-slide img {
	object-fit: contain;
}

.mtm-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, .35);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transition: opacity .25s ease, background-color .25s ease;
	z-index: 2;
}

.mtm-slider:hover .mtm-arrow,
.mtm-arrow:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.mtm-arrow { opacity: 1; }
}

.mtm-arrow svg {
	width: 55%;
	height: 55%;
}

.mtm-arrow-prev { left: 10px; }
.mtm-arrow-next { right: 10px; }

.mtm-arrow[disabled] {
	opacity: .25 !important;
	cursor: default;
}

.mtm-counter {
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 3px 10px;
	border-radius: 20px;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 12px;
	line-height: 1.6;
	z-index: 2;
}

.mtm-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.mtm-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: background-color .25s ease, transform .25s ease;
}

.mtm-dot.is-active {
	background-color: #c9a227;
	transform: scale(1.25);
}

/* ------------------------------------------------------------------ 手機 */

@media (max-width: 767px) {
	.mtm-card--side .mtm-card-media,
	.mtm-card--side .mtm-card-body {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mtm-slides,
	.mtm-grid-item,
	.mtm-grid-media img,
	.mtm-grid-info {
		transition: none !important;
	}
	.mtm-card.mtm-is-target { animation: none; }
	.mtm-slider--auto .mtm-slides { transition: none !important; }
}

/* ------------------------------------------------------------------ 內建燈箱 */

html.mtm-lb-open {
	overflow: hidden;
}

/* display:flex 會蓋過瀏覽器對 [hidden] 的預設 display:none，
   沒有這條的話「關閉」只會設了屬性、畫面上其實沒關。 */
.mtm-lb[hidden],
.mtm-sw[hidden] {
	display: none !important;
}

.mtm-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .92);
	/* iOS：避開瀏覽器上下工具列 */
	padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
	animation: mtm-lb-in .18s ease;
}

@keyframes mtm-lb-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.mtm-lb-stage {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 16px 60px;
	box-sizing: border-box;
}

.mtm-lb-img {
	pointer-events: auto;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	opacity: 0;
	transition: opacity .2s ease;
	border-radius: 4px;
}

.mtm-lb-img.is-ready {
	opacity: 1;
}

.mtm-lb-spin {
	position: absolute;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mtm-lb-spin .8s linear infinite;
	pointer-events: none;
}

@keyframes mtm-lb-spin {
	to { transform: rotate(360deg); }
}

.mtm-lb-close,
.mtm-lb-prev,
.mtm-lb-next {
	position: absolute;
	z-index: 5;
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
	z-index: 2;
	-webkit-tap-highlight-color: transparent;
}

.mtm-lb-close:hover,
.mtm-lb-prev:hover,
.mtm-lb-next:hover {
	background: rgba(255, 255, 255, .26);
}

.mtm-lb-close {
	top: calc(12px + env(safe-area-inset-top, 0px));
	right: 12px;
	width: 46px;
	height: 46px;
	font-size: 28px;
	line-height: 1;
	background: rgba(255, 255, 255, .18);
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
}

.mtm-lb-prev,
.mtm-lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
}

.mtm-lb-prev { left: 12px; }
.mtm-lb-next { right: 12px; }

.mtm-lb-prev svg,
.mtm-lb-next svg {
	width: 55%;
	height: 55%;
}

.mtm-lb-bar {
	position: absolute;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	left: 0;
	right: 0;
	text-align: center;
	color: rgba(255, 255, 255, .8);
	font-size: 13px;
	pointer-events: none;
}

.mtm-zoom {
	cursor: zoom-in;
}

@media (max-width: 600px) {
	.mtm-lb-stage { padding: 52px 8px 52px; }
	.mtm-lb-prev,
	.mtm-lb-next { width: 40px; height: 40px; }
	.mtm-lb-prev { left: 6px; }
	.mtm-lb-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.mtm-lb { animation: none; }
	.mtm-lb-img { transition: none; }
}

/* ------------------------------------------------------------------ 固定／自訂比例
   比例本身由 render() 以行內樣式輸出（Elementor 的 widget CSS 會蓋掉同權重的規則），
   這裡只負責讓圖片填滿裁切框。 */

.mtm-cards.mtm-ratio-fixed .mtm-slide img,
.mtm-grid.mtm-ratio-fixed .mtm-grid-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ------------------------------------------------------------------ 班表 */

.mtm-card-schedwrap { margin-top: 14px; }

.mtm-sched-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 20px;
	border: 0;
	border-radius: 22px;
	background-color: #b8912f;
	color: #fff;
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	cursor: pointer;
	transition: filter .2s ease, transform .15s ease;
	-webkit-tap-highlight-color: transparent;
}

.mtm-sched-btn::before {
	content: "";
	width: 15px;
	height: 15px;
	background: currentColor;
	-webkit-mask: var(--mtm-cal) center/contain no-repeat;
	mask: var(--mtm-cal) center/contain no-repeat;
	--mtm-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v3M17 2v3M3 9h18M5 4h14a2 2 0 012 2v13a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	flex: 0 0 auto;
}

.mtm-sched-btn:hover { filter: brightness(1.08); }
.mtm-sched-btn:active { transform: translateY(1px); }

/* 班表彈窗 */

html.mtm-sw-open { overflow: hidden; }

.mtm-sw {
	position: fixed;
	inset: 0;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	background: rgba(0, 0, 0, .62);
	animation: mtm-lb-in .18s ease;
}

.mtm-sw[hidden] { display: none; }

.mtm-sw-box {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	color: #23232a;
	border-radius: 12px;
	padding: 22px 20px 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	font-family: "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

.mtm-sw-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #999;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.mtm-sw-close:hover { background: #f1f1ef; color: #333; }

.mtm-sw-title { margin: 0 40px 4px 0; font-size: 19px; font-weight: 700; }
.mtm-sw-sub { margin: 0 0 14px; font-size: 12px; color: #8a8a92; }

.mtm-sw-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.mtm-sw-table th,
.mtm-sw-table td {
	border: 1px solid #ebebe6;
	padding: 8px 6px;
	text-align: center;
	white-space: nowrap;
}

.mtm-sw-table thead th { background: #faf8f2; font-size: 12px; color: #6b6b73; font-weight: 600; }
.mtm-sw-table tbody th { background: #faf8f2; font-weight: 600; width: 62px; }
.mtm-sw-table td.is-on { background: #b8912f; color: #fff; font-weight: 600; }
.mtm-sw-table td.is-off { color: #cfcfd4; }
.mtm-sw-scroll { overflow-x: auto; }

.mtm-sw-legend { margin: 12px 0 0; font-size: 12px; color: #8a8a92; }

@media (max-width: 600px) {
	.mtm-sw { padding: 0; }
	.mtm-sw-box { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; }
	.mtm-sw-table th, .mtm-sw-table td { padding: 7px 4px; font-size: 12px; }
}
