/*colour variable assignments*/
:root {
  --text-col: #181818;
  --bg-col: #e5e5e5;
  --link-col: #0c2bf5;
  --shadow-col: #b9b9b9;
  --red-col: #ff0000;
}



.dark {
  --text-col: #e5e5e5;
  --bg-col: #181818;
  --link-col: #0cc6f5;
  --shadow-col: #b9b9b9;
  --red-col: #ff0059;
}

/*總體顏色設定*/
html {
  margin: 0;
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-col);
  background-color: var(--bg-col);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/*header navigation bar*/
.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--text-col);
  padding: 10px 0;
  box-shadow: 0 2px 10px #0000001a;
}

.site-nav svg {
  display: block;
  height: 32px;
  width: auto;
  fill: currentColor;
}

.site-nav a {
  color: var(--bg-col);
  text-decoration: none; 
  font-size: 16px;
  font-weight: 500;
  margin: 0 30px;   /* distance between links */
  padding: 8px 0;
  /*transition: color 0.3s ease;*/
}

.site-nav a:hover {
  color: var(--link-col);
}

.site-nav a.current {
  color: var(--bg-col);
  border-bottom: 3px solid var(--link-col);
  padding-bottom: 5px;
}

#theme-toggle {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  border-radius: 0;
  background: #817676;
  backdrop-filter: blur(10px); 
  border: none;
  color: white;
  font-size: 15px;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /*transition: all 0.3s ease;*/
}

#theme-toggle:hover {
  transform: scale(1.1);
}

#theme-toggle .icon {
  position: absolute;
  /*transition: opacity 0.3s ease;*/
}

theme-toggle .yang,
#theme-toggle .yin {
  position: absolute;
  /*transition: opacity 0.3s ease;*/
}


#theme-toggle .yang { opacity: 1; }
#theme-toggle .yin { opacity: 0; }


.dark #theme-toggle .yin { opacity: 1; }
.dark #theme-toggle .yang { opacity: 0; }

.dark .profile-img {
  filter: invert(1) hue-rotate(180deg);
}

/*所有pjustify*/
p {
    text-align: justify;
}

main a {
  color: var(--link-col);
  text-decoration: none;
}


main a:hover, main a:focus {
  color: var(--red-col);
  text-decoration: underline;
  /*transition: color 0.3s ease;*/
}


.home-container {
  display: flex;
  align-items: flex-start;
  gap: 60px;
  padding: 0px 0px;
}

.home-content {
  flex: 1; 
  min-width: 0;
}

.home-photo {
  flex-shrink: 0;
}

.profile-img {
  width: 100px;
  height: auto;
  border-radius: 0;
  display: block;
}


.mobile-cv {
  display: none;
}



@media (max-width: 768px) {
  .home-container {
    display: block;
    padding: 30px 20px;
  }

  .home-photo {
    display: none;
  }

  .home-content {
    text-align: center;
  }

  .home-content h1 {
    font-size: 28px;
  }
  .cv-iframe {
    display: none;
  } /* hide cv ifframe on phones */

  .mobile-cv {
    display: block;
  }
}



.news-list {
  margin: 0;
  list-style: none;
  padding-left: 1.5em; /* space for bullets*/
}

.news-list li {
  display: flex;
  align-items: center;
  padding: 0 0;
  margin-bottom: -1em;
}

.news-list li::before {
  content: "🪧";
  color: var(--text-col);
  position: absolute;
  left: 0em;
}


.news-list time {
  font-family: monospace;
  background-color: var(--text-col);
  color: var(--bg-col);
  margin-right: 12px;
  padding: 1px 1px;
  border-radius: 0px;
  flex-shrink: 0;
}

main a.button-link {
  display: inline;
  padding: 1px 1px;
  background-color: var(--link-col);
  color: var(--bg-col);
  text-decoration: none; 
  border-radius: 0px;
  font-size: 0.7em;
  /*transition: all 0.3s ease;*/
  box-shadow: 0 2px 0 color-mix(in srgb, var(--link-col) 80%, black 20%);
  position: relative;
}

main a.button-link:hover {
  background-color: var(--red-col);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--red-col) 80%, black 20%);
}

main a.button-link:active {
  transform: translateY(2px);
  box-shadow: var(--red-col);
  color: var(--red-col);
}

/*books*/
.bookshelf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 70px;
  margin: 4rem auto;
  max-width: 900px;
  padding: 0 20px;
}


.mobile-bookshelf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  margin: 4rem auto;
  max-width: 900px;
  padding: 0 20px;
}

.mobile-bookshelf {
  display: none;
}

@media (max-width: 768px) {
  .bookshelf {
    display: none;
  }

  .mobile-bookshelf {
    display: flex;
  }
}

.book-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  justify-content: center;
  padding-bottom: 40px;
}

@media (max-width: 768px) {
  .book-row{
    grid-template-columns: repeat(2, 1fr);
  }
}

.book-row::after {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 10px; 
  height: 20px;
  background: var(--shadow-col);
  z-index: -1;
}

.book {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 220px;
}

.book img {
  width: 120px;
  height: 180px;
}




.book-meta {
  position: absolute;
  bottom: 100%;
  margin-bottom: -10px;
  padding: 6px 10px;
  background-color: var(--text-col);
  color: var(--bg-col);
  font-size: 0.8rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.book:hover .book-meta {
  opacity: 1;
}


.book-title::before {
  content: '«';
}
.book-title::after {
  content: '»';
}

.clustrmap-container {
  display: none
}


.clustrmap-container img {
  width: 100%;
  height: auto;
}