/*
Theme Name: MRT Travel
Theme URI: https://example.com/mrt-travel
Author: MRT Travel
Description: 여행 어필리에이트 콘텐츠 사이트를 위한 독립 실행형 클래식 테마. 빌드 단계 없이 순수 CSS/JS로 동작하며, 상품 데이터는 외부 파이프라인이 REST API로 채웁니다.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mrt-travel
Tags: news, blog, travel, custom-menu, translation-ready, accessibility-ready
*/

/* =========================================================================
   1. 폰트 (로컬 호스팅, KS X 1001 서브셋)
   두 가지 굵기만 쓴다. 400과 800의 강한 대비가 이 테마의 타이포 규칙이다.
   ========================================================================= */

@font-face {
	font-family: 'Pretendard';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: local('Pretendard Regular'),
		url('assets/fonts/Pretendard-Regular.subset.woff2') format('woff2');
}

@font-face {
	font-family: 'Pretendard';
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: local('Pretendard ExtraBold'),
		url('assets/fonts/Pretendard-ExtraBold.subset.woff2') format('woff2');
}

/* =========================================================================
   2. 디자인 토큰 — 색상값은 여기에만 존재한다
   ========================================================================= */

:root {
	/* 색 — 무채색 4 + 액션 1 + 워시 1 */
	--c-ink: #14161a;
	--c-paper: #ffffff;
	--c-line: #e3e5e9;
	--c-mute: #6b7280;
	--c-action: #1b4de4;
	--c-wash: #f4f6f9;

	/* 파생색 (전부 위 6색에서 유도) */
	--c-ink-soft: #3a3f47;
	--c-action-dark: #1439ac;
	--c-action-wash: #eef2fe;
	--c-line-strong: #c8ccd4;
	--c-overlay: rgba(20, 22, 26, 0.62);
	--c-shadow: rgba(20, 22, 26, 0.08);
	--c-shadow-lift: rgba(20, 22, 26, 0.16);
	--c-focus: #1b4de4;

	/* 서체 */
	--ff-base: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
	--ff-num: 'Pretendard', ui-monospace, sans-serif;
	--fw-body: 400;
	--fw-head: 800;

	/* 타입 스케일 — 모바일 기준 */
	--fs-2xs: 0.6875rem;
	--fs-xs: 0.75rem;
	--fs-sm: 0.8125rem;
	--fs-base: 0.9375rem;
	--fs-md: 1.0625rem;
	--fs-lg: 1.1875rem;
	--fs-xl: 1.375rem;
	--fs-2xl: 1.625rem;
	--fs-3xl: 2rem;

	--lh-tight: 1.24;
	--lh-head: 1.32;
	--lh-body: 1.45;
	--lh-read: 1.7;

	/* 신문 헤드라인 밀도: 제목 자간을 좁힌다 */
	--ls-head: -0.035em;
	--ls-tight: -0.02em;
	--ls-wide: 0.02em;

	/* 간격 */
	--sp-1: 0.25rem;
	--sp-2: 0.5rem;
	--sp-3: 0.75rem;
	--sp-4: 1rem;
	--sp-5: 1.25rem;
	--sp-6: 1.5rem;
	--sp-8: 2rem;
	--sp-10: 2.5rem;
	--sp-12: 3rem;

	/* 레이아웃 */
	--w-page: 1120px;
	--w-read: 720px;
	--pad-x: 1rem;
	--h-header: 56px;
	--h-header-min: 44px;
	--h-locbar: 38px;
	--r-sm: 3px;
	--r-md: 6px;
	--r-pill: 999px;

	--z-locbar: 90;
	--z-header: 100;
	--z-sticky-cta: 110;
	--z-overlay: 120;

	--dur: 180ms;
	--ease: cubic-bezier(0.2, 0, 0.2, 1);
}

@media (min-width: 768px) {
	:root {
		--fs-base: 1rem;
		--fs-md: 1.125rem;
		--fs-lg: 1.3125rem;
		--fs-xl: 1.625rem;
		--fs-2xl: 2rem;
		--fs-3xl: 2.75rem;
		--pad-x: 1.5rem;
		--h-header: 64px;
	}
}

/* =========================================================================
   3. 리셋 / 기본
   ========================================================================= */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Anchor targets must clear the collapsed header plus the destination bar. */
	scroll-padding-top: calc(var(--h-header-min) + var(--h-locbar) + var(--sp-4));
}

body {
	margin: 0;
	background: var(--c-paper);
	color: var(--c-ink);
	font-family: var(--ff-base);
	font-size: var(--fs-base);
	font-weight: var(--fw-body);
	line-height: var(--lh-body);
	/* `clip`, not `hidden`: `hidden` would turn body into a scroll container
	   and break the sticky header. */
	overflow-x: clip;
	word-break: keep-all;
	overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
}

img,
picture,
video,
iframe {
	max-width: 100%;
	height: auto;
}

