/* HC layout. Tokens are defined on body so that Rhymix's color_scheme_* body classes switch them. */
body {
	/* Brand (둘레): orange #d76b3d, brown text #3e342e, sand #e9e2d7, paper #faf8f4.
	   The orange itself is for the logo, lines and marks; text and filled buttons use a
	   darker shade of it, because white or paper next to #d76b3d is too faint to read. */
	--hc-brand: #d76b3d;
	--hc-accent: #b9532a;
	--hc-accent-strong: #d76b3d;
	--hc-accent-contrast: #ffffff;
	/* Header is light: same paper as the content, separated by a hairline. */
	--hc-header-bg: #e9e2d7;
	--hc-header-text: #3e342e;
	--hc-header-muted: #6b6159;
	--hc-header-hover: rgba(62, 52, 46, 0.08);
	--hc-header-line: #dbd2c4;
	/* Ink: the dark fill for pill buttons and the current page number. */
	--hc-ink: #3e342e;
	--hc-ink-text: #faf8f4;
	--hc-read-width: 760px;
	--hc-tabbar-h: 0px;
	--hc-bg: #f1ece3;
	--hc-surface: #faf8f4;
	--hc-surface-2: #f3efe8;
	--hc-border: #e0d9cc;
	--hc-border-soft: #ebe5da;
	--hc-text: #3e342e;
	--hc-text-2: #5e544c;
	--hc-text-3: #73695f;
	--hc-badge: #766c62;
	--hc-bar: #ebe5da;
	--hc-accent-soft: #f8e4d9;
	--hc-danger: #b53a2d;
	--hc-radius: 4px;
	--hc-width: 1160px;
	--hc-header-h: 60px;
	--hc-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", "Segoe UI", sans-serif;
	margin: 0;
	background: var(--hc-bg);
	color: var(--hc-text);
	font-family: var(--hc-font);
	font-size: 14px;
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
}
body.color_scheme_dark {
	--hc-brand: #d76b3d;
	--hc-accent: #e08a6d;
	--hc-accent-strong: #d97757;
	--hc-accent-contrast: #1f1e1d;
	--hc-header-bg: #33291f;
	--hc-header-text: #f5f4ee;
	--hc-header-muted: #c0b4a8;
	--hc-header-hover: rgba(245, 244, 238, 0.1);
	--hc-header-line: #4a3c2f;
	--hc-ink: #45443f;
	--hc-ink-text: #f5f4ee;
	--hc-bg: #1a1918;
	--hc-surface: #262624;
	--hc-surface-2: #30302e;
	--hc-border: #45443f;
	--hc-border-soft: #383734;
	--hc-text: #f5f4ee;
	--hc-text-2: #c2c0b6;
	--hc-text-3: #9b9990;
	--hc-badge: #5c5a54;
	--hc-bar: #383734;
	--hc-accent-soft: #3d2f29;
	--hc-danger: #ff8f7d;
	color-scheme: dark;
}

.hc-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.hc-wrap *, .hc-wrap *::before, .hc-wrap *::after { box-sizing: border-box; }
.hc-container { width: 100%; max-width: var(--hc-width); margin: 0 auto; padding: 0 12px; }
.hc-wrap a { color: inherit; text-decoration: none; }
.hc-wrap a:hover { color: var(--hc-accent); }
.hc-wrap :focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }

.hc-skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 8px 12px; background: var(--hc-accent); color: var(--hc-accent-contrast) !important; }
.hc-skip:focus { left: 8px; top: 8px; }

/* Header */
.hc-header { position: sticky; top: 0; z-index: 50; background: var(--hc-header-bg); color: var(--hc-header-text); border-bottom: 1px solid var(--hc-header-line); }
.hc-header__bar { display: flex; align-items: center; gap: 16px; height: var(--hc-header-h); }
.hc-logo { flex: none; display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--hc-header-text) !important; white-space: nowrap; }
.hc-logo__mark { flex: none; width: 30px; height: 30px; }
.hc-logo__word { flex: none; width: auto; height: 22px; }

