/* ============================================================================
   JF Portfolio 2026 — Portfolio Loop + Modal Styles
   Pairs with: assets/js/portfolio.js + inc/cpt-portfolio.php [jf_portfolio]
   ============================================================================ */

/* ── Body lock when modal is open ────────────────────────────────────────── */
body.modal-open { overflow: hidden; }

/* ── Page Transition Overlay (orange wipe) ───────────────────────────────── */
.pf-page-transition {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  background: #ff7a1a;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.38s ease;
}
.pf-page-transition.active {
  transform: scaleX(1);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.pf-wrap {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

/* ── Filters Bar ─────────────────────────────────────────────────────────── */
.pf-filters-wrap {
  padding: 18px 0 18px;
  position: relative;
}
/* Full-viewport-width rule — breaks out of any constrained parent block */
.pf-filters-wrap::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: rgba(255, 255, 255, .07);
}
.pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.pf-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pf-filter-btn {
  border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(255, 255, 255, .04);
  color: #e4edf8;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: .2s ease;
  font-family: inherit;
  line-height: 1;
}
.pf-filter-btn:hover,
.pf-filter-btn.active {
  border-color: rgba(255, 122, 26, .34);
  background: rgba(255, 122, 26, .12);
  color: #fff;
}

/* ── View Toggle ─────────────────────────────────────────────────────────── */
.pf-view-toggle {
  display: flex;
  gap: 8px;
}
.pf-toggle-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s ease;
}
.pf-toggle-btn.active {
  border-color: rgba(255, 122, 26, .34);
  background: rgba(255, 122, 26, .12);
}

/* ── Portfolio Section ───────────────────────────────────────────────────── */
.pf-section {
  padding: 42px 0 78px;
}

/* ── Projects Grid ───────────────────────────────────────────────────────── */
.pf-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.pf-projects-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}

/* ── Rise-In Keyframe ────────────────────────────────────────────────────── */
@keyframes pfRiseIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Project Cards ───────────────────────────────────────────────────────── */
.pf-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px;
  background: #0c1a27;
  min-height: 410px;
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .25);
  transform: translateY(18px);
  opacity: 0;
  animation: pfRiseIn .65s ease forwards;
}
.pf-card:nth-child(2) { animation-delay: .08s; }
.pf-card:nth-child(3) { animation-delay: .16s; }
.pf-card:nth-child(4) { animation-delay: .24s; }
.pf-card:nth-child(5) { animation-delay: .32s; }
.pf-card:nth-child(6) { animation-delay: .40s; }

.pf-card.hidden { display: none; }

/* Orange border overlay on hover */
.pf-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: .24s ease;
}
.pf-card:hover::after {
  border-color: rgba(255, 122, 26, .58);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, .12);
}

/* ── Card Media ──────────────────────────────────────────────────────────── */
.pf-card-media {
  height: 230px;
  overflow: hidden;
  background: #0d1824;
}
.pf-card-shot {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  transition: transform .42s ease;
}
/* Wireframe card hover scale */
.pf-card:hover .pf-card-shot {
  transform: scale(1.045);
}

/* ── Card featured image ─────────────────────────────────────────────────── */
/* Sits directly in .pf-card-media, fills the full area, no chrome */
.pf-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform .42s ease;
}
.pf-card:hover .pf-card-img {
  transform: scale(1.045);
}

/* ── Mini Wireframe Browser ──────────────────────────────────────────────── */
.pf-browser {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, .93);
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .35);
  color: #0f172a;
}
.pf-browser-top {
  height: 22px;
  background: #eef2f7;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 10px;
}
.pf-browser-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8d1dd;
}
.pf-browser-content { padding: 13px; }
.pf-fake-nav {
  height: 12px;
  width: 38%;
  border-radius: 20px;
  background: #d5dce6;
  margin-bottom: 12px;
}
.pf-fake-hero {
  height: 72px;
  border-radius: 9px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .18);
}
.pf-fake-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pf-fake-box {
  height: 45px;
  border-radius: 8px;
  background: #e5eaf1;
}

/* ── Card Body ───────────────────────────────────────────────────────────── */
.pf-card-body { padding: 24px; }
.pf-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.pf-card-title {
  margin: 0;
  font-size: 25px;
  letter-spacing: -.035em;
  line-height: 1.05;
  color: #fff;
}
.pf-card-year {
  color: #ff7a1a;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 3px;
}
.pf-card-desc {
  color: #aeb9c7;
  font-size: 14px;
  margin: 12px 0 18px;
  min-height: 42px;
  line-height: 1.6;
}
.pf-card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-card-tag {
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  color: #d8e4f2;
  background: rgba(255, 255, 255, .035);
  font-weight: 800;
}

