/*
 * 디자인: docs/DESIGN.md (F. 그림 설명형)
 * 참고 시안: docs/design/mobile.html(390px), docs/design/desktop.html(1440px)
 * 색·글꼴·구성을 바꾸려면 사용자 승인을 받는다.
 */
:root {
	--hero: #3D3BF3;
	--bg: #F4F3FF;
	--ink: #16152B;
	--sub: #54536E;
	--soft: #ECEBFF;
	--line: #E3E1F7;
	--gate1: #FFC83D;
	--gate2: #FF7A59;
	--mark: #FFE3DA;
	--ok: #1D6B45;
	--card: #FFFFFF;
	--source-text: #3B3A55;
	/* 글꼴: 제목·본문 모두 Pretendard (2026-09-30 사용자 선택, 읽기 쉬움). 제목은 굵게·자간 조금 좁게 */
	--font-title: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	--font-body: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	--title-weight: 800;
	--title-tracking: -0.02em;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	word-break: keep-all;
	overflow-wrap: break-word;
}

a {
	color: var(--ink);
	text-decoration: none;
}

a:hover {
	color: var(--hero);
}

h1,
h2,
p {
	margin: 0;
}

/* ---------- 휴대폰 (기본) ---------- */

a:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--gate1);
	outline-offset: 2px;
	border-radius: 6px;
}

.site-header {
	position: relative;
	background: var(--hero);
	color: #FFFFFF;
	padding: 18px 22px 0;
	min-height: 62px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.site-name,
.site-name:hover {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 20px;
	color: inherit;
}

.main-nav {
	display: none;
}

/* 휴대폰 메뉴 버튼 (시안의 검색 아이콘 버튼과 같은 모양) */
.menu-button {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	list-style: none;
}

.menu-button::-webkit-details-marker {
	display: none;
}

.menu[open] .menu-button {
	background: rgba(255, 255, 255, 0.32);
}

.menu-panel {
	position: absolute;
	z-index: 10;
	top: calc(100% + 8px);
	left: 16px;
	right: 16px;
	display: flex;
	flex-direction: column;
	padding: 8px 20px;
	background: var(--card);
	border-radius: 20px;
	box-shadow: 0 16px 40px rgba(22, 21, 43, 0.18);
}

.menu-panel a {
	display: flex;
	align-items: center;
	min-height: 52px;
	font-size: 17px;
	font-weight: 700;
	border-bottom: 1px solid var(--line);
}

.menu-panel a:last-child {
	border-bottom: none;
}

/* 현재 위치: 주제별 질문 › 성적 */
.breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0 0 -6px;
	padding: 0;
	list-style: none;
	font-size: 14px;
	font-weight: 700;
}

.breadcrumb li + li::before {
	content: "›";
	margin: 0 6px;
	color: #D6D5FF;
}

.breadcrumb li {
	display: flex;
	align-items: center;
}

.breadcrumb a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: #D6D5FF;
}

.breadcrumb a:hover {
	color: #FFFFFF;
}

.hero {
	background: var(--hero);
	color: #FFFFFF;
	border-radius: 0 0 36px 36px;
	padding: 18px 22px 70px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.hero-text {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.hero h1 {
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 38px;
	line-height: 1.2;
}

.hero-art svg {
	display: block;
	width: 100%;
	max-width: 346px;
	height: auto;
}

.layout {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 0 20px 36px;
	margin-top: -44px;
}

.content,
.sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.card {
	background: var(--card);
	border-radius: 24px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.answer-card {
	padding: 22px 20px;
	gap: 10px;
	box-shadow: 0 12px 30px rgba(61, 59, 243, 0.18);
}

.card-label {
	font-size: 13px;
	font-weight: 800;
	color: var(--hero);
}

.answer-card p {
	font-size: 19px;
	line-height: 1.55;
	font-weight: 700;
}

.mark {
	background: var(--mark);
	padding: 0 4px;
	border-radius: 6px;
}

.card-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.card h2,
.related h2 {
	font-size: 17px;
	font-weight: 800;
}

.card-note {
	font-size: 12px;
	font-weight: 700;
	color: var(--sub);
}

.example-card p {
	font-size: 15px;
	line-height: 1.6;
}

.tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 12px 0;
	border-radius: 18px;
	background: var(--soft);
}

.tile-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--sub);
}

.tile-value {
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 32px;
	color: var(--hero);
}

.tile-total {
	background: var(--ink);
}

.tile-total .tile-label {
	color: #C9C8FF;
}

.tile-total .tile-value {
	color: var(--gate1);
}

.example-result {
	font-size: 14px;
	font-weight: 600;
	color: var(--ok);
}