img {
	display: block;
	background: var(--c-wash);
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

input,
select {
	font: inherit;
	color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	font-weight: var(--fw-head);
	line-height: var(--lh-head);
	letter-spacing: var(--ls-head);
}

p,
ul,
ol,
figure,
blockquote,
table {
	margin: 0;
}

ul,
ol {
	padding-left: 1.2em;
}

hr {
	border: 0;
	border-top: 1px solid var(--c-line);
	margin: var(--sp-6) 0;
}

:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

::selection {
	background: var(--c-action);
	color: var(--c-paper);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: var(--sp-2);
	top: -100px;
	z-index: 999;
	padding: var(--sp-2) var(--sp-4);
	background: var(--c-ink);
	color: var(--c-paper);
	border-radius: var(--r-md);
}

.skip-link:focus {
	top: var(--sp-2);
}

/* =========================================================================
   4. 레이아웃 프리미티브
   ========================================================================= */

.mrt-wrap {
	width: 100%;
	max-width: var(--w-page);
	margin-inline: auto;
	padding-inline: var(--pad-x);
}

.mrt-main {
	padding-bottom: var(--sp-12);
}

.mrt-section {
	padding-block: var(--sp-8);
	border-top: 1px solid var(--c-line);
}

.mrt-section--flush {
	border-top: 0;
	padding-top: var(--sp-5);
}

.mrt-section--wash {
	background: var(--c-wash);
}

.mrt-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sp-3);
	margin-bottom: var(--sp-4);
}

.mrt-section__title {
	font-size: var(--fs-lg);
	letter-spacing: var(--ls-head);
}

.mrt-section__title::before {
	content: '';
	display: inline-block;
	width: 4px;
	height: 0.78em;
	margin-right: 0.42em;
	background: var(--c-action);
	vertical-align: baseline;
}

.mrt-section__more {
	flex: none;
	font-size: var(--fs-sm);
	color: var(--c-mute);
	letter-spacing: var(--ls-tight);
}

.mrt-grid {
	display: grid;
	gap: var(--sp-5);
}

@media (min-width: 768px) {
	.mrt-grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mrt-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.mrt-grid--sidebar {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: var(--sp-10);
		align-items: start;
	}
}

/* 가로 스크롤 레일 (지역별 섹션) */
.mrt-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 74%;
	gap: var(--sp-4);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: var(--sp-3);
	margin-inline: calc(var(--pad-x) * -1);
	padding-inline: var(--pad-x);
	scrollbar-width: thin;
}

.mrt-rail > * {
	scroll-snap-align: start;
}

@media (min-width: 600px) {
	.mrt-rail {
		grid-auto-columns: 46%;
	}
}

@media (min-width: 1000px) {
	.mrt-rail {
		grid-auto-columns: 30%;
	}
}

/* =========================================================================
   5. 헤더 / 시그니처 지역 바 / 네비게이션
   ========================================================================= */

/*
 * Sticky, not fixed: the header stays in normal flow, so no page needs a
 * compensating body offset and nothing can ever be hidden underneath it.
 * Scrolling down collapses the top bar to zero height; the destination bar
 * below it rides up to the top edge and never leaves the screen.
 */
.mrt-header {
	position: sticky;
	top: 0;
	z-index: var(--z-header);
	background: var(--c-paper);
	border-bottom: 1px solid var(--c-line);
}

.mrt-header__bar {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	height: var(--h-header);
	overflow: hidden;
	transition: height var(--dur) var(--ease);
}

.mrt-header.is-shrunk .mrt-header__bar {
	height: var(--h-header-min);
}

.mrt-header.is-hidden .mrt-header__bar {
	height: 0;
}

@media (min-width: 900px) {
	/* The desktop GNB has absolutely positioned dropdown panels, which a
	   clipping bar would cut off — so the bar only shrinks, never collapses. */
	.mrt-header__bar {
		overflow: visible;
	}

	.mrt-header.is-hidden .mrt-header__bar {
		height: var(--h-header-min);
	}
}

.mrt-brand {
	font-size: var(--fs-md);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-head);
	margin-right: auto;
	white-space: nowrap;
}

.mrt-brand:hover {
	text-decoration: none;
}

.mrt-brand__logo {
	max-height: 30px;
	width: auto;
}

.mrt-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: none;
	border-radius: var(--r-md);
	color: var(--c-ink);
}

.mrt-iconbtn:hover {
	background: var(--c-wash);
}

.mrt-iconbtn svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* 데스크톱 GNB */
.mrt-gnb {
	display: none;
}