/* ── Case CTA (slides up on hover) ──────────────────────────────────────── */
.pf-case-cta {
  position: absolute;
  right: 20px;
  bottom: 20px;
  color: #fff;
  background: #ff7a1a;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 950;
  transform: translateY(14px);
  opacity: 0;
  transition: .24s ease;
  pointer-events: none;
  z-index: 2;
}
.pf-card:hover .pf-case-cta {
  transform: translateY(0);
  opacity: 1;
}

/* ── Compact Grid Adjustments ────────────────────────────────────────────── */
.pf-projects-grid.compact .pf-card        { min-height: 350px; }
.pf-projects-grid.compact .pf-card-media  { height: 170px; }
.pf-projects-grid.compact .pf-card-title  { font-size: 21px; }
.pf-projects-grid.compact .pf-card-desc   { display: none; }

/* ── Modal Backdrop ──────────────────────────────────────────────────────── */
.pf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 8, 14, .72);
  backdrop-filter: blur(10px);
  display: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.pf-modal-backdrop.active {
  display: block;
  opacity: 1;
}

/* ── Case Modal ──────────────────────────────────────────────────────────── */
.pf-case-modal {
  position: fixed;
  inset: 34px;
  z-index: 210;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 26px;
  background: #07111b;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .68);
  display: none;
  overflow: hidden;
  transform: scale(.96) translateY(22px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .28s ease;
}
.pf-case-modal.active {
  display: block;
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Close button */
.pf-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: .2s ease;
}
.pf-modal-close:hover { background: rgba(255, 255, 255, .16); }

/* ── Modal Inner Two-Panel Layout ────────────────────────────────────────── */
.pf-case-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}

/* ── Left Panel — Visual ─────────────────────────────────────────────────── */
.pf-case-visual {
  position: relative;
  overflow: hidden;
  background: var(--pf-modal-bg, linear-gradient(135deg, #0f172a, #1e3a8a));
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pf-case-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 18%, rgba(255, 255, 255, .18), transparent 28%);
  pointer-events: none;
}

/* Wireframe browser in modal — slides up on open */
.pf-case-browser {
  position: relative;
  height: min(55vh, 520px);
  transform: translateY(30px);
  opacity: 0;
  transition: .45s ease .1s;
}
.pf-case-modal.active .pf-case-browser {
  transform: translateY(0);
  opacity: 1;
}

/* ── Modal featured image ────────────────────────────────────────────────── */
.pf-case-img-wrap {
  /* display set to 'flex' by JS when image exists */
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;     /* allow flex child to shrink below content size */
  padding: 32px;
  position: relative;
  z-index: 1;
}
.pf-case-img {
  /* Contain inside the panel — never stretches or squishes */
  max-width: 100%;
  max-height: min(55vh, 500px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  transform: translateY(30px);
  opacity: 0;
  transition: .45s ease .1s;
}
.pf-case-modal.active .pf-case-img {
  transform: translateY(0);
  opacity: 1;
}

/* ── Gallery Trigger Button (top-right of left panel) ───────────────────── */
.pf-gallery-trigger {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .20);
  background: rgba(0, 0, 0, .38);
  color: rgba(255, 255, 255, .65);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.pf-gallery-trigger:hover {
  background: rgba(255, 122, 26, .22);
  border-color: rgba(255, 122, 26, .5);
  color: #fff;
}

/* ── Full-Screen Gallery Lightbox ────────────────────────────────────────── */
.pf-gallery-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility 0s linear .28s;
}
.pf-gallery-backdrop.active {
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease, visibility 0s linear 0s;
}

.pf-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 410;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 72px 80px 32px; /* top: room for close btn; sides: room for arrows */
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(.96);
  transition: opacity .3s ease, transform .42s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .3s;
}
.pf-gallery-lightbox.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity .3s ease, transform .42s cubic-bezier(.22, 1, .36, 1), visibility 0s linear 0s;
}

/* ── Gallery Image ───────────────────────────────────────────────────────── */
.pf-gallery-img-wrap {
  max-width: 1240px;
  width: 100%;
  display: flex;
  justify-content: center;
}
.pf-gallery-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .06);
  transition: opacity .2s ease;
}

/* ── Gallery Close Button ────────────────────────────────────────────────── */
.pf-gallery-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 420;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(7, 17, 27, .75);
  color: #fff;
  font-size: 24px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  backdrop-filter: blur(8px);
  transition: background .2s ease, border-color .2s ease;
}
.pf-gallery-close:hover {
  background: rgba(255, 122, 26, .25);
  border-color: rgba(255, 122, 26, .55);
}

/* ── Gallery Nav Arrows ──────────────────────────────────────────────────── */
.pf-gallery-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 420;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(7, 17, 27, .75);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.pf-gallery-prev { left: 16px; }
.pf-gallery-next { right: 16px; }
.pf-gallery-nav:hover {
  background: rgba(255, 122, 26, .22);
  border-color: rgba(255, 122, 26, .5);
  transform: translateY(-50%) scale(1.08);
}
.pf-gallery-nav:active { transform: translateY(-50%) scale(.96); }