/* 내 학년은? — 휴대폰은 본문 안에, PC는 사이드바에 학년 버튼을 둔다 */
.grade-section {
	display: flex;
	flex-direction: column;
	gap: 20px;
	scroll-margin-top: 16px;
}

.sidebar .grade-picker {
	display: none;
}

.grade-buttons {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.grade-button {
	height: 60px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--card);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	color: var(--sub);
}

.grade-button.selected,
.grade-button.selected:hover {
	border-color: var(--hero);
	background: var(--hero);
	color: #FFFFFF;
}

.grade-label {
	font-size: 16px;
	font-weight: 800;
}

.grade-year {
	font-size: 11px;
	font-weight: 600;
}

.grade-hint {
	font-size: 13px;
	color: var(--sub);
}

.grade-detail {
	gap: 10px;
}

.grade-detail-year {
	font-size: 14px;
	font-weight: 600;
	color: var(--sub);
}

.grade-detail p {
	font-size: 15px;
	line-height: 1.7;
}

/* ---------- 여러 줄 글 (예시·학년별 설명): 문단·목록 (BodyText) ---------- */

.body-text {
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 15px;
	line-height: 1.7;
}

.body-text p {
	margin: 0;
}

.body-text .spaced {
	margin-top: 8px;
}

.body-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* 글머리표 뒤로 들여 써서, 줄이 넘어가도 글머리표 아래로 파고들지 않게 */
.body-list li {
	position: relative;
	padding-left: 18px;
}

.body-list li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.72em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--hero);
}

.body-steps {
	counter-reset: step;
}

.body-steps li {
	counter-increment: step;
	padding-left: 30px;
}

.body-steps li::before {
	content: counter(step);
	top: 0.2em;
	left: 0;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	background: var(--soft);
	color: var(--hero);
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
}

/* 라벨: 소제목처럼 굵게. 내용이 길면 윗줄에 따로 */
.item-label {
	font-weight: 800;
	color: var(--ink);
}

.body-list li.stacked .item-label {
	display: block;
}

.related {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.related-link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 14px 16px;
	background: var(--card);
	border-radius: 18px;
	font-size: 16px;
	font-weight: 700;
}

/* 막다른 페이지 방지: 주제 허브·학년 허브로 가는 링크 */
.hub-more {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	padding: 0 18px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--card);
	font-size: 15px;
	font-weight: 800;
	color: var(--hero);
}

.grade-hub-link {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 15px;
	font-weight: 800;
	color: var(--hero);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.q-badge {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border-radius: 10px;
	background: var(--gate1);
	color: var(--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 16px;
}

.related-link:nth-of-type(3n + 2) .q-badge {
	background: var(--gate2);
}

.related-link:nth-of-type(3n) .q-badge {
	background: var(--soft);
	color: var(--hero);
}

.source-box {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px;
	border-radius: 18px;
	background: var(--soft);
}

.source-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 800;
	color: var(--ok);
}

.source-year-note {
	font-weight: 600;
	white-space: nowrap;
}

.source-detail {
	font-size: 13px;
	line-height: 1.6;
	color: var(--source-text);
}

.source-detail a {
	font-weight: 700;
	color: var(--hero);
}

.source-break {
	display: none;
}

.disclaimer {
	font-size: 13px;
	line-height: 1.6;
	color: var(--sub);
}

.changes {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.changes h2 {
	font-size: 15px;
	font-weight: 800;
}

.changes ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--source-text);
}

.changes li {
	display: flex;
	gap: 10px;
}

.changes time {
	flex-shrink: 0;
	font-weight: 700;
	color: var(--sub);
}

.ask-button,
.ask-button:hover {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 56px;
	border-radius: 18px;
	background: var(--ink);
	color: #FFFFFF;
	font-size: 16px;
	font-weight: 800;
}

.recheck-notice {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--gate1);
	color: var(--ink);
	font-size: 14px;
	font-weight: 800;
}

.site-footer {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px 22px 40px;
	border-top: 1px solid var(--line);
}

.footer-nav {
	display: flex;
	flex-wrap: wrap;
	column-gap: 20px;
}

.footer-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 14px;
	font-weight: 600;
	color: var(--sub);
}

.footer-nav a:hover {
	color: var(--hero);
}

.footer-name {
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 18px;
	color: var(--sub);
}

/* ---------- 허브 페이지 (학년별 등): 질문 목록 ---------- */

.hero-sub {
	font-size: 16px;
	line-height: 1.6;
	font-weight: 600;
	color: #D6D5FF;
}

.hub-list {
	box-shadow: 0 12px 30px rgba(61, 59, 243, 0.18);
	gap: 6px;
}

