/* --- 1. Basic settings --- */

html {
  scroll-behavior: smooth;
}

body > footer, 
.wrapper footer {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* url */
a {
  color: #bf5700 !important;
  text-decoration: none !important;
  font-weight: normal !important;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline !important;
  color: #8c4000 !important;
}

section h3 {
  font-size: 1.3em !important;
  color: #333;
  margin-top: 5px !important;
  margin-bottom: 10px !important;
  font-weight: bold;
  line-height: 1.3;
  padding-bottom: 8px;
}

/* --- 2. Container  --- */

.wrapper {
  max-width: 1800px !important;
  margin: 0 auto !important;
  padding: 0 40px !important;
  float: none !important;
  display: block !important;
  min-height: 0 !important;
}

section {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 20px 0 20px 0 !important;
  float: none !important;
  flex: 1;
  border-bottom: none !important;
}

/* --- 3. Header --- */

header {
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('/photos/website-bg.webp') !important;
  background-size: cover !important;
  background-position: bottom !important;
  padding: 55px 0 !important;
  text-align: center !important;
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 0 20px 0 !important;
  float: none !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

header h1, header h1 a {
  margin: 0 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  font-size: 1.8em !important;
  font-weight: bold !important;
  pointer-events: none !important;
  width: 100% !important;
  border: none !important;
}

header p {
  color: #eeeeee !important;
  font-size: 1.2em !important;
  margin: 10px 0 0 0 !important;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

header ul, header p.view, header .buttons {
  display: none !important;
}

/* index bottoms */
.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  width: 100%;
}

.header-nav a {
  margin: 0px 15px;
  text-decoration: none !important;
  text-decoration: none;
  color: #bf5700;
  font-weight: bold;
  font-size: 1.3em;
  transition: color 0.1s ease;
}

.header-nav a:hover {
  color: #ffcc00 !important;
  text-decoration: none !important;
}

/* --- 4. Pages (Profile, Research, CV, Outreach, Wanderings) --- */

.profile-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin: 0 auto;
  max-width: 1700px !important;
  width: 100%;
}

.profile-image {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-image-wrapper {
  flex: 0 0 220px;
  display: flex;
  justify-content: center;
}

/* make sure the style of rainbow bottoms are fixed */
.profile-text {
  flex: 1 !important;
  font-size: 1.1em;
  line-height: 1.45;
  color: #333;
  text-align: justify !important;
  text-justify: inter-word;
  width: 100% !important;
}

.profile-text a[style*="background-color"] {
  text-decoration: none !important;
  color: white !important;
  font-weight: bold !important;
  border-bottom: none !important;
  transition: all 0.2s ease;
  display: inline-flex;
  position: relative;
  top: 0;
}

.profile-text a[style*="background-color"]:hover {
  transform: translateY(3px);
  text-decoration: none !important;
  opacity: 0.9;
}

.profile-text a[style*="background-color"]:active {
  transform: translateY(5px);
  filter: brightness(0.8);
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.2);
}

.profile-text div[style*="margin-top"] {
  margin-top: 12px !important; 
}

.research-section, .cv-section, .outreach-section {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
}

.research-sidebar, .cv-sidebar, .outreach-sidebar {
  flex: 1;
  min-width: 150px;
  font-size: 1.8em;
  font-weight: bold;
  color: #333;
}

.research-content, .cv-content, .outreach-content {
  flex: 4;
  font-size: 1.1em;
  min-width: 300px;
  text-align: justify !important;
  text-justify: inter-word;
}

.filter-btn {
  border: none;
  outline: none;
  padding: 8px 16px;
  background-color: #f1f1f1;
  cursor: pointer;
  border-radius: 20px;
  margin-right: 10px;
  transition: 0.3s;
  font-weight: bold;
  color: #666;
}

.filter-btn:hover { background-color: #ddd; }

.filter-btn.active {
  background-color: #bf5700;
  color: white;
}

.filter-item {
  display: none;
  margin-bottom: 40px;
}

.show {
  display: block;
}

@media screen and (max-width: 768px) {
  .profile-container {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 15px !important;
    width: 100% !important;
    margin: 20px 0 0 0 !important;
  }
  .profile-text {
    margin-top: 15px !important;
    text-align: left !important;
    text-justify: none;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    font-size: 1.0em !important; 
    line-height: 1.6;
  }
  .profile-image-wrapper {
    margin-bottom: 5px !important;
  }
  .wrapper {
    padding: 0 20px !important;
  }
  section {
    padding-top: 30px !important;
    padding-bottom: 40px !important;
  }
  .research-section, .cv-section, .outreach-section {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px !important;
    width: 100% !important;
    margin: 20px 0 0 0 !important;
  }
  .research-sidebar, .cv-sidebar, .outreach-sidebar {
    width: 100% !important;
    text-align: left !important;
    font-size: 1.8em !important;
  }
  .research-content, .cv-content, .outreach-content {
    width: 100% !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: 1.0em !important; 
    line-height: 1.6;
  }
}

/* --- 5. Image / file display --- */

.pdf-container {
  position: relative;
  width: 100%;
  height: 800px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.blog-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin: 0 auto;
}

.project-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin: 0 auto;
}

.image-credit {
  margin-bottom: 20px;
  font-size: 0.85em;
  color: #666;
  font-style: italic;
  margin-bottom: 20px;
  text-align: right;
  display: block;
  width: 100%;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.image-gallery {
  display: flex;
  flex-direction: row;
  gap: 15px;
  margin: 30px 0 !important;
  align-items: flex-start;
}

.gallery-item {
  flex: 1;
  max-width: calc(33.33% - 10px);
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-item figcaption {
  margin-top: 10px !important;
  font-size: 0.8em !important;
  color: #666 !important;
  font-style: italic !important;
  line-height: 1.4;
  text-align: center;
}

figure {
  margin: 30px auto !important;
  padding: 0 !important;
  max-width: 1300px;
  text-align: center;
}

figcaption {
  margin-top: 12px !important;
  font-size: 0.85em !important;
  color: #666 !important;
  font-style: italic !important;
  line-height: 1.5;
  max-width: 500px;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media screen and (max-width: 768px) {
  .image-gallery {
      flex-direction: column !important;
      gap: 30px;
  }
  .gallery-item {
      max-width: 100% !important;
  }
}

/* --- 6. Bottoms --- */

.download-btn {
  display: block;
  width: fit-content;
  margin-bottom: 20px;
  padding: 10px 20px;
  background-color: #bf5700;
  color: white !important;
  text-decoration: none !important;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.2s ease;
  position: relative;
  top: 0;
}

.download-btn:hover {
  transform: translateY(3px);
  color: white !important;
  text-decoration: none !important;
  opacity: 0.9;
}

.download-btn:active {
  transform: translateY(5px);
  filter: brightness(0.8);
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.2);
  color: white !important;
}

.paper-btn {
  display: inline-block;
  margin: 15px 0;
  padding: 10px 20px;
  background-color: #bf5700;
  color: white !important;
  text-decoration: none !important;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.2s ease;
  position: relative;
  top: 0;
}

.paper-btn:hover {
  transform: translateY(3px);
  text-decoration: none !important;
  opacity: 0.9;
  color: white !important;
}

.paper-btn:active {
  transform: translateY(5px);
  filter: brightness(0.8);
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.2);
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #bf5700;
  color: white !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  font-size: 24px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s, background-color 0.3s;
}

.back-to-top:hover {
  background-color: #8c4000;
  transform: translateY(-5px);
}

@media screen and (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* --- 7. Footer --- */

.custom-footer {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: 20px 0 !important;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
  clear: both !important;
  font-size: 0.85em !important;
  color: #999 !important;
  line-height: 1.8;
  border-top: 1px solid #eee;
}

.custom-footer p {
  text-align: center !important;
  margin: 5px 0 !important;
}

.custom-footer a {
  color: #777 !important;
  text-decoration: underline;
}