/* Photography Portfolio - Two Column Layout with Blur Loading */

/* Import Professional Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: #0f172a;
  background: #fafafa;
  /* Random crackle pattern generated by JavaScript */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Two Column Container */
.container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Left Column - 1/4 width */
.sidebar {
  width: 25%;
  min-width: 280px;
  max-width: 400px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 30px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  /* Random crackle pattern generated by JavaScript */
}

/* Right Column - 3/4 width */
.content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Site Header */
.site-header {
  margin-bottom: 50px;
}

.site-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.site-title a,
.site-title a:link,
.site-title a:visited,
.site-title a:active {
  color: #0f172a;
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: color 0.2s ease;
}

.site-title a:hover {
  color: #64748b;
}

/* Project Navigation */
.project-nav {
  flex: 1;
}

.nav-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.nav-title-link,
.nav-title-link:link,
.nav-title-link:visited,
.nav-title-link:active {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-title-link:hover {
  color: #0f172a;
}

.nav-title-link.active {
  color: #0f172a;
}

.project-list {
  list-style: none;
}

.project-list li {
  margin-bottom: 16px;
}

.project-list a,
.project-list a:link,
.project-list a:visited,
.project-list a:active {
  color: #334155;
  text-decoration: none;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  display: inline-block;
  position: relative;
  padding: 4px 0;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.project-list a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #0f172a;
  transition: width 0.2s ease;
}

.project-list a:hover {
  color: #0f172a;
}

.project-list a:hover::after {
  width: 100%;
}

.project-list a.active {
  color: #0f172a;
  font-weight: 500;
}

.project-list a.active::after {
  width: 100%;
  height: 2px;
  bottom: 1px;
}

/* Site Footer */
.site-footer {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #94a3b8;
}

/* Gallery Grid */
.gallery {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.gallery-item {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.gallery-item a,
.gallery-item a:link,
.gallery-item a:visited,
.gallery-item a:active {
  display: block;
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.gallery-item a:hover {
  opacity: 0.9;
}

.gallery-item img {
  width: 100%;
  max-height: 100vh;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Projects Grid Layout */
.projects-grid {
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  display: flex;
  flex-direction: row;
  gap: 24px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 40px;
}

.project-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-link {
  display: flex;
  flex-direction: row;
  gap: 24px;
  width: 100%;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.project-link:hover {
  opacity: 0.95;
}

.project-thumbnail {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 4px;
}

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.project-title {
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0;
}

.project-date {
  font-size: 14px;
  color: #64748b;
  font-weight: 400;
}

.project-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  margin-top: 8px;
}

/* About Page */
.about-content {
  padding: 60px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-title {
  font-size: 48px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0;
}

.about-description {
  font-size: 16px;
  line-height: 1.75;
  color: #334155;
}

.about-description p {
  margin-bottom: 1.5em;
}

.about-section-title {
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
  margin-top: 2em;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

.about-contact {
  margin-top: 1em;
}

.about-description a {
  color: #0f172a;
  text-decoration: none;
  border-bottom: 1px solid #cbd5e1;
  transition: border-color 0.2s ease;
}

.about-description a:hover {
  border-bottom-color: #0f172a;
}

/* Post Content */
.post-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.post-images {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.image-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
  min-height: 200px;
}

.image-container img {
  width: 100%;
  max-height: 100vh;
  height: auto;
  display: block;
  object-fit: contain;
}

.image-container.loaded {
  min-height: unset;
  background: transparent;
}

.post-text {
  margin-top: 20px;
}

.post-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.post-date {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
  margin-bottom: 24px;
  letter-spacing: 0;
}

.post-description {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: #334155;
  letter-spacing: -0.01em;
}

.post-description p {
  margin-bottom: 1em;
}

.post-description a,
.post-description a:link,
.post-description a:visited,
.post-description a:active {
  color: #0f172a;
  text-decoration: none;
  position: relative;
  display: inline;
  border-bottom: 1px solid #cbd5e1;
  transition: border-color 0.2s ease;
}

.post-description a:hover {
  border-bottom-color: #0f172a;
}

/* Progressive Image Loading with Blur Effect */
.lazy-image {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.5s ease-in-out, filter 0.5s ease-in-out;
  will-change: opacity, filter;
}

.lazy-image.loading {
  opacity: 0.3;
  filter: blur(10px);
}

.lazy-image.loaded {
  opacity: 1;
  filter: blur(0);
}

.lazy-image.error {
  opacity: 0.5;
  filter: blur(0);
}

.image-container.error {
  background: #ffebee;
  border: 2px dashed #f44336;
}

.image-container.error::after {
  content: '图片加载失败';
  display: block;
  text-align: center;
  padding: 20px;
  color: #f44336;
  font-size: 14px;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

.sidebar,
.content {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.content::-webkit-scrollbar-track {
  background: #f8fafc;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Design - Mobile */
@media (max-width: 968px) {
  html, body {
    height: 100%;
    overflow: auto;
  }

  .container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  /* Mobile Header - Horizontal Tabs */
  .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    overflow-y: visible;
    overflow-x: hidden;
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: 0;
    background: #fafafa;
    z-index: 100;
  }

  .site-header {
    margin-bottom: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    flex-shrink: 0;
  }

  .site-title {
    font-size: 16px;
  }

  .site-footer {
    display: none;
  }

  /* Vertical Navigation Menu */
  .project-nav {
    width: 100%;
    flex-shrink: 0;
    padding: 10px 0;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 12px 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
  }

  .nav-title-link,
  .nav-title-link:link,
  .nav-title-link:visited,
  .nav-title-link:active {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .nav-title-link:hover {
    color: #64748b;
  }

  .nav-title-link.active {
    color: #0f172a;
    font-weight: 600;
  }

  .project-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0 0 20px 0;
    list-style: none;
  }

  .project-list li {
    margin-bottom: 0;
    border-left: 3px solid transparent;
  }

  .project-list a,
  .project-list a:link,
  .project-list a:visited,
  .project-list a:active {
    display: block;
    padding: 10px 20px 10px 30px;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: #334155;
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .project-list a::after {
    display: none;
  }

  .project-list a:hover {
    color: #0f172a;
    background-color: #f8f9fa;
  }

  .project-list li:has(a.active) {
    border-left-color: #0f172a;
    background-color: #f8f9fa;
  }

  .project-list a.active {
    color: #0f172a;
    font-weight: 500;
  }

  /* Mobile Content Area */
  .content {
    width: 100%;
    height: auto;
    overflow-y: visible;
    overflow-x: hidden;
  }

  /* Mobile Gallery - Vertical Scroll */
  .gallery {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .gallery-item {
    width: 100%;
    position: relative;
    overflow: hidden;
  }

  /* Mobile Projects Grid */
  .projects-grid {
    padding: 20px 15px;
    gap: 30px;
  }

  .project-card {
    flex-direction: column;
    gap: 16px;
    padding-bottom: 30px;
  }

  .project-link {
    flex-direction: column;
    gap: 16px;
  }

  .project-thumbnail {
    width: 100%;
    height: 200px;
  }

  .project-title {
    font-size: 20px;
  }

  .project-excerpt {
    font-size: 14px;
  }

  /* Mobile About Page */
  .about-content {
    padding: 30px 20px;
  }

  .about-title {
    font-size: 36px;
  }

  .about-description {
    font-size: 15px;
  }

  .about-section-title {
    font-size: 20px;
  }

  .gallery-item a,
  .gallery-item a:link,
  .gallery-item a:visited,
  .gallery-item a:active {
    display: block;
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: opacity 0.2s ease;
  }

  .gallery-item a:active {
    opacity: 0.9;
  }

  .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Mobile Post Content - Vertical Scroll */
  .post-content {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .post-images {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
  }

  .image-container img {
    width: 100%;
    height: auto;
    display: block;
  }

  .post-text {
    display: block;
  }

  .post-title {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .post-date {
    font-size: 12px;
    margin-bottom: 15px;
  }

  .post-description {
    font-size: 14px;
    line-height: 1.6;
  }
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

.image-container.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  z-index: 1;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
