@font-face {
  font-family: 'Orbit-Regular';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('Orbit-Regular.woff2') format('woff2');
}

* {
  box-sizing: border-box;
}

:root {
  --border-color: black;
  --hover-color: #007cb8;
}

.special-text {
    font-size: 1.2rem;
    color: red;
    font-style: italic;
}

html, body {
  min-height: 100%;
  min-width: 100%;
  font-family: 'Orbit-Regular', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-backface-visibility: hidden;
  -ms-overflow-style: none;  /* 인터넷 익스플로러와 Edge에서 스크롤 막대 숨기기 */
  scrollbar-width: none;  /* Firefox에서 스크롤 막대 숨기기 */
  margin: 0;
  padding: 0;
  overflow-y: hidden;
  box-sizing: border-box;
}

body::-webkit-scrollbar {
    display: none; /* 웹킷 브라우저에서 스크롤 막대 숨기기 */
}

a {
  text-decoration: none;
  color: black;
  transition: color 0.3s ease, background-color 0.3s ease;
}

a:hover {
  color: var(--hover-color);
  background-color: white;
}

h1, h2 {
  margin: 0;
  padding: 0;
}

.border {
  border: 1px solid var(--border-color);
}

.post-content, .post-header, .primary-content, .secondary-content {
  padding: 20px;
  box-sizing: border-box;
}

.post-header {
 margin: 0vw;
 width: 100%;
 flex-direction: column;
 text-align: center;
}

.post-header h1 {
  font-size: 1.7rem;
}

.container {
  display: flex;
  background-color: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.side-menu, .additional-side-menu {
  background-color: var(--hover-color);
}

.side-menu {
  width: 15vw;
  border-right: 1px solid var(--border-color);
  position: fixed; /* 화면에 고정 */
  top: 0;
  left: 0;
  height: 100vh; /* 화면 전체 높이 차지 */
  overflow-y: auto; /* 내용이 많을 때 스크롤 가능 */
  overflow-x: hidden; 
}

.main-content {
  margin-left: 15vw; /* side-menu의 너비만큼 왼쪽 여백 추가 */
  width: calc(100% - 18vw);
  display: flex;
  padding: 0;
  flex-direction: row; /* Ensure primary and secondary content are laid out in a row */
  box-sizing: border-box;
}

.side-menu ul li a, .additional-side-menu ul li a {
  display: block;
  color: black;
  transition: background-color 0.3s ease;
}

.side-menu ul li a:hover {
  color: var(--hover-color);
  background-color: white;
}

.additional-side-menu {
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  width: 3vw;
  height: 100%;
  padding: 0.5vw;
  flex-direction: column;
  justify-content: flex-start; /* 아이템들을 위쪽에 정렬 */
  align-items: center; /* 아이템들을 수직 가운데에 정렬 */
  border-left: 1px solid var(--border-color);
  box-sizing: border-box;
}

.additional-side-menu span, .additional-side-menu a {
  display: flex;
  align-items: center;
  flex-direction: column; /* 아이템들을 수직으로 정렬 */
  margin-top: 15px;
  margin-bottom: 15px; /* 아이템 간의 간격 설정 */
}

.additional-side-menu i.far, .additional-side-menu i.fab {
  width: 25px; /* 원하는 아이콘 너비로 설정 */
  height: 25px;
  font-size: 25px; /* 원하는 아이콘 크기로 설정 */
}

.additional-side-menu a:hover {
  color: white;
  background-color: var(--hover-color);
}
  
.side-title {
  white-space: nowrap; /* 텍스트 줄 바꿈 방지 */
  writing-mode: vertical-lr;
  font-size: 1rem;
}

.grid-container {
  display: grid;
  width: 15vw;
  background-color: var(--hover-color);
}

.grid-item {
  display: flex; /* 플렉스 박스를 사용하여 가운데 정렬 */
  flex-direction: column; /* 텍스트를 세로로 정렬 */
  text-align: center;
  justify-content: center; /* 수평 가운데 정렬 */
  align-items: center; /* 수직 가운데 정렬 */
  padding: 1vw;
  font-size: 1.6rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s, color 0.3s;
  min-height: 15vh;
}

.grid-item:hover, .grid-item a:hover {
  color: var(--hover-color);
  background-color: white;
}

.grid-text {
  font-size: 1rem;  /* 작은 텍스트 크기 설정 */
  font-weight: 200;
}

.primary-content, .secondary-content {
    height: calc(100vh - (1.6vh + 1.8rem)); /* 헤더 높이만큼 뺀 값으로 설정 */
    overflow-y: scroll; /* 스크롤 가능하게 설정 */
}

.primary-content {
  width: 50vw;
  box-sizing: border-box;
  -ms-overflow-style: none;  /* 인터넷 익스플로러와 Edge에서 스크롤 막대 숨기기 */
  scrollbar-width: none;  /* Firefox에서 스크롤 막대 숨기기 */
}

.primary-content::-webkit-scrollbar, .secondary-content::-webkit-scrollbar {
    display: none; /* 웹킷 브라우저에서 스크롤 막대 숨기기 */
}

.content {
  padding: 0;
}

.content h2, .secondary-content h2 {
  font-size: 1.4em;
}

.primary-content p, .content p, .secondary-content p {
  line-height: 2.1;
}

.secondary-content {
  width: 32vw;
  box-sizing: border-box;
  border-left: 1px solid var(--border-color);
  font-size: 0.8rem;
  -ms-overflow-style: none;  /* 인터넷 익스플로러와 Edge에서 스크롤 막대 숨기기 */
  scrollbar-width: none;  /* Firefox에서 스크롤 막대 숨기기 */
}

.secondary-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

.h-entry {
  padding: 0px;
}

.archive-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0;
    margin-top: 1vh;
    box-sizing: border-box;
}

