/*
Theme Name:   DailyFi
Theme URI:    https://daily-fi.com
Description:  DailyFi 재테크 블로그 — GeneratePress 차일드 테마. 30~40대 직장인을 위한 실용 금융 & 세금 정보 플랫폼.
Author:       DailyFi
Version:      1.0.0
Template:     generatepress
Tags:         blog, finance, korean, custom-colors, custom-menu, featured-images
Text Domain:  dailyfi
*/

/* ──────────────────────────────────────────
   Design Tokens
────────────────────────────────────────── */
:root {
  --navy:       #1A365D;
  --navy-dark:  #0F2240;
  --navy-mid:   #2A4A7F;
  --navy-light: #EEF2F8;
  --green:      #00A86B;
  --green-dark: #007A4D;
  --green-light:#E6F7F1;
  --green-mid:  #00C97F;

  --gray-50:  #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #CED4DA;
  --gray-500: #ADB5BD;
  --gray-600: #6C757D;
  --gray-700: #495057;
  --gray-800: #343A40;
  --gray-900: #212529;

  --red:   #E03E3E;
  --amber: #F59E0B;
  --blue:  #3B82F6;

  --font-body: 'Noto Sans KR', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-en:   'DM Sans', sans-serif;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(26,54,93,0.08);
  --shadow-md: 0 4px 16px rgba(26,54,93,0.10);
  --shadow-lg: 0 8px 32px rgba(26,54,93,0.14);

  --container: 1200px;
}

/* ──────────────────────────────────────────
   Reset / Base
────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--green); }

img { max-width: 100%; height: auto; display: block; }

/* ──────────────────────────────────────────
   Layout
────────────────────────────────────────── */
.df-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.df-site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.df-main {
  flex: 1;
  padding: 48px 0 80px;
}

/* ──────────────────────────────────────────
   Header
────────────────────────────────────────── */
.df-header {
  background: var(--navy-dark);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.df-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 8px;
}

/* Logo */
.df-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 24px;
}

.df-logo-wordmark {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.df-logo-wordmark .w-daily { color: #fff; }
.df-logo-wordmark .w-fi    { color: var(--green); }

/* Nav */
.df-nav {
  display: flex;
  align-items: center;
  flex: 1;
}

.df-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
}

.df-nav ul li a {
  display: block;
  padding: 0 14px;
  height: 60px;
  line-height: 60px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.df-nav ul li a:hover,
.df-nav ul li.current-menu-item > a,
.df-nav ul li.current-menu-ancestor > a {
  color: #fff;
  border-bottom-color: var(--green);
}

.df-nav ul li ul {
  display: none;
  position: absolute;
  background: var(--navy);
  border-radius: 0 0 var(--r-md) var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  flex-direction: column;
  z-index: 300;
}

.df-nav ul li:hover > ul { display: flex; }
.df-nav ul li ul li a { height: auto; line-height: 1.4; padding: 10px 16px; border-bottom: none; }
.df-nav ul li { position: relative; }

/* Header right */
.df-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-search-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.7);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.df-search-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Mobile hamburger */
.df-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 8px;
}

/* ──────────────────────────────────────────
   Search Overlay
────────────────────────────────────────── */
.df-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,0.85);
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
.df-search-overlay.active { display: flex; }

.df-search-form {
  width: 100%;
  max-width: 600px;
  padding: 0 24px;
}

.df-search-form input[type="search"] {
  width: 100%;
  background: white;
  border: none;
  border-radius: var(--r-lg);
  padding: 16px 20px;
  font-size: 18px;
  font-family: var(--font-body);
  outline: none;
  color: var(--gray-900);
}

/* ──────────────────────────────────────────
   Posts Grid (Index / Archive)
────────────────────────────────────────── */
.df-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

/* Article Card */
.df-article-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.df-article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.df-article-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.df-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.df-article-card:hover .df-article-thumb img {
  transform: scale(1.04);
}

.df-article-thumb-placeholder {
  aspect-ratio: 16/9;
  background: repeating-linear-gradient(
    45deg,
    var(--gray-100),
    var(--gray-100) 10px,
    var(--gray-50) 10px,
    var(--gray-50) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-family: var(--font-mono);
  font-size: 11px;
}

.df-article-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.df-article-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.df-article-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.45;
  margin: 0 0 10px;
  flex: 1;
}

.df-article-title a {
  color: inherit;
  text-decoration: none;
}

.df-article-title a:hover { color: var(--navy-mid); }

.df-article-meta {
  font-size: 11px;
  color: var(--gray-500);
  font-family: var(--font-mono);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}

/* Badge / Category tag */
.df-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--navy-light);
  color: var(--navy-mid);
  text-decoration: none;
  transition: background 0.15s;
}
.df-badge:hover { background: var(--navy-mid); color: white; }

/* ──────────────────────────────────────────
   Hero / Archive Header
────────────────────────────────────────── */
.df-archive-header {
  background: var(--navy);
  color: white;
  padding: 40px 0;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

.df-archive-header::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(0,168,107,0.1);
  pointer-events: none;
}

.df-archive-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.df-archive-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.df-archive-desc {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin-top: 6px;
}

