/* ════════════════════════════════════════════
   공지사항 (모바일 우선 · 360px~1280px)
   히어로는 components/page-hero.php + page.css의 .page-hero 공용 스타일 사용.
   ════════════════════════════════════════════ */

/* ── 레이아웃 ────────────────────────────── */
#notice-main,
#notice-single-main {
	padding: 28px 16px 56px;
	background: #fff;
}

.notice-wrap {
	max-width: 1180px;
	margin: 0 auto;
}

/* ── 카테고리 필터 ───────────────────────── */
.notice-cat-tabs {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.notice-cat-tab {
	display: inline-block;
	padding: 6px 14px;
	border: 1.5px solid var(--hyoo-border);
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	color: var(--hyoo-text-muted);
	text-decoration: none;
	transition: border-color 0.2s, color 0.2s, background 0.2s;
	white-space: nowrap;
}

.notice-cat-tab:hover {
	border-color: var(--hyoo-accent-light);
	color: var(--hyoo-accent-dark);
}

.notice-cat-tab.is-active {
	border-color: var(--hyoo-accent-light);
	background: var(--hyoo-accent-light);
	color: #fff;
}

/* ── 검색 폼 ─────────────────────────────── */
.notice-search-form {
	margin-bottom: 24px;
}

.notice-search-inner {
	display: flex;
	border: 1.5px solid var(--hyoo-border);
	border-radius: 8px;
	overflow: hidden;
	transition: border-color 0.2s;
}

.notice-search-inner:focus-within {
	border-color: var(--hyoo-accent-light);
}

.notice-search-input {
	flex: 1;
	border: none;
	outline: none;
	padding: 10px 14px;
	font-size: 14px;
	color: var(--hyoo-text);
	background: #fff;
	min-width: 0;
}

.notice-search-input::placeholder {
	color: #bbb;
}

.notice-search-btn {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	background: var(--hyoo-accent-light);
	border: none;
	cursor: pointer;
	color: #fff;
	transition: background 0.2s;
}

.notice-search-btn:hover {
	background: var(--hyoo-accent-dark);
}

.notice-search-btn svg {
	width: 18px;
	height: 18px;
}

/* ── 공지 목록 (카드형 그리드, 모바일 우선: 1열 → 768px 2열 → 1024px 3열) ── */
.notice-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

.notice-item {
	border: 1px solid var(--hyoo-border);
	border-radius: 14px;
	overflow: hidden;
	transition: box-shadow 0.2s, border-color 0.2s;
}

.notice-item:hover {
	border-color: var(--hyoo-accent-light);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.notice-item--pinned {
	border-color: var(--hyoo-accent-dark);
}

.notice-item__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
}

/* 썸네일 — 대표이미지가 있으면 이미지, 없으면 아이콘 자리표시자 */
.notice-item__thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--hyoo-bg-soft);
}

.notice-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s;
}

.notice-item__link:hover .notice-item__thumb img {
	transform: scale(1.05);
}

.notice-item__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
}

.notice-item__thumb--placeholder svg {
	width: 40px;
	height: 40px;
	color: var(--hyoo-accent-light);
}

/* 고정 배지 — 썸네일 위 오버레이. 카테고리 배지(왼쪽)와 겹치지 않게 오른쪽에 배치 */
.notice-item__pin {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-block;
	padding: 3px 11px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.2px;
	background: var(--hyoo-text);
	color: #fff;
	white-space: nowrap;
}

.notice-item__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
	gap: 8px;
	padding: 16px 18px 20px;
}

/* 카테고리 뱃지 — 배경/글자색은 inc/cpt-notice.php의 hyoo_notice_cat_color()가
   슬러그 기준으로 자동 배정해서 인라인 style로 출력함(새 카테고리 추가해도 CSS 수정 불필요) */
.notice-item__cat {
	flex-shrink: 0;
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.2px;
	white-space: nowrap;
}

/* 목록 카드에서는 썸네일 위 오버레이로 — 왼쪽에 배치(고정 배지는 오른쪽으로 이동해서 안 겹침).
   상세 페이지(.notice-single__head)는 썸네일이 없어 기본 인라인 흐름을 그대로 씀. */
