/*
 * 몇 년 전 오늘 — GeneratePress 팔레트 변수(--accent, --contrast…)를 쓰고, 없으면 GP 기본색.
 * 기본은 좁은 화면용(연도 위, 글 아래) 배치이고, 상자가 넉넉하면(@container) 왼쪽 연도 + 세로선 타임라인.
 */

.wnm {
	--wnm-accent: var(--accent, #1e73be);
	--wnm-text: var(--contrast, #222);
	--wnm-muted: var(--contrast-2, #575760);
	--wnm-faint: var(--contrast-3, #b2b2be);
	--wnm-tint: var(--base, #f0f0f0);
	--wnm-soft: var(--base-2, #f7f8f9);
	--wnm-bg: var(--base-3, #fff);
	--wnm-line: #e2e2e7;
	--wnm-thumb: 72px;
	container: wnm / inline-size;
	color: var(--wnm-text);
}

.wnm--home,
.wnm--single {
	margin-bottom: 20px;
}

/* 본문·위젯 안에 카드 형태를 넣은 경우 GP 상자가 겹치지 않게. */
.inside-article .wnm > .inside-article,
.widget .wnm > .inside-article,
.editor-styles-wrapper .wnm > .inside-article {
	padding: 0;
	background: none;
}

/* 초기화는 클래스 하나 수준으로 — 아래 구성 요소 규칙이 이길 수 있게(GP의 ol/ul/p 여백보다는 강하다). */
.wnm__years,
.wnm__items,
.wnm__days {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wnm__eyebrow,
.wnm__summary,
.wnm__excerpt,
.wnm__meta,
.wnm__empty,
.wnm__nearest,
.wnm__date,
.wnm__legend,
.wnm__month-name,
.wnm__empty p {
	margin: 0;
}

.wnm a {
	text-decoration: none;
}

.wnm a:hover,
.wnm a:focus {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
}

.wnm a:focus-visible,
.wnm select:focus-visible,
.wnm button:focus-visible {
	outline: 2px solid var(--wnm-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

.wnm__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ── 머리 ─────────────────────────────── */

.wnm__header {
	margin-bottom: 1.75rem;
}

.wnm .wnm__header .wnm__heading {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 400;
	line-height: 1.25;
}

.wnm__eyebrow {
	display: block;
	margin-bottom: .3rem;
	color: var(--wnm-accent);
	font-size: .8125rem;
	font-weight: 600;
	line-height: 1.4;
}

.wnm__date {
	display: block;
	font-variant-numeric: tabular-nums;
}

.wnm__summary {
	margin-top: .35rem;
	color: var(--wnm-muted);
	font-size: .9375rem;
	line-height: 1.5;
}

/* ── 타임라인(좁은 화면: 연도 줄 아래 글) ─── */

.wnm__year {
	position: relative;
	padding: 0 0 1.5rem 1.25rem;
	border-left: 1px solid var(--wnm-line);
}

.wnm__year:last-child {
	padding-bottom: .25rem;
}

.wnm__year::before,
.wnm__items::before {
	position: absolute;
	left: -5px;
	box-sizing: border-box;
	width: 9px;
	height: 9px;
	border: 2px solid var(--wnm-accent);
	border-radius: 50%;
	background: var(--wnm-bg);
}

.wnm__year::before {
	content: "";
	top: .55rem;
}

.wnm .wnm__year-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .25rem .5rem;
	margin: 0 0 .5rem;
	color: var(--wnm-text);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.3;
}

.wnm__year-num {
	font-size: 1.25rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.01em;
}

.wnm__pill {
	display: inline-block;
	padding: .1rem .55rem;
	border-radius: 999px;
	background: var(--wnm-tint);
	color: var(--wnm-muted);
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
	line-height: 1.5;
	white-space: nowrap;
}

.wnm__item {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.wnm__item + .wnm__item {
	margin-top: 1rem;
}

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

.wnm__link {
	color: var(--wnm-accent);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.45;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

/* 제목 없는 옛 글: 본문 앞부분을 인용처럼. */
.wnm__item--untitled .wnm__link {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 400;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.wnm__item--untitled .wnm__link::before {
	content: "\201C";
}

.wnm__item--untitled .wnm__link::after {
	content: "\201D";
}

.wnm__excerpt {
	display: -webkit-box;
	overflow: hidden;
	margin-top: .2rem;
	color: var(--wnm-muted);
	font-size: .9375rem;
	line-height: 1.6;
	word-break: keep-all;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.wnm__meta {
	margin-top: .3rem;
	color: var(--wnm-muted);
	font-size: .8125rem;
	line-height: 1.5;
}

.wnm__meta > * + *::before {
	content: "·";
	margin-right: .3em;
	color: var(--wnm-faint);
}

.wnm__offset {
	color: var(--wnm-accent);
}

.wnm__thumb {
	flex: 0 0 var(--wnm-thumb);
	width: var(--wnm-thumb);
	height: var(--wnm-thumb);
	overflow: hidden;
	border-radius: 6px;
	background: var(--wnm-soft);
}

.wnm__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── 바닥 ─────────────────────────────── */

.wnm__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .5rem 1rem;
	margin-top: 1.75rem;
	padding-top: 1rem;
	border-top: 1px solid var(--wnm-line);
	font-size: .9375rem;
}

.wnm__rest {
	color: var(--wnm-muted);
	font-size: .875rem;
	font-variant-numeric: tabular-nums;
}

.wnm__more {
	margin-left: auto;
	font-weight: 600;
}

.wnm__empty {
	color: var(--wnm-muted);
	font-size: .9375rem;
}

/* ── 사이드바 ─────────────────────────── */

.wnm--sidebar {
	--wnm-thumb: 48px;
}

.wnm--sidebar .wnm__heading {
	margin-bottom: .2rem;
}

.wnm--sidebar .wnm__summary {
	margin: 0 0 1.25rem;
	font-size: .875rem;
}

.wnm--sidebar .wnm__year-num {
	font-size: 1.0625rem;
}

.wnm--sidebar .wnm__year {
	padding-bottom: 1.1rem;
}

.wnm--sidebar .wnm__year::before {
	top: .45rem;
}

.wnm--sidebar .wnm__item {
	gap: .75rem;
}

.wnm--sidebar .wnm__item + .wnm__item {
	margin-top: .75rem;
}

.wnm--sidebar .wnm__link {
	font-size: .9375rem;
}

.wnm--sidebar .wnm__excerpt {
	font-size: .8125rem;
	line-height: 1.55;
}

.wnm--sidebar .wnm__meta {
	font-size: .75rem;
}

.wnm--sidebar .wnm__footer {
	margin-top: 1.25rem;
	padding-top: .75rem;
	font-size: .875rem;
}

/* ── 전용 페이지 ──────────────────────── */

.wnm__pagehead {
	margin-bottom: 1.25rem;
}

.wnm__date--page {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	font-size: 1.75rem;
	line-height: 1.25;
}

.wnm__badge {
	display: inline-block;
	padding: .15rem .6rem;
	border-radius: 999px;
	background: var(--wnm-accent);
	color: #fff;
	font-size: .75rem;
	font-weight: 600;
	line-height: 1.5;
}

/* 오늘이 아닌 날짜 주소: 배지는 숨겨 두고 memories.js가 켠다(display 규칙이 UA의 [hidden]보다 세다). */
.wnm__badge[hidden] {
	display: none;
}

.wnm__daynav {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	margin-bottom: 2rem;
}

.wnm__daynav-link {
	display: flex;
	flex-direction: column;
	padding: .55rem .9rem;
	border: 1px solid var(--wnm-line);
	border-radius: 8px;
	color: var(--wnm-text);
	font-size: .875rem;
	line-height: 1.4;
	transition: border-color .15s ease;
}

.wnm a.wnm__daynav-link:hover,
.wnm a.wnm__daynav-link:focus {
	border-color: var(--wnm-accent);
	text-decoration: none;
}

.wnm__daynav-link--next {
	margin-left: auto;
	text-align: right;
}

.wnm__daynav-hint {
	color: var(--wnm-muted);
	font-size: .75rem;
}

.wnm__daynav-day {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.wnm--page .wnm__empty {
	padding: 1.25rem 1.5rem;
	border-radius: 8px;
	background: var(--wnm-soft);
}

.wnm__empty .wnm__nearest {
	margin-top: .5rem;
}

.wnm__browse {
	margin-top: 2.5rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--wnm-line);
}

.wnm .wnm__browse-title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
}

.wnm__jump {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-bottom: 1rem;
}

.wnm__jump-label {
	margin-right: .25rem;
	color: var(--wnm-muted);
	font-size: .875rem;
}

.wnm .wnm__jump select {
	width: auto;
	min-width: 0;
	padding: .4rem .5rem;
	font-size: .9375rem;
}

.wnm .wnm__jump-btn {
	padding: .45rem 1rem;
	font-size: .9375rem;
	line-height: 1.4;
}

.wnm__legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .3rem;
	margin-bottom: 1.25rem;
	color: var(--wnm-muted);
	font-size: .75rem;
}

.wnm__legend .wnm__d {
	width: .875rem;
	height: .875rem;
}

.wnm__legend-today {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	margin-left: .75rem;
}

.wnm__cal {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem 1rem;
}

.wnm__month-name {
	margin-bottom: .35rem;
	font-size: .8125rem;
	font-weight: 600;
}

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

.wnm__d {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border-radius: 3px;
	color: var(--wnm-muted);
	font-size: .6875rem;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.wnm a.wnm__d {
	color: var(--wnm-text);
	text-decoration: none;
	transition: box-shadow .15s ease;
}

.wnm a.wnm__d:hover,
.wnm a.wnm__d:focus {
	box-shadow: inset 0 0 0 1px var(--wnm-accent);
}

/* 옅은 단계부터 — 거의 매일 글이 있는 사이트라 달력 전체가 시끄럽지 않게. 글자는 모두 짙은 색(대비 6.5:1 이상). */
.wnm__d--1 {
	background: #e9f1f9;
	background: color-mix(in srgb, var(--wnm-accent) 10%, var(--wnm-bg));
}

.wnm__d--2 {
	background: #cee0f1;
	background: color-mix(in srgb, var(--wnm-accent) 22%, var(--wnm-bg));
}

.wnm__d--3 {
	background: #aacae6;
	background: color-mix(in srgb, var(--wnm-accent) 38%, var(--wnm-bg));
}

.wnm__d--4 {
	background: #78abd8;
	background: color-mix(in srgb, var(--wnm-accent) 60%, var(--wnm-bg));
}

.wnm__d--today {
	box-shadow: inset 0 0 0 2px var(--wnm-text);
	font-weight: 700;
}

.wnm a.wnm__d--today:hover,
.wnm a.wnm__d--today:focus {
	box-shadow: inset 0 0 0 2px var(--wnm-text);
}

.wnm .wnm__d[aria-current] {
	outline: 2px solid var(--wnm-accent);
	outline-offset: 1px;
	font-weight: 700;
}

/* 키보드 초점: 선택한 날(aria-current)·오늘 칸의 평소 테두리와 겹쳐도 달라 보이게, 위 두 규칙보다 뒤·세게. */
.wnm a.wnm__d:focus-visible {
	outline: 3px solid var(--wnm-text);
	outline-offset: 2px;
	box-shadow: inset 0 0 0 2px var(--wnm-accent);
	text-decoration: underline;
	text-underline-offset: .15em;
}

/* ── 넉넉한 상자: 왼쪽 연도 + 세로선 ───────── */

@container wnm (min-width: 34em) {
	.wnm__year {
		display: grid;
		grid-template-columns: 5.25rem minmax(0, 1fr);
		column-gap: 1.5rem;
		padding: 0;
		border-left: 0;
	}

	.wnm__year::before {
		content: none;
	}

	.wnm .wnm__year-head {
		display: block;
		margin: 0;
		text-align: right;
	}

	.wnm__year-num {
		display: block;
		font-size: 1.375rem;
		line-height: 1.2;
	}

	.wnm__pill {
		margin-top: .35rem;
	}

	.wnm__items {
		position: relative;
		padding: 0 0 1.75rem 1.5rem;
		border-left: 1px solid var(--wnm-line);
	}

	.wnm__items::before {
		content: "";
		top: .6rem;
	}

	.wnm__year:last-child .wnm__items {
		padding-bottom: .25rem;
	}
}

@container wnm (min-width: 26em) {
	.wnm__cal {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container wnm (min-width: 42em) {
	.wnm__cal {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 1.5rem 1.25rem;
	}
}

@media (max-width: 768px) {
	.wnm--home,
	.wnm--single,
	.wnm--page {
		--wnm-thumb: 56px;
	}

	.wnm .wnm__header .wnm__heading,
	.wnm__date--page {
		font-size: 1.5rem;
	}

	.wnm__item {
		gap: .75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wnm *,
	.wnm *::before,
	.wnm *::after {
		transition: none !important;
	}
}
