/* 12) PORTFOLIO PAGE */
.portfolio-page {
  background: #fff;
  color: #111;
}

.portfolio-container {
  max-width: calc(100% - 260px); /* 130px gutters each side */
  margin: 0 auto;
  padding: 5rem 1rem;
}

/* Header */
.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5rem;
}
.portfolio-header h1 {
  font-size: 2.5rem;
  margin: 0;
}
.portfolio-header .btn-outline {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.portfolio-header .btn-outline:hover {
  background: #f0f0f0;
}

/* Empty state */
.no-projects {
  text-align: center;
  color: #888;
  font-size: 1.25rem;
  margin: 4rem 0;
}

/* Portfolio list */
/* make the list center its items */
.portfolio-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

/* cap the card’s width but still let the badge overflow */
.portfolio-card {
  position: relative;
  overflow: visible;      /* keep the badge from getting clipped */
  width: 100%;
  max-width: 48rem;       /* <-- whatever max width you prefer */
  margin: 0 auto;         /* center it in the list */
  background: #f8f8f8;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Top bar */
.card-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #ddd;
}
.card-topbar .agency-logo img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}
.card-topbar .client-name {
  font-weight: 500;
  font-size: 1rem;
  margin-right: 6rem;           /* make room for badge */
}

/* Screenshot */
.card-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.card-topbar{
   border-top-left-radius: 1rem;  /* match the card’s rounding */
   border-top-right-radius: 1rem;
}

/* Client badge overlaps image/details */
.client-badge {
  position: absolute;
  top: 1.25rem;        /* near top of the card */
  right: 1rem;
  width: 4.5rem;       /* 72px */
  height: 4.5rem;      /* 72px */
  border: 3px solid #000;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
#project-cta{
    background-color: white;
    padding: 0.8rem 1.8rem;
}
.client-badge img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Always apply .btn-light styling */
.btn-light {
  background: #e0e0e0;
  color: #111;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.btn-light:hover {
  background: #d0d0d0;
  color: #000;
}

/* Details row */

.card-details .details-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.card-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  gap: 1rem;
  background: #ddd;
     border-bottom-left-radius: 1rem;  /* match the card’s rounding */
   border-bottom-right-radius: 1rem;
}
.card-details .details-left .project-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.card-details .details-left .project-location {
  font-size: 1rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* 1) Make the card a column-flex so its children stack */
.portfolio-card {
  display: flex;
  flex-direction: column;
  
}

/* 2) Enforce a fixed aspect ratio (e.g. 16:9) on the screenshot area */
.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;    /* prevent this area from collapsing */
}

/* 3) Have the <img> fully cover that area */
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 4) Let the details row sit at the bottom naturally */
.card-details {
  flex-shrink: 0;
}

/* Pagination */
.pagination {
  margin: 3rem 0;
  text-align: center;
}
.pagination a {
  margin: 0 0.5rem;
  text-decoration: none;
  color: #111;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
}
.pagination a.active {
  font-weight: 700;
}
.pagination a:hover {
  color: #000;
}
.agency-logo{
  width: 50px;
  border-radius: 400px;
}

/* Responsive */

/* Medium desktops and tablets */
@media (max-width: 1024px) {
    .portfolio-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;   /* you already have this in your responsive CSS */
    align-items: stretch;
  }
  .portfolio-card {
    max-width: 100%;
    margin: 0;
  }
  .portfolio-container {
    padding: 3rem 1rem;
  }
  .portfolio-header h1 {
    font-size: 2rem;
  }
  .portfolio-header .btn-outline {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
  /* shrink side gutters so cards can grow */
  .portfolio-container {
    max-width: 100%;
  }
  /* let cards stretch to full width */
  .portfolio-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;   /* you already have this in your responsive CSS */
    align-items: stretch;
  }
  .portfolio-card {
    max-width: 100%;
    margin: 0;
  }
  .portfolio-card {
    max-width: 100%;
    margin: 0;
  }


  /* Hide agency logo */
  .agency-logo {
    display: none;
  }
  /* Shrink badge */
  .client-badge {
    width: 3.5rem;
    height: 3.5rem;
    top: 1rem;
    right: 0.75rem;
    border-width: 2px;
  }
  .card-topbar .client-name {
    margin-right: 5rem;
  }
}
/* Stack the “Learn More” button under title+location on narrow screens */
@media (max-width: 590px) {
  .card-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* move the CTA into its own line */
  .card-details .btn-light {
    order: 1;       /* ensure it comes after the text block */
    margin-top: 0;  /* remove any auto margins */
  }

  /* make sure your title+location block stays first */
  .card-details .details-left {
    order: 0;
  }
}
/* Small phones */
@media (max-width: 480px) {
  /* even tighter side gutters */
  .portfolio-container {
    max-width: 100%;
  }
  .portfolio-header {
    flex-direction: column;
    gap: 2rem;
  }
  .portfolio-header .btn-outline {
    align-self: center;
  }
  .portfolio-list {
    gap: 1rem;
    align-items: stretch;
  }
  .portfolio-card {
    max-width: 100%;
    margin: 0;
  }
  /* Top bar becomes vertical to clear space */
  .card-topbar {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 2.5rem;   /* space for badge */
  }
  .card-topbar .client-name {
    margin-right: 0;
  }
  /* Hide agency logo */
  .agency-logo {
    display: none;
  }
  /* Badge smaller and closer to top-left */
  .client-badge {
    top: 0.5rem;
    right: 0.5rem;
    width: 3rem;
    height: 3rem;
    border-width: 2px;
  }
}