/* =========================================================================
   VUTREND 테마 스타일
   발견 중심 블로그 · 1400px 반응형 · 라이트/다크 대응
   ========================================================================= */

/* ---- 디자인 토큰 -------------------------------------------------------- */
:root {
  --wrap: 1400px;              /* 사이트 최대 폭 (PC 1400px) */
  --read: 760px;              /* 본문 가독 폭 */
  --sidebar: 320px;
  --gap: 40px;

  --bg: #ffffff;
  --surface: #f6f8fb;
  --surface-2: #eef2f7;
  --text: #16191f;
  --muted: #5b6472;
  --border: #e3e7ee;
  --accent: #1e6fb8;          /* 로고 블루 */
  --accent-hover: #175a95;
  --accent-soft: #e9f2fb;
  --danger: #d33;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.10);

  --font: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "D2Coding", "Consolas", "Menlo", "Monaco", monospace;

  --fs-base: 17px;
  --lh: 1.75;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-force-light]) {
    --bg: #14171c;
    --surface: #1b1f26;
    --surface-2: #232833;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --border: #2b313b;
    --accent: #4c9ae0;
    --accent-hover: #6cb0ec;
    --accent-soft: #1d2732;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
  }
}

/* ---- 리셋 --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; color: var(--text); }
ul, ol { padding-left: 1.2em; }

/* 접근성: 키보드 포커스 명확히 */
a:focus-visible, button:focus-visible, input:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---- 레이아웃 골격 ------------------------------------------------------ */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.site-main { padding: var(--gap) 0 64px; }
.content-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar);
  gap: 56px;
  align-items: start;
}

/* ---- 헤더 --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--header-h);
}
.site-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.site-brand img { max-height: 36px; width: auto; }
.site-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.site-title a { color: inherit; text-decoration: none; }

.primary-nav { flex: 1 1 auto; }
.primary-nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.primary-nav a {
  display: block; padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 600; font-size: 15.5px; text-decoration: none;
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--accent-soft); color: var(--accent); }
.primary-nav .sub-menu {
  position: absolute; margin-top: 8px; min-width: 200px; list-style: none; padding: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: none; z-index: 120;
}
.primary-nav li { position: relative; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* 언어 전환 (KO / EN) */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lang-btn {
  padding: 0 12px; height: 42px; min-width: 44px; border: 0; background: var(--bg);
  color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border); }
.lang-btn:hover { color: var(--accent); }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.menu-toggle { display: none; }

/* 헤더 검색 패널 */
.header-search {
  border-bottom: 1px solid var(--border); background: var(--surface);
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
}
.header-search.open { max-height: 120px; }
.header-search .wrap { padding-top: 16px; padding-bottom: 16px; }

/* ---- 카테고리 칩 바 ----------------------------------------------------- */
.chips-bar { border-bottom: 1px solid var(--border); background: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: thin; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.chip:hover, .chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.chip .count { font-size: 12px; opacity: .7; }

/* ---- 카드 그리드 -------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-thumb { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-cat {
  align-self: flex-start; font-size: 12.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; text-decoration: none;
}
.card-title { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin: 0; }
.card-meta { margin-top: auto; color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }

/* 큰 히어로 카드 (홈 최상단) */
.hero-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; }
.hero-card .card-thumb { aspect-ratio: auto; height: 100%; min-height: 320px; }
.hero-card .card-body { justify-content: center; padding: 40px; gap: 14px; }
.hero-card .card-title { font-size: 30px; line-height: 1.25; }
.hero-card .card-excerpt { font-size: 16px; }

/* ---- 섹션 헤더 ---------------------------------------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 44px 0 20px; }
.section-head h2 { font-size: 22px; margin: 0; }
.section-head .more { font-size: 14px; font-weight: 600; }
.section-head .accent-bar::before {
  content: ""; display: inline-block; width: 4px; height: 20px; background: var(--accent);
  border-radius: 2px; margin-right: 10px; vertical-align: -3px;
}

/* ---- 브레드크럼 -------------------------------------------------------- */
.breadcrumb { font-size: 13.5px; color: var(--muted); padding: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .5; }

