:root {
  --kr-blue: #3182f6;
  --kr-blue-soft: #edf6ff;
  --kr-ink: #191f28;
  --kr-sub: #4e5968;
  --kr-muted: #8b95a1;
  --kr-line: #e5e8eb;
  --kr-soft: #f2f4f6;
}

* { box-sizing: border-box; }
body {
  color: var(--kr-ink) !important;
  background: #fff !important;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif !important;
  letter-spacing: -.025em;
  word-break: keep-all;
}
::selection { color: #fff; background: var(--kr-blue); }

/* Shared header */
header.fixed {
  min-height: 72px;
  border-bottom: 1px solid rgb(229 232 235 / 82%);
  background: rgb(255 255 255 / 88%) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px);
}
header.fixed > div {
  display: flex !important;
  width: min(100%, 1160px) !important;
  min-height: 72px;
  align-items: center !important;
  gap: 28px !important;
  padding: 12px 24px !important;
}
header.fixed > div > div:first-child {
  display: flex !important;
  flex: 1 1 auto;
  align-items: center;
  gap: 27px !important;
  margin: 0 !important;
}
header.fixed a[href="/home"] {
  display: inline-flex;
  align-items: center;
  padding: 5px 0;
  color: var(--kr-ink);
  font-size: 19px !important;
  letter-spacing: -.05em;
  transition: color .18s ease;
}
header.fixed a[href="/home"]:hover { color: var(--kr-blue) !important; }
header.fixed nav { gap: 11px !important; }
header.fixed nav > .relative.group > button {
  padding: 7px 9px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: var(--kr-sub);
  background: transparent !important;
  font-size: 15px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease;
}
header.fixed nav > .relative.group > button:hover { color: var(--kr-blue) !important; background: var(--kr-blue-soft) !important; }
header.fixed nav > .relative.group > div {
  top: calc(100% - 2px) !important;
  overflow: visible !important;
  padding: 8px !important;
  border: 1px solid var(--kr-line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 12px 30px rgb(25 31 40 / 12%) !important;
}
header.fixed nav > .relative.group > div a {
  border: 0 !important;
  border-radius: 9px;
  color: var(--kr-sub);
  font-size: 14px;
  font-weight: 650;
}
header.fixed nav > .relative.group > div a:hover { color: var(--kr-blue) !important; background: transparent !important; }
header.fixed > div > div:last-child { display: flex !important; flex: 0 1 330px; justify-content: flex-end !important; gap: 10px !important; margin: 0 !important; }
header.fixed #searchForm { width: 230px !important; }
header.fixed #searchInput { border: 0 !important; border-radius: 13px !important; background: var(--kr-soft) !important; box-shadow: none !important; }
header.fixed #searchInput:focus { background: #fff !important; box-shadow: 0 0 0 2px var(--kr-blue) !important; }
header.fixed #searchForm button { border-radius: 10px !important; background: var(--kr-blue) !important; }
header.fixed #darkToggle { border: 1px solid var(--kr-line) !important; border-radius: 13px !important; box-shadow: none !important; }

/* Listing pages and search cards */
main {
  max-width: 1200px !important;
  padding-top: 112px !important;
}
#breadcrumb {
  margin-bottom: 20px !important;
  color: var(--kr-muted) !important;
  font-size: 13px !important;
  font-weight: 650;
}
#breadcrumb a:hover { color: var(--kr-blue) !important; }
#postContainer > a,
#searchContent > a {
  min-height: 178px !important;
  border: 1px solid var(--kr-line) !important;
  border-radius: 20px !important;
  background: #fff !important;
  box-shadow: none !important;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease !important;
}
#postContainer > a:hover,
#searchContent > a:hover {
  border-color: transparent !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 34px rgb(25 31 40 / 10%) !important;
}
#postContainer > a img,
#searchContent > a img { border-radius:14px !important; }
#postContainer > a h2,
#searchContent > a h2 { color: var(--kr-ink) !important; letter-spacing: -.04em; }
#postContainer > a h2:hover,
#searchContent > a h2:hover { color: var(--kr-blue) !important; }
#postContainer > a p,
#searchContent > a p { color: var(--kr-sub) !important; }
#postContainer .category-link,
#searchContent .category-link { color: #2674e8 !important; background: var(--kr-blue-soft) !important; }
#postContainer .category-link:hover,
#searchContent .category-link:hover { color: var(--kr-blue) !important; background: var(--kr-blue-soft) !important; }
#paginationContainer button,
#searchPagination button { min-width: 38px; border-radius: 11px !important; box-shadow: none !important; }

