/*-----------------------------------------------------------------------------------

    portfolio.css
    Styles for the portfolio listing page (category tabs + project cards)
    and the shared project case-study (detail page) template.
    Additive only — relies on tokens/colors already defined in style.css.

-----------------------------------------------------------------------------------*/

/* ============================= Shared: project grid wrapper ============================= */

/*
   Deliberately NOT using the theme's ".gallery" class here — scripts.js runs
   Isotope masonry on every ".gallery" element at page load, which breaks a
   panel that starts out [hidden] (Isotope measures zero size and every card
   collapses onto the same spot). This is a plain responsive grid, so we skip
   Isotope entirely.
*/
.pf-gallery {
  margin-left: -15px;
  margin-right: -15px;
}

.pf-gallery .items {
  margin-top: 40px;
}

/* "All" view — flatten both galleries so every card flows in one
   continuous row grid (no break between the dynamic and static blocks). */
#pf-panels[data-view="all"] {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}

#pf-panels[data-view="all"] > .pf-gallery,
#pf-panels[data-view="all"] > .pf-gallery > .row {
  display: contents;
}

/* ============================= Shared: tab filter bar ============================= */

.pf-tabs {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 50px;
}

.pf-tabs.justify-center {
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.pf-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
  padding: 12px 26px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.35s ease;
}

.pf-tab:hover {
  border-color: rgba(40, 233, 140, 0.5);
  color: #fff;
}

.pf-tab.active {
  background: var(--maincolor);
  border-color: var(--maincolor);
  color: #0c0c0c;
  box-shadow: 0 10px 25px -8px rgba(40, 233, 140, 0.55);
}

.pf-panel[hidden] {
  display: none !important;
}

/* ============================= Listing: placeholder thumbnails ============================= */

.pf-thumb {
  --c1: var(--maincolor);
  --c2: #0c0c0c;
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(140deg, var(--c1) 0%, rgba(12, 12, 12, 0.92) 60%, var(--c2) 100%);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  text-align: center;
}

.pf-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.5;
}

.pf-thumb .pf-thumb-icon {
  position: relative;
  z-index: 2;
  font-size: 42px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 10px;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Real screenshot in place of a placeholder thumbnail — sized to the
   image's own natural ratio, so it's never cropped (cover) or letterboxed
   (contain); the box simply takes the image's real shape. */
.pf-thumb-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.pf-thumb .pf-thumb-label {
  position: relative;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(12, 12, 12, 0.35);
  padding: 4px 12px;
  border-radius: 30px;
}

/* Tech-stack mini pills inside a listing card */
.pf-stack-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pf-stack-pill {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 30px;
  white-space: nowrap;
}

/* Empty state (Static Websites tab) */
.pf-empty {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 80px 30px;
  text-align: center;
}

.pf-empty .icon {
  font-size: 48px;
  color: var(--maincolor);
  display: block;
  margin-bottom: 20px;
}

.pf-empty h5 {
  margin-bottom: 10px;
}

.pf-empty p {
  color: rgba(255, 255, 255, 0.6);
  max-width: 420px;
  margin: 0 auto;
}

/* ============================= Detail (case-study) page ============================= */

.case-hero {
  --accent: var(--maincolor);
  padding-top: 40px;
}

.case-hero .back-link {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 32px;
  transition: color 0.3s ease;
}

.case-hero .back-link:hover {
  color: var(--maincolor);
}

.case-hero .back-link svg {
  width: 14px;
  stroke: currentColor;
  fill: none;
}

.case-badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 20px;
}

.case-hero h1 {
  margin-bottom: 18px;
}

.case-hero .tagline {
  color: rgba(255, 255, 255, 0.75);
  max-width: 780px;
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 30px;
}

.case-stack-pills {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 35px;
}

.case-stack-pills span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 30px;
}

.case-cta-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 55px;
}

/* Stat chips */
.case-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 35px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 70px;
}

.case-stat {
  text-align: center;
  padding: 0 10px;
}

.case-stat h4 {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.4;
}

.case-stat span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