@media (min-width: 900px) {
	.mrt-gnb {
		display: block;
		margin-right: var(--sp-2);
	}

	.mrt-gnb__list {
		display: flex;
		align-items: center;
		gap: var(--sp-5);
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.mrt-gnb__link {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		height: var(--h-header-min);
		font-size: var(--fs-sm);
		font-weight: var(--fw-head);
		letter-spacing: var(--ls-tight);
	}

	.mrt-gnb__link:hover,
	.mrt-gnb__item:focus-within .mrt-gnb__link {
		color: var(--c-action);
		text-decoration: none;
	}

	.mrt-gnb__item {
		position: relative;
	}

	.mrt-gnb__panel {
		position: absolute;
		top: 100%;
		left: 50%;
		transform: translateX(-50%);
		min-width: 420px;
		padding: var(--sp-5);
		background: var(--c-paper);
		border: 1px solid var(--c-line);
		border-radius: var(--r-md);
		box-shadow: 0 12px 28px var(--c-shadow);
		display: none;
	}

	.mrt-gnb__item:hover .mrt-gnb__panel,
	.mrt-gnb__item:focus-within .mrt-gnb__panel,
	.mrt-gnb__panel.is-open {
		display: block;
	}

	.mrt-gnb__cols {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--sp-2) var(--sp-5);
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.mrt-gnb__cols a {
		font-size: var(--fs-sm);
		color: var(--c-ink-soft);
	}

	.mrt-gnb__cols a:hover {
		color: var(--c-action);
	}
}

/* 모바일 전체화면 오버레이 */
.mrt-drawer {
	position: fixed;
	inset: 0;
	z-index: var(--z-overlay);
	background: var(--c-paper);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-bottom: var(--sp-12);
	visibility: hidden;
	opacity: 0;
	transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}

.mrt-drawer.is-open {
	visibility: visible;
	opacity: 1;
}

.mrt-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--h-header);
	border-bottom: 1px solid var(--c-line);
}

.mrt-drawer__title {
	font-size: var(--fs-md);
}

.mrt-drawer__group {
	padding-block: var(--sp-5);
	border-bottom: 1px solid var(--c-line);
}

.mrt-drawer__label {
	display: block;
	margin-bottom: var(--sp-3);
	font-size: var(--fs-xs);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-wide);
	color: var(--c-action);
}

.mrt-drawer__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	list-style: none;
	margin: 0;
	padding: 0;
}

.mrt-drawer__links a {
	display: block;
	padding: var(--sp-2) var(--sp-4);
	border: 1px solid var(--c-line);
	border-radius: var(--r-pill);
	font-size: var(--fs-sm);
	letter-spacing: var(--ls-tight);
}

.mrt-drawer__links a:hover {
	border-color: var(--c-action);
	color: var(--c-action);
	text-decoration: none;
}

body.mrt-noscroll {
	overflow: hidden;
}

/* 검색 오버레이 */
.mrt-searchbox {
	position: fixed;
	inset: 0;
	z-index: var(--z-overlay);
	background: var(--c-overlay);
	visibility: hidden;
	opacity: 0;
	transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}

.mrt-searchbox.is-open {
	visibility: visible;
	opacity: 1;
}

.mrt-searchbox__inner {
	background: var(--c-paper);
	padding-block: var(--sp-6);
	border-bottom: 1px solid var(--c-line);
}

.mrt-searchform {
	display: flex;
	gap: var(--sp-2);
	align-items: stretch;
}

.mrt-searchform input[type='search'] {
	flex: 1 1 auto;
	min-width: 0;
	padding: var(--sp-3) var(--sp-4);
	background: var(--c-wash);
	border: 1px solid var(--c-line);
	border-radius: var(--r-md);
	font-size: var(--fs-md);
}

.mrt-searchform input[type='search']:focus {
	background: var(--c-paper);
	border-color: var(--c-action);
	outline: none;
}

.mrt-searchform button[type='submit'] {
	flex: none;
	padding-inline: var(--sp-5);
	background: var(--c-ink);
	color: var(--c-paper);
	border-radius: var(--r-md);
	font-weight: var(--fw-head);
	font-size: var(--fs-sm);
}

/* ── 시그니처: 항상 붙어 있는 얇은 지역 바 ───────────────────────────── */

.mrt-locbar {
	position: relative;
	z-index: var(--z-locbar);
	height: var(--h-locbar);
	background: var(--c-ink);
	color: var(--c-paper);
	font-size: var(--fs-xs);
	letter-spacing: var(--ls-tight);
}

.mrt-locbar__inner {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	height: var(--h-locbar);
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
}

.mrt-locbar__inner::-webkit-scrollbar {
	display: none;
}

.mrt-locbar__mark {
	flex: none;
	width: 0;
	height: 0;
	border-left: 5px solid var(--c-action);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
}

.mrt-locbar a {
	color: var(--c-paper);
	opacity: 0.72;
}

.mrt-locbar a:hover {
	opacity: 1;
}

.mrt-locbar__sep {
	opacity: 0.4;
}

.mrt-locbar__current {
	font-weight: var(--fw-head);
}

/* =========================================================================
   6. 카드
   ========================================================================= */

/* 가로형 카드 — 이 사이트의 기본형 */
.mrt-card {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: var(--sp-3);
	align-items: start;
	padding-block: var(--sp-4);
	border-bottom: 1px solid var(--c-line);
}

.mrt-card:last-child {
	border-bottom: 0;
}

.mrt-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--r-sm);
	background: var(--c-wash);
}

.mrt-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mrt-card__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--sp-1);
}

.mrt-card__eyebrow {
	font-size: var(--fs-2xs);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-wide);
	color: var(--c-action);
	text-transform: uppercase;
}