.notice-item__thumb .notice-item__cat {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.notice-item__title {
	font-size: 15px;
	font-weight: 700;
	color: var(--hyoo-text);
	line-height: 1.5;
	word-break: break-all;
}

.notice-item__link:hover .notice-item__title {
	color: var(--hyoo-accent-dark);
}

.notice-item__date {
	font-size: 12px;
	color: var(--hyoo-text-muted);
	white-space: nowrap;
	margin-top: auto;
	padding-top: 4px;
}

/* ── 본문 발췌 (검색 시) ─────────────────── */
.notice-item__excerpt {
	margin: -2px 0 0;
	padding: 0;
	font-size: 12px;
	color: var(--hyoo-text-muted);
	line-height: 1.6;
	word-break: break-word;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* 검색 강조 — 목록(제목/발췌)과 상세(제목/본문) 전체에 공용 적용 */
.notice-wrap mark {
	background: #fff3cd;
	color: #856404;
	border-radius: 2px;
	padding: 0 2px;
	font-style: normal;
}

/* ── 빈 상태 ─────────────────────────────── */
.notice-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 72px 16px 80px;
	text-align: center;
}

.notice-empty__icon {
	width: 72px;
	height: 72px;
	background: var(--hyoo-bg-soft);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	flex-shrink: 0;
}

.notice-empty__icon svg {
	width: 34px;
	height: 34px;
	color: var(--hyoo-accent-light);
}

.notice-empty__msg {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 500;
	color: var(--hyoo-text);
	line-height: 1.65;
	word-break: break-word;
}

.notice-empty__kw {
	color: var(--hyoo-accent-dark);
	font-weight: 700;
}

.notice-empty__sub {
	margin: 0 0 28px;
	font-size: 13px;
	color: var(--hyoo-text-muted);
	line-height: 1.6;
}

.notice-empty__reset {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 10px 22px;
	background: var(--hyoo-accent-dark);
	color: #fff;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s;
	white-space: nowrap;
}

.notice-empty__reset:hover { background: var(--hyoo-accent-light); color: #fff; }
.notice-empty__reset:focus-visible { outline: 2px solid var(--hyoo-accent-light); outline-offset: 3px; }

/* ── 페이지네이션 ─────────────────────────── */
.notice-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.notice-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1.5px solid var(--hyoo-border);
	border-radius: 6px;
	font-size: 13px;
	color: var(--hyoo-text-muted);
	text-decoration: none;
	transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.notice-pagination .page-numbers svg {
	width: 16px;
	height: 16px;
}

.notice-pagination .page-numbers:hover {
	border-color: var(--hyoo-accent-light);
	color: var(--hyoo-accent-light);
}

.notice-pagination .page-numbers.current {
	border-color: var(--hyoo-accent-dark);
	background: var(--hyoo-accent-dark);
	color: #fff;
	font-weight: 700;
}

.notice-pagination .page-numbers.dots {
	border: none;
	cursor: default;
	color: var(--hyoo-text-muted);
}

/* ════════════════════════════════════════════
   공지사항 상세
   ════════════════════════════════════════════ */

.notice-single__head {
	padding-bottom: 20px;
	border-bottom: 2px solid var(--hyoo-text);
	margin-bottom: 28px;
}

.notice-single__head .notice-item__cat {
	margin-bottom: 10px;
}

.notice-single__title {
	font-size: 20px;
	font-weight: 700;
	color: var(--hyoo-text);
	line-height: 1.5;
	letter-spacing: -0.5px;
	margin: 8px 0 12px;
}

.notice-single__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
}

.notice-single__date {
	font-size: 13px;
	color: var(--hyoo-text-muted);
}

/* 공유 버튼 — margin-left:auto로 .notice-single__meta(flex) 안에서 항상 우측 끝에 배치.
   기본 hidden 상태([hidden])는 아래 display:inline-flex보다 명시적으로 우선시켜야 한다
   (동일 특이도의 [hidden]{display:none} UA 규칙은 나중에 선언된 클래스 규칙에 밀림 —
   FAQ 아코디언에서 겪은 것과 같은 문제라 여기도 [hidden] 전용 규칙으로 방지). */
.notice-share-btn[hidden] {
	display: none;
}

.notice-share-btn {
	margin-left: auto;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1.5px solid var(--hyoo-border);
	border-radius: 20px;
	background: #fff;
	color: var(--hyoo-text-muted);
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: border-color 0.2s, color 0.2s;
	white-space: nowrap;
}

.notice-share-btn:hover {
	border-color: var(--hyoo-accent-light);
	color: var(--hyoo-accent-dark);
}

.notice-share-btn:focus-visible {
	outline: 2px solid var(--hyoo-accent-light);
	outline-offset: 2px;
}

.notice-share-btn svg {
	width: 14px;
	height: 14px;
}

.notice-share-btn.is-copied {
	border-color: var(--hyoo-accent-dark);
	color: var(--hyoo-accent-dark);
}

/* ── 완료(공유/복사 성공) 체크 애니메이션 ─────────────────── */
/* 평소엔 공유 아이콘만, is-copied가 붙는 순간 체크 아이콘으로 바뀌며 그려지는
   효과(stroke-dashoffset) + 살짝 팝업(scale)되는 애니메이션을 재생한다. */
.notice-share-btn__icon--check {
	display: none;
}

.notice-share-btn.is-copied .notice-share-btn__icon--share {
	display: none;
}

.notice-share-btn.is-copied .notice-share-btn__icon--check {
	display: block;
	stroke-dasharray: 24;
	stroke-dashoffset: 24;
	transform-box: fill-box;
	transform-origin: center;
	animation: hyoo-share-check-draw 0.35s ease-out forwards;
}

@keyframes hyoo-share-check-draw {
	from {
		stroke-dashoffset: 24;
		transform: scale(0.6);
	}
	to {
		stroke-dashoffset: 0;
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.notice-share-btn.is-copied .notice-share-btn__icon--check {
		animation: none;
		stroke-dashoffset: 0;
	}
}

/* ── 본문 ───────────────────────────────── */
/* 구분선(border-bottom)은 여기(전체 폭, wrap 기준 1280px)에 걸고, 실제 읽기 폭 제한은
   -inner 쪽에서 처리 — 본문만 860px로 좁혀도 구분선은 페이지 폭과 맞게 유지하기 위함
   (전에는 본문에 직접 border-bottom을 걸어서 구분선만 짧게 보이는 문제가 있었음). */
.notice-single__body {
	padding-bottom: 36px;
	border-bottom: 1px solid var(--hyoo-border);
}

.notice-single__body-inner {
	max-width: 860px; /* wrap이 1280px이어도 본문은 가독성 유지 */
	font-size: 15px;
	line-height: 1.9;
	color: var(--hyoo-text);
	word-break: break-word;
	overflow-wrap: break-word;
}

.notice-single__body-inner p  { margin: 0 0 1em; }
.notice-single__body-inner h2 { font-size: 18px; font-weight: 700; margin: 1.5em 0 0.5em; color: var(--hyoo-text); }
.notice-single__body-inner h3 { font-size: 16px; font-weight: 700; margin: 1.2em 0 0.4em; color: var(--hyoo-text); }
.notice-single__body-inner ul,
.notice-single__body-inner ol { padding-left: 1.5em; margin: 0 0 1em; }
.notice-single__body-inner li { margin-bottom: 4px; }
.notice-single__body-inner img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.notice-single__body-inner a  { color: var(--hyoo-accent-dark); text-decoration: underline; word-break: break-all; }
.notice-single__body-inner table { width: 100%; border-collapse: collapse; }
.notice-single__body-inner .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1em; }

/* ── 최신 칼럼 (콘텐츠 하단, 4개) ─────────── */
.notice-related {
	margin-top: 40px;
	padding-top: 32px;
}

.notice-related__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--hyoo-text);
	margin: 0 0 16px;
}

