/* ============================================================
   portfolio-patch.css
   Drop this <link> AFTER style.css in portfolio.html.
   Overrides: uniform image boxes, no greyscale, modal styles.
   ============================================================ */

/* ── Uniform image box — landscape 4:3 for all project cards ── */
.proj .img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #c8c4bc;
  position: relative;
}

.proj .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: none !important;          /* Remove all greyscale */
  transition: transform .7s ease;
}

.proj:hover .img img {
  transform: scale(1.06);
  filter: none !important;          /* Stay full colour on hover */
}

/* Elegant dark vignette on hover — no grey filter */
.proj .img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(21,23,28,.72));
  opacity: 0;
  transition: opacity .45s ease;
}
.proj:hover .img::after { opacity: 1; }

/* "View Project" label that slides up on hover */
.proj .img .hover-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(243,239,231,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(243,239,231,.35);
  color: #f3efe7;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .35em;
  text-transform: uppercase;
  padding: 8px 18px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .4s ease, transform .4s ease;
  z-index: 2;
  pointer-events: none;
}
.proj:hover .img .hover-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Modal overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,10,12,.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 1020px;
  background: #15171c;
  border: 1px solid rgba(243,239,231,.1);
  animation: modalIn .4s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(32px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Slider */
.modal-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d0e11;
}
.modal-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
.modal-slide.active { opacity: 1; }
.modal-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Arrows */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(243,239,231,.1);
  border: 1px solid rgba(243,239,231,.2);
  color: #f3efe7;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 10;
  transition: background .25s;
  -webkit-user-select: none;
  user-select: none;
}
.modal-arrow:hover { background: rgba(243,239,231,.22); }
.modal-arrow.prev  { left: 16px; }
.modal-arrow.next  { right: 16px; }

/* Dots */
.modal-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.modal-dots .mdot {
  width: 28px;
  height: 2px;
  background: rgba(243,239,231,.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .3s;
}
.modal-dots .mdot.active { background: #f3efe7; }

/* Info bar */
.modal-info {
  padding: 24px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.modal-info h2 {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 300;
  color: #f3efe7;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.modal-info .modal-meta {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(243,239,231,.45);
  margin-top: 6px;
}
.modal-close {
  background: none;
  border: 1px solid rgba(243,239,231,.2);
  color: rgba(243,239,231,.7);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  transition: background .25s, color .25s;
}
.modal-close:hover { background: rgba(243,239,231,.1); color: #f3efe7; }

.modal-counter {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(243,239,231,.4);
  margin-top: 8px;
}

@media (max-width: 600px) {
  .modal-info  { padding: 16px 20px; }
  .modal-arrow { width: 36px; height: 36px; font-size: 15px; }
}

/* ══════════════════════════════════════════
   MOBILE FIX — prevent horizontal overflow
══════════════════════════════════════════ */

/* Fix 1: Single column on small screens */
@media (max-width: 560px) {
  .portfolio-grid {
    grid-template-columns: 1fr !important;  /* was "grid-column: 1fr" — typo fixed */
    gap: 16px;
  }

  /* Fix 2: Wide cards must NOT span 2 cols on mobile */
  .proj.wide {
    grid-column: span 1 !important;
  }
}

/* Fix 3: Prevent any child from exceeding viewport width */
.portfolio-grid,
.proj,
.proj .img,
.proj .img img {
  max-width: 100%;
}

/* Fix 4: Tabs bar overflowing on mobile */
@media (max-width: 560px) {
  .tabs-bar .container {
    padding-inline: 12px;
    gap: 2px;
  }
  .tab {
    padding: 8px 10px;
    font-size: 10px;
  }
}