/* ============================================
   CSS Variables
   ============================================ */
:root {
  font-size: clamp(16px, 1.4vw, 45px);

  --main-color: rgb(0, 0, 0);
  --sub-color: white;
  --text-color: black;
  --text-color-gray: #e5e5e5;
  --text-color-gray-dark: #8f8f8f;
  --background-color: #efefef;
  --header-language-toggle-background: var(--text-color-gray-dark);

  --border: 1px solid black;
  --space-2: 0.125rem;  
  --space-4: 0.25rem;   
  --space-6: 0.375rem;  
  --space-8: 0.5rem;    
  --space-16: 1rem;     
  --space-32: 2rem;     

  --body-font-size: 1rem;
  --font-size-small: 0.8rem;
  
  --body-padding-top: calc(var(--header-height) * 1.75);
  --body-padding-sides: calc(var(--header-height) * 1.75);
  
  --header-height: var(--space-32);
  --header-padding: var(--space-4);
  --header-disabled-background: #636363;
  --header-disabled-color: #868686;
  --gradient-start: 0%;
  --gradient-mid: 70%;
  --gradient-end: 100%;
  --gradient-mid-opacity: 0.8;
  --header-transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* ============================================
   Animations
   ============================================ */
@keyframes blinking {
  50% { color: var(--main-color); }
}

/* ============================================
   Fonts
   ============================================ */
@font-face {
  font-family: "sanjak-regular";
  src: url("/assets/fonts/AS-Sanjak-R.woff") format("woff");
  unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F;
  size-adjust: 85%;
}

/* ============================================
   Base Styles
   ============================================ */
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  word-break: keep-all;
  font-family: "vendetta", "sanjak-regular", sans-serif;
  font-weight: 500;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: 0;
  word-spacing: 0.05em;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  overflow-y: auto;
  padding-top: var(--body-padding-top);
  padding-left: var(--body-padding-sides);
  padding-right: var(--body-padding-sides);
  /* 스크롤바 숨기기 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  background-color: var(--background-color);
}

/* 스크롤바 숨기기 (Webkit 브라우저: Chrome, Safari, Opera) */
body::-webkit-scrollbar {
  display: none;
}

html::-webkit-scrollbar {
  display: none;
}

* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

*::-webkit-scrollbar {
  display: none; /* Webkit 브라우저 */
}

a {
  color: currentColor;
  text-decoration: none;
}

a[href^="mailto:"],
a[x-apple-data-detectors] {
  text-decoration: none !important;
  color: inherit !important;
}

a[x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  font-size: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

button {
  font: inherit;
  background: none;
  border: 0;
  color: currentColor;
  cursor: pointer;
}

img {
  width: 100%;
  height: 100%;
}

li {
  list-style: none;
}

u {
  text-decoration: none;
}

::selection {
  background-color: var(--main-color);
  color: var(--sub-color);
}

.kr {
  line-height: 1.3;
}


.text_alert {
  width: 100%;
  height: 100%;
  text-align: center;
  display: flex;
  padding: 0 var(--space-8) var(--space-8) var(--space-8);
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

/* ============================================
   Header Styles
   ============================================ */
.site-header {
  font-weight: 500;
    font-style: normal;
  letter-spacing: 0em;
    position: fixed;
    display: flex;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
  height: calc(var(--header-height) * 1.5);
  z-index: 100;
  padding: 0 var(--body-padding-sides);
    background: linear-gradient(
        to bottom,
    var(--background-color) var(--gradient-start),
    rgba(235, 235, 235, var(--gradient-mid-opacity)) var(--gradient-mid),
    rgba(235, 235, 235, 0) var(--gradient-end)
    );
    transform: translateY(0);
    transition: var(--header-transition);
    align-items: flex-start;
    justify-content: center;
}

.site-header--hidden {
  transform: translateY(-100%) !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out !important;
}

body.books-page .site-header--hidden {
  transform: translateY(0) !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.site-header__controls {
  padding-top: var(--space-4);
  display: flex;
  gap: var(--space-4);
}

.site-header__nav {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.site-header__logo {
  width: 20%;
  text-align: left;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.site-header__nav-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2rem, 1fr));
  gap: var(--space-4);
  width: 100%;
}

.site-header__nav-items a {
  border-bottom: none;
  outline: 1px solid var(--main-color);
}

.site-header__nav-item {
  text-align: left;
  background-color: var(--text-color-gray); 
  padding: var(--space-8) var(--space-8) var(--space-4) var(--space-8);
  transition: all 0.2s ease;
}

.site-header__nav-items a[aria-current] .site-header__nav-item {
  background-color: var(--sub-color); 
  color: var(--text-color); 
}

.site-header__nav-item:hover {
  background-color: var(--main-color);
  color: var(--sub-color);
}

.site-header__nav-items a:last-child .site-header__nav-item {
  background-color: var(--header-language-toggle-background) !important;
  color: var(--main-color) !important;
}

.site-header__nav-items a:last-child .site-header__nav-item:hover {
  background-color: var(--main-color);
  color: var(--sub-color);
}

.site-header__nav-items a:last-child.language-toggle--disabled .site-header__nav-item,
.site-header__nav-items a:last-child .site-header__nav-item.language-toggle--disabled {
  background-color: var(--header-disabled-background) !important;
  color: var(--header-disabled-color) !important;
  cursor: not-allowed;
  pointer-events: none;
}

.site-header__nav-items a:last-child.language-toggle--disabled {
  pointer-events: none;
}

.site-header__nav-items a:last-child.language-toggle--disabled .site-header__nav-item:hover {
  background-color: var(--header-disabled-background) !important;
  color: var(--header-disabled-color) !important;
}

.site-header__info {
  display: flex;
  align-items: center;
  background-color: var(--text-color);
  color: var(--sub-color);
  overflow: hidden;
  width: 100%;
}

.site-header__info-content {
  width: fit-content;
  white-space: nowrap;
}

.site-header__name-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  min-width: 10rem;
  height: 3rem;
}

.site-header__name {
  color: var(--main-color);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  padding: var(--space-8) 0;
  font-size: 1.25rem;
  font-style: italic;
  position: absolute;
  z-index: 103;
}

/* ============================================
   Mobile Menu Styles
   ============================================ */
/* 데스크톱에서는 숨김 */
.site-header__menu-toggle {
  display: none;
}

.site-header__mobile-menu {
  display: none;
}

/* ============================================
   Media Queries
   ============================================ */

/* Tablet: 768px - 1024px */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
  :root {
    --body-padding-sides: 2rem;
  }
}

/* Mobile: 768px 이하 */
@media only screen and (max-width: 768px) {
  :root {
    --body-padding-sides: 1rem;
  }
}

/* Mobile Menu: 768px 이하 */
@media screen and (max-width: 768px) {
  body {
    text-align: justify;
    word-break: break-all;
  }
  
  .site-header {
    height: calc(var(--header-height) * 2);
  }
  
  /* Header Navigation */
  .site-header__nav {
    padding-top: var(--space-16);
  }
  
  .site-header__name {
    padding-top: 0;
    font-size: 1.5rem;
  }
  
  .site-header__nav-items {
    display: none;
  }
  
  .site-header__logo {
    width: auto;
    flex: 1;
  }

  /* Mobile Menu Toggle */
  .site-header__menu-toggle {
    display: flex;
  flex-direction: column;
    justify-content: space-between;
    width: 2rem;
    height: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 102;
    position: relative;
  }

  .site-header__menu-toggle-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--main-color);
    transition: all 0.3s ease;
    transform-origin: center;
  }

  
  /* Mobile Menu */
  .site-header__mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    align-items: center;
    justify-content: center;
  }

  .site-header__mobile-menu.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .site-header__mobile-menu-content {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    width: 100vw;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 0 var(--body-padding-sides);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .site-header__mobile-menu-item {
    display: block;
    width: 100%;
    background-color: transparent;
    outline: none;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    padding: var(--space-8) var(--space-4);
    font-size: 2rem;
  }

  .site-header__mobile-menu-item:hover,
  .site-header__mobile-menu-item:focus {
    background-color: transparent;
    color: var(--text-color);
  }

  .site-header__mobile-menu-item[aria-current="page"] {
    background-color: transparent;
    color: var(--text-color);
  }

  .site-header__mobile-menu-item:last-child {
    background-color: var(--header-language-toggle-background);
    outline: 1px solid var(--main-color);
    color: var(--main-color);
  }

  .site-header__mobile-menu-item:last-child:hover,
  .site-header__mobile-menu-item:last-child:focus {
    background-color: var(--main-color);
    color: var(--sub-color);
  }
}

/* ============================================
   Footer Styles
   ============================================ */
footer,
.site-footer,
.page-footer {
  display: flex;
  gap: var(--space-16);
  flex-wrap: wrap;
  }

footer a,
.site-footer a,
.page-footer a {
  display: inline-block;
}
