/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * projects.css — shared styles for index.html and portfolio.html
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/* Project card */

.project {
  position: relative;
  display: flex;
  min-height: 500px;
  background-color: var(--little-darker);
  border-top: var(--single) var(--darker);
  border-left: var(--single) var(--darker);
  border-bottom: var(--single) var(--lighter);
  border-right: var(--single) var(--lighter);
  border-radius: var(--radius);
  overflow: hidden;
  gap: 0.5rem;
}

.no-main-media {
  min-height: auto;
}

.big-project {
  flex-direction: column;
  min-height: auto;
}

.big-project .project-media {
  min-height: auto;
}

.project-media {
  flex: 2;
  position: relative;
  min-height: 500px;
  padding: 0.75rem;
}

/* Slideshow */

.slideshowContainer {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  height: 100%;
  min-height: 400px;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.big-project .slideshowContainer {
  min-height: auto;
}

.slideshowContainer::-webkit-scrollbar {
  display: none;
}

.slide {
  max-width: 100%;
  max-height: 400px;
  margin: 0 auto;
  cursor: pointer;
  flex-shrink: 0;
  border: none !important;
  background: none !important;
}

/* Project overlay */

.project-overlay {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.project-overlay-full {
  flex-direction: row;
}

@media (max-width: 700px) {
  .project-overlay-full {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Project text */

.projectText {
  padding: 1rem 0 1rem 0.5rem;
}

.projectText a {
  text-decoration: none;
}

.projectText h3 {
  display: flex;
  align-items: center;
  font-size: 1.3em;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.projectText small {
  margin-bottom: 0.5rem;
}

.projectText p {
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 0.5rem;
  margin-left: 0.5rem;
}

/* External link icon */

.external-link-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.3s;
  flex-shrink: 0;
  display: inline-block;
  margin-left: 0.3rem;
  position: relative;
  top: -1px;
  color: var(--lot-darkwr);
  stroke: currentColor;
}

.external-link-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(45deg,
      rgba(255, 255, 255, 0.3) 0%,
      rgba(255, 255, 255, 0.1) 25%,
      rgba(255, 255, 255, 0.4) 50%,
      rgba(255, 255, 255, 0.1) 75%,
      rgba(255, 255, 255, 0.3) 100%);
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
}

.external-link-icon:hover {
  opacity: 0.8;
  transform: translate(1px, -1px);
  filter: brightness(1.2) contrast(1.1) saturate(1.3);
}

.external-link-icon:hover::before {
  background:
    linear-gradient(45deg,
      rgba(255, 255, 255, 0.5) 0%,
      rgba(255, 255, 255, 0.2) 25%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0.2) 75%,
      rgba(255, 255, 255, 0.5) 100%);
}

/* Additional images */

.additional-images {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.5rem 0.5rem 0.5rem 0;
  justify-content: flex-end;
}

.additional-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s;
}

.additional-image:hover {
  transform: scale(1.05);
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: hsla(100, 6.4%, 90%, 0.9);
}

.modal-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 80%;
  max-width: 900px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
}

.modal-image {
  max-height: 80vh;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.modal-image:not([src]) {
  display: none;
}

.modal-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal-text h3 {
  display: block;
  margin: 0 0 10px 0;
  font-weight: bold;
}

.modal-text p {
  margin: 8px 0;
}

.modal-text .description {
  font-size: 0.95em;
}

.modal-text .role {
  font-size: 0.9em;
  font-style: italic;
}

.modal-text .date {
  font-size: 0.85em;
  color: #666;
}

.modal-text .image-caption {
  font-size: 0.9em;
  color: #555;
}

.modal-text .visit-button {
  display: inline-block;
  text-decoration: underline;
  color: var(--lot-darkwr);
  font-size: 0.9em;
  transition: all 0.2s;
}

.modal-text .visit-button:hover,
.modal-text .visit-button:focus {
  text-decoration: none;
  font-style: italic;
  text-transform: capitalize;
}

.modal-embed {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 8px;
  margin-top: 15px;
}

/* Modal controls */

.close {
  position: absolute;
  right: 20px;
  top: 0;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 10px;
  z-index: 1000;
  opacity: 0.6;
  transition: opacity 0.2s, left 0.2s, right 0.2s;
}

.nav-arrow:hover {
  opacity: 1;
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* Misc */

.visit-button-wrapper {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

#projectsContainer {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: min(100%, 52rem);
  margin: 0 auto;
  border: none;
}

#projectsContainer td {
  padding: 0;
  border: none;
  background: none;
  min-width: 0;
}

/* Responsive */

@media screen and (max-width: 600px) {
  .prev {
    left: -30px;
  }
  .next {
    right: -30px;
  }
}

@media screen and (max-width: 768px) {
  .project {
    flex-direction: column;
    min-height: auto;
  }

  .slide {
    max-width: 100%;
    max-height: 300px;
  }
}

@media screen and (max-width: 480px) {
  .project-overlay {
    padding: 0.5rem;
  }

  .projectText h3 {
    font-size: 1.1em;
  }

  .projectText small {
    font-size: 0.85em;
  }

  .additional-image {
    width: 80px;
    height: 80px;
  }
}
