/* Projects archive, cards, photography gallery, and controls */

/* PROJECTS PAGE CSS */

.hero-section {
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* puts content higher */
  padding-top: 15vh; /* control exact height from top */
}

.content-center {
  text-align: center;
}

.work-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem); /* scales with screen width */
  font-weight: 600;
  color: var(--navBarText);
  margin-bottom: 45px; /* smaller gap to buttons */
  opacity: 0;
}

.section-title {
  width: 100%;
  text-align: center;
  margin-top: 100px;
  margin-bottom: 30px;
}

.section-title h2 {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--navBarText);
  opacity: 0.95;
  transition: color 0.3s ease;
}

/* Mobile */
@media (max-width: 600px) {
  .section-title h2 {
    font-size: 1.6rem;
    padding: 0 10px;
  }
}

.category-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 35px;
  margin: 25px 0 60px;
  opacity: 0;
}

.category-buttons button {
  font-size: 1.4rem;
  font-weight: 500;
  background: transparent;
  color: var(--navBarText);
  padding: 10px 22px;
  border: 2px solid var(--navBarText);
  border-radius: 50px;
  cursor: none; /* to match your custom cursor */
  transition: 0.3s ease;
}

.category-buttons button:hover {
  background: var(--navBarText);
  color: var(--navText);
}

/* Active state — JS can toggle this class */
.category-buttons button.active {
  background: var(--navBarText);
  color: var(--navText);
}

/* Mobile */
@media (max-width: 600px) {
  .category-buttons {
    gap: 20px;
  }

  .category-buttons button {
    font-size: 1.1rem;
    padding: 8px 16px;
    border-width: 1.8px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .category-buttons {
    gap: 12px; /* Much smaller gap */
    margin: 20px 0 40px; /* Reduced margins too */
  }

  .category-buttons button {
    font-size: 1rem; /* Smaller font */
    padding: 6px 12px; /* Tighter padding */
    border-width: 1.5px;
  }
}

.projects-section {
  width: 100%;
  min-height: 100vh;
  padding-top: 18vh;
  display: flex;
  flex-direction: column;
  align-items: center; /* This centers child elements horizontally */
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 5%;
  box-sizing: border-box; /* Add this to include padding in width calculation */
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* title sticks to top */
  gap: 12px; /* prevent crashing when title wraps */
  margin-bottom: 16px;
}

.title-row h3 {
  margin: 0;
  line-height: 1.2; /* slightly more breathable */
}

.project-date {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.6;
  background: var(--black);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center; /* keeps text centered inside */
  height: 100%;
}

/* 📱 MOBILE RESPONSIVE */
@media (max-width: 550px) {
  .title-row {
    flex-direction: column; /* date drops below title */
    align-items: flex-start; /* keep clean left alignment */
    gap: 6px;
  }
  .project-date{
    margin-top: -15px;
  }
}

/* PROJECTS GRID */
.projects-container {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 45px;
  display: grid;
}

/* Make project cards stack on mobile */
@media (max-width: 768px) {
  .projects-container {
    grid-template-columns: 1fr;
  }
}

/* CARD BASE */
.project-card {
  background: var(--white);
  color: var(--black);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .3s ease;
  position: relative;
  overflow: hidden;
}

/* IMAGE SECTION — full visible with angled bottom */
.image-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;

  /* Only bottom angled line */
  clip-path: polygon(
    0 0,
    100% 0,
    100% 88%,
    0 95%
  );

  transition: clip-path .35s ease;
}

/* Gradient overlay */
.image-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;

  mix-blend-mode: multiply;

  /* Clip shape matches angled image */
  clip-path: polygon(
    0 0,
    100% 0,
    100% 88%,
    0 95%
  );

  /* GSAP will animate this */
  opacity: var(--overlayOpacity);
}

/* CONTENT SECTION */
.project-content {
  padding: 32px;
  background: var(--white);
}