/* ── Gallery Dots ────────────────────────────────────────────────────────── */
.pf-gallery-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pf-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background .2s ease, transform .2s ease;
}
.pf-gallery-dot.active {
  background: #ff7a1a;
  transform: scale(1.4);
}
.pf-gallery-dot:hover:not(.active) { background: rgba(255, 255, 255, .55); }

/* ── Project Images Thumbnail Grid ──────────────────────────────────────── */
.pf-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.pf-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .07);
  transition: border-color .2s ease, transform .2s ease;
  position: relative;
}
.pf-thumb:hover {
  border-color: rgba(255, 122, 26, .65);
  transform: scale(1.04);
}
.pf-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Right Panel — Content ───────────────────────────────────────────────── */
.pf-case-content {
  overflow: auto;
  padding: 54px 48px 44px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 122, 26, .12), transparent 20%),
    #08131e;
}

/* ── Custom Scrollbar (right panel) ──────────────────────────────────────── */
.pf-case-content::-webkit-scrollbar {
  width: 5px;
}
.pf-case-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
  border-radius: 999px;
}
.pf-case-content::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 26, .50);
  border-radius: 999px;
}
.pf-case-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 26, .80);
}
/* Firefox */
.pf-case-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 122, 26, .50) rgba(255, 255, 255, .04);
}

/* ── Modal Typography ────────────────────────────────────────────────────── */
.pf-case-kicker {
  color: #ff7a1a;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .22em;
  margin: 0 0 12px;
}
.pf-case-title {
  margin: 0;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -.055em;
  color: #fff;
}
.pf-case-summary {
  color: #aeb9c7;
  font-size: 16px;
  line-height: 1.75;
  margin: 20px 0 28px;
}

/* ── Meta Grid ───────────────────────────────────────────────────────────── */
.pf-case-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.pf-meta-card {
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  padding: 14px;
}
.pf-meta-card span {
  display: block;
  color: #768392;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 6px;
}
.pf-meta-card strong { font-size: 14px; color: #fff; }

/* ── Case Sections — stagger in on open ─────────────────────────────────── */
.pf-case-section {
  border-top: 1px solid rgba(255, 255, 255, .11);
  padding-top: 22px;
  margin-top: 22px;
  transform: translateY(16px);
  opacity: 0;
  transition: .36s ease;
}
.pf-case-modal.active .pf-case-section                     { transform: translateY(0); opacity: 1; }
.pf-case-modal.active .pf-case-section:nth-of-type(2)      { transition-delay: .12s; }
.pf-case-modal.active .pf-case-section:nth-of-type(3)      { transition-delay: .20s; }
.pf-case-modal.active .pf-case-section:nth-of-type(4)      { transition-delay: .28s; }

.pf-case-section h3 { margin: 0 0 10px; font-size: 18px; color: #fff; }

/* WYSIWYG output styling */
.pf-wysiwyg        { color: #aeb9c7; font-size: 15px; line-height: 1.7; }
.pf-wysiwyg p      { margin: 0 0 12px; }
.pf-wysiwyg ul     { padding-left: 18px; margin: 0 0 12px; }
.pf-wysiwyg ol     { padding-left: 18px; margin: 0 0 12px; }
.pf-wysiwyg li     { margin-bottom: 5px; }
.pf-wysiwyg strong { color: #fff; }
.pf-wysiwyg em     { color: #c8d6e4; }
.pf-wysiwyg a      { color: #ff7a1a; text-decoration: underline; }

/* ── Tools & Skills Pills ────────────────────────────────────────────────── */
.pf-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-tool {
  border: 1px solid rgba(255, 122, 26, .26);
  background: rgba(255, 122, 26, .10);
  color: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

/* ── Case Actions ────────────────────────────────────────────────────────── */
/* Buttons use the theme's .btn / .btn-primary / .btn-outline from main.css  */
.pf-case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1050px) {
  .pf-case-inner               { grid-template-columns: 1fr; height: auto; }
  .pf-case-modal               { inset: 18px; overflow: auto; }
  .pf-case-visual              { min-height: 410px; }
  .pf-projects-grid,
  .pf-projects-grid.compact    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 740px) {
  .pf-wrap                      { width: calc(100% - 30px); }
  .pf-projects-grid,
  .pf-projects-grid.compact     { grid-template-columns: 1fr; }
  .pf-card                      { min-height: auto; }
  .pf-filters                   { align-items: flex-start; }
  .pf-case-modal {
    inset: auto 0 0 0;
    height: 92vh;
    border-radius: 24px 24px 0 0;
  }
  .pf-case-content              { padding: 40px 24px; }
  .pf-case-title                { font-size: 38px; }
  .pf-case-meta                 { grid-template-columns: 1fr; }
  .pf-case-visual               { padding: 24px; min-height: 310px; }
  .pf-case-browser              { height: 260px; }
  .pf-gallery-trigger           { top: auto; bottom: 16px; }
}