.hub-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hub-items li + li {
	border-top: 1px solid var(--line);
}

.hub-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 44px;
	padding: 14px 0;
}

.hub-item .q-badge {
	margin-top: 1px;
}

.hub-items li:nth-child(3n + 2) .q-badge {
	background: var(--gate2);
}

.hub-items li:nth-child(3n) .q-badge {
	background: var(--soft);
	color: var(--hero);
}

.hub-item-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hub-item-title {
	font-size: 17px;
	font-weight: 800;
	line-height: 1.4;
}

.hub-item-answer {
	font-size: 14px;
	line-height: 1.6;
	color: var(--sub);
}

.hub-empty {
	font-size: 15px;
	line-height: 1.6;
	color: var(--sub);
}

.grade-choice {
	box-shadow: 0 12px 30px rgba(61, 59, 243, 0.18);
}

.hub-item-text {
	flex-grow: 1;
}

.hub-item-arrow {
	flex-shrink: 0;
	align-self: center;
	color: var(--sub);
}

/* 2028 특집: 이 입시를 치르는 학년 + 요약 페이지 큰 링크 */
.hero-grade {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 12px;
	font-size: 15px;
	font-weight: 700;
}

.hero-grade a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	/* 노란색(gate1)은 hero 배경 위 대비가 4.36:1이라 흰색 + 밑줄 (AccessibilityTests) */
	color: #FFFFFF;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.hero-grade a:hover {
	color: #FFFFFF;
	text-decoration-thickness: 3px;
}

.summary-card {
	box-shadow: 0 12px 30px rgba(61, 59, 243, 0.18);
	gap: 10px;
}

.summary-link {
	display: grid;
	grid-template-columns: 1fr auto;
	column-gap: 12px;
	row-gap: 6px;
}

.summary-title {
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 28px;
	line-height: 1.2;
}

.summary-answer {
	grid-row: 2;
	font-size: 15px;
	line-height: 1.6;
	color: var(--sub);
}

.summary-link .hub-item-arrow {
	grid-row: 1 / span 2;
	grid-column: 2;
	color: var(--hero);
}

/* 용어 사전: 첫 글자로 찾기 + 자음 묶음 */
.term-jump {
	box-shadow: 0 12px 30px rgba(61, 59, 243, 0.18);
}

.term-jump .topic-link {
	justify-content: center;
	min-width: 44px;
	padding: 0 12px;
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	font-size: 18px;
}

.term-group {
	scroll-margin-top: 16px;
}

.term-initial {
	font-family: var(--font-title);
	font-weight: var(--title-weight);
	letter-spacing: var(--title-tracking);
	color: var(--hero);
}

.card h2.term-initial {
	font-size: 28px;
}

/* 다른 주제 보기 — 휴대폰은 목록 아래, PC는 사이드바 */
.sidebar .topic-picker {
	display: none;
}

.topic-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.topic-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 15px;
	font-weight: 700;
	color: var(--sub);
}

.topic-link.selected,
.topic-link.selected:hover {
	border-color: var(--hero);
	background: var(--hero);
	color: #FFFFFF;
}

.grade-choice .grade-button {
	height: 72px;
}

/* 홈: 최근 추가·수정된 질문의 표시 + 날짜 */
.recent-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--sub);
}

.recent-tag {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--soft);
	color: var(--hero);
}

.recent-tag.added {
	background: var(--gate1);
	color: var(--ink);
}

/* ---------- 안내 페이지 (사이트 소개·정보 원칙·이용 안내·전체 변경 기록) ---------- */

.info-card p,
.info-note {
	font-size: 15px;
	line-height: 1.7;
}