/* ──────────────────────────────────────────
   Pagination
────────────────────────────────────────── */
.df-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.df-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  background: white;
  border: 1px solid var(--gray-200);
  transition: all 0.15s;
}

.df-pagination .page-numbers:hover,
.df-pagination .page-numbers.current {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.df-pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
}

/* ──────────────────────────────────────────
   Single Post
────────────────────────────────────────── */
.df-post-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.df-post-header {
  margin-bottom: 32px;
}

.df-post-header .df-article-cats {
  margin-bottom: 16px;
}

.df-post-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.df-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-500);
  font-family: var(--font-mono);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.df-post-featured-img {
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 36px;
  aspect-ratio: 16/7;
}

.df-post-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Post Content Typography */
.df-post-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--gray-800);
}

.df-post-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy-light);
  letter-spacing: -0.01em;
}

.df-post-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-mid);
  margin: 28px 0 12px;
}

.df-post-content p {
  margin: 0 0 20px;
}

.df-post-content ul,
.df-post-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.df-post-content li {
  margin-bottom: 6px;
}

.df-post-content strong {
  color: var(--gray-900);
  font-weight: 700;
}

.df-post-content a {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.df-post-content a:hover { color: var(--green); }

.df-post-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--navy-light);
  border-left: 4px solid var(--navy-mid);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--navy);
  font-size: 14px;
}

.df-post-content blockquote p { margin: 0; }

.df-post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 24px 0;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.df-post-content th {
  background: var(--navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.df-post-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}

.df-post-content tr:last-child td { border-bottom: none; }
.df-post-content tr:hover td { background: var(--gray-50); }

/* Post Tags */
.df-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.df-post-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  border: 1px solid var(--navy-mid);
  background: var(--navy-light);
  transition: all 0.15s;
}
.df-post-tag:hover { background: var(--navy); color: white; }

/* Author Box */
.df-author-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 40px;
  box-shadow: var(--shadow-sm);
}

.df-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.df-author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.df-author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.df-author-bio {
  font-size: 13px;
  color: var(--gray-600);
  margin: 0;
}

/* ──────────────────────────────────────────
   Sidebar
────────────────────────────────────────── */
.df-sidebar {
  position: sticky;
  top: 76px;
}

.df-widget {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.df-widget-title {
  background: var(--navy-light);
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-200);
}

.df-widget-body {
  padding: 16px 18px;
}

.df-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.df-widget ul li {
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.df-widget ul li:last-child { border-bottom: none; }

.df-widget ul li a {
  color: var(--gray-700);
  transition: color 0.15s;
}

.df-widget ul li a:hover { color: var(--green-dark); }

/* ──────────────────────────────────────────
   Footer
────────────────────────────────────────── */
.df-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.6);
  padding: 48px 0 32px;
  margin-top: auto;
}

.df-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
  margin-bottom: 32px;
}

.df-footer-brand .df-logo-wordmark {
  font-size: 20px;
  margin-bottom: 8px;
  display: block;
}

.df-footer-tagline {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
}

.df-footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.df-footer-nav ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  transition: color 0.15s;
}

.df-footer-nav ul li a:hover { color: var(--green); }

.df-footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.df-footer-disclaimer {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  margin-top: 16px;
  line-height: 1.6;
}

/* ──────────────────────────────────────────
   404 / No Results
────────────────────────────────────────── */
.df-not-found {
  text-align: center;
  padding: 80px 24px;
}

.df-not-found-code {
  font-family: var(--font-mono);
  font-size: 96px;
  font-weight: 700;
  color: var(--navy-light);
  line-height: 1;
  margin-bottom: 16px;
}

.df-not-found-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.df-not-found p {
  color: var(--gray-500);
  margin-bottom: 28px;
}

/* ──────────────────────────────────────────
   Responsive
────────────────────────────────────────── */
@media (max-width: 1024px) {
  .df-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .df-post-wrap {
    grid-template-columns: 1fr;
  }

  .df-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .df-header-inner { height: 56px; }

  .df-nav { display: none; }
  .df-nav.open { display: flex; }

  .df-menu-toggle { display: flex; }

  .df-nav {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 12px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  }

  .df-nav ul {
    flex-direction: column;
    width: 100%;
  }

  .df-nav ul li a {
    height: auto;
    line-height: 1.4;
    padding: 12px 24px;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .df-nav ul li.current-menu-item > a {
    border-bottom: none;
    border-left-color: var(--green);
    background: rgba(255,255,255,0.05);
  }

  .df-posts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .df-archive-title { font-size: 22px; }
  .df-post-title    { font-size: 22px; }

  .df-footer-inner {
    grid-template-columns: 1fr;
  }

  .df-footer-nav ul {
    gap: 16px;
  }
}

/* ──────────────────────────────────────────
   GeneratePress Overrides
────────────────────────────────────────── */
/* Hide GP default header/nav since we use our own */
.site-header,
.main-navigation,
.nav-below-header,
.site-main > .inside-article:not(.df-post-content) {
  /* Managed via our templates — GP styles removed selectively */
}

/* Override GP body background */
body { background: var(--gray-50) !important; }

/* Override GP content width */
.site-content .inside-page-header,
.site-content .content-area { max-width: none; padding: 0; }