/* Article pages */
#articleHeader {
  max-width: 800px !important;
  margin-top: 8px;
  padding: 30px 34px 25px !important;
  border: 1px solid var(--kr-line);
  border-radius: 25px;
  background: #fff;
}
#articleHeader hr { border-color: var(--kr-line) !important; }
#articleHeader h1 {
  margin-top: 20px;
  color: var(--kr-ink) !important;
  font-size: clamp(28px, 3.2vw, 36px) !important;
  line-height: 1.3;
  letter-spacing: -.055em;
}
#articleHeader p { color: var(--kr-muted) !important; }
.entry-content {
  max-width: 800px !important;
  margin: 29px auto 0 !important;
  padding: 4px 34px 14px !important;
  color: var(--kr-sub) !important;
  font-size: 17px !important;
  line-height: 1.9 !important;
}
.entry-content p { margin-top: 27px !important; color: var(--kr-sub) !important; }
.entry-content h2, .entry-content h3 { margin-top: 48px; color: var(--kr-ink); font-weight: 780; letter-spacing: -.045em; }
.entry-content img {
  margin: 34px auto !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 26px rgb(25 31 40 / 8%);
}
.site-footer { margin: 0 !important; padding: 35px 0 43px; color: var(--kr-muted); font-size: 14px; }
.site-footer .shell { width: min(calc(100% - 48px), 1160px); margin: 0 auto; }
.site-footer .footer-row { display: flex; justify-content: space-between; gap: 16px; }
.site-footer .footer-meta { display: flex; align-items: center; gap: 12px; }
.site-footer .footer-email { color: inherit; }
.site-footer a:hover { color: var(--kr-blue); }

/* Shared search and feedback */
#searchResultWrapper { width: min(calc(100% - 48px), 1200px) !important; margin: 0 auto 8px !important; }
#searchResult { position: relative !important; display: flex !important; align-items: center; justify-content: center; min-height: 64px; padding: 16px !important; }
#searchContent { display: flex !important; flex-direction: column !important; gap: 8px !important; margin-top: 8px !important; }
#searchContent > .article-card { overflow: hidden !important; border-radius: 20px !important; }
#searchContent > .article-card .article-image,
#searchContent > .article-card .article-image img { border-radius: 20px 20px 0 0 !important; }
#searchResult { border-radius: 20px !important; background: var(--kr-blue-soft) !important; box-shadow: none !important; }
#searchBackBtn { position: absolute !important; right: 16px; padding: 8px 11px; border: 0; border-radius: 10px !important; color: #fff; background: var(--kr-blue) !important; font-size: 13px; }
#popularSection, #categorySection { border-color: var(--kr-line) !important; border-radius: 20px !important; box-shadow: none !important; }
#popularSection li { border-color: var(--kr-line) !important; border-radius: 12px !important; }
#popularSection li:hover { background: var(--kr-soft) !important; }

