/* =========================================================
   스케치북 모드 (sketch.css)
   - 사진 카테고리(이름이 01~04로 시작)에서만 html에 .sketch-mode가 붙고
     아래 규칙이 모두 그때만 적용됩니다.
   - 다른 카테고리·홈 화면은 기존 스킨 그대로입니다.
   - 클래스 이름은 기존 스킨과 겹치지 않게 모두 sk- 로 시작합니다.
   ========================================================= */

.sketch-mode {
	--sk-paper: #f4f1ea;
	--sk-paper-deep: #e6e1d4;
	--sk-ink: #2f3b2f;
	--sk-soft: #6f786b;
	--sk-leaf: #1f5132;
	--sk-line: #d8d2c3;
	--sk-dark: #0d0f0d;
	--sk-serif: "Noto Serif KR", serif;
	--sk-side: var(--aside-width, 320px);     /* 오른쪽 프레임 폭 (style.css의 값과 같이 씀) */
}

.sketch-mode body {
	background: var(--sk-paper);
	color: var(--sk-ink);
}

/* ---------- 1. 기존 스킨 요소 숨기기 ----------
   위쪽 사진 프레임(.main-slider)은 숨기지 않고 기존 스킨 설정 그대로 둠 */
.sketch-mode #header,
.sketch-mode #footer,
.sketch-mode #aside,
.sketch-mode .post-cover,
.sketch-mode #content .tags,
.sketch-mode .related-articles {
	display: none !important;
}

.sketch-mode #tt-body-page #container { padding-top: 0; }
.sketch-mode #container .content-wrap:before { content: none; }

/* ---------- 2. 전체 틀: 사진 영역 + 오른쪽 프레임 ---------- */
@media screen and (min-width: 768px) {
	.sketch-mode #container .content-wrap {
		display: flex;
		max-width: none;
		padding: 0;
	}
	.sketch-mode #container .content-wrap:after { display: none; }
	.sketch-mode #content {
		float: none;
		flex: 1;
		min-width: 0;
		width: auto;
		padding: 56px 48px 80px;
	}
}

/* ---------- 3. 오른쪽 프레임 (sketch.js가 만들어 넣음) ---------- */
.sk-side { display: none; }

.sketch-mode .sk-side {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 48px 32px 32px;
	border-left: 1px solid var(--sk-line);
	font-family: 'Noto Sans KR', sans-serif;
}

@media screen and (min-width: 768px) {
	.sketch-mode .sk-side {
		position: sticky;
		top: 0;
		flex: 0 0 var(--sk-side);
		width: var(--sk-side);
		height: 100vh;
		overflow-y: auto;
	}
}

.sk-home {
	margin-bottom: 28px;
	font-size: 13px;
	color: var(--sk-soft) !important;
}
.sk-home:hover { color: var(--sk-leaf) !important; text-decoration: none; }

.sk-brand {
	font-family: var(--sk-serif);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--sk-leaf) !important;
}
.sk-brand:hover { text-decoration: none; }

.sk-desc {
	margin: 8px 0 28px;
	font-size: 13px;
	color: var(--sk-soft);
}

/* 검색창 */
.sk-search {
	display: flex;
	align-items: center;
	margin-bottom: 28px;
	border: 1px solid var(--sk-line);
	border-radius: 99px;
	background: #fbfaf6;
}
.sk-search:focus-within { border-color: var(--sk-leaf); }
.sk-search input {
	flex: 1;
	min-width: 0;
	height: auto;
	padding: 9px 4px 9px 16px;
	border: 0;
	background: transparent;
	font-size: 14px;
	color: var(--sk-ink);
	outline: none;
}
.sk-search input::placeholder { color: #a3a89c; }
.sk-search button {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	color: var(--sk-soft);
}
.sk-search button:hover { color: var(--sk-leaf); }
.sk-search svg { width: 18px; height: 18px; }

/* 사진 카테고리 목록 */
.sk-category ul { margin: 0; padding: 0; }
.sk-category li { list-style: none; }
.sk-category .sk-cat-title {
	padding-bottom: 12px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--sk-line);
	font-size: 12px;
	letter-spacing: .08em;
	color: var(--sk-soft);
}
.sk-category a {
	display: block;
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 15px;
	color: var(--sk-ink) !important;
	transition: background .2s, color .2s;
}
.sk-category .sk-sub a { padding-left: 24px; font-size: 14px; color: var(--sk-soft) !important; }
.sk-category a:hover,
.sk-category .sk-current a {
	background: var(--sk-paper-deep);
	color: var(--sk-leaf) !important;
	text-decoration: none;
}
.sk-category .sk-cnt { margin-left: 4px; font-size: 12px; color: var(--sk-soft); }