.hc-nav { flex: 1 1 auto; min-width: 0; }
.hc-nav__list { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hc-nav__item { flex: none; }
.hc-nav__item > a { display: block; padding: 0 13px; line-height: var(--hc-header-h); font-size: 16px; font-weight: 400; color: var(--hc-header-muted); white-space: nowrap; height: var(--hc-header-h); }
.hc-nav__item > a:hover { color: var(--hc-header-text); }
.hc-nav__item.is-active > a { color: var(--hc-accent); font-weight: 700; box-shadow: inset 0 -2px 0 var(--hc-brand); }
/* Next to the larger menu, the search box, the nickname and the log-in button on a PC. */
@media (min-width: 1024px) {
	.hc-header .hc-search__input, .hc-header .hc-profile__btn, .hc-header .hc-login { font-size: 15px; }
}

.hc-tools { flex: none; display: flex; align-items: center; gap: 4px; }

/* The board menu of small screens: a panel that slides in from the left. */
.hc-header .hc-burger { display: none; }
.hc-drawer { position: fixed; inset: 0; z-index: 90; }
.hc-drawer[hidden] { display: none; }
.hc-drawer__shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.18s ease; }
.hc-drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(78vw, 300px); overflow-y: auto; background: var(--hc-surface); color: var(--hc-text); box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2); transform: translateX(-100%); transition: transform 0.18s ease; }
.hc-drawer.is-open .hc-drawer__shade { opacity: 1; }
.hc-drawer.is-open .hc-drawer__panel { transform: none; }
.hc-drawer__head { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 6px 0 16px; border-bottom: 1px solid var(--hc-border); font-size: 15px; }
.hc-drawer__close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--hc-radius); background: transparent; color: var(--hc-text-2); cursor: pointer; }
.hc-drawer__list { margin: 0; padding: 6px 0; list-style: none; }
.hc-drawer__list a { display: block; padding: 12px 16px; font-size: 15px; }
.hc-drawer__list li.is-active a { color: var(--hc-accent); font-weight: 700; box-shadow: inset 3px 0 0 var(--hc-brand); }
.hc-drawer__list--sub { border-top: 1px solid var(--hc-border-soft); }
.hc-drawer__list--sub a { padding: 10px 16px; color: var(--hc-text-2); font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
	.hc-drawer__shade, .hc-drawer__panel { transition: none; }
}
.hc-iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: var(--hc-radius); background: transparent; color: var(--hc-header-muted) !important; cursor: pointer; font: inherit; }
.hc-iconbtn:hover { background: var(--hc-header-hover); color: var(--hc-header-text) !important; }

.hc-search { display: flex; align-items: center; height: 36px; border: 1px solid transparent; border-radius: 18px; background: var(--hc-header-hover); }
.hc-search:focus-within { border-color: var(--hc-header-muted); }
.hc-search__input { width: 150px; height: 34px; padding: 0 4px 0 12px; border: 0; background: transparent; color: var(--hc-header-text); font: inherit; outline: none; }
.hc-search__input::placeholder { color: var(--hc-header-muted); }
.hc-search .hc-iconbtn:hover { background: transparent; }
.hc-search__btn { height: 34px; }

.hc-theme__icon { display: none; }
html[data-hc-theme-pref="light"] .hc-theme__icon--light,
html[data-hc-theme-pref="dark"] .hc-theme__icon--dark,
html[data-hc-theme-pref="auto"] .hc-theme__icon--auto,
html:not([data-hc-theme-pref]) .hc-theme__icon--auto { display: block; }
.hc-theme__label { margin-left: 4px; font-size: 12px; }
.hc-footer__pill .hc-theme__icon { flex: 0 0 auto; }

.hc-bell__badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--hc-danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

/* Notification pop-up under the bell: unread notifications, loaded when opened. */
.hc-notibox { position: relative; }
.hc-noti { position: absolute; right: 0; top: 40px; z-index: 2; width: 340px; border: 1px solid var(--hc-border); border-radius: 8px; background: var(--hc-surface); color: var(--hc-text); font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); }
.hc-noti[hidden] { display: none; }
.hc-noti__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 12px; border-bottom: 1px solid var(--hc-border-soft); font-size: 14px; }
.hc-noti__readall { padding: 0; border: 0; background: none; color: var(--hc-accent); font: inherit; font-size: 12px; cursor: pointer; }
.hc-noti__readall[hidden] { display: none; }
.hc-noti__list { max-height: min(360px, 60vh); margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.hc-noti__list > li > a { display: block; padding: 9px 12px; border-bottom: 1px solid var(--hc-border-soft); line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.hc-noti__list > li > a:hover { background: var(--hc-surface-2); color: inherit; }
.hc-noti__list time { display: block; margin-top: 2px; color: var(--hc-text-3); font-size: 12px; }
.hc-noti__empty { padding: 28px 12px; color: var(--hc-text-3); text-align: center; }
.hc-noti__all { display: block; padding: 10px 12px; color: var(--hc-text-2) !important; text-align: center; }
.hc-noti__all:hover { background: var(--hc-surface-2); }

.hc-profile { position: relative; }
.hc-profile__btn { display: inline-flex; align-items: center; gap: 4px; max-width: 140px; height: 36px; padding: 0 8px; border: 0; border-radius: var(--hc-radius); background: transparent; color: var(--hc-header-text); font: inherit; font-weight: 600; cursor: pointer; }
.hc-profile__btn:hover { background: var(--hc-header-hover); }
.hc-profile__menu { color: var(--hc-text); }
.hc-profile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-profile__menu { position: absolute; right: 0; top: 40px; min-width: 140px; margin: 0; padding: 4px 0; list-style: none; background: var(--hc-surface); border: 1px solid var(--hc-border); border-radius: var(--hc-radius); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); }
.hc-profile__menu[hidden] { display: none; }
.hc-profile__menu a { display: block; padding: 8px 12px; white-space: nowrap; }
.hc-profile__menu a:hover { background: var(--hc-surface-2); }
.hc-profile__point { margin-bottom: 4px; padding: 6px 12px 8px; border-bottom: 1px solid var(--hc-border-soft); color: var(--hc-text-3); font-size: 13px; white-space: nowrap; }
.hc-profile__point b { color: var(--hc-accent); font-variant-numeric: tabular-nums; }
.hc-login { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--hc-accent); color: var(--hc-accent-contrast) !important; font-weight: 700; white-space: nowrap; }
.hc-login:hover { filter: brightness(1.08); }