.archive-grid-item {
    display: flex;
    border: 1px solid #ccc;
    padding: 1vw;
    text-align: center;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    text-decoration: none;
    color: inherit;
    min-height: 15vh; /* 모든 그리드 아이템의 높이를 동일하게 유지 */
}

.archive-grid-item h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 200;
}

.archive-grid-item:hover {
    background-color: #e9e9e9;
}

header {
  padding: 0.8vw;
  width: calc(100% - 18vw); /* Adjusted width to exclude side-menu and footer */
  margin-left: 15vw; /* side-menu의 너비만큼 왼쪽 여백 추가 */
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.8rem;
}

footer {
  position: fixed;
  top: 0;
  right: 0;
  width: 3vw;
  height: 100vh; /* 화면 전체 높이 차지 */
  background-color: var(--hover-color);
  overflow-y: auto; /* 내용이 많을 때 스크롤 가능 */
}

.search-container {
    position: relative;
}

#search-input {
    padding: 5px;
    border: none;
    border-bottom: 1px solid black;
    width: 200px;
    margin-right: 0.8vw;
    outline: none;
}

#search-input:focus {
  border-bottom-color: var(--hover-color); /* 포커스 시 하단 테두리 색상 변경 */
}

#search-results-container {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#search-results-container.hidden {
    display: none;
}

#search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

#search-results li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

#search-results li a {
    text-decoration: none;
    color: #333;
    font-size: 13px;
}

#search-results li a:hover {
    text-color: #007cb8;
}

/* 반응형 디자인 */
@media (min-width: 769px) and (max-width: 1024px) {
    .archive-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .archive-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
  .additional-side-menu {
    width: 4vw;
  }
  
  .main-content {
    width: calc(100% - 4vw);
  }

  .secondary-content {
    width: 26vw;
    box-sizing: border-box;
  }    
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .side-menu {
    width: calc(100% - 5vw);
    height: auto;
    position: relative; /* fixed 위치를 relative로 변경 */
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .additional-side-menu {
    width: 5vw;
  }
  
  .additional-side-menu i.far, .additional-side-menu i.fab {
    width: 17px;
    height: 17px;
    font-size: 17px;
  }

  .grid-container {
    width: 100%;
    grid-template-columns: repeat(4, 1fr); /* 수평으로 4칸 정렬 */
  }
  
  .grid-item {
    min-height: 10vw; /* 높이를 10vw로 설정 */
    font-size: 1rem; /* 텍스트 크기 조정 */
}

.main-content {
    margin-left: 0; /* side-menu 너비만큼의 여백 제거 */
    margin-right: 0; /* footer 너비만큼의 여백 제거 */
    width: calc(100% - 5vw);
    flex-direction: column;
    border-top: none;
  }

 .primary-content, .secondary-content {
    width: 100%;
    padding: 10px;
    flex-direction: column;
  }

  .primary-content {
    margin-bottom: 20px;
    border-top: none;
  }
  
  .secondary-content {
    border-top: 1px solid var(--border-color);
  }
    
  .archive-grid-container {
        grid-template-columns: 1fr;
    }

 header {
    margin-left: 0;
    width: calc(100% - 5vw);
  }
  
 .side-title  {
   font-size: 0.9rem;
 }   
}

@media (max-width: 480px) {
  header h1, .side-menu h1 {
    font-size: 1.5rem;
  }

  .primary-content h2, .secondary-content h2 {
    font-size: 0.9rem;
  }

  .primary-content p, .secondary-content p {
    font-size: 0.9rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }
}
