/* ==========================================================================
   1. 기본 변수 및 리셋 (시니어 가독성 중심)
   ========================================================================== */
:root {
  --primary: #0284c7;       /* 신뢰감을 주는 메인 블루 */
  --primary-dark: #0369a1;
  --secondary: #16a34a;     /* 부업/수익 포인트 그린 */
  --accent: #d97706;        /* 지원금 포인트 오렌지 */
  --bg-main: #f8fafc;       /* 은은한 연회색 배경 */
  --card-bg: #ffffff;
  --text-main: #0f172a;     /* 진한 텍스트로 시인성 확보 */
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1140px;
  --header-height: 70px;     /* 헤더 높이 변수 지정 */
}

/* 📌 [추가] 부드러운 스크롤 애니메이션 적용 */
html {
  scroll-behavior: smooth;
}

/* 📌 [추가] 목차/앵커 이동 시 상단 고정 헤더에 제목이 가려지지 않도록 여백 확보 */
[id] {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: 18px; /* 시니어 배려 기본 글씨 크기 */
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-main);
  word-break: keep-all;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   2. 헤더 & 스티키 네비게이션
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  z-index: 1000;
  min-height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative; /* 모바일 메뉴 드롭다운 위치 기준점 */
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 28px;
}

.main-nav a {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 2px;
}

/* ==========================================================================
   3. 히어로 비주얼 섹션 및 기둥 기사(Pillar)
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 50px 0 60px;
  text-align: center;
}

.hero-subtitle {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 30px;
}

.quick-category {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-btn {
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.cat-btn:hover {
  transform: translateY(-2px);
}

/* Pillar Content (기둥 기사) 전용 배너 스타일 */
.pillar-container {
  margin-bottom: 40px;
}

.pillar-card {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.pillar-badge {
  align-self: flex-start;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: -0.5px;
}

.pillar-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.35;
}

.pillar-title a {
  color: #ffffff;
}

.pillar-title a:hover {
  text-decoration: underline;
}

.pillar-desc {
  font-size: 1.05rem;
  opacity: 0.95;
  line-height: 1.6;
}

/* ==========================================================================
   4. 카드 그리드 레이아웃
   ========================================================================== */
.main-content {
  padding-top: 40px;
  padding-bottom: 60px;
}

.cards-section {
  padding: 30px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
}

.section-header h2,
.section-subtitle {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.view-all {
  color: var(--primary);
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.info-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.card-image {
  position: relative;
  height: 200px;
  background-color: #cbd5e1;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 15px;
  left: 15px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
}

.badge-blue { background-color: var(--primary); }
.badge-green { background-color: var(--secondary); }
.badge-orange { background-color: var(--accent); }

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 12px;
  font-weight: 700;
}

.card-title a:hover {
  color: var(--primary);
}

.card-text {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  padding-top: 15px;
}

.read-more {
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   5. 아티클 상세 페이지 스타일 (본문 읽기 배려 및 SEO 요소 확장)
   ========================================================================== */
.article-detail {
  background: #ffffff;
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.article-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #1e293b;
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  color: var(--text-main);
}

.article-content h3 {
  font-size: 1.25rem;
  margin: 28px 0 12px;
  color: var(--primary-dark);
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--primary-dark);
}

/* 📌 [보완] 인용구 & 콜아웃 상자 (💡 요약 박스) */
.article-content blockquote {
  background-color: #f0f9ff;
  border-left: 5px solid var(--primary);
  padding: 16px 20px;
  margin: 25px 0;
  border-radius: 0 8px 8px 0;
  color: #0f172a;
}

.article-content blockquote p {
  margin-bottom: 0;
}

/* 📌 [보완] 표(Table) 스타일 - 반응형 모바일 지원 및 시인성 강화 */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 1rem;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.article-content th {
  background-color: #f1f5f9;
  font-weight: 700;
  color: var(--text-main);
}

.article-content tr:nth-child(even) {
  background-color: #f8fafc;
}

/* 📌 [보완] 코드 블록 & 인라인 코드 스타일 */
.article-content code {
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: Consolas, Monaco, monospace;
}

.article-content pre {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 25px 0;
}

.article-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* ==========================================================================
   6. [신규 추가] 시니어/독자 배려 편의 기능 스타일
   ========================================================================== */

/* 1) 글자 크기 조절 컨트롤 버튼 */
.font-size-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: flex-end;
}

.font-btn {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
}

.font-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

/* 2) 정보 강조 하이라이트 박스 */
.highlight-box {
  background-color: #fef3c7;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
  color: #78350f;
}

/* 3) 맨 위로 가기 (Back to Top) Floating 버튼 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background-color: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.2rem;
  font-weight: bold;
  z-index: 99;
  transition: transform 0.2s, background-color 0.2s;
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

/* ==========================================================================
   7. 푸터 & 모바일 반응형 Breakpoints
   ========================================================================== */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 40px 0;
  margin-top: 60px;
  font-size: 0.95rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-info strong {
  color: #f8fafc;
  font-size: 1.1rem;
}

/* 카테고리 페이지 헤더 스타일 */
.category-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #222;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: #666;
}

/* 모바일 전용 UI 제어 (768px 이하) */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 15px 20px;
    border-top: 1px solid #f1f5f9;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .pillar-card {
    padding: 24px;
  }

  .pillar-title {
    font-size: 1.3rem;
  }

  .card-grid {
    grid-template-columns: 1fr; /* 모바일에서 1열 카드로 정렬 */
  }

  .article-detail {
    padding: 20px;
  }

  /* 모바일 화면에서 표 좌우 스크롤 허용 */
  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}