/* Title */
.project-card h3 {
  font-size: 1.7rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Only affect elements inside this Projects page */
.projects-section .role strong,
.projects-section .contribution strong {
  font-size: .8rem;
  letter-spacing: .05em;
  opacity: .7;
  display: block;
}

.projects-section .role p,
.projects-section .contribution p {
  font-size: .95rem;
  opacity: .75;
}

/* Button */
.view-btn {
  padding: 12px 18px;
  background: transparent;
  border: 2px solid var(--black);
  border-radius: 30px;
  font-size: .85rem;
  cursor: none;
  transition: .25s;
}

.view-btn:hover {
  background: var(--black);
  color: var(--white);
}

.project-card.expanding,
.project-card.expanded {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  border-radius: 25px;
}

.project-card.expanded {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.big-card {
  position: fixed;
  border-radius: 25px;
  width: 100%;
  height: 100%;
  z-index: 99;
  background: var(--white);
  border-radius: 25px;
  overscroll-behavior: contain; /* prevent scrolling outside */
  -webkit-overflow-scrolling: touch; /* smooth scroll iOS */
  pointer-events: auto;
  overflow: hidden
}

.image-wrapper.remove-gradient::after {
  opacity: 0 !important;
}

.fullscreen-active {
  --navBarText: var(--black)!important;
  --navBackground: var(--black)!important;
  --navText: var(--white)!important;
}

    .fullscreen-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0);
      pointer-events: none;
      z-index: 997;
    }

    .fullscreen-img {
      position: fixed;
      object-fit: cover;
      will-change: width, height, left, top, clip-path;
      cursor: none;
      user-select: none;
      z-index: 998;
      pointer-events: none;
    }

/* Fullscreen reveal area */
.fullscreen-extra {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .6s ease, transform .6s ease;
  z-index: 99;
  align-items: flex-start; /* important: stop vertical centering */
  padding: 60px 0; /* optional breathing room */
  padding-top: min(25vh);
}

/* Active state */
.fullscreen-extra.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Fullscreen layout container */
.extra-layout {
  width: min(1400px, 92vw);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 60px;
  align-items: flex-start;

  margin: 0 auto;
  padding-top: 80px; /* space from top */
  padding-bottom: 40px; /* space at bottom */
  position: relative;
}

/* Clean floating image */
.extra-media img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 85vh; /* image scales but never crops */
  border-radius: 24px;
  filter: grayscale(8%) contrast(1.04);
  box-shadow: 0 12px 55px rgba(0, 0, 0, 0.12);
  object-fit: contain; /* ensures full image always visible */
  display: block;
}

/* Text side */
.extra-content {
  color: var(--black);
  max-width: 520px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center; /* ⬅️ This centers vertically */
  height: 100%;
}

.small-label {
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: 2px;
  opacity: .55;
  margin-bottom: 14px;
  text-align: left;
}

.headline {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  font-weight: 750;
  line-height: 1.12;
  margin: 0 0 24px 0; /* reduce top gap */
  text-align: left; /* ⬅️ force left alignment */
}

.divider-card {
  width: 50px;
  height: 4px;
  background: var(--black);
  border-radius: 2px;
  margin-bottom: 10px;
  order: 0;
}

.subtext-card {
  font-size: 1.05rem;
  line-height: 1.55;
  opacity: .78;
  margin-top: 18px;
  max-width: 420px;
}

/*** Mobile Fixes ***/
@media (max-width: 950px) {
  .extra-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 45px;
  }
}

.image-gallery {
  column-count: 3;
  column-gap: 24px;
  width: min(1400px, 92vw); /* ⭐ full width look */
  margin: 60px auto 0;
  padding: 0 5px; /* subtle alignment tweak */
}

.image-gallery img {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 24px;
  display: block;
  break-inside: avoid;
  object-fit: cover;
}

