/* ============================================================
   dailybetter Visual Identity v3 — Paper Magazine (2026-10-21)
   기본: 아이보리 페이퍼 라이트 / 다크모드: 잉크 매거진(v2 톤)
   제목·마스트헤드 = Noto Serif KR, 본문 = 기존 Pretendard/Noto Sans KR
   레퍼런스 공식: 신문 마스트헤드(중앙 로고+헤어라인) + 에디토리얼 위계
   premium-ui 준수: 보더리스, 포인트 1~2곳, 여백 우선, 좌측색바 금지
   ============================================================ */

/* ---------- 1. 팔레트 오버라이드 (기존 변수 시스템 재정의) ---------- */
:root {
  --primary-color: #1E7A5F;
  --primary-light: #3FA98A;
  --primary-dark: #16604A;
  --secondary-color: #2F7D6B;
  --accent-color: #8A6D2F;

  --text-color: #1B1F27;
  --text-secondary: #58606E;
  --text-light: #8A92A0;
  --bg-color: #FAF9F6;
  --bg-secondary: #F3F1EB;
  --bg-tertiary: #ECE9E1;
  --border-color: #E7E4DB;
  --border-subtle: rgba(27, 31, 39, 0.07);
  --card-bg: #FFFFFF;

  --category-youth: #1E7A5F;
  --category-it: #3E6B8F;
  --category-self: #8F6B3E;
  --category-lifestyle: #6B8F56;
  --category-etc: #7A7F8C;
  --category-youth-solid: #1E7A5F;
  --category-it-solid: #3E6B8F;
  --category-self-solid: #8F6B3E;
  --category-lifestyle-solid: #6B8F56;
  --category-etc-solid: #7A7F8C;

  --header-bg: rgba(250, 249, 246, 0.92);
  --header-bg-scrolled: rgba(250, 249, 246, 0.97);
  --header-border: rgba(27, 31, 39, 0.1);

  /* db 전용 토큰 */
  --db-tint: #EEF3EF;
  --db-gold: #8A6D2F;
  --db-line: rgba(27, 31, 39, 0.08);
  --db-rule: #1B1F27;
  --db-font-display: "Noto Serif KR", "Noto Serif CJK KR", serif;
  --db-r-sm: 10px;
  --db-r-lg: 18px;
  --db-sh-sm: 0 2px 10px rgba(16, 20, 27, 0.05);
  --db-sh-lg: 0 16px 40px rgba(16, 20, 27, 0.1);
}

@media (prefers-color-scheme: dark) {
  body:not(.light-mode):not(.force-light) {
    --primary-color: #3FA98A;
    --primary-light: #5BBFA1;
    --primary-dark: #2E8A6E;
    --accent-color: #D4B05E;

    --text-color: #E9EBEE;
    --text-secondary: #A7AEBB;
    --text-light: #717A89;
    --bg-color: #10141B;
    --bg-secondary: #141922;
    --bg-tertiary: #1A202B;
    --border-color: #262D3A;
    --border-subtle: rgba(233, 235, 238, 0.07);
    --card-bg: #181D26;

    --category-youth: #3FA98A;
    --category-it: #6E9CC4;
    --category-self: #C4A06E;
    --category-lifestyle: #93B97E;
    --category-etc: #9AA1AE;
    --category-youth-solid: #3FA98A;
    --category-it-solid: #6E9CC4;
    --category-self-solid: #C4A06E;
    --category-lifestyle-solid: #93B97E;
    --category-etc-solid: #9AA1AE;

    --header-bg: rgba(16, 20, 27, 0.92);
    --header-bg-scrolled: rgba(16, 20, 27, 0.97);
    --header-border: rgba(233, 235, 238, 0.1);

    --db-tint: #16211D;
    --db-gold: #D4B05E;
    --db-line: rgba(233, 235, 238, 0.09);
    --db-rule: #E9EBEE;
    --db-sh-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --db-sh-lg: 0 16px 40px rgba(0, 0, 0, 0.42);
  }
}