.mrt-card__title {
	font-size: var(--fs-base);
	line-height: var(--lh-tight);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mrt-card__title a:hover {
	color: var(--c-action);
	text-decoration: none;
}

.mrt-card__excerpt {
	font-size: var(--fs-sm);
	color: var(--c-mute);
	line-height: var(--lh-body);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mrt-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-1) var(--sp-2);
	margin-top: auto;
	padding-top: var(--sp-1);
	font-size: var(--fs-xs);
	color: var(--c-mute);
	letter-spacing: var(--ls-tight);
}

.mrt-card__meta > * {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.mrt-card__meta .mrt-dot::before {
	content: '·';
	color: var(--c-line-strong);
}

.mrt-card__price {
	font-family: var(--ff-num);
	font-weight: var(--fw-head);
	font-size: var(--fs-sm);
	color: var(--c-action);
	font-variant-numeric: tabular-nums;
	letter-spacing: var(--ls-tight);
}

.mrt-card__price small {
	font-weight: var(--fw-body);
	font-size: var(--fs-2xs);
	color: var(--c-mute);
}

@media (min-width: 600px) {
	.mrt-card {
		grid-template-columns: 148px minmax(0, 1fr);
		gap: var(--sp-4);
	}

	.mrt-card__title {
		font-size: var(--fs-md);
	}
}

/* 리스트 컨테이너 — 카드 사이 구분선만 남긴다 */
.mrt-list > .mrt-card:first-child,
.mrt-list > div:first-child > .mrt-card {
	padding-top: 0;
}

/* 본문에 숏코드로 삽입된 카드 */
.mrt-embedcard {
	padding: var(--sp-2) var(--sp-4);
	margin-block: var(--sp-6);
	border: 1px solid var(--c-line);
	border-left: 3px solid var(--c-action);
	border-radius: 0 var(--r-md) var(--r-md) 0;
	font-size: var(--fs-base);
	line-height: var(--lh-body);
}

/* 세로형 카드 — 레일/그리드용 */
.mrt-card--stack {
	grid-template-columns: minmax(0, 1fr);
	gap: var(--sp-3);
	border-bottom: 0;
	padding-block: 0;
}

.mrt-card--stack .mrt-card__media {
	aspect-ratio: 16 / 10;
	border-radius: var(--r-md);
}

.mrt-card--stack .mrt-card__title {
	font-size: var(--fs-md);
	-webkit-line-clamp: 3;
}

@media (min-width: 600px) {
	.mrt-card--stack {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* 톱 기사 */
.mrt-lead {
	display: grid;
	gap: var(--sp-4);
	padding-bottom: var(--sp-6);
	border-bottom: 2px solid var(--c-ink);
}

.mrt-lead__media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--r-md);
	background: var(--c-wash);
}

.mrt-lead__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mrt-lead__title {
	font-size: var(--fs-2xl);
}

.mrt-lead__title a:hover {
	color: var(--c-action);
	text-decoration: none;
}

.mrt-lead__excerpt {
	font-size: var(--fs-base);
	color: var(--c-ink-soft);
	line-height: var(--lh-body);
}

@media (min-width: 900px) {
	.mrt-lead {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
		gap: var(--sp-8);
		align-items: center;
	}

	.mrt-lead__title {
		font-size: var(--fs-3xl);
	}
}

/* 순위 리스트 */
.mrt-ranklist {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: rank;
}

.mrt-ranklist > li {
	counter-increment: rank;
	display: grid;
	grid-template-columns: 26px minmax(0, 1fr);
	gap: var(--sp-3);
	align-items: baseline;
	padding-block: var(--sp-3);
	border-bottom: 1px solid var(--c-line);
	font-size: var(--fs-base);
}

.mrt-ranklist > li::before {
	content: counter(rank);
	font-family: var(--ff-num);
	font-weight: var(--fw-head);
	font-size: var(--fs-md);
	color: var(--c-action);
	font-variant-numeric: tabular-nums;
	letter-spacing: var(--ls-head);
}

/* Ranks 4 and below drop the action colour but stay above 4.5:1 — the number
   is content, not decoration. */
.mrt-ranklist > li:nth-child(n + 4)::before {
	color: var(--c-mute);
}

.mrt-ranklist__link {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: var(--lh-tight);
	letter-spacing: var(--ls-tight);
}

/* =========================================================================
   7. 뱃지 · 칩 · 버튼
   ========================================================================= */

.mrt-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: var(--r-sm);
	background: var(--c-action-wash);
	color: var(--c-action);
	font-size: var(--fs-2xs);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-wide);
	white-space: nowrap;
}

.mrt-badge--ghost {
	background: var(--c-wash);
	color: var(--c-mute);
}

.mrt-badge--solid {
	background: var(--c-action);
	color: var(--c-paper);
}

.mrt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	list-style: none;
	margin: 0;
	padding: 0;
}

.mrt-chips--scroll {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
	margin-inline: calc(var(--pad-x) * -1);
	padding-inline: var(--pad-x);
}

.mrt-chips--scroll::-webkit-scrollbar {
	display: none;
}