/* 방문자수 */
.sk-counter {
	display: flex;
	gap: 18px;
	margin: auto 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--sk-line);
}
.sk-counter div { display: flex; flex-direction: column; }
.sk-counter dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--sk-soft); }
.sk-counter dd { margin: 2px 0 0; font-family: var(--sk-serif); font-size: 18px; color: var(--sk-ink); }

/* ---------- 4. 카테고리 목록 화면: 제목 + 사진 타일 ---------- */
.sketch-mode .post-header { padding: 0 0 8px; }
.sketch-mode .post-header h1 {
	margin-bottom: 32px;
	font-family: var(--sk-serif);
	font-size: clamp(28px, 3.4vw, 44px);
	font-weight: 600;
	line-height: 1.25;
	color: var(--sk-ink);
}
.sketch-mode .post-header h1 em {
	margin-left: 4px;
	font-family: 'Noto Sans KR', sans-serif;
	font-size: .55em;
	font-weight: 400;
	color: var(--sk-soft) !important;
	vertical-align: .15em;
}
.sketch-mode .post-header h1 em:before { content: "("; }
.sketch-mode .post-header h1 em:after { content: ")"; }

/* 블로그의 '목록 형태' 옵션(썸네일형·글자형 등)과 상관없이 사진 타일로 보이게 함 */
.sketch-mode #content > .inner:has(> .post-item) {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 28px 22px;
}
.sketch-mode #content > .inner:after { content: none; }
.sketch-mode .post-header {
	margin-bottom: 0 !important;
	border-bottom: 0 !important;
}

.sketch-mode .post-item {
	float: none !important;
	overflow: visible !important;
	width: auto !important;
	margin: 0 !important;
}
.sketch-mode .post-item .thum {
	display: block !important;
	position: relative !important;
	width: 100% !important;
	height: 0 !important;
	padding: 0 0 125% !important;          /* 세로로 긴 4:5 사진 칸 */
	margin: 0 !important;
	overflow: hidden;
	border-radius: 4px;
	background: var(--sk-paper-deep);
}
.sketch-mode .post-item .thum img {
	position: absolute !important;
	top: 0;
	left: 0;
	float: none !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	border: 0 !important;
	object-fit: cover;
	transform: none;
	transition: transform .6s ease;
}
.sketch-mode .post-item a:hover .thum img { transform: scale(1.04); }
.sketch-mode .post-item .title {
	max-width: 100% !important;
	margin: 0 !important;
	padding-top: 10px !important;
	font-family: var(--sk-serif);
	font-size: 17px !important;
	color: var(--sk-ink);
}
.sketch-mode .post-item a:hover .title { color: var(--sk-leaf); text-decoration: none; }
.sketch-mode .post-item .excerpt,
.sketch-mode .post-item .meta { display: none !important; }

.sketch-mode .pagination { margin-top: 56px; }

/* ---------- 5. 글 화면: 식물도감 한 페이지 ---------- */
.sketch-mode #tt-body-page .sk-side { display: none; }      /* 글 화면에서는 오른쪽 프레임 숨김 */
.sketch-mode #tt-body-page #content { padding: 24px clamp(16px, 3.5vw, 56px) 80px; }
.sketch-mode #tt-body-page #content > .inner { max-width: 1680px; margin: 0 auto; }