body {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ---------- 2. 마스트헤드 (신문형 헤더) ---------- */
/* 구 스타일(.site-header sticky flex + body .site-header padding !important) 무력화 */
body .site-header.db-mast {
  position: static !important;
  display: block !important;
  height: auto;
  padding: 0 !important;
  background: var(--bg-color) !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
}

/* 중앙 로고 */
.db-masthead {
  text-align: center;
  padding: 40px 16px 28px;
}
.db-logo {
  font-family: var(--db-font-display);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  color: var(--text-color);
  text-decoration: none;
  line-height: 1.1;
}
.db-logo:hover { color: var(--text-color); }
.db-deck {
  margin: 14px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  color: var(--text-secondary);
}

/* 네비 — 더블 헤어라인 사이 */
.db-nav {
  border-top: 1px solid var(--db-line);
  border-bottom: 1px solid var(--db-line);
}
.db-nav-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
}
.db-nav .category-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.db-nav .category-menu::-webkit-scrollbar { display: none; }
.db-nav .category-menu li { margin: 0; white-space: nowrap; }
.db-nav .category-menu a {
  display: inline-block;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  transition: color 0.16s ease;
}
.db-nav .category-menu a:hover { color: var(--text-color); background: transparent; }
.db-nav .category-menu li.active a {
  color: var(--text-color);
  box-shadow: inset 0 -2px 0 var(--primary-color);
}
.db-nav .cat-dot { display: none; }
.db-nav .vlog-search-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 10px;
}
.db-nav .vlog-search-btn:hover { color: var(--text-color); }

@media (max-width: 720px) {
  .db-masthead { padding: 28px 16px 20px; }
  .db-deck { letter-spacing: 0.2em; }
  .db-nav-in { justify-content: flex-start; padding-right: 40px; }
}

/* ---------- 3. 홈 히어로 ---------- */
.db-hero {
  padding: 56px 0 40px;
  text-align: left;
}
.db-overline {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--primary-color);
}
.db-hero h1 {
  margin: 0 0 16px;
  font-family: var(--db-font-display);
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-color);
}
.db-hero-sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ---------- 4. 피처드 카드 ---------- */
.db-feat {
  position: relative;
  display: block;
  border-radius: var(--db-r-lg);
  overflow: hidden;
  box-shadow: var(--db-sh-lg);
  text-decoration: none;
  margin-bottom: 28px;
  aspect-ratio: 21 / 10;
  background: var(--bg-tertiary);
}
.db-feat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.db-feat:hover img { transform: scale(1.025); }
.db-feat-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 17, 22, 0) 32%, rgba(14, 17, 22, 0.62) 68%, rgba(14, 17, 22, 0.88) 100%);
}
.db-feat-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 38px;
}
.db-feat-meta {
  display: block;
  margin-bottom: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
}
.db-feat h2 {
  margin: 0 0 10px;
  font-family: var(--db-font-display);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: #FFFFFF;
}
.db-feat p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 720px) {
  .db-feat { aspect-ratio: 4 / 3; }
  .db-feat-body { padding: 20px 18px; }
}

/* ---------- 5. 썸네일 그리드 ---------- */
.db-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}
@media (max-width: 960px) { .db-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .db-grid { grid-template-columns: 1fr; } }

.db-card {
  background: var(--card-bg);
  border: 1px solid var(--db-line);
  border-radius: var(--db-r-lg);
  overflow: hidden;
  box-shadow: var(--db-sh-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.db-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--db-sh-lg);
}
.db-card > a { display: block; text-decoration: none; color: inherit; }
.db-card-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--db-tint);
  position: relative;
}
.db-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.db-card:hover .db-card-thumb img { transform: scale(1.03); }
.db-card-thumb .db-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--db-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-color);
}
.db-card-body { padding: 20px 22px 22px; }
.db-card-meta {
  display: block;
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light);
}
.db-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.db-card:hover h3 { color: var(--primary-color); }
.db-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 6. 본문·공통 요소 (전 페이지) ---------- */
.single-post h1.entry-title, .single .entry-title {
  font-family: var(--db-font-display);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.post-wrapper h2, .post-wrapper .section-title {
  padding: 0;
  border: none;
}
.post-wrapper h2::after, .post-wrapper .section-title::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary-color);
  margin-top: 10px;
  opacity: 0.85;
}
.post-wrapper blockquote, .entry-content blockquote {
  background: var(--db-tint);
  border: none;
  border-left: none;
  border-radius: var(--db-r-sm);
  font-style: normal;
}
.post-wrapper div[style*="border-left: 4px solid"] {
  border-left: none !important;
  background: var(--db-tint) !important;
  border-radius: var(--db-r-sm) !important;
}

/* 아카이브·기존 post-card도 페이퍼 톤으로 */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--db-line);
  box-shadow: var(--db-sh-sm);
}
.post-card:hover { box-shadow: var(--db-sh-lg); }
.category-card:hover { background: var(--db-tint) !important; }

/* 푸터 */
.site-footer {
  background: transparent;
  border-top: 1px solid var(--db-line);
}