/* ---- 아카이브/카테고리 헤더 -------------------------------------------- */
.archive-head { padding: 8px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.archive-head .kicker { color: var(--accent); font-weight: 700; font-size: 14px; }
.archive-head h1 { font-size: 30px; margin: 6px 0 8px; }
.archive-head .desc { color: var(--muted); margin: 0; max-width: 720px; }

/* ---- 단일 글 ----------------------------------------------------------- */
.post-header { margin-bottom: 24px; }
.post-header .post-cat { color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none; }
.post-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.25; margin: 10px 0 14px; letter-spacing: -.02em; }
.post-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.post-meta .avatar { width: 26px; height: 26px; border-radius: 50%; }
.post-featured { margin: 26px 0; border-radius: var(--radius); overflow: hidden; }

.entry-content { font-size: var(--fs-base); line-height: var(--lh); max-width: var(--read); }
.entry-content > * { margin-top: 0; margin-bottom: 1.15em; }
.entry-content h2 { font-size: 25px; margin: 1.8em 0 .6em; padding-top: .2em; }
.entry-content h3 { font-size: 20px; margin: 1.5em 0 .5em; }
.entry-content p { margin: 0 0 1.15em; }
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.entry-content img, .entry-content figure { border-radius: var(--radius-sm); }
.entry-content figure { margin: 1.4em 0; }
.entry-content figcaption { color: var(--muted); font-size: 13.5px; text-align: center; margin-top: 8px; }
.entry-content blockquote {
  margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--accent);
  background: var(--surface); color: var(--text); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-content pre {
  background: #0d1117; color: #e6edf3; padding: 18px 20px; border-radius: var(--radius-sm);
  overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.6;
}
.entry-content code {
  font-family: var(--mono); font-size: .9em; background: var(--surface-2);
  padding: 2px 6px; border-radius: 5px;
}
.entry-content pre code { background: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.entry-content thead th { background: var(--surface); font-weight: 700; }
.entry-content ul, .entry-content ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.entry-content li { margin: .35em 0; }

/* 글 태그 */
.post-tags { margin: 32px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags .tag {
  font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px; text-decoration: none;
}
.post-tags .tag:hover { color: var(--accent); border-color: var(--accent); }

/* 이전/다음 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0; }
.post-nav a {
  display: block; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); text-decoration: none;
}
.post-nav a:hover { border-color: var(--accent); background: var(--surface); }
.post-nav .dir { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.post-nav .t { color: var(--text); font-weight: 700; font-size: 15.5px; margin-top: 4px; }
.post-nav .next { text-align: right; }

/* 관련글 */
.related { margin: 48px 0 8px; }
.related .grid { gap: 22px; }

/* ---- 사이드바 ---------------------------------------------------------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 28px; }
.widget {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.widget-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; }
.widget-title::before { content: ""; width: 4px; height: 15px; background: var(--accent); border-radius: 2px; margin-right: 9px; }
.widget ul { list-style: none; margin: 0; padding: 0; }

/* 카테고리 위젯 */
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.cat-list a:hover { color: var(--accent); }
.cat-list .count { font-size: 12.5px; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 2px 9px; font-weight: 600; }

/* 인기글/최근글 위젯 */
.mini-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-list li:last-child { border-bottom: 0; }
.mini-thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-body .rank { color: var(--accent); font-weight: 800; font-size: 13px; }
.mini-title { font-size: 14.5px; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-title:hover { color: var(--accent); }
.mini-date { font-size: 12px; color: var(--muted); }

/* 태그 클라우드 */
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a {
  font-size: 13px !important; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; text-decoration: none;
}
.tagcloud a:hover { color: var(--accent); border-color: var(--accent); }

/* 광고 자리 */
.ad-slot {
  margin: 28px 0; padding: 14px; text-align: center; background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 12.5px;
}
.ad-slot.in-article { margin: 36px auto; max-width: var(--read); }

/* ---- 검색 폼 ----------------------------------------------------------- */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 15px; font-family: inherit;
}
.search-form input[type="search"]:focus { border-color: var(--accent); outline: none; }
.search-form button {
  padding: 11px 18px; border: 0; border-radius: var(--radius-sm); background: var(--accent);
  color: #fff; font-weight: 700; cursor: pointer; font-size: 15px;
}
.search-form button:hover { background: var(--accent-hover); }

/* ---- 페이지네이션 ------------------------------------------------------ */
.pagination { margin: 44px 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px;
  padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-weight: 600; text-decoration: none;
}
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .dots { border: 0; background: none; }

/* ---- 푸터 --------------------------------------------------------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 48px; }
.footer-widgets { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 48px 0; }
.footer-col h3 { font-size: 15px; margin: 0 0 14px; }
.footer-col p { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 5px 0; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.footer-col a:hover { color: var(--accent); }
.footer-brand .site-title { font-size: 20px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; color: var(--muted); font-size: 13.5px; }
/* 사업자(운영 주체) 정보 — 광고 심사 소유 확인용 */
.footer-business { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; font-size: 13px; }
.footer-business .biz-name { font-weight: 700; color: var(--text); }
.footer-business .sep { opacity: .4; }
.footer-business a { color: var(--muted); text-decoration: none; }
.footer-business a:hover { color: var(--accent); text-decoration: underline; }
.footer-copy { margin-top: 8px; font-size: 12.5px; opacity: .85; }

/* ---- 404 / 없음 -------------------------------------------------------- */
.notice-block { text-align: center; padding: 60px 20px; }
.notice-block .big { font-size: 64px; font-weight: 800; color: var(--accent); margin: 0; }
.notice-block h1 { font-size: 26px; margin: 8px 0 12px; }
.notice-block p { color: var(--muted); margin: 0 auto 24px; max-width: 480px; }

/* ---- 반응형 ------------------------------------------------------------- */
@media (max-width: 1080px) {
  .content-with-sidebar { grid-template-columns: 1fr; gap: 40px; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .widget { flex: 1 1 260px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card .card-thumb { min-height: 240px; }
  .footer-widgets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  :root { --fs-base: 16px; }
  .header-inner { gap: 12px; }
  .primary-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px; box-shadow: var(--shadow-lg); }
  .primary-nav.open { display: block; }
  .primary-nav > ul { flex-direction: column; gap: 2px; }
  .primary-nav .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding-left: 16px; margin-top: 0; }
  .menu-toggle { display: inline-flex; }
  .grid, .grid.cols-2 { grid-template-columns: 1fr; }
  .sidebar { flex-direction: column; }
  .footer-widgets { grid-template-columns: 1fr; gap: 28px; }
  .post-nav { grid-template-columns: 1fr; }
  .hero-card .card-body { padding: 24px; }
  .hero-card .card-title { font-size: 24px; }
}

/* ---- 조회수 (카드) ------------------------------------------------------ */
.card-views { display: inline-flex; align-items: center; gap: 4px; }

/* ---- 실제 광고 슬롯 (플레이스홀더 스타일 제거, 가운데 정렬) ------------ */
.ad-slot.ad-real {
  background: transparent; border: 0; padding: 12px 0; color: inherit;
  display: flex; justify-content: center;
}
.ad-slot.ad-real .kakao_ad_area { margin: 0 auto; }

/* ---- 구글 번역 위젯 숨김 처리 ------------------------------------------- */
/* 위젯 진입점은 화면에서 안 보이게, 상단 배너는 제거, 본문 위치 밀림 방지 */
#google_translate_element { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.skiptranslate,
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
/* 번역 중 폰트 깨짐 방지 */
font { font: inherit !important; }

/* ---- 기본 블록 위젯 방어 스타일 (혹시 사이드바에 추가될 경우) ---------- */
.wp-block-search__input,
.wp-block-search__inside-wrapper input {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; font-family: inherit; font-size: 15px;
}
.wp-block-search__button {
  background: var(--accent); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 0 16px; font-weight: 700; cursor: pointer;
}
.widget .wp-block-latest-posts,
.widget .wp-block-categories,
.widget .wp-block-archives,
.widget .wp-block-latest-comments { list-style: none; margin: 0; padding: 0; }
.widget .wp-block-latest-posts li,
.widget .wp-block-categories li,
.widget .wp-block-archives li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.widget .wp-block-latest-posts a,
.widget .wp-block-categories a,
.widget .wp-block-archives a { color: var(--text); text-decoration: none; }
.widget .wp-block-latest-posts a:hover,
.widget .wp-block-categories a:hover,
.widget .wp-block-archives a:hover { color: var(--accent); }