/* 상단: 카테고리 / 식물 이름 */
.sk-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 18px;
	padding-bottom: 14px;
	margin-bottom: 20px;
	border-bottom: 2px solid var(--sk-leaf);
}
.sk-backs {
	display: flex;
	flex-wrap: wrap;
	flex-basis: 100%;
	gap: 4px 28px;              /* 카테고리 링크와 블로그 첫 화면 링크 사이 간격 */
}
.sk-back {
	font-size: 13px;
	color: var(--sk-soft) !important;
}
.sk-back:hover { color: var(--sk-leaf) !important; text-decoration: none; }
.sk-title {
	margin: 0;
	font-family: var(--sk-serif);
	font-size: clamp(28px, 3.4vw, 44px);
	font-weight: 600;
	line-height: 1.25;
	color: var(--sk-leaf);
}
.sk-tags {
	margin: 0;
	font-size: 15px;
	color: var(--sk-soft);
}
.sk-tags .sk-sep { margin: 0 10px; color: var(--sk-line); }
.sk-meta {
	margin-left: auto;
	font-size: 13px;
	color: var(--sk-soft);
}
.sk-meta a { margin-left: 10px; color: var(--sk-soft) !important; }

/* 사진 배치 (규칙은 sketch.js의 '사진 개수에 따른 배치 규칙' 참고)
   위: 큰 사진 + 오른쪽 작은 사진 묶음 / 아래: 나머지 사진 줄 */
.sk-photos {
	--gap: 14px;
	--top-h: max(380px, calc(100vh - 230px));   /* 위쪽 묶음 높이: 첫 화면에 꽉 차게 */
	--row-h: clamp(200px, 20vw, 320px);         /* 아래 줄 사진 높이 */
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.sk-top {
	display: grid;
	grid-template-columns: 2fr 1fr;              /* 2~4장: 큰 사진 2/3 */
	gap: var(--gap);
	height: var(--top-h);
}
.sk-n1 .sk-top { grid-template-columns: 1fr; }
.sk-n5 .sk-top { grid-template-columns: 1fr 1fr; }   /* 5장: 큰 사진 1/2 + 2×2 */
.sk-n6 .sk-top { grid-template-columns: 3fr 1fr; }   /* 6장 이상: 큰 사진 3/4 */

.sk-sidecol {
	display: grid;
	grid-template-rows: repeat(var(--k), minmax(0, 1fr));
	gap: var(--gap);
	min-height: 0;
}
.sk-n5 .sk-sidecol {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
}

.sk-row {
	display: grid;
	grid-template-columns: repeat(var(--k), minmax(0, 1fr));
	gap: var(--gap);
	height: var(--row-h);
}

.sk-photo {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	margin: 0 !important;
}

.sk-frame {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow: hidden;
	border-radius: 3px;
	background: var(--sk-paper-deep) !important;
	cursor: zoom-in;
}
.sk-frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.sk-frame:hover img { transform: scale(1.03); }

/* + 돋보기 */
.sk-zoom {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: var(--sk-ink);
	opacity: 0;
	transition: opacity .25s;
}
.sk-zoom svg { width: 18px; height: 18px; }
.sk-frame:hover .sk-zoom,
.sk-frame:focus-visible .sk-zoom { opacity: 1; }
@media (hover: none) { .sk-zoom { opacity: .85; } }

/* 사진 설명(캡션) */
.sk-photo figcaption {
	padding-top: 8px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 15px;
	line-height: 1.45;
	color: var(--sk-soft);
}
.sk-photo--main figcaption { font-size: 16px; }

/* 큰 사진 아래 줄: 캡션 | 안내 문구 */
.sk-caprow {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	min-width: 0;
}
.sk-caprow figcaption { flex: 1; min-width: 0; }
.sk-hint {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 5px;
	padding-top: 8px;
	font-size: 13px;
	color: var(--sk-soft);
	cursor: zoom-in;
}
.sk-hint svg { width: 15px; height: 15px; }
.sk-hint:hover { color: var(--sk-leaf); }

/* 큰 사진의 돋보기는 항상 보이게 */
.sk-photo--main .sk-zoom { opacity: .85; }

/* 설명글 */
.sketch-mode #tt-body-page .entry-content {
	max-width: 760px;
	margin: 48px auto 0;
}
.sketch-mode #tt-body-page .entry-content p,
.sketch-mode #tt-body-page .entry-content li {
	font-size: 17px;
	line-height: 1.95;
	color: var(--sk-ink);
}
.sketch-mode #tt-body-page .entry-content p { margin-bottom: 1em; }
.sketch-mode .entry-content .another_category,
.sketch-mode .entry-content .container_postbtn { display: none !important; }