.mrt-chip {
	display: inline-block;
	padding: var(--sp-2) var(--sp-4);
	border: 1px solid var(--c-line);
	border-radius: var(--r-pill);
	background: var(--c-paper);
	font-size: var(--fs-sm);
	letter-spacing: var(--ls-tight);
	white-space: nowrap;
}

.mrt-chip:hover {
	border-color: var(--c-action);
	color: var(--c-action);
	text-decoration: none;
}

.mrt-chip[aria-current='true'],
.mrt-chip.is-active {
	background: var(--c-ink);
	border-color: var(--c-ink);
	color: var(--c-paper);
	font-weight: var(--fw-head);
}

.mrt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	min-height: 44px;
	padding: var(--sp-3) var(--sp-5);
	border-radius: var(--r-md);
	background: var(--c-action);
	color: var(--c-paper);
	font-size: var(--fs-base);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-tight);
	text-align: center;
}

.mrt-btn:hover {
	background: var(--c-action-dark);
	color: var(--c-paper);
	text-decoration: none;
}

.mrt-btn--ghost {
	background: var(--c-paper);
	color: var(--c-ink);
	border: 1px solid var(--c-line-strong);
}

.mrt-btn--ghost:hover {
	background: var(--c-wash);
	color: var(--c-ink);
}

.mrt-btn--block {
	display: flex;
	width: 100%;
}

.mrt-btn[aria-disabled='true'],
.mrt-btn.is-disabled {
	background: var(--c-line);
	color: var(--c-ink-soft);
	cursor: not-allowed;
	pointer-events: none;
}

/* =========================================================================
   8. 상품 상세
   ========================================================================= */

.mrt-hero {
	margin-bottom: var(--sp-5);
}

.mrt-hero__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--r-md);
	background: var(--c-wash);
	margin-bottom: var(--sp-4);
}

.mrt-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mrt-hero__badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	margin-bottom: var(--sp-3);
}

.mrt-hero__title {
	font-size: var(--fs-2xl);
	margin-bottom: var(--sp-3);
}

.mrt-hero--textonly .mrt-hero__title {
	font-size: var(--fs-3xl);
	padding-block: var(--sp-4);
	border-block: 2px solid var(--c-ink);
}

.mrt-hero__lead {
	font-size: var(--fs-md);
	color: var(--c-ink-soft);
	line-height: var(--lh-body);
}

.mrt-metabar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-2) var(--sp-4);
	padding-block: var(--sp-3);
	margin-bottom: var(--sp-5);
	border-block: 1px solid var(--c-line);
	font-size: var(--fs-xs);
	color: var(--c-mute);
	letter-spacing: var(--ls-tight);
}

.mrt-metabar__author {
	font-weight: var(--fw-head);
	color: var(--c-ink);
}

.mrt-rating {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--ff-num);
	font-variant-numeric: tabular-nums;
}

.mrt-rating__score {
	font-weight: var(--fw-head);
	color: var(--c-ink);
}

.mrt-rating__star {
	width: 13px;
	height: 13px;
	fill: var(--c-action);
}

.mrt-rating__count {
	color: var(--c-mute);
}

/* 제휴 고지 */
.mrt-disclosure {
	display: flex;
	gap: var(--sp-3);
	padding: var(--sp-4);
	margin-bottom: var(--sp-6);
	background: var(--c-wash);
	border-left: 3px solid var(--c-action);
	border-radius: 0 var(--r-md) var(--r-md) 0;
	font-size: var(--fs-sm);
	color: var(--c-ink-soft);
	line-height: var(--lh-body);
}

.mrt-disclosure__icon {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	fill: var(--c-action);
}

.mrt-disclosure--inline {
	margin-bottom: var(--sp-4);
	padding: var(--sp-3);
	font-size: var(--fs-xs);
}

/* 상세 상단 가격 줄 */
.mrt-priceline {
	margin-bottom: var(--sp-5);
}

.mrt-priceline__amount {
	display: block;
	font-family: var(--ff-num);
	font-size: var(--fs-xl);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-head);
	font-variant-numeric: tabular-nums;
	color: var(--c-action);
}

/* 가격 기준 시각 문구 */
.mrt-pricenote {
	display: block;
	margin-top: var(--sp-1);
	font-size: var(--fs-2xs);
	color: var(--c-mute);
	line-height: 1.35;
	letter-spacing: var(--ls-tight);
}

/* 품절 안내 */
.mrt-notice {
	padding: var(--sp-4);
	margin-block: var(--sp-5);
	border: 1px solid var(--c-line-strong);
	border-radius: var(--r-md);
	background: var(--c-wash);
	font-size: var(--fs-sm);
	color: var(--c-ink-soft);
}

.mrt-notice__title {
	display: block;
	margin-bottom: var(--sp-1);
	font-size: var(--fs-base);
	font-weight: var(--fw-head);
	color: var(--c-ink);
}

/* 갤러리 — CSS scroll-snap */
.mrt-gallery {
	margin-block: var(--sp-6);
}

.mrt-gallery__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 86%;
	gap: var(--sp-2);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	margin-inline: calc(var(--pad-x) * -1);
	padding-inline: var(--pad-x);
}

.mrt-gallery__track::-webkit-scrollbar {
	display: none;
}

