@charset "utf-8";

/* ============================================================
   march13 — 조판실형 지난호
   흰 용지 + 격자 오버레이 + 크롭마크 + 판면 목록 그리드
   ============================================================ */

:root {
	--ts-bg: #f8f7f4;
	--ts-ink: #1c1c1c;
	--ts-accent: #1a56db;
	--ts-muted: #6b7280;
	--ts-grid: rgba(0, 0, 0, 0.06);
	--ts-crop: #bbb;
	--ts-border: rgba(0, 0, 0, 0.1);
	--ts-border-strong: rgba(0, 0, 0, 0.2);
}

body {
	background: var(--ts-bg);
}
body.dark {
	background: #111318;
}

body.page-light-header #header,
body.page-light-header #header.on,
body.page-light-header #header.act {
	background-color: var(--ts-bg) !important;
}

.ma13-wrap {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 60px;
	position: relative;
}

/* ── 격자 오버레이 ── */
.ma13-grid-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	opacity: 0;
	background-image:
		linear-gradient(var(--ts-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--ts-grid) 1px, transparent 1px);
	background-size: 64px 64px;
}

/* ── 크롭마크 ── */
.ma13-cropmarks {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.ma13-cm {
	position: absolute;
	width: 14px;
	height: 14px;
	opacity: 0;
}
.ma13-cm--tl { top: 0; left: 0; border-top: 1px solid var(--ts-crop); border-left: 1px solid var(--ts-crop); }
.ma13-cm--tr { top: 0; right: 0; border-top: 1px solid var(--ts-crop); border-right: 1px solid var(--ts-crop); }
.ma13-cm--bl { bottom: 0; left: 0; border-bottom: 1px solid var(--ts-crop); border-left: 1px solid var(--ts-crop); }
.ma13-cm--br { bottom: 0; right: 0; border-bottom: 1px solid var(--ts-crop); border-right: 1px solid var(--ts-crop); }

/* ============================================================
   S1: 헤더
   ============================================================ */
.ma13-head {
	padding: 120px 0 60px;
	position: relative;
}

.ma13-folio-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ts-border-strong);
	margin-bottom: 40px;
	opacity: 0;
}
.ma13-fvol {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-weight: 700;
	font-family: var(--font-serif);
	color: var(--ts-ink);
}
.ma13-fdiv {
	display: block;
	width: 1px;
	height: 14px;
	background: var(--ts-border-strong);
	flex-shrink: 0;
}
.ma13-folio-bar span:not(.ma13-fvol):not(.ma13-fdiv):not(.ma13-fspecial) {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	color: var(--ts-muted);
}
.ma13-fspecial {
	margin-left: auto;
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	color: var(--ts-muted);
	font-family: var(--font-serif);
	font-style: italic;
}

.ma13-tit-outer {
	overflow: hidden;
	margin-bottom: 16px;
}
.ma13-tit {
	font-size: clamp(56px, calc(16px + 6vw), 96px);
	font-weight: 900;
	font-family: var(--font-serif);
	color: var(--ts-ink);
	clip-path: inset(0 100% 0 0);
}

.ma13-head-sub {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	color: var(--ts-muted);
	font-family: var(--font-serif);
	opacity: 0;
}

/* ============================================================
   S2: 판면 그리드
   ============================================================ */
.ma13-grid-sec {
	padding: 0 0 80px;
}

.ma13-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	border: 1px solid var(--ts-border-strong);
}

/* 카드 */
.ma13-card {
	position: relative;
	background: none;
	border: none;
	border-right: 1px solid var(--ts-border-strong);
	cursor: pointer;
	text-align: left;
	padding: 28px;
	transition: background 0.2s;
}
.ma13-card:nth-child(4n) {
	border-right: none;
}
.ma13-card:nth-child(n + 5) {
	border-top: 1px solid var(--ts-border-strong);
}
.ma13-card:hover {
	background: rgba(0, 0, 0, 0.025);
}

/* 카드 내 크롭마크 */
.ma13-card-cropmarks {
	position: absolute;
	inset: 8px;
	pointer-events: none;
}
.ma13-card-cropmarks .ma13-cm {
	width: 10px;
	height: 10px;
	opacity: 0;
	transition: opacity 0.2s;
}
.ma13-card:hover .ma13-card-cropmarks .ma13-cm {
	opacity: 1;
}

/* 점선 프레임 */
.ma13-card-frame {
	position: absolute;
	inset: 20px;
	border: 1px dashed var(--ts-crop);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s;
}
.ma13-card:hover .ma13-card-frame {
	opacity: 1;
}

/* 폴리오 번호 */
.ma13-card-folio {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-family: var(--font-serif);
	font-weight: 700;
	color: var(--ts-crop);
	margin-bottom: 14px;
}

/* 표지 이미지 */
.ma13-card-img {
	aspect-ratio: 3 / 4;
	overflow: hidden;
	margin-bottom: 16px;
}
.ma13-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(70%) contrast(1.08);
	transition: transform 0.5s ease, filter 0.4s ease;
}
.ma13-card:hover .ma13-card-img img {
	transform: scale(1.04);
	filter: grayscale(20%) contrast(1.03);
}

