﻿/* ============================================
   Global CSS Variables & Base Element Styles
   ============================================ */
/* Aligns content to the right side and adjusts padding and color */
.right {
  flex: 1;
  text-align: right;
  padding-right: 2rem;
  color: #666;
}

/* Typography styles for headers and paragraphs */
h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1.2rem;
  color: #555;
}

/* Styles for navbar on other pages only */
body.other-page nav.navbar {
  position: fixed;
  top: 1rem;
  right: 2rem;
  left: 2rem;
  padding: 0.75rem 2rem;
  background-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between; /* changed from flex-end */
  z-index: 1000;
  transition: opacity 0.3s ease;
}

body.other-page nav.navbar .page-label {
  font-weight: bold;
  font-size: 1rem;
  color: #333;
}

body.other-page nav.navbar ul.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: clamp(1rem, 3vw, 2rem);
}

body.other-page nav.navbar ul.nav-links li a {
  text-decoration: none;
  font-weight: 500;
  color: #333;
  transition: color 0.3s ease, transform 0.3s ease;
}

body.other-page nav.navbar ul.nav-links li a:hover {
  color: #000;
}

body.other-page nav.navbar ul.nav-links li a.active {
  color: #a95e00; /* Darker amber */
  font-weight: 600;
  border-bottom: 2px solid #a95e00;
}

/* Hamburger toggle hidden on desktop */
body.other-page nav.navbar .menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
}

body.other-page nav.navbar .menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: #333;
}


/* Styles for call-to-action buttons */
.visit-button {
  display: inline-block;
  margin-top: 2em;
  padding: 0.75em 1.5em;
  background-color: #d9a15f;
  color: white;
  text-decoration: none;
  border-radius: 2em;
  font-weight: 600;
  font-size: 1em;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.visit-button:hover {
  background-color: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
  transition: transform 0.5s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Fade transitions and keyframe animations */
body.fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.fade-in {
  animation: fadeIn 1.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Home Page Hero Section & Background
   ============================================ */
body.index-page {
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

body.index-page {
  background-image: url('../images/Other_bkg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.index-hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ============================================
   Other Page Background and Top Header
   ============================================ */
body.other-page {
  background-image: url("../images/Other_bkg.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}


/* ============================================
   Scrollable Content Grid for Card Layout
   ============================================ */
.scrollable-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding-top: 6rem; /* adjust top padding if needed */
  margin-top: 0.5rem; /* 为导航栏留出更紧凑的空间 */
  height: calc(100vh); /* 可视高度减去导航栏 */
  overflow-y: auto;
  padding: 2rem;
  max-width: 100vw;
  box-sizing: border-box;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.scrollable-content.fade-in-up {
  transform: translateY(20px);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}
.project-section {
  padding: 5vh 5vw;
  color: white;
}

/* Frosted content card styling for grid display */
.frosted-block {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  color: #333;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  /* Removed height or min-height */
  flex: 1 1 calc(33% - 2rem); /* New: allow 2–3 per row with wrapping */
  min-width: 240px;
  max-width: 480px;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Hover and internal styles for frosted content blocks */
.frosted-block:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.frosted-block h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #4A3B2A;
}

.frosted-block p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #444;
}

/* Ensure consistent sizing and wrapping */
.scrollable-content,
.frosted-block,
.page-wrapper,
.about-container {
  max-width: 100vw;
  box-sizing: border-box;
}

/* Limit all elements to screen width */
* {
  max-width: 100vw;
  box-sizing: border-box;
}

/* Force white text on frosted blocks */
.frosted-block, .frosted-block * {
  color: white !important;
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
}

/* Remove height constraints for masonry blocks */
.card-container.masonry .frosted-block {
  /* Removed fixed height */
  min-width: 200px;
  margin-bottom: 2rem;
  color: white;
}

/* Generic card styling with blur and glow */
.card {
  flex: 1 1 300px;
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  /* Removed any height or min-height */
}

/* Slide animation utility classes */
.slide-in-left {
  animation: slideFromLeft 0.6s ease both;
}
.slide-in-right {
  animation: slideFromRight 0.6s ease both;
}

.slide-left {
  animation: slideFromRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide-right {
  animation: slideFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Slide-in keyframe definitions */
@keyframes slideFromRight {
  0% {
    transform: translateX(120%);
    opacity: 0;
  }
  60% {
    transform: translateX(4%);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideFromLeft {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  60% {
    transform: translateX(-4%);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

@keyframes fadeInUp {
  from {
    transform: translateY(80px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-80px);
  }
}

.newest-button {
  position: fixed;
  bottom: 1rem;
  right: 0.6rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-family: 'Inter', sans-serif;
  font-weight: bold;
  font-size: 0.85rem;
  color: white;
  text-decoration: none;
  z-index: 999;
  transition: background-color 0.3s ease;
}

.newest-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.post-header {
  margin-bottom: 1rem;
}

.post-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-meta {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  font-family: 'Courier New', monospace;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  margin: 1rem 0;
  border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body.other-page nav.navbar {
    padding: 0.5rem 1rem;
  }

  body.other-page nav.navbar .menu-toggle {
    display: flex;
  }

  body.other-page nav.navbar .nav-wrapper {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    background-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1rem;
    display: none;
    flex-direction: row;
    align-items: center;
  }

  body.other-page nav.navbar .nav-wrapper.open {
    display: flex;
  }

  body.other-page nav.navbar ul.nav-links {
    flex-direction: row;
    gap: 1rem;
  }

  .contact-container {
    flex-direction: column;
    padding: 2rem;
  }

  .contact-block {
    height: auto;
  }

  .timeline-column {
    display: none;
  }

  .project-images {
    flex-direction: column;
    align-items: center;
  }

  .frosted-block {
    flex: 1 1 100%;
  }
  /* Reduced spacing for project page on small screens */
  .page-projects .scrollable-content {
    padding: 1rem;
    gap: 1rem;
  }
  .page-projects section {
    padding: 2vh 3vw;
  }
  .page-projects .frosted-block {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
  }

}