.mrt-gallery__item {
	scroll-snap-align: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--r-md);
	background: var(--c-wash);
}

.mrt-gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mrt-gallery__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3);
	margin-top: var(--sp-2);
	font-size: var(--fs-xs);
	color: var(--c-mute);
}

.mrt-gallery__index {
	font-variant-numeric: tabular-nums;
}

.mrt-gallery__dots {
	display: flex;
	gap: 5px;
}

.mrt-gallery__dot {
	width: 6px;
	height: 6px;
	border-radius: var(--r-pill);
	background: var(--c-line-strong);
}

.mrt-gallery__dot.is-active {
	background: var(--c-action);
	width: 16px;
}

@media (min-width: 700px) {
	.mrt-gallery__track {
		grid-auto-columns: 48%;
	}
}

/* 리뷰 요약 */
.mrt-review {
	padding: var(--sp-5);
	margin-block: var(--sp-8);
	border: 1px solid var(--c-line);
	border-radius: var(--r-md);
}

.mrt-review__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3);
	margin-bottom: var(--sp-4);
	padding-bottom: var(--sp-3);
	border-bottom: 1px solid var(--c-line);
}

.mrt-review__title {
	font-size: var(--fs-md);
}

.mrt-review__count {
	font-size: var(--fs-xs);
	color: var(--c-mute);
}

.mrt-review__layout {
	display: grid;
	gap: var(--sp-5);
}

@media (min-width: 700px) {
	.mrt-review__layout {
		grid-template-columns: 220px minmax(0, 1fr);
		gap: var(--sp-8);
	}
}

.mrt-dist {
	display: grid;
	gap: var(--sp-2);
}

.mrt-dist__row {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) 40px;
	align-items: center;
	gap: var(--sp-2);
	font-size: var(--fs-xs);
	color: var(--c-mute);
	font-variant-numeric: tabular-nums;
}

.mrt-dist__track {
	height: 6px;
	border-radius: var(--r-pill);
	background: var(--c-wash);
	overflow: hidden;
}

.mrt-dist__fill {
	display: block;
	height: 100%;
	background: var(--c-action);
	border-radius: var(--r-pill);
}

.mrt-review__summary {
	font-size: var(--fs-base);
	line-height: var(--lh-read);
	color: var(--c-ink-soft);
}

.mrt-review__keywords {
	margin-top: var(--sp-4);
}

/* 모바일 하단 고정 CTA */
.mrt-stickycta {
	position: fixed;
	inset: auto 0 0;
	z-index: var(--z-sticky-cta);
	background: var(--c-paper);
	border-top: 1px solid var(--c-line);
	box-shadow: 0 -4px 20px var(--c-shadow);
	padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom));
	transform: translateY(110%);
	transition: transform var(--dur) var(--ease);
}

.mrt-stickycta.is-visible {
	transform: translateY(0);
}

.mrt-stickycta__inner {
	display: flex;
	align-items: center;
	gap: var(--sp-4);
}

.mrt-stickycta__price {
	flex: 1 1 auto;
	min-width: 0;
}

.mrt-stickycta__amount {
	display: block;
	font-family: var(--ff-num);
	font-size: var(--fs-lg);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-head);
	font-variant-numeric: tabular-nums;
}

.mrt-stickycta__btn {
	flex: none;
	min-width: 168px;
}

@media (max-width: 480px) {
	.mrt-stickycta__btn {
		min-width: 140px;
		padding-inline: var(--sp-4);
		font-size: var(--fs-sm);
	}
}

body.has-stickycta {
	padding-bottom: 84px;
}

/* =========================================================================
   9. 본문 (Python이 넣은 HTML을 받는 영역)
   ========================================================================= */

.mrt-content {
	font-size: var(--fs-md);
	line-height: var(--lh-read);
	color: var(--c-ink);
}

.mrt-content > * + * {
	margin-top: var(--sp-5);
}

.mrt-content h2 {
	font-size: var(--fs-xl);
	margin-top: var(--sp-10);
	padding-top: var(--sp-4);
	border-top: 2px solid var(--c-ink);
}

.mrt-content h3 {
	font-size: var(--fs-lg);
	margin-top: var(--sp-8);
}

.mrt-content h4 {
	font-size: var(--fs-md);
	margin-top: var(--sp-6);
}

.mrt-content a {
	color: var(--c-action);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}

.mrt-content ul,
.mrt-content ol {
	padding-left: 1.35em;
}

.mrt-content li + li {
	margin-top: var(--sp-2);
}

.mrt-content img {
	border-radius: var(--r-md);
	margin-inline: auto;
}

.mrt-content figcaption {
	margin-top: var(--sp-2);
	font-size: var(--fs-xs);
	color: var(--c-mute);
	text-align: center;
}

.mrt-content blockquote {
	padding-left: var(--sp-4);
	border-left: 3px solid var(--c-action);
	color: var(--c-ink-soft);
}

.mrt-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-sm);
}

.mrt-content th,
.mrt-content td {
	padding: var(--sp-2) var(--sp-3);
	border: 1px solid var(--c-line);
	text-align: left;
}

