/* ===== Portfolio Page Styles ===== */

/* Disable wild mode effects on portfolio page */
html.portfolio-page.wild-mode,
body.portfolio-page.wild-mode,
body.portfolio-page.wild-mode .looping-images-section,
body.portfolio-page.wild-mode .portfolio-work,
body.portfolio-page.wild-mode .navbar {
  background: var(--color-bg) !important;
  animation: none !important;
}

body.portfolio-page.wild-mode * {
  color: var(--color-text) !important;
  text-shadow: none !important;
}

body.portfolio-page.wild-mode .top-logo-img,
body.portfolio-page.wild-mode .logo-img {
  filter: none !important;
  box-shadow: none !important;
}

body.portfolio-page.wild-mode .nav-link {
  color: var(--color-text) !important;
  text-shadow: none !important;
}

/* Override specific wild mode element styles */
body.portfolio-page.wild-mode .square,
body.portfolio-page.wild-mode .square img,
body.portfolio-page.wild-mode .video-overlay,
body.portfolio-page.wild-mode .lightbox,
body.portfolio-page.wild-mode .sidebar-video-item {
  filter: none !important;
  box-shadow: none !important;
  border-color: var(--color-text) !important;
}

/* Completely hide floating HIRE US text on portfolio page regardless of wild mode */
.portfolio-page .floating-hire-text,
body.portfolio-page .floating-hire-text,
html.portfolio-page .floating-hire-text {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Ensure no wild mode is triggered on portfolio page load */
html.portfolio-page,
body.portfolio-page {
  background: var(--color-bg) !important;
}

/* Disable scrolling on portfolio page */
body.portfolio-page {
  overflow: hidden;
  height: 100vh;
}

/* Looping Images Section */
.looping-images-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--color-bg);
  padding: 4rem;
}

.looping-images-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.looping-images-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.looping-images-inner {
  position: relative;
  width: 500px;
  height: 500px;
}

.square {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  will-change: transform;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 1;
}

.square:hover {
  z-index: 2;
}

.square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.square-with-offset {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  will-change: transform;
  cursor: pointer;
  z-index: 1;
}

.square-with-offset:hover {
  z-index: 2;
}

.square-with-offset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.square-children {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
}

/* Video Overlay */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-overlay.active {
  display: flex;
  opacity: 1;
}

.video-overlay-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background-color: rgba(63, 95, 90, 0.1);
  border: 1px solid var(--color-text);
  color: var(--color-text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 9501;
  border-radius: 4px;
}

.video-overlay-close:hover {
  background-color: var(--color-accent-mustard);
  border-color: var(--color-accent-mustard);
  color: var(--color-bg);
}

.video-overlay-content {
  width: 72%; /* 20% smaller than 90% */
  max-width: 960px; /* 20% smaller than 1200px */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.video-overlay-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 50.625%; /* 16:9 aspect ratio */
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-overlay-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay-info {
  width: 100%;
  padding: 1.5rem 0;
  text-align: center;
}

.video-overlay-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.video-overlay-client {
  font-size: 1.1rem;
  color: var(--color-text-light);
  font-weight: 300;
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.video-overlay-year {
  font-size: 1rem;
  color: var(--color-text-light);
  font-weight: 300;
  letter-spacing: 0.5px;
}

html.portfolio-page {
  overflow: hidden;
  height: 100vh;
}

/* Portfolio Work Section */
.portfolio-work {
  background-color: var(--color-bg);
  height: 100vh;
  width: 100%;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
}

.portfolio-work .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding-top: 100px; /* Space for top logo */
  padding-bottom: 100px; /* Space for bottom nav */
  box-sizing: border-box;
}

.portfolio-work .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.portfolio-work .section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.portfolio-work .section-description {
  font-size: 1rem;
  color: var(--color-text-light);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Filter Buttons */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
  font-family: var(--font-primary);
}

.filter-btn:hover {
  background-color: var(--color-accent-mustard);
  border-color: var(--color-accent-mustard);
  color: var(--color-bg);
}

.filter-btn.active {
  background-color: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

/* Portfolio Layout */
.portfolio-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 3rem;
  align-items: start;
  height: 100%;
  max-height: calc(100vh - 200px); /* Account for logo and nav */
  overflow: hidden;
}

/* Main Video Container */
.main-video-container {
  width: 100%;
}

.main-video-content {
  width: 80%; /* 20% smaller */
  display: flex;
  flex-direction: column;
}

.main-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background-color: #000;
  border-radius: 4px;
  overflow: hidden;
}

.main-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.main-video-info {
  width: 100%;
  padding: 1rem 0;
}

.main-video-title {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.main-video-client {
  font-size: 1rem;
  color: var(--color-text-light);
  font-weight: 300;
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.main-video-year {
  font-size: 0.95rem;
  color: var(--color-text-light);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Video Sidebar */
.video-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.video-sidebar::-webkit-scrollbar {
  width: 4px;
}

.video-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.video-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-text);
  border-radius: 2px;
}

.video-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-mustard);
}