@media (max-width: 900px) {
  .image-gallery {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .image-gallery {
    column-count: 1;
  }
}

.video-gallery {
  width: min(1400px, 92vw);
  margin: 60px auto 0;
  display: grid;
  gap: 32px;

  /* ⭐ Auto responsive layout */
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* 16:9 responsive wrapper */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* Aspect ratio 16:9 */
  border-radius: 16px;
  overflow: hidden;
}

/* Actual YouTube embed */
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.project-description {
  width: min(1400px, 92vw);
  margin: 0px auto 2%;
  padding: 10px 0;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;

  color: var(--black);
}

/* Section Title */
.project-description h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* Main text */
.project-description p {
  font-size: 1.05rem;
  line-height: 1.55;
  opacity: .78;
  max-width: 1050px; /* makes it wider across the page */
}

/* Add subtle fade animation when entering fullscreen */
.fullscreen-extra.visible .project-description {
  animation: fadeUp .6s ease both;
  animation-delay: .2s;
}

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

.divider-line {
  width: min(1400px, 92vw);
  height: 2px;
  background: rgba(0, 0, 0, 0.12); /* subtle line */
  margin: 0 auto 2.5%; /* spacing above + below */
  border-radius: 2px;
}

.white-space {
  height: 120px; /* extra breathing room at bottom */
}

.fullscreen-extra {
  transform-origin: top center;
  will-change: transform, opacity;
}

.project-card {
  opacity: 0;
  transform: translateY(100px);
}

/* Ensure smooth transitions for the transform */
.project-card {
  transition: transform 0.3s ease;
}

/* Photography Section Styles */
.photography-section {
  width: 100%;
  min-height: 60vh;
}

.photography-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.photography-section,
.photography-content {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0; /* remove if you don't want offset */
}

.instagram-link {
  text-align: center;
  margin-bottom: 15px;
}

.instagram-link a {
  text-decoration: none;
  font-size: 1.125rem; /* 18px responsive */
  font-weight: 600;
  color: #E1306C;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: color 0.3s ease;
  flex-wrap: wrap; /* Keeps layout clean on small screens */
}

.insta-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Underline animation */
.instagram-link a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background-color: #E1306C;
  transition: width 0.3s ease;
}

.instagram-link a:hover {
  color: #B22B5A;
}

.instagram-link a:hover::after {
  width: 100%;
}

/* 🔹 Mobile responsiveness */
@media (max-width: 480px) {
  .instagram-link a {
    font-size: 1rem; /* Slightly smaller text on mobile */
  }

  .insta-icon {
    width: 22px;
    height: 22px;
  }
}
@media (max-width: 415px) {
  .instagram-link a {
    font-size: 0.8rem; /* Slightly smaller text on mobile */
  }

  .insta-icon {
    width: 22px;
    height: 22px;
  }
}

.project-card {
  /* Ensure hardware acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
  will-change: transform, opacity;
}

/* Improve scrolling performance on mobile */
.image-gallery, .project-content {
  transform: translateZ(0);
}

/* button close big card */

.close-wrapper {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;

  width: 54px;
  height: 54px;
  border-radius: 50%;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  background: rgba(255, 255, 255, 0.03); /* Barely visible */

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

/* Show only when fullscreen card is open */
.fullscreen-active .close-wrapper {
  opacity: 1;
  pointer-events: auto;
}

/* Button Shape and Animation */
.close-button {
  width: 40px;
  height: 40px;
  position: absolute; /* MUST be absolute */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centers correctly */
  cursor: pointer;
}

.close-button > div {
  position: relative;
}

.close-button-block {
  width: 40px;
  height: 20px;
  position: relative;
  overflow: hidden;
}

.close-button-block:before,
.close-button-block:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(55% - 4px);
  width: 4px;
  height: 25px;
  background: var(--black);
  transform-origin: bottom center;
  transition: all ease-out 280ms;
}

.close-button-block:last-of-type {
  transform: rotate(180deg);
}

.close-button .in .close-button-block:before {
  transition-delay: 280ms;
  transform: translateX(20px) translateY(-20px) rotate(45deg);
}

.close-button .in .close-button-block:after {
  transition-delay: 280ms;
  transform: translateX(-22px) translateY(-22px) rotate(-45deg);
}

.close-button .out {
  position: absolute;
  top: 0;
  left: 0;
}

.close-button .out .close-button-block:before {
  transform: translateX(-5px) translateY(5px) rotate(45deg);
}

.close-button .out .close-button-block:after {
  transform: translateX(5px) translateY(5px) rotate(-45deg);
}

.close-button:hover .in .close-button-block:before {
  transform: translateX(-5px) translateY(5px) rotate(45deg);
}

.close-button:hover .in .close-button-block:after {
  transform: translateX(5px) translateY(5px) rotate(-45deg);
}

.close-button:hover .out .close-button-block:before {
  transform: translateX(-20px) translateY(20px) rotate(45deg);
}

.close-button:hover .out .close-button-block:after {
  transform: translateX(20px) translateY(20px) rotate(-45deg);
}

/* --- Sorting & Filtering Controls --- */
.project-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 50px;
  opacity: 1; /* Add to your GSAP animations if you want it to fade in */
  z-index: 9; /* Keeps it above other content when open */
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group label {
  color: var(--navBarText);
  font-weight: 500;
  font-size: 1rem;
}

/* --- Custom Animated Dropdowns --- */
.custom-dropdown {
  position: relative;
  font-family: inherit;
  width: 160px; /* Adjust as needed */
  z-index: 999; /* Keeps it above other content when open */
}

.dropdown-selected {
  background: transparent;
  color: var(--navBarText);
  border: 2px solid var(--navBarText);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: none; /* Matches your custom cursor */
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  user-select: none;
}

.dropdown-selected:hover {
  background-color: var(--navBarText);
  color: var(--navText);
}

/* Custom CSS Arrow */
.dropdown-selected .arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s ease;
}

