/* ==========================================================================
   Nati's Film Diary - Ultra-Spacious Minimalist Monochromatic Theme
   Typography: Gambarino (Fontshare) & Switzer (Fontshare)
   Color Palette: Pure Black & White UI with generous white space
   ========================================================================== */

/* Removed imports (moved to index.html for better loading) */

:root {
  /* Ultra-Soft Minimalist Palette */
  --bg-primary: #FFFFFF;
  --bg-secondary: #FFFFFF; /* Pure white everywhere to remove boxes */
  
  --text-primary: #181818;
  --text-secondary: #777777;
  --text-light: #A0A0A0;
  
  --border-light: transparent; /* Remove all structural borders */
  --border-dark: #181818;
  
  /* Typography */
  --font-display: 'Cormorant', serif;
  --font-body: 'Cormorant', serif;
  
  /* Expanded Layout Spacing */
  --header-height: 110px;
  --max-width: 1440px;
  
  --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Natural Page Flow */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea, a {
  font-family: inherit;
  font-weight: inherit;
}

body {
  display: flex;
  flex-direction: column;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 2.5rem;
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus {
  top: 1.5rem;
}

/* Navigation Header - Spacious 110px */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-height, 110px);
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  will-change: height;
  transition: background-color 0.3s ease;
}

.header-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--font-display);
  font-size: var(--title-font-size, 1.35rem);
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  will-change: font-size;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-link {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 500;
  border-bottom-color: var(--text-primary);
}

/* Language Switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 2rem;
}

.lang-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: var(--text-primary);
  font-weight: 500;
}

.lang-divider {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Main Content Area (Ultra-Spacious Padding) */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 4rem 8rem 4rem;
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* ==========================================================================
   HOME VIEW (Generous Spacious Grid)
   ========================================================================== */
#home-view {
  display: none;
}
#home-view.active {
  display: block;
}

.hero-banner {
  margin-bottom: 5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.8rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 5.5rem 4rem;
}

.project-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.card-image-wrapper {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: opacity var(--transition), filter var(--transition);
}

.project-card:hover .card-image {
  opacity: 0.95;
  filter: grayscale(0%);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--text-primary);
}

/* ==========================================================================
   PROJECT DETAIL VIEW (100% Viewport Width, Last Photo Without Margin Right)
   ========================================================================== */
#project-view {
  display: none;
}
#project-view.active {
  display: block;
}

.project-header {
  margin-bottom: 3.5rem;
}

.back-link {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color var(--transition), opacity var(--transition);
}

.back-link:hover {
  color: var(--text-primary);
  opacity: 0.7;
}

.project-page-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
}

/* Horizontal Gallery Wrapper - Full Bleed but aligns first item to content margin */
.gallery-wrapper {
  --offset: max(4rem, calc((100vw - var(--max-width)) / 2 + 4rem));
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
}

.gallery-horizontal-container {
  height: clamp(500px, 75vh, 900px);
  width: 100%;
  display: flex;
  gap: 3rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scroll-padding-inline-start: var(--offset);
  scroll-padding-inline-end: var(--offset);
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-horizontal-container::before,
.gallery-horizontal-container::after {
  content: "";
  flex: 0 0 calc(var(--offset) - 3rem);
}

.gallery-horizontal-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.gallery-horizontal-container:active {
  cursor: grabbing;
}

/* Gallery Item - Last Photo without trailing right margin */
.gallery-item {
  height: 100%;
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:last-child {
  scroll-snap-align: end;
}

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

/* Gallery Controls Bar */
.gallery-controls-bar {
  max-width: var(--max-width);
  width: 100%;
  margin: 2.5rem auto 0 auto;
  padding: 0 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

.scroll-progress-track {
  flex: 1;
  height: 1px;
  background-color: #EAEAEA;
  position: relative;
}

.scroll-progress-fill {
  height: 2px;
  top: -0.5px;
  position: absolute;
  width: 0%;
  background-color: var(--text-primary);
  transition: width 0.1s linear;
}

.gallery-nav-buttons {
  display: flex;
  gap: 2rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: opacity var(--transition);
}

.btn-text:hover {
  color: var(--text-secondary);
}

/* ==========================================================================
   ABOUT ME VIEW (Refined Minimalist)
   ========================================================================== */
#about-view {
  display: none;
}
#about-view.active {
  display: block;
}

.about-container {
  display: flex;
  gap: 5rem;
  align-items: flex-start;
  padding-top: 2rem;
}

@media (max-width: 900px) {
  .about-container {
    flex-direction: column;
    gap: 3rem;
  }
}

.about-portrait-img {
  width: 320px;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.about-bio-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 500px; /* Restrict width for elegant reading measure */
  padding-top: 1rem;
}

.about-heading {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.about-bio-text {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-section {
  padding-top: 1.5rem;
}

.contact-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.contact-link {
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: underline;
  transition: opacity var(--transition), color var(--transition);
}

.contact-link:hover {
  color: var(--text-primary);
  opacity: 0.7;
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  padding: 3rem;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 4rem 0;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-primary);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 1rem;
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 2rem;
  }
  .header-right {
    gap: 1rem;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 1000;
  }
  .main-nav.active {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    align-items: flex-end;
    gap: 1.5rem;
  }
  .lang-switch {
    margin-left: auto;
    border-left: none;
    padding-left: 0;
  }
  .main-content {
    padding: 3rem 2rem 5rem 2rem;
  }
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
  .gallery-horizontal-container {
    height: clamp(350px, 70vh, 800px);
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