html.dark body { color: #f2f4f6 !important; background: #17191c !important; }
html.dark header.fixed { border-color: #34383d; background: rgb(23 25 28 / 90%) !important; }
html.dark header.fixed a[href="/home"] { color: #f2f4f6; }
html.dark header.fixed a[href="/home"]:hover { color: #78b8ff !important; }
html.dark header.fixed nav > .relative.group > button { color: #c6cbd1; background: transparent !important; }
html.dark header.fixed nav > .relative.group > button:hover { color: #78b8ff !important; background: #1b3451 !important; }
html.dark header.fixed nav > .relative.group > div,
html.dark #postContainer > a,
html.dark #searchContent > a,
html.dark #articleHeader { border-color: #383d43 !important; background: #24272b !important; }
html.dark header.fixed nav > .relative.group > div a { color: #c6cbd1; }
html.dark header.fixed nav > .relative.group > div a:hover { color: #78b8ff !important; background: transparent !important; }
html.dark #searchInput, html.dark #darkToggle { color: #f2f4f6; border-color: #383d43 !important; background: #24272b !important; }
html.dark #postContainer > a h2, html.dark #searchContent > a h2, html.dark #articleHeader h1, html.dark .entry-content h2, html.dark .entry-content h3 { color: #f2f4f6 !important; }
html.dark #postContainer > a p, html.dark #searchContent > a p, html.dark .entry-content, html.dark .entry-content p { color: #c6cbd1 !important; }
html.dark #articleHeader, html.dark #articleHeader p, html.dark #breadcrumb { color: #aeb6bf !important; }
html.dark .entry-content img { box-shadow: 0 10px 26px rgb(0 0 0 / 24%); }
html.dark #searchResult { color: #f2f4f6 !important; background: #1b3451 !important; }
html.dark #popularSection, html.dark #categorySection { border-color: #383d43 !important; background: #24272b !important; }
html.dark #popularSection li:hover { background: #33383e !important; }

@media (max-width: 760px) {
  header.fixed, header.fixed > div { min-height: 64px; }
  header.fixed > div { display: grid !important; grid-template-columns: 1fr auto; gap: 8px !important; padding: 9px 18px !important; }
  header.fixed > div > div:first-child { gap: 12px !important; }
  header.fixed > div > div:last-child { grid-column: 1 / -1; width: 100%; max-width: none; }
  header.fixed #searchForm { flex: 1; width: auto !important; }
  header.fixed nav > .relative.group > button { padding: 5px 6px !important; font-size: 14px; }
  main { padding: 132px 20px 0 !important; }
  #articleHeader { padding: 23px 20px !important; border-radius: 20px; }
  .entry-content { padding: 3px 4px !important; font-size: 16px !important; }
  #postContainer > a, #searchContent > a { min-height: auto !important; }
}

/* Header shared with the redesigned home page */
.site-header { position: sticky; z-index: 50; top: 0; height: 72px; border-bottom: 1px solid rgb(229 232 235 / 78%); background: rgb(255 255 255 / 88%); backdrop-filter: blur(17px); }
.site-header .shell { width: min(calc(100% - 48px), 1160px); height: 100%; margin: 0 auto; }
.site-header .header-row { display: flex; align-items: center; gap: 28px; }
.site-header .brand { display: flex; flex-shrink: 0; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 13px; color: var(--kr-ink); font-size: 19px; font-weight: 800; letter-spacing: -.05em; transition: color .18s ease; }
.site-header .brand:hover { color: var(--kr-blue); background: transparent; }
.site-header .brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #fff; background: var(--kr-blue); font-size: 14px; transform: rotate(-5deg); }
.site-header .desktop-nav { display: flex; align-items: center; gap: 23px; margin-right: auto; color: var(--kr-sub); font-size: 15px; font-weight: 650; }
.site-header .nav-details { position: relative; }
.site-header .category-trigger { padding: 6px 9px; border: 0; border-radius: 10px; color: inherit; background: transparent; cursor: pointer; font: inherit; font-weight: inherit; transition: color .18s ease; }
.site-header .category-trigger:hover, .site-header .category-trigger:focus-visible { color: var(--kr-blue); outline: 0; }
.site-header .nav-menu { position: absolute; top: 100%; left: -17px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 238px; padding: 9px; border: 1px solid var(--kr-line); border-radius: 16px; background: #fff; box-shadow: 0 12px 30px rgb(25 31 40 / 12%); opacity: 0; pointer-events: none; transform: translateY(-7px) scale(.97); transform-origin: top left; transition: opacity .18s ease, transform .18s cubic-bezier(.2,.8,.2,1); }
.site-header .nav-details:hover .nav-menu, .site-header .nav-details:focus-within .nav-menu { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.site-header .nav-menu a { padding: 9px 10px; border-radius: 9px; color: var(--kr-sub); font-size: 14px; font-weight: 650; white-space: nowrap; }
.site-header .nav-menu a:hover, .site-header .nav-menu a:focus-visible { color: var(--kr-blue); outline: 0; }
.site-header .header-search { position: relative; width: 230px; }
.site-header .header-search input { width: 100%; height: 40px; padding: 0 43px 0 15px; border: 0; border-radius: 13px; outline: 0; color: var(--kr-ink); background: var(--kr-soft); font-size: 14px; }
.site-header .header-search input:focus { background: #fff; box-shadow: 0 0 0 2px var(--kr-blue); }
.site-header .header-search button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 10px; color: var(--kr-sub); background: transparent; font-size: 16px; }
.site-header .header-search button:hover { color: #fff; background: var(--kr-blue); }
.site-header .theme-button, .site-header .mobile-menu { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--kr-line); border-radius: 13px; color: var(--kr-sub); background: #fff; font-size: 17px; }
.site-header .theme-button:hover, .site-header .mobile-menu:hover { color: var(--kr-blue); border-color: #bedbff; background: #eff7ff; }
.site-header .mobile-menu, .site-header .mobile-panel { display: none; }
body.has-shared-header main { padding-top: 42px !important; }

/* Category listing: keep the containing box, with six wide cards per page. */
.themed-listing #postContainer { display: grid !important; grid-template-columns: 1fr; gap: 14px !important; min-height: 0 !important; }
body.themed-listing main { min-height: 0 !important; }
body.themed-listing #postContainer #copyrightNotice { display: none !important; }
.themed-listing #postContainer > .article-card { display: flex !important; min-height: 178px !important; height: 178px !important; flex-direction: row !important; gap: 0 !important; padding: 0 !important; overflow: hidden; border: 1px solid var(--kr-line) !important; border-radius: 23px !important; color: var(--kr-ink); background: #fff !important; box-shadow: none !important; }
.themed-listing #postContainer > .article-card:hover { border-color: transparent !important; transform: translateY(-5px) !important; box-shadow: 0 18px 38px rgb(25 31 40 / 10%) !important; }
.themed-listing .article-image { width: 100%; height: 178px; overflow: hidden; background: linear-gradient(135deg, #e5f2ff, #eef6ff); }
.themed-listing #postContainer > .article-card .article-image { width: 260px; min-width: 260px; height: 178px; }
.themed-listing #postContainer > .article-card .article-image img,
.themed-listing #searchContent > .article-card .article-image img { display: block; width: 100% !important; height: 100% !important; border-radius: 22px 22px 0 0 !important; object-fit: cover; transition: transform .4s ease; }
.themed-listing #postContainer > .article-card .article-image img { border-radius: 22px 0 0 22px !important; }
.themed-listing .article-card:hover .article-image img { transform: scale(1.045); }
.themed-listing .article-image.empty { display: grid; place-items: center; color: #5a99f7; font-size: 43px; }
.themed-listing .article-image.empty svg { width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.themed-listing .article-image.empty svg circle { fill: currentColor; stroke: none; }
.themed-listing .article-body { display: flex; min-height: 192px; flex: 1; flex-direction: column; padding: 22px 23px 21px; }
.themed-listing #postContainer > .article-card .article-body { min-height: 0; padding: 20px 26px; }
.themed-listing .article-meta { display: flex; align-items: center; gap: 8px; color: var(--kr-muted); font-size: 13px; font-weight: 630; }
.themed-listing .article-category { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 8px; color: #2674e8; background: var(--kr-blue-soft); font-size: 12px; font-weight: 750; }
.themed-listing .article-title { margin: 14px 0 10px; color: var(--kr-ink) !important; font-size: 20px !important; line-height: 1.42; letter-spacing: -.045em; }
.themed-listing #postContainer > .article-card .article-title:hover,
.themed-listing #searchContent > .article-card .article-title:hover { color: var(--kr-blue) !important; }
.themed-listing .article-desc { display: -webkit-box; overflow: hidden; margin: 0; color: var(--kr-sub) !important; font-size: 14px !important; line-height: 1.58; transition: color .18s ease; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.themed-listing #postContainer > .article-card .article-desc:hover,
.themed-listing #searchContent > .article-card .article-desc:hover { color: var(--kr-blue) !important; }
.themed-listing .article-more { margin-top: auto; padding-top: 17px; color: var(--kr-blue); font-size: 14px; font-weight: 720; }
.themed-listing #paginationContainer { grid-column: 1 / -1; width: 100%; }

html.dark .site-header { border-color: #34383d; background: rgb(23 25 28 / 90%); }
html.dark .site-header .brand { color: #f2f4f6; }
html.dark .site-header .brand:hover, html.dark .site-header .category-trigger:hover, html.dark .site-header .category-trigger:focus-visible, html.dark .site-header .nav-menu a:hover, html.dark .site-header .nav-menu a:focus-visible { color: #78b8ff; }
html.dark .site-header .desktop-nav, html.dark .site-header .theme-button, html.dark .site-header .mobile-menu { color: #c6cbd1; }
html.dark .site-header .nav-menu, html.dark .site-header .header-search input, html.dark .site-header .theme-button, html.dark .site-header .mobile-panel { border-color: #383d43; color: #f2f4f6; background: #24272b; }
html.dark .site-header .nav-menu a { color: #c6cbd1; }
html.dark .themed-listing #postContainer > .article-card { border-color: #383d43 !important; color: #f2f4f6; background: #24272b !important; }
html.dark .themed-listing .article-title { color: #f2f4f6 !important; }
html.dark .themed-listing #postContainer > .article-card .article-title:hover,
html.dark .themed-listing #searchContent > .article-card .article-title:hover { color: #78b8ff !important; }
html.dark .themed-listing .article-desc { color: #c6cbd1 !important; }
html.dark .themed-listing #postContainer > .article-card .article-desc:hover,
html.dark .themed-listing #searchContent > .article-card .article-desc:hover { color: #78b8ff !important; }

@media (max-width: 690px) {
  .site-header { height: 62px; }
  .site-footer .footer-row { align-items: flex-start; flex-direction: column; }
  .site-header .shell { width: min(calc(100% - 36px), 1160px); }
  .site-header .header-row { gap: 9px; }
  .site-header .brand { margin-right: auto; font-size: 17px; }
  .site-header .brand-mark { width: 26px; height: 26px; }
  .site-header .desktop-nav, .site-header .header-search { display: none; }
  .site-header .mobile-menu { display: grid; }
  .site-header .mobile-panel { position: absolute; top: 62px; right: 18px; left: 18px; z-index: 51; padding: 13px; border: 1px solid var(--kr-line); border-radius: 17px; background: #fff; box-shadow: 0 15px 30px rgb(25 31 40 / 13%); }
  .site-header .mobile-panel.is-open { display: block; }
  .site-header .mobile-search { position: relative; margin-bottom: 11px; }
  .site-header .mobile-search input { width: 100%; height: 42px; padding: 0 15px; border: 0; border-radius: 12px; outline: 0; background: var(--kr-soft); }
  .site-header .mobile-search button { position: absolute; top: 5px; right: 5px; height: 32px; padding: 0 10px; border: 0; border-radius: 9px; color: #fff; background: var(--kr-blue); font-size: 13px; font-weight: 700; }
  .site-header .mobile-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .site-header .mobile-links a { padding: 10px; border-radius: 10px; color: var(--kr-sub); font-size: 14px; font-weight: 700; text-align: center; }
  .site-header .mobile-links a:hover { color: var(--kr-blue); }
  body.has-shared-header main { padding-top: 28px !important; }
  .themed-listing #postContainer { grid-template-columns: 1fr; }
  .themed-listing #postContainer > .article-card { height: auto !important; min-height: 0 !important; flex-direction: column !important; }
  .themed-listing .article-image,
  .themed-listing #postContainer > .article-card .article-image { width: 100%; min-width: 0; height: 191px; }
  .themed-listing #postContainer > .article-card .article-image img { border-radius: 22px 22px 0 0 !important; }
  .themed-listing #postContainer > .article-card .article-body { min-height: 192px; padding: 22px 23px 21px; }
}
