/* Work page - grid layout */

body {
  overflow: hidden;
  height: 100vh;
}

main {
  flex: 1;
  padding: 60px 0 40px 0;
  position: relative;
  overflow-y: hidden;
}

.coming-soon {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -1px;
  color: #000;
}

header,
footer {
  position: relative;
  z-index: 10;
}

/* Blur overlay */
.blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.3);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.blur-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Work Grid */
.work-grid {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.work-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 20px;
  margin-bottom: 80px;
  margin-left: 0;
  margin-right: 0;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 0;
  align-items: end;
  position: relative;
}

/* Line container for positioning the line under photos */
.work-row .line-under-photos {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #000;
  z-index: 10;
  pointer-events: none;
}

/* Second row - line stops at last photo */
.work-row:last-child {
  width: fit-content;
}

/* LinkedIn note */
.linkedin-note {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.linkedin-note a {
  font-size: 11px;
  color: #000;
  text-decoration: none;
  white-space: normal;
  width: 200px;
  text-align: justify;
  line-height: 1.2;
  transition: opacity 0.2s ease;
  pointer-events: auto;
  display: block;
}

.linkedin-note a:hover {
  opacity: 0.6;
}

.work-item {
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.work-item:hover {
  transform: translateY(-4px);
  opacity: 0.8;
}

.work-item img,
.work-item video {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

.work-item video {
  pointer-events: none;
}

.work-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 3;
  background: white;
}

.work-year {
  font-size: 11px;
  font-weight: 400;
  color: #999;
}

.work-title {
  font-size: 16px;
  font-weight: 400;
  color: #000;
  letter-spacing: -0.3px;
}

.work-category {
  font-size: 12px;
  font-weight: 400;
  color: #666;
}

/* Project Modal */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.project-modal.active .cursor-follower {
  display: none !important;
}

.project-content {
  position: relative;
  width: 90%;
  max-width: 750px;
  padding: 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 30px;
  align-items: start;
  background: #E94E32;
  border: none;
  box-shadow: none;
}

.project-close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 18px;
  font-weight: 400;
  color: #000;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.project-close:hover {
  color: #000;
  border-bottom-color: #000;
}

.project-image-area {
  position: relative;
}

.project-main-image {
  width: 350px;
  height: 400px;
  background: transparent;
  margin-bottom: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.project-main-image video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #000;
  width: 100%;
}

.project-nav span {
  cursor: pointer;
  transition: border-color 0.2s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.project-nav span:hover {
  border-bottom-color: #000;
}

.project-nav .nav-arrow {
  font-size: 12px;
}

.project-counter {
  color: rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}

.project-info {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.project-label {
  font-size: 9px;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.project-title {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #000;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 18px;
  max-width: 320px;
}

.project-meta span:last-child {
  text-align: right;
}

.project-description {
  font-size: 14px;
  line-height: 1.6;
  color: #000;
  margin-bottom: auto;
  max-width: 320px;
  text-align: justify;
}

.project-links {
  display: flex;
  gap: 20px;
  max-width: 320px;
  justify-content: space-between;
}

.project-link {
  display: inline-block;
  font-size: 11px;
  color: #000;
  text-decoration: none;
  border-bottom: none;
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.project-link:hover {
  border-bottom: 1px solid #000;
}

/* Hide old modal elements */
.project-left,
.project-right,
.project-grid,
.project-text {
  display: none;
}

/* Responsive overrides for work page */
@media (max-width: 1024px) {
  .work-row {
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
  }

  .work-item img {
    height: auto;
  }

  .coming-soon {
    font-size: 24px;
  }
  
  footer {
    padding: 15px 30px;
    font-size: 10px;
  }

  .project-content {
    padding: 40px;
    gap: 40px;
    grid-template-columns: 1fr 280px;
  }

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

@media (max-width: 768px) {
  body {
    overflow: auto;
    height: auto;
  }

  main {
    padding: 30px 0 20px 0;
    overflow-y: auto;
  }

  .work-grid {
    padding: 0;
  }

  .work-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 15px;
    margin-bottom: 50px;
    padding-left: 20px;
    padding-right: 20px;
    width: 100% !important;
  }

  /* Hide lines on mobile */
  .work-row .line-under-photos {
    display: none;
  }

  /* Hide linkedin note on mobile */
  .linkedin-note {
    display: none;
  }

  .work-item {
    display: flex;
    flex-direction: column;
  }

  .work-item img,
  .work-item video {
    width: 100%;
    height: auto;
  }

  .work-info {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    padding-top: 8px;
  }

  .work-year {
    font-size: 10px;
  }

  .work-title {
    font-size: 13px;
  }

  .work-category {
    font-size: 10px;
  }

  /* Modal on mobile */
  .project-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 25px 20px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .project-info {
    order: -1;
    padding-top: 10px;
  }

  .project-image-area {
    order: 1;
  }

  .project-main-image {
    width: 100%;
    height: auto;
    max-height: 50vh;
  }

  .project-main-image img,
  .project-main-image video {
    max-height: 50vh;
    width: auto;
    margin: 0 auto;
  }

  .project-title {
    font-size: 22px;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
  }

  .project-meta {
    margin-bottom: 4px;
    max-width: 100%;
  }

  .project-links {
    max-width: 100%;
    margin-bottom: 12px;
    gap: 12px;
  }

  .project-description {
    margin-bottom: 0;
    font-size: 12px;
    max-width: 100%;
  }

  .project-close {
    top: 12px;
    right: 15px;
    font-size: 16px;
  }

  .coming-soon {
    font-size: 20px;
  }
  
  footer {
    gap: 5px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .work-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 12px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .work-year {
    font-size: 9px;
  }

  .work-title {
    font-size: 12px;
  }

  .work-category {
    font-size: 9px;
  }

  .coming-soon {
    font-size: 18px;
  }

  .project-content {
    padding: 20px 15px;
  }

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

  .project-meta {
    margin-bottom: 3px;
  }

  .project-links {
    margin-bottom: 10px;
    gap: 10px;
  }

  .project-description {
    font-size: 11px;
    line-height: 1.5;
  }

  .project-label {
    font-size: 8px;
  }

  .project-meta {
    font-size: 10px;
  }
}