/* ── 이전 / 다음 글 ─────────────────────── */
.notice-single__nav {
	margin-top: 0;
	border-bottom: 1px solid var(--hyoo-border);
}

.notice-single__nav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 4px;
	border-top: 1px solid var(--hyoo-border);
	text-decoration: none;
	transition: background 0.15s;
}

.notice-single__nav-item:hover {
	background: var(--hyoo-bg-soft);
}

.notice-single__nav-label {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
	color: var(--hyoo-accent-dark);
	width: 36px;
	letter-spacing: 0.3px;
}

.notice-single__nav-title {
	font-size: 14px;
	color: var(--hyoo-text);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* ── 목록으로 ────────────────────────────── */
.notice-single__back {
	margin-top: 28px;
	text-align: center;
}

.notice-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 24px;
	border: 1.5px solid var(--hyoo-accent-light);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--hyoo-accent-dark);
	text-decoration: none;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.notice-back-btn:hover {
	background: var(--hyoo-accent-dark);
	border-color: var(--hyoo-accent-dark);
	color: #fff;
}

.notice-back-btn svg {
	width: 16px;
	height: 16px;
}

/* ════════════════════════════════════════════
   반응형 (360px → 1280px 모바일 우선)
   ════════════════════════════════════════════ */

@media (max-width: 360px) {
	#notice-main,
	#notice-single-main { padding: 20px 12px 48px; }

	.notice-cat-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 4px;
		gap: 6px;
	}
	.notice-cat-tabs::-webkit-scrollbar { display: none; }
	.notice-cat-tab { flex-shrink: 0; font-size: 11px; padding: 5px 10px; }

	.notice-search-input { font-size: 13px; padding: 9px 10px; }
	.notice-search-btn { width: 38px; }
	.notice-search-btn svg { width: 16px; height: 16px; }

	.notice-item__body { padding: 12px 14px 16px; }
	.notice-item__cat { font-size: 10px; padding: 2px 7px; }
	.notice-item__title { font-size: 13px; }

	.notice-pagination { gap: 2px; margin-top: 24px; }
	.notice-pagination .page-numbers { width: 30px; height: 30px; font-size: 12px; }

	.notice-single__title { font-size: 16px; }
	.notice-single__body-inner { font-size: 14px; }
	.notice-back-btn { font-size: 13px; padding: 8px 18px; }
}

@media (min-width: 480px) {
	#notice-main,
	#notice-single-main { padding: 36px 20px 64px; }

	.notice-single__title { font-size: 22px; }
}

@media (min-width: 768px) {
	#notice-main,
	#notice-single-main { padding: 48px 24px 72px; }

	.notice-list { grid-template-columns: repeat(2, 1fr); }
	.notice-item__title { font-size: 15px; }
	.notice-single__title { font-size: 24px; }
	.notice-single__body-inner { font-size: 16px; }
}

@media (min-width: 1024px) {
	#notice-main,
	#notice-single-main { padding: 56px 40px 80px; }

	.notice-list { grid-template-columns: repeat(3, 1fr); }
	.notice-cat-tab { font-size: 14px; padding: 7px 18px; }
	.notice-single__title { font-size: 26px; }
}

@media (min-width: 1280px) {
	#notice-main,
	#notice-single-main { padding: 64px 40px 96px; }
}
