/* 국세청 홈택스(hometax.go.kr) 배색을 참고한 테마 */
:root {
  --brand-blue: #2466eb;
  --brand-blue-hover: #1c50c4;
  --brand-blue-light: #eaf1fd;
  --brand-navy: #004288;
  --brand-navy-dark: #002c5c;
  --text-dark: #111111;
}

body {
  background-color: #f2f5fa;
}

/* 상단 내비게이션 */
.site-navbar {
  background: linear-gradient(100deg, var(--brand-navy) 0%, var(--brand-blue) 65%, var(--brand-blue) 100%) !important;
  box-shadow: 0 2px 10px rgba(0, 42, 88, 0.25);
}
.site-navbar .nav-link {
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus {
  color: #ffffff;
}
.site-navbar .nav-link.active,
.site-navbar .nav-link.fw-700 {
  color: #ffffff;
  font-weight: 700;
}
.site-navbar .nav-link.active::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.35rem;
  height: 3px;
  border-radius: 2px;
  background-color: #ffffff;
}
.site-navbar .dropdown-menu {
  background-color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 10px 24px rgba(0, 42, 88, 0.2);
  overflow: hidden;
}
.site-navbar .dropdown-item {
  color: var(--text-dark);
}
.site-navbar .dropdown-item:hover,
.site-navbar .dropdown-item:focus {
  background-color: var(--brand-blue-light);
  color: var(--brand-blue);
}
.site-navbar .dropdown-item.active {
  background-color: var(--brand-blue);
  color: #ffffff;
}

/* 로고와 메뉴 사이 간격 (화면이 좁아지면 자동으로 줄어듦) */
.site-navbar .container {
  column-gap: clamp(1rem, 2vw, 1.75rem);
  row-gap: 0.15rem;
}

/* 좌측 상단 세금365 로고 (관공서 엠블럼 스타일) */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  padding: 0.4rem 0;
  flex-shrink: 0;
}
.site-logo-mark {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.site-logo-name {
  color: #ffffff;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.site-logo-name strong {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.site-logo:hover .site-logo-name {
  color: #ffffff;
  opacity: 0.9;
}

/* 카드 */
.card {
  border: none;
  border-top: 3px solid var(--brand-blue);
  box-shadow: 0 4px 16px rgba(13, 59, 140, 0.08);
}

/* 제목 강조 */
h1 {
  position: relative;
  padding-left: 0.9rem;
  border-left: 5px solid var(--brand-blue);
}

/* 버튼 */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-navy));
  border-color: var(--brand-blue);
  box-shadow: 0 4px 10px rgba(36, 102, 235, 0.35);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--brand-blue-hover) !important;
  border-color: var(--brand-blue-hover) !important;
  box-shadow: 0 4px 12px rgba(28, 80, 196, 0.45);
}
.btn-outline-secondary {
  color: var(--brand-navy);
  border-color: var(--brand-navy);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: var(--brand-navy);
  border-color: var(--brand-navy);
}

/* 입력 폼 포커스 */
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.2rem rgba(36, 102, 235, 0.2);
}

/* 결과 표 강조색 */
.table-primary {
  --bs-table-bg: var(--brand-blue-light);
}
.table-success {
  --bs-table-bg: #e1f0e6;
  font-size: 1.05em;
}
.table-success th,
.table-success td {
  color: var(--brand-navy-dark);
  font-weight: 700;
}

/* ==========================================================================
   SEO/구조 개선으로 추가된 공통 컴포넌트
   ========================================================================== */