.info-card a,
.info-note a {
	color: var(--hero);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.info-note {
	color: var(--sub);
}

.info-list,
.info-steps {
	margin: 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 15px;
	line-height: 1.7;
}

.info-list strong,
.info-steps strong {
	display: block;
	font-weight: 800;
}

.change-date {
	font-size: 13px;
	font-weight: 700;
	color: var(--sub);
}

/* ---------- 태블릿: 휴대폰 흐름 그대로, 너무 넓어지지 않게 ---------- */

@media (min-width: 640px) {
	.hero,
	.site-header,
	.site-footer {
		padding-left: max(22px, calc((100% - 600px) / 2));
		padding-right: max(22px, calc((100% - 600px) / 2));
	}

	.layout {
		max-width: 640px;
		margin-left: auto;
		margin-right: auto;
		width: 100%;
	}
}

/* ---------- PC ---------- */

@media (min-width: 1024px) {
	.site-header {
		height: 72px;
		min-height: 0;
		padding: 0 80px;
		background: var(--card);
		color: var(--hero);
		border-bottom: 1px solid var(--line);
	}

	.site-header {
		justify-content: flex-start;
		gap: 40px;
	}

	.site-name,
	.site-name:hover {
		font-size: 24px;
		color: var(--hero);
	}

	.main-nav {
		display: flex;
		gap: 28px;
	}

	.main-nav a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		font-size: 16px;
		font-weight: 700;
	}

	.menu {
		display: none;
	}

	a:focus-visible {
		outline-color: var(--hero);
	}

	.hero a:focus-visible {
		outline-color: var(--gate1);
	}

	.breadcrumb ol {
		font-size: 15px;
	}

	.hero {
		border-radius: 0;
		padding: 48px 80px 96px;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 40px;
	}

	.hero-art svg {
		width: 520px;
		max-width: none;
	}

	.hero-text {
		max-width: 560px;
		gap: 16px;
	}

	.hero h1 {
		font-size: 56px;
		line-height: 1.15;
	}

	.layout {
		max-width: none;
		flex-direction: row;
		align-items: flex-start;
		gap: 32px;
		padding: 0 80px 56px;
		margin-top: -56px;
	}

	.content {
		flex-grow: 1;
		max-width: 820px;
		gap: 24px;
	}

	.card {
		border-radius: 28px;
		padding: 28px 36px;
		gap: 18px;
	}

	.answer-card {
		padding: 32px 36px;
		gap: 12px;
		box-shadow: 0 16px 40px rgba(61, 59, 243, 0.16);
	}

	.card-label {
		font-size: 14px;
	}

	.answer-card p {
		font-size: 26px;
		line-height: 1.5;
	}

	.card h2 {
		font-size: 20px;
	}

	.card-note {
		font-size: 13px;
	}

	.example-card p,
	.example-card .body-text {
		font-size: 17px;
	}

	.mark {
		padding: 0 6px;
		border-radius: 8px;
	}

	.tiles {
		gap: 12px;
		max-width: 520px;
	}

	.tile {
		gap: 4px;
		padding: 16px 0;
		border-radius: 20px;
	}

	.tile-label {
		font-size: 13px;
	}

	.tile-value {
		font-size: 40px;
	}

	.example-result {
		font-size: 15px;
		font-weight: 700;
	}

	.content .grade-picker {
		display: none;
	}

	.sidebar .grade-picker {
		display: flex;
		border-radius: 24px;
		padding: 22px;
		gap: 12px;
	}

	.sidebar .grade-picker h2 {
		font-size: 17px;
	}

	.grade-section {
		gap: 24px;
		scroll-margin-top: 24px;
	}

	.grade-detail {
		gap: 12px;
	}

	.grade-detail-year {
		font-size: 15px;
	}

	.grade-detail p,
	.grade-detail .body-text {
		font-size: 17px;
	}

	.sidebar {
		width: 380px;
		flex-shrink: 0;
		padding-top: 80px;
	}

	.related {
		background: var(--card);
		border-radius: 24px;
		padding: 22px;
		gap: 8px;
	}

	.related h2 {
		margin-bottom: 4px;
	}

	.related-link {
		padding: 10px 0;
		border-radius: 0;
		font-size: 15px;
	}

	.q-badge {
		width: 30px;
		height: 30px;
	}

	.source-box {
		border-radius: 24px;
		padding: 20px 22px;
	}

	.source-status,
	.source-detail,
	.disclaimer,
	.changes ul {
		font-size: 14px;
	}

	.disclaimer,
	.changes {
		padding: 0 22px;
	}

	.source-sep {
		display: none;
	}

	.source-break {
		display: inline;
	}

	.hub-hero .hero-text {
		max-width: 820px;
	}

	.hero-sub {
		font-size: 18px;
	}

	.hub-list {
		box-shadow: 0 16px 40px rgba(61, 59, 243, 0.16);
		gap: 8px;
	}

	.hub-item {
		padding: 16px 0;
	}

	.hub-item-title {
		font-size: 19px;
	}

	.hub-item-answer {
		font-size: 15px;
	}

	.grade-choice {
		max-width: 560px;
	}

	/* 홈에서는 다른 카드와 폭을 맞춘다 */
	.grade-choice.home-grade {
		max-width: none;
	}

	.summary-title {
		font-size: 36px;
	}

	.summary-answer {
		font-size: 17px;
	}

	.content .topic-picker {
		display: none;
	}

	.sidebar .topic-picker {
		display: flex;
		border-radius: 24px;
		padding: 22px;
		gap: 12px;
	}

	.site-footer {
		padding: 32px 80px 48px;
	}
}