/* Section heading spacing reuse */
.case-section {
  margin-bottom: 80px;
}

/* Gallery — always two screenshots per row */
.case-gallery-grid,
.case-gallery-grid.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.case-gallery-tile {
  --c1: var(--maincolor);
  --c2: #0c0c0c;
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--c1) 0%, rgba(12, 12, 12, 0.94) 65%, var(--c2) 100%);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: end;
  -ms-flex-align: end;
  align-items: flex-end;
  padding: 16px;
  transition: transform 0.4s ease;
}

.case-gallery-tile:hover {
  transform: translateY(-4px);
}

.case-gallery-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.14) 1px, transparent 0);
  background-size: 16px 16px;
}

.case-gallery-tile .tile-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.55);
}

.case-gallery-tile span {
  position: relative;
  z-index: 2;
  font-size: 12.5px;
  color: #fff;
  background: rgba(12, 12, 12, 0.4);
  padding: 5px 12px;
  border-radius: 30px;
}

/* Real screenshot in place of a placeholder gallery tile — sized to the
   image's own natural ratio (no cover crop, no contain letterboxing); the
   tile's height simply follows the image at the grid column's width. */
.case-gallery-tile.has-img {
  aspect-ratio: auto;
  height: auto;
  display: block;
  padding: 0;
}

.case-gallery-tile.has-img img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
}

.case-gallery-tile.has-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 55%);
  z-index: 1;
}

.case-gallery-tile.has-img span {
  position: absolute;
  left: 16px;
  bottom: 16px;
}

/* Feature icon cards */
.case-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 25px;
}

.case-feature {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 16px;
}

.case-feature .ico {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
}

.case-feature h6 {
  margin-bottom: 6px;
  font-size: 15.5px;
}

.case-feature p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
}

/* Tech stack groups */
.case-tech-group {
  margin-bottom: 26px;
}

.case-tech-group h6 {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.case-tech-pills {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 10px;
}

.case-tech-pills span {
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 16px;
  border-radius: 30px;
  transition: all 0.3s ease;
}

.case-tech-pills span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Architecture / prose block */
.case-prose p {
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.85;
  font-size: 15px;
  margin-bottom: 18px;
}

.case-prose p:last-child {
  margin-bottom: 0;
}

/* Footer CTA band */
.case-footer-cta {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(40, 233, 140, 0.08), transparent 60%);
}

.case-footer-cta h3 {
  margin-bottom: 16px;
}

.case-footer-cta p {
  color: rgba(255, 255, 255, 0.6);
  max-width: 520px;
  margin: 0 auto 30px;
}

.case-footer-cta .case-cta-row {
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-bottom: 0;
}

/* ============================= Responsive ============================= */

@media (max-width: 991px) {
  .case-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 20px;
  }

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

@media (max-width: 767px) {
  .pf-tabs {
    gap: 10px;
    margin-bottom: 36px;
  }

  .pf-tab {
    padding: 10px 18px;
    font-size: 13px;
  }

  /* ---- detail (case-study) page ---- */
  .case-hero {
    padding-top: 24px;
  }

  .case-hero h1 {
    font-size: 30px;
    line-height: 1.25;
  }

  .case-hero .tagline {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .case-stack-pills {
    margin-bottom: 26px;
  }

  .case-cta-row {
    gap: 10px;
    margin-bottom: 42px;
  }

  .case-cta-row .butn {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 100%;
    flex: 1 1 100%;
    text-align: center;
  }

  .case-footer-cta .case-cta-row .butn {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
  }

  .case-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
    padding: 28px 0;
    margin-bottom: 48px;
  }

  .case-stat {
    padding: 0;
  }

  .case-stat h4 {
    font-size: 15px;
  }

  .case-section {
    margin-bottom: 52px;
  }

  .case-section .sec-head h3 {
    font-size: 26px;
  }

  .case-gallery-grid,
  .case-gallery-grid.cols-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .case-features {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .case-feature .ico {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .case-prose p {
    font-size: 14.5px;
    line-height: 1.75;
  }

  .case-footer-cta {
    padding: 40px 20px;
  }
}