.mrt-content th {
	background: var(--c-wash);
	font-weight: var(--fw-head);
}

.mrt-tablewrap {
	overflow-x: auto;
}

/* ── 본문 삽입용 CTA 규약 (Python이 이 클래스로 마크업을 만든다) ─────── */

.mrt-cta {
	display: grid;
	gap: var(--sp-3);
	padding: var(--sp-5);
	margin-block: var(--sp-6);
	border: 1px solid var(--c-line);
	border-top: 3px solid var(--c-action);
	border-radius: var(--r-md);
	background: var(--c-paper);
}

.mrt-cta__label {
	font-size: var(--fs-2xs);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-wide);
	color: var(--c-action);
}

.mrt-cta__title {
	font-size: var(--fs-md);
	font-weight: var(--fw-head);
	line-height: var(--lh-tight);
	letter-spacing: var(--ls-head);
}

.mrt-cta__price {
	font-family: var(--ff-num);
	font-size: var(--fs-xl);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-head);
	font-variant-numeric: tabular-nums;
}

.mrt-cta__note {
	font-size: var(--fs-2xs);
	color: var(--c-mute);
	line-height: 1.4;
}

.mrt-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: var(--sp-3) var(--sp-5);
	border-radius: var(--r-md);
	background: var(--c-action);
	color: var(--c-paper);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-tight);
	text-decoration: none;
}

.mrt-cta__btn:hover {
	background: var(--c-action-dark);
	color: var(--c-paper);
	text-decoration: none;
}

.mrt-cta--compact {
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	padding: var(--sp-4);
}

.mrt-cta--compact .mrt-cta__btn {
	grid-row: span 2;
}

.mrt-inline-cta {
	font-weight: var(--fw-head);
	color: var(--c-action);
	white-space: nowrap;
}

.mrt-content .mrt-note {
	padding: var(--sp-4);
	background: var(--c-wash);
	border-radius: var(--r-md);
	font-size: var(--fs-base);
	color: var(--c-ink-soft);
}

/* 목차 */
.mrt-toc {
	margin-block: var(--sp-6);
	border: 1px solid var(--c-line);
	border-radius: var(--r-md);
	background: var(--c-wash);
}

.mrt-toc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: var(--sp-3) var(--sp-4);
	font-size: var(--fs-sm);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-tight);
}

.mrt-toc__toggle svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	transition: transform var(--dur) var(--ease);
}

.mrt-toc__toggle[aria-expanded='true'] svg {
	transform: rotate(180deg);
}

.mrt-toc__list {
	list-style: none;
	margin: 0;
	padding: 0 var(--sp-4) var(--sp-4);
	display: grid;
	gap: var(--sp-2);
	font-size: var(--fs-sm);
}

.mrt-toc__list[hidden] {
	display: none;
}

.mrt-toc__list a {
	color: var(--c-ink-soft);
}

.mrt-toc__list a:hover {
	color: var(--c-action);
}

/* =========================================================================
   10. 아카이브 / 필터 / 페이지네이션
   ========================================================================= */

.mrt-hubhead {
	padding-block: var(--sp-6) var(--sp-5);
}

.mrt-hubhead__kicker {
	font-size: var(--fs-xs);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-wide);
	color: var(--c-action);
}

.mrt-hubhead__title {
	font-size: var(--fs-3xl);
	margin-block: var(--sp-2) var(--sp-3);
}

.mrt-hubhead__desc {
	max-width: var(--w-read);
	font-size: var(--fs-base);
	color: var(--c-ink-soft);
	line-height: var(--lh-body);
}

.mrt-hubhead__count {
	margin-top: var(--sp-3);
	font-size: var(--fs-xs);
	color: var(--c-mute);
	font-variant-numeric: tabular-nums;
}

.mrt-filters {
	display: grid;
	gap: var(--sp-3);
	padding-block: var(--sp-4);
	border-block: 1px solid var(--c-line);
	margin-bottom: var(--sp-2);
}

.mrt-filters__row {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
}

.mrt-filters__legend {
	flex: none;
	font-size: var(--fs-xs);
	font-weight: var(--fw-head);
	color: var(--c-mute);
	letter-spacing: var(--ls-wide);
}

.mrt-sort {
	display: flex;
	gap: var(--sp-4);
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: var(--fs-sm);
}

.mrt-sort a {
	color: var(--c-mute);
	letter-spacing: var(--ls-tight);
}

.mrt-sort a[aria-current='true'] {
	color: var(--c-ink);
	font-weight: var(--fw-head);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-thickness: 2px;
	text-decoration-color: var(--c-action);
}

.mrt-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--sp-2);
	margin-top: var(--sp-8);
}

.mrt-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding-inline: var(--sp-2);
	border: 1px solid var(--c-line);
	border-radius: var(--r-md);
	font-size: var(--fs-sm);
	font-variant-numeric: tabular-nums;
}

.mrt-pagination .page-numbers:hover {
	border-color: var(--c-action);
	color: var(--c-action);
	text-decoration: none;
}

