/* =========================================================
   SATOTA — Projects / Portfolio page
   Builds on style.css tokens. Scoped to .pf-* classes.
   ========================================================= */

/* ---------- Hero ---------- */
.pf-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--nav-h) + 40px) 0 44px;
}
@media (min-width: 768px) {
  .pf-hero { padding: calc(var(--nav-h) + 64px) 0 60px; }
}
.pf-hero__title {
  font-family: var(--font-bn-serif);
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 6px 0 12px;
}
@media (min-width: 768px) { .pf-hero__title { font-size: 42px; } }
.pf-hero__sub {
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
}
@media (min-width: 768px) { .pf-hero__sub { font-size: 16.5px; } }

/* Tighten the gap between hero and the grid */
.pf-hero + .section { padding-top: 36px; }
@media (min-width: 768px) { .pf-hero + .section { padding-top: 48px; } }

/* ---------- Toolbar: filters + count ---------- */
.pf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}
.pf-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pf-filter {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-bn);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pf-filter:hover { border-color: var(--gold); }
.pf-filter.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
}
.pf-count { color: var(--muted); font-size: 13.5px; font-family: var(--font-en); }

.pf-state {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

#pfMore { text-align: center; margin-top: 32px; }

/* ---------- Card grid ---------- */
.pf-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .pf-grid { grid-template-columns: repeat(3, 1fr); gap: 26px; } }

.pf-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.pf-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pf-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
}
.pf-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease);
}
.pf-card:hover .pf-card__media img { transform: scale(1.045); }

.pf-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(11, 31, 51, 0.82);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(3px);
}
.pf-card__count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(11, 31, 51, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: var(--font-en);
}

.pf-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px 18px;
  flex: 1;
}
.pf-card__title {
  font-family: var(--font-bn-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
}
.pf-card__meta { color: var(--muted); font-size: 13px; }
.pf-card__cta {
  margin-top: auto;
  padding-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
}
.pf-card__cta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease);
}
.pf-card:hover .pf-card__cta svg { transform: translateX(3px); }

/* ---------- Detail view ---------- */
body.pf-lock { overflow: hidden; }

/* When closed the overlay MUST be fully gone — otherwise this fixed,
   full-viewport element sits on top of the page and silently eats every
   click (nav links, project cards, everything). */
.pf-detail[hidden] { display: none !important; }

.pf-detail {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.pf-detail__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 30, 0.72);
  backdrop-filter: blur(3px);
}
.pf-detail__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  height: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 1000px) {
  .pf-detail { padding: 32px 20px; align-items: center; }
  .pf-detail__panel { height: auto; max-height: 100%; border-radius: var(--radius-md); }
}
.pf-detail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pf-detail__back {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.pf-detail__back:hover { color: var(--gold); }
.pf-detail__close {
  appearance: none;
  border: none;
  background: var(--bg);
  color: var(--charcoal);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.pf-detail__close:hover { background: var(--border-strong); }

.pf-detail__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 40px;
}
@media (min-width: 768px) { .pf-detail__scroll { padding: 32px 40px 48px; } }

.pf-detail__head { margin-bottom: 14px; }
.pf-detail__head h2 {
  font-family: var(--font-bn-serif);
  font-size: 24px;
}
@media (min-width: 768px) { .pf-detail__head h2 { font-size: 30px; } }
.pf-detail__code {
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 13px;
  margin-top: 4px;
}
.pf-detail__overview {
  color: var(--charcoal);
  font-size: 15px;
  margin-bottom: 20px;
  max-width: 640px;
}

.pf-info {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 26px;
  font-size: 14px;
}
.pf-info th,
.pf-info td {
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.pf-info th {
  width: 38%;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
}
@media (min-width: 560px) { .pf-info th { width: 30%; } }

.pf-detail__gh {
  font-family: var(--font-bn-serif);
  font-size: 18px;
  margin-bottom: 14px;
}
.pf-gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .pf-gallery { grid-template-columns: repeat(2, 1fr); } }
.pf-gallery__item {
  appearance: none;
  border: 1px solid var(--border);
  padding: 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}
.pf-gallery__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf-gallery__item:hover img { opacity: 0.92; }
.pf-gallery__item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pf-detail__cta { margin-top: 30px; }

/* ---------- Lightbox ---------- */
.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(6, 14, 24, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pf-lightbox__stage {
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pf-lightbox__stage img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.pf-lightbox__stage figcaption {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  text-align: center;
}
.pf-lightbox__close,
.pf-lightbox__nav {
  position: absolute;
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease);
}
.pf-lightbox__close:hover,
.pf-lightbox__nav:hover { background: rgba(255, 255, 255, 0.24); }
.pf-lightbox__close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
}
.pf-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 64px;
  border-radius: 8px;
  font-size: 30px;
}
.pf-lightbox__nav--prev { left: 12px; }
.pf-lightbox__nav--next { right: 12px; }
@media (min-width: 768px) {
  .pf-lightbox__nav--prev { left: 28px; }
  .pf-lightbox__nav--next { right: 28px; }
}
.pf-lightbox__counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .pf-card, .pf-card__media img, .pf-card__cta svg { transition: none; }
  .pf-card:hover { transform: none; }
}