/* 발행 정보 */
.ma13-card-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.ma13-card-tit {
	font-size: clamp(18px, calc(5px + 1.6vw), 24px);
	font-weight: 800;
	color: var(--ts-ink);
	word-break: keep-all;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ma13-card-date {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-family: var(--font-serif);
	color: var(--ts-muted);
}

/* ============================================================
   디테일 패널
   ============================================================ */
.ma13-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 380px;
	height: 100%;
	background: var(--ts-bg);
	border-left: 1px solid var(--ts-border-strong);
	z-index: 500;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.ma13-panel.is-open {
	transform: translateX(0);
}

.ma13-panel-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: none;
	border: none;
	font-size: 20px;
	color: var(--ts-muted);
	cursor: pointer;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--ts-border);
	transition: color 0.2s, border-color 0.2s;
}
.ma13-panel-close:hover {
	color: var(--ts-ink);
	border-color: var(--ts-ink);
}

.ma13-panel-body {
	padding: 60px 36px 40px;
}

.ma13-panel-mag {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-family: var(--font-serif);
	color: var(--ts-muted);
	margin-bottom: 12px;
}

.ma13-panel-rule {
	height: 1px;
	background: var(--ts-border-strong);
	margin: 16px 0;
}

.ma13-panel-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}
.ma13-panel-vol {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-weight: 700;
	font-family: var(--font-serif);
	color: var(--ts-crop);
}
.ma13-panel-date {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-family: var(--font-serif);
	color: var(--ts-muted);
}

.ma13-panel-tit {
	font-size: clamp(22px, calc(6px + 2.2vw), 32px);
	font-weight: 900;
	color: var(--ts-ink);
	margin-bottom: 4px;
	word-break: keep-all;
}

.ma13-panel-toc-label {
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-weight: 700;
	color: var(--ts-ink);
	margin-bottom: 14px;
}

.ma13-panel-toc {
	list-style: none;
	padding: 0;
	margin: 0 0 28px;
}
.ma13-panel-toc li {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--ts-border);
	font-size: clamp(15px, calc(4px + 1.3vw), 18px);
	color: var(--ts-ink);
}
.ma13-panel-toc li:first-child {
	border-top: 1px solid var(--ts-border);
}
.ma13-panel-toc li::before {
	content: attr(data-num);
	font-family: var(--font-serif);
	color: var(--ts-crop);
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	flex-shrink: 0;
	min-width: 20px;
}

.ma13-cta-wrap {
	padding-top: 8px;
}
.ma13-panel-cta {
	display: inline-block;
	padding: 13px 28px;
	font-size: clamp(14px, calc(4px + 1.2vw), 18px);
	font-weight: 700;
	color: var(--ts-bg);
	background: var(--ts-ink);
	border: 1.5px solid var(--ts-ink);
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}
.ma13-panel-cta:hover {
	background: var(--ts-accent);
	border-color: var(--ts-accent);
}

/* 백드롭 */
.ma13-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	z-index: 499;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s;
}
.ma13-backdrop.is-open {
	opacity: 1;
	pointer-events: auto;
}

/* ============================================================
   반응형 — 999px
   ============================================================ */
@media all and (max-width: 999px) {
	.ma13-wrap { padding: 0 32px; }
	.ma13-head { padding: 90px 0 40px; }

	.ma13-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.ma13-card:nth-child(4n) {
		border-right: 1px solid var(--ts-border-strong);
	}
	.ma13-card:nth-child(3n) {
		border-right: none;
	}
	.ma13-card:nth-child(n + 4) {
		border-top: 1px solid var(--ts-border-strong);
	}

	.ma13-panel { width: 320px; }
}

/* ============================================================
   반응형 — 768px
   ============================================================ */
@media all and (max-width: 768px) {
	.ma13-wrap { padding: 0 20px; }
	.ma13-head { padding: 80px 0 32px; }

	.ma13-folio-bar { flex-wrap: wrap; gap: 10px; }
	.ma13-fspecial { margin-left: 0; width: 100%; }

	.ma13-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.ma13-card:nth-child(3n) {
		border-right: 1px solid var(--ts-border-strong);
	}
	.ma13-card:nth-child(2n) {
		border-right: none;
	}
	.ma13-card:nth-child(n + 3) {
		border-top: 1px solid var(--ts-border-strong);
	}
	.ma13-card { padding: 20px; }

	.ma13-panel {
		width: 100%;
		height: 70vh;
		top: auto;
		bottom: 0;
		right: 0;
		border-left: none;
		border-top: 1px solid var(--ts-border-strong);
		transform: translateY(100%);
	}
	.ma13-panel.is-open {
		transform: translateY(0);
	}
	.ma13-grid-sec { padding-bottom: 32px; }
}

/* ============================================================
   반응형 — 499px
   ============================================================ */
@media all and (max-width: 499px) {
	.ma13-card-folio { margin-bottom: 10px; }
}

/* ============================================================
   darkmode
   ============================================================ */
body.dark {
	--ts-bg: #111318;
	--ts-ink: #e8e8e8;
	--ts-accent: #60a5fa;
	--ts-muted: #9ca3af;
	--ts-grid: rgba(255, 255, 255, 0.05);
	--ts-crop: #555;
	--ts-border: rgba(255, 255, 255, 0.08);
	--ts-border-strong: rgba(255, 255, 255, 0.15);
}

body.dark .ma13-grid-overlay {
	mix-blend-mode: screen;
}
body.dark .ma13-card:hover {
	background: rgba(255, 255, 255, 0.04);
}
body.dark .ma13-panel-cta {
	color: var(--ts-bg);
}