.mrt-pagination .page-numbers.current {
	background: var(--c-ink);
	border-color: var(--c-ink);
	color: var(--c-paper);
	font-weight: var(--fw-head);
}

.mrt-pagination .dots {
	border-color: transparent;
}

.mrt-empty {
	padding: var(--sp-12) var(--sp-4);
	text-align: center;
	color: var(--c-mute);
	font-size: var(--fs-base);
}

.mrt-empty__title {
	display: block;
	margin-bottom: var(--sp-2);
	font-size: var(--fs-lg);
	color: var(--c-ink);
}

/* 더보기 */
.mrt-more {
	margin-top: var(--sp-6);
	text-align: center;
}

/* =========================================================================
   11. 사이드바 / 위젯 / 에디터
   ========================================================================= */

.mrt-sidebar {
	display: grid;
	gap: var(--sp-6);
	font-size: var(--fs-sm);
}

.mrt-widget {
	padding-bottom: var(--sp-5);
	border-bottom: 1px solid var(--c-line);
}

.mrt-widget__title {
	margin-bottom: var(--sp-3);
	font-size: var(--fs-base);
	letter-spacing: var(--ls-head);
}

.mrt-widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--sp-2);
}

.mrt-editorcard {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: var(--sp-4);
	align-items: center;
	padding: var(--sp-4);
	margin-block: var(--sp-6);
	border: 1px solid var(--c-line);
	border-radius: var(--r-md);
}

.mrt-editorcard__avatar {
	width: 56px;
	height: 56px;
	border-radius: var(--r-pill);
	object-fit: cover;
}

.mrt-editorcard__name {
	font-size: var(--fs-base);
	font-weight: var(--fw-head);
}

.mrt-editorcard__bio {
	font-size: var(--fs-sm);
	color: var(--c-mute);
	line-height: var(--lh-body);
}

/* =========================================================================
   12. 푸터
   ========================================================================= */

.mrt-footer {
	margin-top: var(--sp-12);
	padding-block: var(--sp-8) var(--sp-10);
	background: var(--c-ink);
	color: var(--c-paper);
	font-size: var(--fs-sm);
	line-height: var(--lh-body);
}

.mrt-footer a {
	color: var(--c-paper);
	opacity: 0.78;
}

.mrt-footer a:hover {
	opacity: 1;
}

.mrt-footer__top {
	display: grid;
	gap: var(--sp-6);
	padding-bottom: var(--sp-6);
	border-bottom: 1px solid var(--c-ink-soft);
}

@media (min-width: 800px) {
	.mrt-footer__top {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: start;
	}
}

.mrt-footer__brand {
	font-size: var(--fs-md);
	font-weight: var(--fw-head);
	letter-spacing: var(--ls-head);
}

.mrt-footer__nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2) var(--sp-5);
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: var(--fs-sm);
}

.mrt-footer__biz {
	margin-top: var(--sp-6);
	color: var(--c-line-strong);
	font-size: var(--fs-xs);
	line-height: 1.7;
}

.mrt-footer__biz dl {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-1) var(--sp-4);
	margin: 0;
}

.mrt-footer__biz dt {
	font-weight: var(--fw-head);
}

.mrt-footer__biz dd {
	margin: 0;
}

.mrt-footer__legal {
	margin-top: var(--sp-5);
	padding: var(--sp-4);
	border: 1px solid var(--c-ink-soft);
	border-radius: var(--r-md);
	font-size: var(--fs-xs);
	color: var(--c-line-strong);
	line-height: 1.7;
}

.mrt-footer__copy {
	margin-top: var(--sp-5);
	font-size: var(--fs-xs);
	/* --c-mute would only reach 3.8:1 against the ink footer. */
	color: var(--c-line-strong);
}

/* 상단 공지 배너 */
.mrt-notice-bar {
	background: var(--c-action);
	color: var(--c-paper);
	font-size: var(--fs-xs);
	letter-spacing: var(--ls-tight);
}

.mrt-notice-bar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	min-height: 34px;
	padding-block: var(--sp-1);
	text-align: center;
}

.mrt-notice-bar a {
	color: var(--c-paper);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* =========================================================================
   13. 유틸리티 / 접근성
   ========================================================================= */

.mrt-readtime {
	font-variant-numeric: tabular-nums;
}

.mrt-hide-desktop {
	display: block;
}

.mrt-hide-mobile {
	display: none;
}

@media (min-width: 900px) {
	.mrt-hide-desktop {
		display: none;
	}

	.mrt-hide-mobile {
		display: block;
	}
}

.mrt-mt-3 {
	margin-top: var(--sp-3);
}

.mrt-mt-6 {
	margin-top: var(--sp-6);
}

.mrt-stack-4 > * + * {
	margin-top: var(--sp-4);
}

.mrt-stack-6 > * + * {
	margin-top: var(--sp-6);
}

.mrt-mute {
	color: var(--c-mute);
}

.mrt-nowrap {
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.mrt-header,
	.mrt-locbar,
	.mrt-stickycta,
	.mrt-drawer,
	.mrt-searchbox,
	.mrt-footer__nav {
		display: none !important;
	}
}
