/* =============================================================================
   폰트 설정 (기존 유지)
   ========================================================================== */

/* 영어 폰트 */
@font-face {
  font-family: "LINESeedSans";
  src: url("../fonts/LINESeedSans_A_Rg.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  unicode-range: U+0020-007E, U+00A0-00FF;
}

/* 일본어 폰트 */
@font-face {
  font-family: "LINESeedJP";
  src: url("../fonts/LINESeedJP_A_TTF_Rg.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  unicode-range: U+3000-30FF, U+4E00-9FFF;
}

/* 한글 폰트 */
@font-face {
  font-family: "LINESeedKR";
  src: url("../fonts/LINESeedKR-Rg.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  unicode-range: U+1100-11FF, U+3130-318F, U+AC00-D7AF;
}

/* 코드 전용 폰트 */
@font-face {
  font-family: "Victor Mono";
  src: url("../fonts/VictorMono-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* 본문 및 UI 폰트 우선순위 */
body,
input,
textarea,
select,
button {
  font-family: "LINESeedKR", "LINESeedJP", "LINESeedSans", "Noto Sans KR",
    "Noto Sans JP", "Noto Sans", "Apple SD Gothic Neo", "Malgun Gothic",
    "Meiryo", "sans-serif";
}

/* 코드 영역 폰트 적용 */
pre,
code,
kbd,
samp {
  font-family: "Victor Mono", "Fira Mono", "Source Code Pro", "Menlo",
    "Consolas", "monospace";
  font-size: 1em;
}

/* =============================================================================
   네비게이션 잘림 완전 해결
   ========================================================================== */

/* 헤더 전체 고정 */
.md-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  height: auto !important;
  overflow: visible !important;
}

/* 헤더 내부 컨테이너 */
.md-header__inner {
  max-width: none !important;
  overflow: visible !important;
  height: auto !important;
  padding: 0 !important;
}

/* 탭 컨테이너 - 가장 중요한 수정 */
.md-tabs {
  background: linear-gradient(
    135deg,
    var(--md-primary-fg-color),
    var(--md-accent-fg-color)
  ) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 48px !important;
  max-height: none !important;
  position: relative !important;
  z-index: 999 !important;
}

/* 탭 리스트 - 핵심 수정사항 */
.md-tabs__list {
  overflow: visible !important;
  white-space: nowrap !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 1rem !important;
  box-sizing: border-box !important;
}

/* 개별 탭 링크 */
.md-tabs__link {
  font-weight: 500 !important;
  opacity: 0.8 !important;
  transition: all 0.3s ease !important;
  padding: 12px 16px !important;
  border-radius: 8px 8px 0 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  height: auto !important;
  min-height: 44px !important;
  line-height: 1.2 !important;
  font-size: 14px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  margin-right: 4px !important;
  overflow: visible !important;
}

.md-tabs__link:hover {
  opacity: 1 !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-1px) !important;
  color: white !important;
}

.md-tabs__link--active {
  opacity: 1 !important;
  font-weight: 700 !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
}

/* 반응형 처리 */
@media screen and (max-width: 1200px) {
  .md-tabs__link {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
}

@media screen and (max-width: 900px) {
  .md-tabs__link {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
}

@media screen and (max-width: 600px) {
  .md-tabs__list {
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .md-tabs__list::-webkit-scrollbar {
    display: none !important;
  }

  .md-tabs__link {
    padding: 8px 12px !important;
    font-size: 11px !important;
    min-width: max-content !important;
  }
}

/* 추가 안전장치 */
.md-tabs * {
  box-sizing: border-box !important;
}

/* Material Design 기본 스타일 무력화 */
.md-tabs__list {
  -webkit-overflow-scrolling: touch !important;
}

/* =============================================================================
   기타 스타일 개선
   ========================================================================== */

/* 다운로드 버튼 */
.md-button {
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  margin: 0.5rem 0.5rem 0.5rem 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.md-button--primary {
  background: linear-gradient(
    135deg,
    var(--md-primary-fg-color),
    var(--md-accent-fg-color)
  );
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.md-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 코드 블록 */
.highlight {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

/* 경고 박스 */
.admonition {
  border-radius: 8px;
  border-left: 4px solid var(--md-primary-fg-color);
  margin: 1rem 0;
  overflow: hidden;
}

.admonition.tip {
  border-left-color: var(--md-accent-fg-color);
}

/* 테이블 */
.md-content table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

/* 예쁜 Permalink 스타일 */
.headerlink {
  color: var(--md-accent-fg-color) !important;
  opacity: 0.3;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.headerlink:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* 제목 호버시에만 표시 */
h1 .headerlink,
h2 .headerlink,
h3 .headerlink {
  opacity: 0;
}

h1:hover .headerlink,
h2:hover .headerlink,
h3:hover .headerlink {
  opacity: 0.7;
}

/* =============================================================================
   상단 네비게이션 폰트 크기 증가
   ========================================================================== */

/* 탭 링크 폰트 크기 증가 */
.md-tabs__link {
  font-size: 16px !important;        /* 기본 14px → 16px */
  font-weight: 600 !important;       /* 500 → 600으로 굵게 */
  padding: 14px 20px !important;     /* 패딩도 약간 증가 */
  letter-spacing: 0.5px !important;  /* 글자 간격 추가 */
}

/* 호버 및 활성 상태 */
.md-tabs__link:hover {
  font-weight: 700 !important;
  transform: translateY(-1px) scale(1.02) !important;
}

.md-tabs__link--active {
  font-weight: 700 !important;
  font-size: 17px !important;        /* 활성 탭은 더 크게 */
}

/* 탭 컨테이너 높이 조정 */
.md-tabs {
  min-height: 56px !important;       /* 48px → 56px */
}

/* 반응형 조정 */
@media screen and (max-width: 1200px) {
  .md-tabs__link {
    font-size: 15px !important;
    padding: 12px 18px !important;
  }
  
  .md-tabs__link--active {
    font-size: 16px !important;
  }
}

@media screen and (max-width: 900px) {
  .md-tabs__link {
    font-size: 14px !important;
    padding: 10px 16px !important;
  }
  
  .md-tabs__link--active {
    font-size: 15px !important;
  }
}

@media screen and (max-width: 600px) {
  .md-tabs__link {
    font-size: 13px !important;
    padding: 8px 14px !important;
  }
  
  .md-tabs__link--active {
    font-size: 14px !important;
  }
}

/* ================================
   사이드바 메뉴 들여쓰기 & 강조
   ================================ */

/* 상위 항목 (예: 환경설정, 개발, 문제해결) */
.md-nav__item--nested > .md-nav__link {
  font-weight: bold;
  font-size: 0.95rem;
  
  color: var(--md-default-fg-color);
}

/* 하위 항목 (예: Java 17, Linter) 들여쓰기 적용 */
.md-nav__item--nested .md-nav__list .md-nav__link {
  padding-left: 0.9rem;
  font-size: 0.7rem;
  opacity: 0.85;
}

/* 사이드바 메뉴 제목 텍스트 6자 이상일 경우 ... 처리 */
.md-nav__link {
  max-width: 15em;                  /* 한글 기준 약 6자 */
  white-space: nowrap;            /* 한 줄로 유지 */
  overflow: hidden;               /* 넘치는 부분 숨김 */
  text-overflow: ellipsis;       /* 말줄임표 (...) 처리 */
}