/* Main */
/* Core screens (member pages etc.) that are wider than the viewport scroll inside main, not the page. */
.hc-main { flex: 1 0 auto; padding-top: 16px; padding-bottom: 40px; padding-left: 20px; padding-right: 20px; min-width: 0; overflow-x: auto; background: var(--hc-surface); }
.hc-main img, .hc-main video, .hc-main iframe { max-width: 100%; }

/* Footer: sits on the outer background, like a quiet site map. */
.hc-footer { color: var(--hc-text-3); font-size: 13px; }
.hc-footer__inner { display: grid; gap: 12px; padding-top: 20px; padding-bottom: 28px; }
.hc-footer__menu { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hc-footer__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-footer__pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: var(--hc-ink); color: var(--hc-ink-text) !important; font: inherit; font-size: 13px; cursor: pointer; }
.hc-footer__text { margin: 0; }

/* Tablet and below: one row (menu button, logo, tools); the board menu is the drawer. */
@media (max-width: 1023px) {
	.hc-header__bar { height: 48px; gap: 0 4px; }
	.hc-header .hc-burger { display: inline-flex; order: 0; margin-left: -6px; }
	.hc-logo { order: 1; flex: 1 1 0; min-width: 0; margin-right: 0; overflow: hidden; text-overflow: ellipsis; line-height: 48px; }
	.hc-logo__mark { width: 26px; height: 26px; }
	.hc-logo__word { height: 19px; }
	.hc-tools { order: 2; flex: none; height: 48px; }
	.hc-nav { display: none; }
	.hc-main { padding-left: 12px; padding-right: 12px; }
	.hc-theme__label { display: none; }
}
@media (max-width: 599px) {
	.hc-search { border-color: transparent; background: transparent; }
	.hc-search:not(:focus-within) .hc-search__input { padding: 0; }
	.hc-search__input { width: 0; padding: 0; }
	.hc-search:focus-within { position: absolute; left: 12px; right: 12px; top: 6px; z-index: 2; border-color: var(--hc-header-muted); background: var(--hc-header-bg); }
	.hc-search:focus-within .hc-search__input { flex: 1; width: auto; padding: 0 8px; }
	.hc-header__bar { position: relative; }
	/* The pop-up spans the header row instead of hanging off the bell. */
	.hc-notibox { position: static; }
	.hc-noti { left: 0; right: 0; top: 46px; width: auto; }
	.hc-profile__btn { max-width: 88px; padding: 0 4px; }
	.hc-logo { font-size: 18px; }
	.hc-tools { gap: 0; }
}

/* Phone: fixed bottom menu (home, popular, write, notifications, me). */
.hc-tabbar { display: none; }
@media (max-width: 767px) {
	body { --hc-tabbar-h: 56px; }
	.hc-wrap { padding-bottom: calc(var(--hc-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
	.hc-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--hc-tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--hc-border); background: var(--hc-surface); }
	.hc-tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--hc-text-3) !important; font-size: 10px; line-height: 1.2; }
	.hc-tabbar a.is-active { color: var(--hc-accent) !important; font-weight: 700; }
	.hc-tabbar svg { display: block; }
	.hc-tabbar__write svg { padding: 5px; border-radius: 50%; background: var(--hc-accent); color: var(--hc-accent-contrast); box-sizing: content-box; }
	.hc-tabbar .hc-bell__badge { top: 4px; right: calc(50% - 22px); }
}
