/* assets/css/portfolio.css -------------------------------------------------
/* Container flex layout */
.portfolio-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
   Gallery styling for the portfolio section.
   – Responsive 4‑column grid on desktop.
   – 2‑column grid on tablets, 1‑column on mobile.
   – Elegant hover overlay with smooth fade‑in.
   – Category‑based filter using the existing filter buttons.
   – Attractive background “bg‑pX” helpers for visual variety.
-------------------------------------------------------------------------- */

/* ==== Layout ==== */
#portfolio {
    padding: 4rem 0;
    background: #fafafa;
}
.portfolio-inner {
    max-width: 1240px;
    margin: 0 auto;
}

/* Grid */
.portfolio-inner .reveal {
    width: 100%;
}
.portfolio-inner .portfolio-filter {
    width: 100%;
    text-align: center;
    margin-bottom: 2rem;
}
.filter-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.4rem 1.2rem;
    margin: 0.3rem 0.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}
.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, #0066ff, #0044cc);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
    transform: translateY(-2px);
}

/* Items */
.portfolio-inner .portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    background: #fff;
    transition: transform 0.3s ease;
    margin: 1rem;
    flex: 1 1 calc(25% - 2rem); /* 4 columns */
    min-width: 250px;
}
.portfolio-inner .portfolio-item:hover {
    transform: translateY(-4px);
}

/* Image wrapper */
.portfolio-item-images {
    width: 100%;
    height: 0;
    padding-bottom: 66%;          /* 3:2 aspect ratio */
    position: relative;
}
.portfolio-item-images img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Icon badge */
.portfolio-item .port-icon {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    font-size: 2rem;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    padding: 0.3rem;
    line-height: 1;
}

/* Overlay – appears on hover */
.portfolio-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.6));
    color: #fff;
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 1rem;
    transition: opacity 0.25s ease;
}
.portfolio-item:hover .portfolio-item-overlay {
    opacity: 1;
}
.portfolio-item-cat {
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: capitalize;
}

/* “View Project” button */
.portfolio-item-link {
    margin-top: 0.4rem;
    color: #fff;
    text-decoration: underline;
    font-size: 0.9rem;
}

/* Background modifiers – random visual flair */
.bg-p1 { background: #e0f7fa; }
.bg-p2 { background: #fff3e0; }
.bg-p3 { background: #e8f5e9; }
.bg-p4 { background: #f3e5f5; }
.bg-p5 { background: #ffebee; }

/* ==== Responsive ==== */
@media (max-width: 1024px) {
    .portfolio-inner .portfolio-item {
        flex: 1 1 calc(33.333% - 2rem); /* 3 columns */
    }
}
@media (max-width: 768px) {
    .portfolio-inner .portfolio-item {
        flex: 1 1 calc(50% - 2rem); /* 2 columns */
    }
}
@media (max-width: 480px) {
    .portfolio-inner .portfolio-item {
        flex: 1 1 100%;
    }
}

/* ----- Image Styles ----- */
.portfolio-item-images {
  position: relative;
  width: 100%;
  padding-bottom: 66%;
}
/* Hide default img element if present */
.portfolio-item-images > img { display: none; }
.portfolio-item-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* Removed old carousel styles */

/* ----- Modal Styles ----- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
}
.modal.active {
  display: flex;
}
.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 2rem;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
}
