/* ============================================================
   운세박스 — 기본 구조 스타일 (헤더/푸터/컨테이너/사이드레일)
   다크 미스틱 밤하늘 테마
   ============================================================ */

:root {
  /* 밤하늘 배경 팔레트 */
  --bg:       #080c18;
  --bg-soft:  #0d1225;
  --bg-card:  rgba(15, 20, 45, 0.85);
  --bg-card-solid: #0f142d;
  --bg-deep:  #060911;

  /* 텍스트 */
  --fg:       #e8e4f4;
  --fg-soft:  #b8b0d4;
  --fg-mute:  #7a7298;

  /* 포인트 컬러 */
  --accent:      #8b5cf6;   /* 보라 */
  --accent-hot:  #a78bfa;   /* 밝은 보라 */
  --accent-soft: rgba(139, 92, 246, 0.15);
  --accent-deep: #6d28d9;
  --gold:        #d4af37;   /* 금빛 */
  --gold-bright: #f5d060;
  --gold-soft:   rgba(212, 175, 55, 0.15);

  /* 테두리 / 그림자 */
  --border:       rgba(139, 92, 246, 0.2);
  --border-gold:  rgba(212, 175, 55, 0.3);
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.4);
  --shadow:       0 4px 20px rgba(0,0,0,0.5);
  --shadow-hover: 0 8px 32px rgba(139, 92, 246, 0.25);
  --glow-purple:  0 0 20px rgba(139, 92, 246, 0.35);
  --glow-gold:    0 0 20px rgba(212, 175, 55, 0.3);

  --max:    1280px;
  --radius: 14px;
  --ink:    #f0ecff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  /* 밤하늘 성운 배경 레이어 */
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(76, 29, 149, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 70%, rgba(30, 27, 75, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(6, 9, 17, 0.8) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Pretendard npm CDN — 정상 경로 (gh/ 경로는 404, npm/ 경로 사용) */
@import url('https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/pretendard.css');

/* 명조 제목용 폰트 — 신비로운 고급 느낌 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;700;900&display=swap');

a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--gold-bright); }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ============ Header ============ */
.site-header {
  background: rgba(8, 12, 24, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,0.4);
}
.site-header .container {
  display: flex; align-items: center; gap: 28px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-weight: 900; font-size: 24px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-mark {
  color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.6));
  position: relative;
  display: inline-block;
}
.brand-name {
  color: var(--fg);
  margin-left: 8px;
  background: linear-gradient(135deg, #f0ecff, var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-link {
  font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
  color: var(--fg-soft);
}
.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent-hot);
}
.nav-link .emoji { font-size: 16px; }
.hamburger {
  display: none;
  background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px 8px;
  margin-left: auto;
  color: var(--fg);
}

/* ============ Main ============ */
.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* ============ Hero (기본 — styles-unse.css 가 override) ============ */
.hero {
  background: linear-gradient(160deg, #1a0e3a 0%, #0d1225 60%, #080c18 100%);
  color: #fff;
  padding: 48px 32px;
  border-radius: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hero p { margin: 0; color: var(--fg-soft); font-size: 14px; }

/* ============ Section title ============ */
.section-title {
  font-size: 22px; font-weight: 900;
  margin: 0 0 18px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.section-title span:first-child {
  font-size: 22px;
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--accent-soft);
  border-radius: 10px;
}
.section-title .more {
  margin-left: auto;
  font-size: 13px; font-weight: 600;
  color: var(--fg-mute);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}
.section-title .more:hover { background: var(--accent-soft); color: var(--accent-hot); }

/* ============ Post Grid + Cards ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.post-card-thumb {
  height: 130px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.post-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 100%);
}
.post-card-body { padding: 10px 12px 12px; }
.post-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--accent-soft);
  color: var(--accent-hot);
  padding: 2px 8px 2px 6px;
  border-radius: 3px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.02em;
}
.post-card-title {
  margin: 6px 0 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--fg);
}
.post-card-desc {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--fg-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-date { font-size: 10.5px; color: var(--fg-mute); font-weight: 600; }

/* Category header */
.cat-header {
  background: linear-gradient(160deg, #1a0e3a, #0d1225);
  color: #fff;
  padding: 36px 28px;
  border-radius: 0;
  box-shadow: var(--shadow);
}
.cat-header h1 { margin: 0; font-size: 30px; font-weight: 900; }
.cat-header p { margin: 6px 0 0; color: var(--fg-soft); font-size: 14px; }
.cat-section { padding-top: 8px; }

/* ============ Post article + sidebar ============ */
.site-main:has(.post-article) {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .site-main:has(.post-article) {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}
.post-article {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.post-header { margin-bottom: 20px; }
.post-cat-link {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-hot);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px; font-weight: 800;
}
.post-title {
  margin: 12px 0 8px;
  font-size: 30px; font-weight: 900;
  line-height: 1.3;
  color: var(--ink);
}
.post-meta { color: var(--fg-mute); font-size: 13px; font-weight: 600; }
.post-content {
  font-size: 17px;
  line-height: 1.88;
  margin: 24px 0;
  color: var(--fg);
}
.post-content p { margin: 0 0 1.2em; }
.post-content h2, .post-content h3 {
  margin-top: 1.8em;
  font-weight: 900;
  color: var(--ink);
}
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  margin: 1.2em 0;
  border-radius: 6px;
}
.post-content strong { color: var(--gold-bright); font-weight: 800; }
.post-sidebar { display: flex; flex-direction: column; gap: 18px; }

/* ============ Static pages ============ */
.static-page {
  background: var(--bg-card);
  padding: 36px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 760px;
  margin: 32px auto;
  line-height: 1.78;
}
.static-page h1 {
  font-size: 28px; font-weight: 900;
  margin: 0 0 14px;
  color: var(--ink);
}
.static-page h2 {
  font-size: 19px; font-weight: 800;
  margin: 28px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--ink);
}
.static-page h2:first-of-type { border-top: 0; padding-top: 0; }
.static-page ul { padding-left: 22px; margin: 8px 0; }
.static-page li { margin: 4px 0; color: var(--fg-soft); }
.static-page a { color: var(--accent-hot); text-decoration: underline; }
.static-page p { margin: 8px 0; color: var(--fg-soft); }

/* ============ Ad slots ============ */
.adslot-wrap { display: block; }
.adslot {
  display: block;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  margin: 18px 0;
  padding: 10px;
  text-align: center;
  min-height: 100px;
  position: relative;
}
.adslot:has(ins) { background: transparent; border: 0; padding: 0; }
.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.adslot:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }
.site-rail:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }

.coupang-banner, .ali-banner {
  display: block;
  width: 100%;
  margin: 12px auto;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  border: 1px solid var(--border);
}
.coupang-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.coupang-slot {
  display: block;
  width: 100%;
  margin: 12px auto;
  overflow: hidden;
  line-height: 0;
  text-align: center;
}
.coupang-slot:empty { display: none; margin: 0; }
.coupang-slot > iframe,
.coupang-slot > div,
.coupang-slot > a {
  max-width: 100% !important;
  display: inline-block !important;
}

/* ============ Footer ============ */
.site-footer {
  background: var(--bg-deep);
  color: var(--fg-soft);
  padding: 48px 0 28px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), var(--accent), transparent);
}
.site-footer h4 {
  color: var(--gold-bright);
  font-size: 14px;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.site-footer a { color: var(--fg-mute); font-size: 13px; }
.site-footer a:hover { color: var(--gold-bright); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 7px; }
.site-footer p { font-size: 13px; color: var(--fg-mute); line-height: 1.7; margin: 0 0 8px; }
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.footer-bottom {
  padding-top: 20px;
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.6;
}
.footer-bottom p { margin: 4px 0; }

/* ============ Side rails ============ */
.site-rail {
  position: fixed;
  top: 100px;
  width: 160px;
  height: 600px;
  z-index: 5;
}
.site-rail--left  { left: 16px; }
.site-rail--right { right: 16px; }
@media (max-width: 1620px) {
  .site-rail { display: none; }
}

/* ============ Mobile ============ */
@media (max-width: 720px) {
  /* 헤더를 relative 기준점으로 — nav 드롭다운 absolute 배치 위해 */
  .site-header { position: sticky; top: 0; }

  /* 기본: nav 숨김 */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;       /* 헤더 바로 아래 */
    left: 0;
    right: 0;
    z-index: 100;
    flex-direction: column;
    gap: 0;
    background: rgba(8, 12, 24, 0.97);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    border-bottom: 2px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.1);
    padding: 8px 0 12px;
    /* 카테고리 많을 때 화면 넘치면 메뉴 내부 스크롤 (position:absolute라 페이지 스크롤로는 안 닿음) */
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* 열림: 헤더 아래 전체폭 드롭다운 */
  .site-nav.open {
    display: flex;
  }

  .site-nav.open .nav-link {
    padding: 13px 20px;
    border-radius: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--fg-soft);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .12s ease, color .12s ease, padding-left .12s ease;
  }

  .site-nav.open .nav-link:last-child {
    border-bottom: none;
  }

  .site-nav.open .nav-link:hover,
  .site-nav.open .nav-link:active {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-hot);
    padding-left: 26px;
  }

  .site-nav.open .nav-link .emoji {
    font-size: 18px;
    width: 24px;
    text-align: center;
  }

  .hamburger { display: inline-block; }
  .site-header .container { gap: 12px; flex-wrap: nowrap; }
  .brand { font-size: 20px; }
  .post-article { padding: 22px 18px; }
  .post-title { font-size: 23px; }
  .post-content { font-size: 16px; }
  .static-page { padding: 22px 18px; }
  .footer-cols { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 32px 22px; }
  .hero h1 { font-size: 24px; }
  .cat-header { padding: 26px 22px; }
  .cat-header h1 { font-size: 24px; }
  .section-title { font-size: 19px; }
}

/* ── Anti-adblock blur ─────────────────────────────────── */
body.adblock-detected .post-content,
body.adblock-detected .post-grid,
body.adblock-detected .latest,
body.adblock-detected .cat-section {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}