/* 메뉴 토글을 button 으로 바꾸면서 필요한 초기화 */
.site-navbar button.nav-link {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.site-navbar .dropdown-menu {
  display: none;
}
.site-navbar .dropdown-menu.show {
  display: block;
}
.site-navbar .dropdown-divider {
  margin: 0.25rem 0;
  border-top: 1px solid #e5e9f0;
}

/* 이동 경로 (breadcrumb) */
.site-breadcrumb {
  background-color: #e7edf7;
  border-bottom: 1px solid #d7e0ee;
}
.site-breadcrumb .breadcrumb {
  margin: 0;
  padding: 0.6rem 0;
  flex-wrap: wrap;
  font-size: 0.875rem;
}
.site-breadcrumb .breadcrumb-item a {
  color: var(--brand-navy);
  text-decoration: none;
}
.site-breadcrumb .breadcrumb-item a:hover,
.site-breadcrumb .breadcrumb-item a:focus {
  text-decoration: underline;
}
.site-breadcrumb .breadcrumb-item.active {
  color: #495a70;
}

/* 홈 히어로 */
.home-hero-lead {
  max-width: 46rem;
  margin-bottom: 0;
  color: #435068;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* 홈 카테고리 섹션 */
.home-category {
  margin-bottom: 2.25rem;
}
.home-category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-blue-light);
}
.home-category-head h2 {
  color: var(--brand-navy);
}
.home-category-more {
  margin-left: auto;
  color: var(--brand-blue);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.home-category-more:hover,
.home-category-more:focus {
  text-decoration: underline;
}
.home-category-intro {
  margin: 0.75rem 0 1rem;
  color: #566275;
}

/* 계산기 카드 그리드 */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.calc-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  min-height: 3.5rem;
  padding: 1rem 1.1rem;
  background-color: #ffffff;
  border: 1px solid #dfe6f1;
  border-left: 4px solid var(--brand-blue);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(13, 59, 140, 0.06);
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.calc-card:hover,
.calc-card:focus {
  box-shadow: 0 6px 18px rgba(13, 59, 140, 0.16);
  transform: translateY(-2px);
}
.calc-card-name {
  color: var(--brand-navy);
  font-weight: 700;
}
.calc-card-desc {
  color: #5a6678;
  font-size: 0.875rem;
  line-height: 1.55;
}

/* 안내 목록 */
.guide-list {
  padding-left: 1.15rem;
  margin-bottom: 0;
}
.guide-list li {
  margin-bottom: 0.55rem;
  line-height: 1.7;
}
.guide-list li:last-child {
  margin-bottom: 0;
}

/* 입력 항목 설명 */
.input-guide dt {
  margin-top: 0.85rem;
  color: var(--brand-navy);
  font-weight: 700;
}
.input-guide dt:first-child {
  margin-top: 0;
}
.input-guide dd {
  margin: 0.2rem 0 0;
  color: #545f70;
  line-height: 1.7;
}

/* 자주 묻는 질문 */
.faq-q {
  margin-top: 1.15rem;
  color: var(--brand-navy);
  font-weight: 700;
}
.faq-q:first-of-type {
  margin-top: 0;
}
.faq-a {
  margin-bottom: 0;
  color: #4c5768;
  line-height: 1.7;
}

/* 관련 계산기 / 404 인기 계산기 */
.related-list,
.hub-other-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.related-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid #eef1f6;
}
.related-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.related-list a {
  display: inline-block;
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
}
.related-list a:hover,
.related-list a:focus {
  text-decoration: underline;
}
.related-desc {
  display: block;
  margin-top: 0.15rem;
  color: #6b7688;
  font-size: 0.875rem;
  line-height: 1.55;
}
.hub-other-list li {
  display: inline-block;
  margin: 0 0.85rem 0.4rem 0;
}
.hub-other-list a {
  color: var(--brand-blue);
  text-decoration: none;
}
.hub-other-list a:hover,
.hub-other-list a:focus {
  text-decoration: underline;
}

/* 계산 결과 면책 문구 */
.calc-disclaimer {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  background-color: #f6f8fc;
  border-left: 3px solid #b9c6dc;
  border-radius: 0.35rem;
  color: #556072;
  font-size: 0.875rem;
  line-height: 1.65;
}

/* 404 */
.error-code {
  margin-bottom: 0.35rem;
  color: var(--brand-blue);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

/* 문의 이메일 */
.contact-email-line {
  font-size: 1.15rem;
  font-weight: 700;
}
.contact-email-line a {
  color: var(--brand-blue);
}

/* 공통 푸터 */
.site-footer {
  margin-top: 3rem;
  padding: 2.25rem 0 1.5rem;
  background-color: #1b2c45;
  color: #c8d2e2;
  font-size: 0.9rem;
}
.site-footer-brand {
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 500;
}
.site-footer-brand strong {
  font-weight: 800;
}
.site-footer-desc {
  margin-bottom: 0;
  color: #a9b6cb;
  line-height: 1.7;
}
.site-footer-heading {
  margin-bottom: 0.75rem;
  color: #ffffff;
  font-weight: 700;
}
.site-footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer-links li {
  margin-bottom: 0.45rem;
}
.site-footer-links a {
  color: #c8d2e2;
  text-decoration: none;
}
.site-footer-links a:hover,
.site-footer-links a:focus {
  color: #ffffff;
  text-decoration: underline;
}
.site-footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #93a2ba;
  font-size: 0.8rem;
  line-height: 1.65;
}