.sidebar-video-item {
  display: flex;
  gap: 1rem;
  cursor: pointer;
  padding: 0.75rem;
  border: 1px solid transparent;
  transition: var(--transition);
  opacity: 0.7;
}

.sidebar-video-item:hover {
  opacity: 1;
  border-color: var(--color-text);
  background-color: rgba(63, 95, 90, 0.05);
}

.sidebar-video-item.active {
  opacity: 1;
  border-color: var(--color-accent-mustard);
  background-color: rgba(200, 154, 58, 0.1);
}

.sidebar-thumbnail {
  position: relative;
  width: 120px;
  min-width: 120px;
  height: 68px;
  overflow: hidden;
  background-color: #000;
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sidebar-video-item:hover .sidebar-thumbnail img {
  transform: scale(1.05);
}

.sidebar-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-video-item:hover .sidebar-play-overlay {
  opacity: 1;
}

.sidebar-play-overlay svg {
  width: 30px;
  height: 30px;
}

.sidebar-video-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.sidebar-video-title {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.sidebar-video-client {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-weight: 300;
  line-height: 1.3;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(217, 106, 58, 0.95);
  backdrop-filter: blur(10px);
}

.lightbox-content {
  position: relative;
  z-index: 10001;
  max-width: 1200px;
  width: 100%;
  background-color: var(--color-bg);
  border: 1px solid var(--color-text);
  animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(63, 95, 90, 0.1);
  border: 1px solid var(--color-text);
  color: var(--color-text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10002;
}

.lightbox-close:hover {
  background-color: var(--color-accent-mustard);
  border-color: var(--color-accent-mustard);
  color: var(--color-bg);
}

.lightbox-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background-color: #000;
}

.lightbox-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-info {
  padding: 2rem;
}

.lightbox-title {
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.lightbox-client {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
  font-weight: 300;
}

.lightbox-description {
  font-size: 1rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  font-weight: 300;
}

.lightbox-year {
  font-size: 0.9rem;
  color: var(--color-text-light);
  opacity: 0.6;
  font-weight: 300;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .portfolio-layout {
    grid-template-columns: 1fr 320px;
    gap: 2rem;
  }
  
  .sidebar-thumbnail {
    width: 100px;
    min-width: 100px;
    height: 56px;
  }
}

@media (max-width: 768px) {
  .portfolio-work {
    padding: 0;
    padding-top: 60px; /* Minimal space for top logo on mobile */
    padding-bottom: 60px; /* Minimal space for bottom nav on mobile */
  }
  
  .portfolio-work .container {
    padding: 0 1rem;
    padding-top: 0; /* Remove top padding to shift content up */
    padding-bottom: 0; /* Remove bottom padding */
    margin-top: 0vh; /* Shift video player section up 10% from previous position */
    align-items: flex-start;
  }
  
  .portfolio-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-height: calc(100vh - 120px); /* Reduced for mobile */
    margin-top: 0;
  }
  
  .video-sidebar {
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1rem;
    padding-right: 0;
    padding-bottom: 0.5rem;
  }
  
  .video-sidebar::-webkit-scrollbar {
    height: 4px;
    width: auto;
  }
  
  .sidebar-video-item {
    min-width: 200px;
    flex-direction: column;
  }
  
  .sidebar-thumbnail {
    width: 100%;
    height: 112px;
  }
  
  .main-video-title {
    font-size: 1.5rem;
  }
  
  .main-video-client {
    font-size: 1.1rem;
  }
  
  .lightbox-content {
    margin: 1rem;
  }
  
  .lightbox-info {
    padding: 1.5rem;
  }
  
  .video-overlay-content {
    width: 90%; /* Larger on mobile for better viewing */
  }
  
  .video-overlay-info {
    padding: 1rem 0;
  }
  
  .video-overlay-title {
    font-size: 1.25rem;
  }
  
  .video-overlay-client {
    font-size: 1rem;
  }
  
  .video-overlay-year {
    font-size: 0.9rem;
  }
  
  .main-video-content {
    width: 100%; /* Full width on mobile */
  }
  
  .main-video-info {
    padding: 0.75rem 0;
  }
  
  .main-video-title {
    font-size: 1.1rem;
  }
  
  .main-video-year {
    font-size: 0.85rem;
  }
  
  /* Scale looping images for mobile */
  .looping-images-section {
    padding: 2rem 1rem;
  }
  
  .looping-images-inner {
    transform: scale(0.975); /* 30% bigger than 0.75 */
    transform-origin: center center;
  }
}

@media (max-width: 480px) {
  .portfolio-work .section-header {
    margin-bottom: 2rem;
  }
  
  .main-video-title {
    font-size: 1.25rem;
  }
  
  .main-video-client {
    font-size: 1rem;
  }
  
  .main-video-description {
    font-size: 0.9rem;
  }
  
  .sidebar-video-item {
    min-width: 160px;
  }
  
  .sidebar-thumbnail {
    height: 90px;
  }
  
  /* Scale looping images even more for small mobile */
  .looping-images-inner {
    transform: scale(0.8125); /* 30% bigger than 0.625 */
  }
}