/* 댓글 */
.sketch-mode #tt-body-page .comments {
	max-width: 760px;
	margin: 64px auto 0;
	padding-top: 24px;
	border-top: 1px solid var(--sk-line);
}

/* ---------- 6. 크게 보기 ---------- */
.sk-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	grid-template-rows: 1fr auto;
	place-items: center;
	padding: 24px 72px 20px;
	background: rgba(8, 10, 8, .96);
	color: #eee;
	cursor: zoom-out;
}
.sk-lightbox.is-open { display: grid; }
.sk-lightbox img {
	max-width: 100%;
	max-height: calc(100vh - 100px);
	object-fit: contain;
}
.sk-lightbox p {
	margin: 12px 0 0;
	text-align: center;
	font-size: 17px;
	color: #eee;
}
.sk-lightbox .sk-count { margin-left: 12px; font-size: 13px; color: #999; }
.sk-lightbox button {
	position: absolute;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	font-size: 28px;
	line-height: 1;
	color: #fff;
}
.sk-lightbox button:hover { background: rgba(255, 255, 255, .25); }
.sk-lightbox .sk-close { top: 16px; right: 16px; }
.sk-lightbox .sk-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.sk-lightbox .sk-next { right: 14px; top: 50%; transform: translateY(-50%); }
.sk-lightbox.single .sk-prev,
.sk-lightbox.single .sk-next { display: none; }
body.sk-no-scroll { overflow: hidden; }

/* ---------- 7. 휴대폰 ---------- */
@media screen and (max-width: 767px) {
	.sketch-mode #container .content-wrap { display: flex; flex-direction: column; }
	.sketch-mode .sk-side {
		order: -1;
		padding: 24px 16px 8px;
		border-left: 0;
		border-bottom: 1px solid var(--sk-line);
	}
	.sk-home { margin-bottom: 12px; }
	.sk-desc { margin-bottom: 16px; }
	.sk-category li { display: inline-block; }
	.sk-category .sk-cat-title { display: block; }
	.sk-counter { display: none; }

	.sketch-mode #content { padding: 24px 16px 48px; }
	.sketch-mode #content > .inner:has(> .post-item) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px 12px;
	}

	/* 휴대폰: 큰 사진 한 줄, 나머지는 두 장씩 */
	.sk-photos { gap: 10px; }
	.sk-top { display: flex; flex-direction: column; height: auto; gap: 10px; }
	.sk-sidecol,
	.sk-n5 .sk-sidecol,
	.sk-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: none;
		height: auto;
		gap: 10px;
	}
	.sk-frame { flex: none; aspect-ratio: 1; }
	.sk-photo--main .sk-frame { aspect-ratio: 4 / 5; }

	.sketch-mode #tt-body-page .entry-content { margin-top: 32px; }
	.sketch-mode #tt-body-page .entry-content p { font-size: 16px; }

	.sk-hint span { display: none; }
	.sk-hint:after { content: "크게 보기"; }

	.sk-lightbox { padding: 56px 8px 16px; }
	.sk-lightbox .sk-prev,
	.sk-lightbox .sk-next { display: none; }
}