/* Arrow state when open handled by GSAP/class, but just in case */
.custom-dropdown.open .arrow {
  transform: translateY(2px) rotate(-135deg);
}

/* The expanding options list */
.dropdown-options {
  list-style: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: var(--navBackground);
  border: 1px solid color-mix(in srgb, var(--navBarText) 20%, transparent);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  /* Hidden by default, GSAP will handle showing it */
  height: 0;
  opacity: 0;
  pointer-events: none; 
}

.dropdown-options li {
  padding: 10px 18px;
  color: var(--navText);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: none;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.dropdown-options li:hover {
  background: color-mix(in srgb, var(--navText) 10%, transparent);
  padding-left: 24px; /* Slight indent hover effect */
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .custom-dropdown {
    width: 140px;
  }
  .dropdown-selected {
    font-size: 0.85rem;
    padding: 6px 14px;
  }
  .dropdown-options li {
    font-size: 0.85rem;
    padding: 8px 14px;
  }
}

/* ============================================
   3D INFINITE GALLERY STYLES - FIXED
   ============================================ */

.gallery-3d-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--black);
  z-index: 100;
}

/* Add to your CSS */
#gallery-3d-canvas,
.gallery-3d-container canvas {
  cursor: none !important;
}

/* Hide footer when photography section is active */
body:has(#photography-section:not([style*="display: none"])) .footer {
  display: none !important;
}

/* Only hide the project grid and controls, NOT the category buttons */
body:has(#photography-section:not([style*="display: none"])) #project-grid,
body:has(#photography-section:not([style*="display: none"])) .project-controls {
  display: none !important;
}

/* Keep the category buttons and title visible but reposition them */
body:has(#photography-section:not([style*="display: none"])) .content-center {
  position: relative;
  z-index: 102;
}

/* Ensure the photography section itself is fullscreen when active */
#photography-section {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99;
  padding: 0 !important;
  margin: 0 !important;
  display: none;
}

#photography-section:not([style*="display: none"]) {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Ensure Instagram link is visible and positioned correctly */
body:has(#photography-section:not([style*="display: none"])) .instagram-link {
  display: block !important;
  position: relative;
  z-index: 102;
  margin-top: -20vh;
  margin-bottom: 20px;
}

/* Remove padding from projects section when gallery is active */
body:has(#photography-section:not([style*="display: none"])) .projects-section {
  padding-bottom: 0 !important;
}

/* Ensure nav bar stays visible */
body:has(#photography-section:not([style*="display: none"])) .nav-bar {
  z-index: 101;
}
