/* =============================================
   PROJECT PAGE STYLES
   Used by: all project gallery pages + about.html
   Requires: styles.css (for header/nav)
   ============================================= */


/* --- ACTIVE NAV STATE --- */
/* Highlights the current page in the dropdown */
.active-page {
  font-weight: 600 !important;
  color: #fff !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* Highlights bio & contact when active */
.main-nav a.active-page {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  color: #fff !important;
}


/* =============================================
   PROJECT PAGES: HEADER BLOCK
   ============================================= */

.project-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 4rem 5rem 4rem;
  background-color: #111;
  min-height: calc(100vh - 72px);
}

/* Remove max-width from here — separator now spans full content width */
.project-header {
  padding: 3.5rem 0 2.5rem 0;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 3rem;
}

/* Add this new rule — constrains only the text, proportionally */
.project-header-text {
  max-width: 85%;
}

.project-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.75rem;
}

.project-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.project-intro {
  font-size: 1rem;
  line-height: 1.85;
  color: #aaa;
  font-weight: 400;
}


/* =============================================
   COLLAPSIBLE INTRO TEXT (mobile only)
   Hidden on desktop/tablet, clamped to 2 lines
   on phone with a more/less toggle button.
   ============================================= */

.intro-toggle {
  display: none;
}

@media (max-width: 600px) {
  .project-intro.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .intro-toggle {
    display: inline-block;
    background: none;
    border: none;
    color: #888;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.5rem 0 0 0;
    transition: color 0.2s ease;
  }

  .intro-toggle:hover {
    color: #ccc;
  }
}


/* =============================================
   JUSTIFIED GALLERY GRID
   Uses JavaScript to calculate row-based layout.
   Images flow left-to-right, scaled to equal height
   per row, with tight edge-to-edge packing.
   ============================================= */

.masonry-grid {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.masonry-item {
  position: absolute;
  overflow: hidden;
  cursor: pointer;
  display: block;
  background-color: #222;
  border: 4px solid #ffffff;
  transition: opacity 0.3s ease;
  opacity: 0;
}

/* Fade in once JS has calculated position */
.masonry-item.positioned {
  opacity: 1;
}

/* Images fill their justified containers */
.masonry-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Subtle overlay on hover — shows the zoom icon */
.masonry-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.zoom-icon {
  color: white;
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  line-height: 1;
  user-select: none;
}

.masonry-item:hover .masonry-img {
  transform: scale(1.03);
}

.masonry-item:hover .masonry-overlay {
  background: rgba(0, 0, 0, 0.25);
}

.masonry-item:hover .zoom-icon {
  opacity: 1;
}


/* =============================================
   PROJECT NAVIGATION (PREV / NEXT)
   ============================================= */

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #2a2a2a;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-nav-home {
  text-decoration: none;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.project-nav-home:hover {
  color: #fff;
}

.project-nav-arrows {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  align-items: center;
}

.project-nav-prev,
.project-nav-next {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.project-nav-next {
  margin-left: auto;
}

.project-nav-prev:hover,
.project-nav-next:hover {
  color: #aaa;
}

/* Greyed out — used on first/last project */
.project-nav-prev.disabled,
.project-nav-next.disabled {
  color: #ccc;
  cursor: default;
  pointer-events: none;
}


/* =============================================
   LIGHTBOX
   ============================================= */

.lightbox {
  display: none;
  /* Hidden by default, shown by JS */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* JS adds class "active" to show it */
.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  display: block;
  border: 4px solid #ffffff;
}

.lightbox-caption {
  color: #aaa;
  font-size: 0.8rem;
  margin-top: 0.75rem;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.5px;
  min-height: 1.2em;
}

/* Close button — top right */
.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 1010;
  font-family: inherit;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Arrow navigation */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  z-index: 1010;
  font-family: inherit;
  user-select: none;
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}


/* =============================================
   ABOUT / CONTACT PAGE
   ============================================= */

.about-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem 6rem 4rem;
  background-color: #111;
  min-height: calc(100vh - 72px);
}

/* --- About Section --- */
/* Two-column grid: fixed photo column left, bio text right.
   Mirrors the contact section's structure. */
.about-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  padding: 4rem 0;
  align-items: start;
}

.about-photo-placeholder {
  position: relative;
}

.about-photo {
  width: 100%;
  height: auto;
  display: block;
  border: 4px solid #ffffff;
  /* Matches masonry-item and lightbox image borders */
}

/* Fallback shown if portrait photo doesn't load */
.about-photo-fallback {
  display: none;
  width: 100%;
  aspect-ratio: 4/5;
  background-color: #1a1a1a;
  border: 1px dashed #444;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.85rem;
  letter-spacing: 1px;
  font-family: 'Montserrat', sans-serif;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 1rem;
}

.about-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 2rem;
  line-height: 1.1;
}

.about-body p {
  font-size: 1rem;
  line-height: 1.85;
  color: #aaa;
  margin-bottom: 1.25rem;
}

.about-meta {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-meta-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.about-meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  min-width: 60px;
}

.about-meta-value {
  font-size: 0.95rem;
  color: #e0e0e0;
}

.about-meta-value a {
  color: #e0e0e0;
  text-decoration: none;
  border-bottom: 1px solid #555;
  transition: border-color 0.2s ease;
}

.about-meta-value a:hover {
  border-color: #fff;
}

/* --- Section Divider --- */
.section-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 0;
}

/* --- Contact Section --- */
.contact-section {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 6rem;
  padding: 4rem 0 0 0;
  align-items: start;
}

.contact-heading {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.contact-subtext {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #aaa;
  margin-bottom: 1rem;
}

/* --- Contact Form --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: #e0e0e0;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s ease;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #555;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #888;
}

.form-group textarea {
  resize: vertical;
  min-height: 160px;
}

.form-group select {
  /* Light chevron for dark background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* White button with dark text — stands out clearly on dark background */
.submit-btn {
  align-self: flex-start;
  background: #ffffff;
  color: #111;
  border: none;
  padding: 0.9rem 2.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.submit-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}


/* =============================================
   RESPONSIVE: TABLET & MOBILE
   ============================================= */

@media (max-width: 1024px) {
  .project-main {
    padding: 0 2rem 4rem 2rem;
  }

  .about-main {
    padding: 0 2rem 4rem 2rem;
  }

  /* contact-section is still grid-based, reduce column at tablet */
  .contact-section {
    grid-template-columns: 260px 1fr;
    gap: 3rem;
  }

  /* about-section: narrow photo column slightly at tablet */
  .about-section {
    grid-template-columns: 240px 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {

  .project-main {
    padding: 0 1rem 3rem 1rem;
  }

  .project-header {
    padding: 2rem 0 2rem 0;
    margin-bottom: 1.5rem;
  }

  .project-title {
    font-size: 1.8rem;
  }

  /* Justified layout is handled by JS — no column overrides needed */

  .project-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .project-nav-arrows {
  width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }

  /* About / Contact stack vertically on mobile */
  .about-main {
    padding: 0 1rem 3rem 1rem;
  }

  /* About section: single column, photo centers above text */
  .about-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo-placeholder {
    max-width: 240px;
    margin: 0 auto;
  }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .about-name,
  .contact-heading {
    font-size: 1.8rem;
  }

  /* Lightbox arrows tuck closer on mobile */
  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }
}

@media (max-width: 600px) {
  .project-header {
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
  }
}
