@charset "utf-8";

@import "global.css";

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Overlay */
.portfolio-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center; /* center vertically; inner spacing handled by modal */
  justify-content: center;
  z-index: 1000;
  padding: 12px; /* uniform outer padding */
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal-overlay {
    padding: 20px;
  }
}

.portfolio-modal-overlay.is-open {
  display: flex;
}

/* Modal */
.portfolio-modal {
  width: 100%;
  max-width: 1000px;
  background: #ffffff;
  border-radius: 12px;
  overflow: auto; /* allow scrolling if content exceeds */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  margin-top: 0;
  padding-top: 32px; /* inner top spacing as per design */
  max-height: calc(100vh - 24px); /* account for overlay 20px top+bottom */
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal {
    border-radius: 16px;
    padding-top: 50px;
    max-height: calc(100vh - 40px);
  }
}

/* Hero image */
.portfolio-modal .hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative; /* for layered slides */
  overflow: hidden;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .hero {
    aspect-ratio: 16 / 9;
  }
}

.portfolio-modal .hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 400ms ease;
  will-change: opacity;
}

.portfolio-modal .hero .slide.is-visible {
  opacity: 1;
}

/* Progress bars under hero */
.portfolio-modal .progress {
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 0 12px;
  margin-top: 8px;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .progress {
    gap: 6px;
    padding: 0 24px;
    margin-top: 10px;
  }
}

.portfolio-modal .progress .bar {
  height: 4px; /* inactive */
  background: #d9d9d9;
  border-radius: 9999px;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .progress .bar {
    height: 5px;
  }
}

.portfolio-modal .progress .bar.is-active {
  background: #6c68df; /* active */
}

/* Content */
.portfolio-modal .content {
  padding: 16px;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .content {
    padding: 50px;
  }
}

.portfolio-modal .content .category {
  font-size: 14px;
  font-weight: 700;
  color: #6c68df;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .content .category {
    font-size: 16px;
  }
}

.portfolio-modal .content .title {
  margin-top: 10px;
  font-size: 36px;
  font-weight: 900;
  color: #404040;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .content .title {
    font-size: 48px;
  }
}

.portfolio-modal .content .subtitle {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 400;
  color: #404040;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .content .subtitle {
    font-size: 16px;
  }
}

.portfolio-modal .divider {
  display: none;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .divider {
    display: block;
    margin: 20px 0;
    height: 1px;
    background: #d9d9d9;
  }
}

.portfolio-modal .description {
  font-size: 14px;
  color: #404040;
  white-space: pre-wrap;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .description {
    font-size: 16px;
  }
}

.portfolio-modal .tags {
  margin-top: 10px;
  font-size: 14px;
  color: #404040;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .tags {
    font-size: 16px;
  }
}

/* Actions */
.portfolio-modal .actions {
  display: flex;
  justify-content: center;
  padding: 0 16px 16px 16px;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .actions {
    padding: 24px;
  }
}

.portfolio-modal .close-btn {
  padding: 10px 50px;
  background-color: #404040;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 20px;
  cursor: pointer;
}

@media only screen and (min-width: 1280px) {
  .portfolio-modal .close-btn {
    font-size: 16px;
  }
}

/* Close button corner (optional) */
.portfolio-modal .corner-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