/* 계산기 하단 설명 영역 */
.calc-guide .card {
  border-top-width: 2px;
}
.calc-guide h2 {
  color: var(--brand-navy);
}

/* 클릭 영역 확보 (모바일) */
.site-navbar .nav-link,
.site-navbar .dropdown-item {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}

@media (max-width: 575.98px) {
  .home-hero-lead {
    font-size: 1rem;
  }
  .error-code {
    font-size: 2.25rem;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

/* 모바일 터치 타깃 확보 (목록형 링크) */
.site-footer-links a,
.related-list a,
.hub-other-list a {
  display: inline-block;
  padding: 0.35rem 0;
}
.site-breadcrumb .breadcrumb-item a {
  display: inline-block;
  padding: 0.3rem 0;
}

/* 금액 입력칸의 한글 단위 표시 */
.amount-hint {
  min-height: 1.35rem;
  margin-top: 0.3rem;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
  line-height: 1.35rem;
}
.amount-hint:empty {
  min-height: 0;
  margin-top: 0;
}
input[data-amount] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 적용 세법 연도 · 검토일 배지 */
.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0.9rem 0 0;
  font-size: 0.825rem;
  color: #5a6678;
}
.review-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.review-label {
  padding: 0.1rem 0.45rem;
  background-color: var(--brand-blue-light);
  border-radius: 0.25rem;
  color: var(--brand-navy);
  font-weight: 700;
}

/* 결과 영역 경고 (색상만으로 의미를 전달하지 않도록 "주의" 라벨을 함께 표시) */
.result-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
  background-color: #fff6e5;
  border: 1px solid #f0c987;
  border-left: 5px solid #d98a00;
  border-radius: 0.4rem;
  color: #5c4408;
  font-size: 0.9rem;
  line-height: 1.65;
}
.result-warning-badge {
  flex-shrink: 0;
  padding: 0.1rem 0.5rem;
  background-color: #d98a00;
  border-radius: 0.25rem;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 공식 참고자료 */
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.source-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eef1f6;
}
.source-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.source-list a {
  display: inline-block;
  padding: 0.2rem 0;
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
}
.source-list a:hover,
.source-list a:focus {
  text-decoration: underline;
}
.external-mark {
  margin-left: 0.25rem;
  font-size: 0.8em;
}
.source-desc {
  display: block;
  color: #6b7688;
  font-size: 0.85rem;
}

/* 계산 사례 */
.example-case + .example-case {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eef1f6;
}
.example-case-title {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.12rem 0.5rem;
  background-color: var(--brand-blue-light);
  border-radius: 0.25rem;
  color: var(--brand-navy);
}
.example-case-note {
  margin: 0.75rem 0 0;
  color: #6b7688;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 가이드 */
.guide-toc ol {
  padding-left: 1.15rem;
  margin-bottom: 0;
}
.guide-toc li {
  margin-bottom: 0.3rem;
}
.guide-toc a {
  color: var(--brand-blue);
  text-decoration: none;
}
.guide-toc a:hover,
.guide-toc a:focus {
  text-decoration: underline;
}
.guide-lead {
  font-size: 1.05rem;
  line-height: 1.75;
}
.guide-article h2 {
  color: var(--brand-navy);
}
.guide-article p {
  line-height: 1.8;
}
.guide-index {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.guide-index li {
  margin-bottom: 0.85rem;
  padding: 1rem 1.1rem;
  background-color: #ffffff;
  border: 1px solid #dfe6f1;
  border-left: 4px solid var(--brand-blue);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(13, 59, 140, 0.06);
}
.guide-index a {
  color: var(--brand-navy);
  font-weight: 700;
  text-decoration: none;
}
.guide-index a:hover,
.guide-index a:focus {
  text-decoration: underline;
}
.guide-index-desc {
  display: block;
  margin-top: 0.3rem;
  color: #5a6678;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 스크롤 시 목차 앵커가 상단에 가려지지 않도록 */
.guide-article section[id],
.guide-article h2[id] {
  scroll-margin-top: 1rem;
}
