/**
 * PlanStudy base styles.
 * 최소 기본 스타일만 작성한다. 컴포넌트별 스타일은 components.css 에 둔다.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

/* 모바일 메뉴가 열려 있는 동안 배경 스크롤을 막는다 (main.js 에서 토글). */
body.ps-no-scroll {
	overflow: hidden;
}

body {
	margin: 0;
	background-color: var(--ps-color-background);
	color: var(--ps-color-text);
	font-family: var(--ps-font-family);
	font-size: var(--ps-font-size-body);
	font-weight: var(--ps-font-weight-regular);
	line-height: var(--ps-line-height-body);
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--ps-space-4);
	font-weight: var(--ps-font-weight-bold);
	line-height: var(--ps-line-height-heading);
	color: var(--ps-color-text);
	word-break: keep-all;
}

h1 { font-size: var(--ps-font-size-h1); line-height: var(--ps-line-height-hero); }
h2 { font-size: var(--ps-font-size-h2); }
h3 { font-size: var(--ps-font-size-h3); }

p {
	margin: 0 0 var(--ps-space-4);
}

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

a:hover {
	text-decoration: underline;
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Buttons reset */
button,
input,
textarea,
select {
	font-family: inherit;
	font-size: 100%;
}

button {
	cursor: pointer;
	border: none;
	background: none;
}

/* Forms 기본값 */
input,
textarea,
select {
	width: 100%;
	padding: var(--ps-space-3);
	border: 1px solid var(--ps-color-border);
	border-radius: var(--ps-radius-sm);
	background-color: var(--ps-color-surface);
	color: var(--ps-color-text);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: none;
	border-color: var(--ps-color-accent);
	box-shadow: 0 0 0 3px var(--ps-color-accent-tint);
}

/* Container utility */
.ps-container {
	width: 100%;
	max-width: var(--ps-container-max);
	margin-inline: auto;
	padding-inline: var(--ps-container-gutter);
}

/* Screen-reader-only text (WordPress 표준 클래스명과 호환) */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--ps-color-surface);
	color: var(--ps-color-text);
	clip: auto !important;
	clip-path: none;
	display: block;
	height: auto;
	left: 5px;
	top: 5px;
	width: auto;
	padding: var(--ps-space-3) var(--ps-space-4);
	z-index: 100000;
	border-radius: var(--ps-radius-sm);
	box-shadow: var(--ps-shadow-elevated);
}

/*
 * 접근성 원칙: outline을 전역에서 제거하지 않는다.
 * 대신 마우스 클릭 시에는 숨기고 키보드 포커스에서만 보이도록 focus-visible을 사용한다.
 */
:focus-visible {
	outline: 2px solid var(--ps-color-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
