/* =====================================================
   RESET & BASE
===================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #EAEAEA;
  color: #000000;
  line-height: 1.6;
  font-family: "Titillium Web";
}

/* =====================================================
   PORTFOLIO HERO
===================================================== */
.portfolio-hero {
  max-width: 1800px;
  margin: 150px auto 3rem;
  padding-inline: clamp(1.5rem, 5vw, 4rem);
  display: grid;
  place-items: center;
  text-align: center;
}

.portfolio-hero h1 {
  font-size: clamp(2.2rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* =====================================================
   FILTERS
===================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  justify-content: center;
}

.filters button {
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  border: 1px solid #868686;
  background: #E6E6E6;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 20px;
}

.filters button:hover {
  background: #3cb371;
}

.filters button.active {
  color: #fff;
  font-weight: 600;
  border: 2px solid #4DAF86;
  background: #3DD092;
}

/* =====================================================
   VIEW SWITCHING (FIXED)
===================================================== */
.view {
  display: none;
}

.view.active-view {
  display: block;
}

/* =====================================================
   GRID BASE (UNCHANGED DESIGN)
===================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: clamp(1.25rem, 2vw, 1.75rem);
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
  margin-bottom: clamp(3rem, 5vw, 5rem);
}

/* Exited grid */
.grid.exited {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* =====================================================
   CARD BASE
===================================================== */
.card-all,
.card-small {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  height: 300px;
  width: 100%;
  position: relative;
  overflow: hidden;
  contain: content;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card-all:hover,
.card-small:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

/* ============================= */
/* FLIP EFFECT */
/* ============================= */

.flip-card {
  perspective: 1200px;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

/* ============================= */
/* FRONT & BACK */
/* ============================= */

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  z-index: 3;
  pointer-events: none;
}

/* Badge Text */
.badge-text {
  position: absolute;
  top: 10px;
  right: 48px; /* space for badge icon */
  font-size: 20px;
  font-weight: 600;
  z-index: 3;
  pointer-events: none;
}
/* FRONT */
.flip-front img {
  max-width: 90%;
  max-height: 70%;
}

/* BACK */
.flip-back {
  background: #ffffff;
  padding: 24px;
  transform: rotateY(180deg);
  flex-direction: column;
  text-align: center;
}

/* Description */
.flip-back p {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

/* ============================= */
/* CTA LINK */
/* ============================= */

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.card-cta:hover {
  background: #b4b4b4;
  transform: translateY(-1px);
}

/* ============================= */
/* SMALL CARD */
/* ============================= */

.card-small {
  height: 220px;
}

.card-small .flip-back p {
  font-size: 0.85rem;
}

/* =====================================================
   EXITED SECTION TEXT
===================================================== */

.section-subtitle {
  font-size: clamp(1rem, 2.9vw, 2.8rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  margin-left: 100px;
}

.grid.exited .card-small {
  height: 220px;
  opacity: 0.85;
}

/* ==== EXITED LIST ====== */
.exited-list {
  max-width: 1200px;
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ======== EXITED CARD =========== */
.exited-card {
  display: grid;
  grid-template-columns: 0.8fr 40px 1.2fr;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 20px;
  padding: 2rem;
}

/* =====================================================
   LEFT – LOGO
===================================================== */
.exited-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.exited-left img {
  object-fit: contain;
  max-width: 400px;
  max-height: 300px;
}

/* Exited Grid Static Cards */
#exitedGrid .card-front {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#exitedGrid .card-front img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* =====================================================
   DIVIDER
===================================================== */
/* .exited-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
} */

.exited-divider img {
  height: 80%;
  width: auto;
}

/* =====================================================
   CENTER – CONTENT
===================================================== */
.exited-center .label {
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.exited-center .desc {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 1.2rem;
  max-width: 620px;
}

.exited-center {
  position: relative; /* important */
}

.top-tag {
  position: absolute;
  top: -60px;
  right: 15px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}
.top-tag img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

/* =====================================================
   META
===================================================== */
.meta {
  text-align: left;
}

.visit-label {
  display: block;
  font-weight: 600;
}

.meta a {
  font-size: 1rem;
  color: #0066cc;
  word-break: break-all;
}

.meta a:hover {
  text-decoration: underline;
}

/* =====================================================
   EXITED VIEW (ONLY EXITED)
===================================================== */
.view-exited .grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.view-exited .card-small {
  height: 160px;
  opacity: 0.75;
}

/* =====================================================
   RESPONSIVE GRIDS
===================================================== */
@media (min-width: 1920px) {
  .grid,
  .grid.exited {
    max-width: 1800px;
  }
}

@media (min-width: 1500px) {
  .grid,
  .grid.exited {
    max-width: 1600px;
    gap: 2.5rem;
  }

  .card-all,
  .card-small {
    height: 260px;
  }
}

@media (max-width: 1024px) {
  .grid,
  .grid.exited {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
  }
  .exited-list{
    max-width: 750px;
  }

  .view-exited .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-all {
    height: 260px;
  }

  .card-small {
    height: 200px;
  }

  .portfolio-hero {
    margin: 120px auto 2.5rem;
  }

  .filters button {
    font-size: 18px;
  }
  .top-tag{
    top:-35px;
  }
}

@media (max-width: 768px) {
 .exited-list{
  max-width: 600px;
 }
 
  .card-divider {
    display: none;
  }
  .grid,
  .grid.exited {
    grid-template-columns: 1fr;
    max-width: 600px;
    gap: 1.5rem;
  }

  .view-exited .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-hero {
    margin: 100px auto 2rem;
    padding-inline: 1.2rem;
  }

  .portfolio-hero h1 {
    font-size: 1.9rem;
  }

  .filters {
    gap: 0.5rem;
  }

  .filters button {
    font-size: 15px;
    padding: 0.45rem 1rem;
  }

  .card-all {
    height: 240px;
  }

  .card-small {
    height: 180px;
  }

  .flip-back {
    padding: 18px;
  }

  .exited-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .exited-left img {
    max-width: 100%;
    max-height: 200px;
  }

  .top-tag {
    position: static;
    margin-bottom: 0.5rem;
    text-align: right;
  }

  .section-subtitle {
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .grid,
  .grid.exited {
    grid-template-columns: 1fr;
    max-width: 380px;
  }

  .section-subtitle {
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .portfolio-hero {
    margin: 180px auto 2.5rem;
  }
  .filters {
    gap: 1.4rem;
  }
  .portfolio-hero h1 {
    font-size: 1.6rem;
  }

  .filters button {
    font-size: 13px;
    padding: 0.4rem 0.8rem;
  }

  .view-exited .grid {
    grid-template-columns: 1fr;
  }

  .card-all {
    height: 220px;
  }

  .card-small {
    height: 160px;
  }

  .flip-back {
    padding: 14px;
  }

  .flip-back p {
    font-size: 0.8rem;
  }

  .card-cta {
    font-size: 0.75rem;
    padding: 8px 14px;
  }

  .exited-left img {
    max-height: 160px;
  }

  .top-tag {
    font-size: 16px;
  }
  .exited-list{
    max-width: 350px;
  }
  .exited-card{
    grid-template-columns: 1fr;
    gap:0;
  }
}