/* ============================================
   GABRIEL CRESPO — Photography Portfolio
   portfolio.css
   Loaded alongside the site-wide styles.css,
   which provides the design tokens, navbar,
   footer, buttons, and reveal animations.
   ============================================ */

/* === PAGE INTRO / HEADER === */
.pf-head {
  padding-top: 160px;
  padding-bottom: 24px;
}

.pf-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 28px;
  transition: gap var(--duration) var(--ease), color var(--duration) var(--ease);
}

.pf-breadcrumb svg { flex-shrink: 0; }

.pf-breadcrumb:hover {
  color: var(--text-primary);
  gap: 12px;
}

.pf-head__tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
}

.pf-head__title {
  font-family: var(--font-sans);
  font-size: clamp(44px, 8vw, 80px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.pf-head__subtitle {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 620px;
}

.pf-head__count {
  display: inline-block;
  margin-top: 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-light);
}

/* === CATEGORY INDEX GRID (portfolio landing) === */
.pf-cats {
  padding-top: 40px;
  padding-bottom: var(--section-pad);
}

.pf-cats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pf-cat {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--bg-secondary);
  aspect-ratio: 4 / 5;
  isolation: isolate;
}

.pf-cat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  z-index: 0;
}

.pf-cat::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(17, 17, 17, 0.72) 0%,
    rgba(17, 17, 17, 0.28) 42%,
    rgba(17, 17, 17, 0) 72%
  );
  transition: opacity var(--duration) var(--ease);
}

.pf-cat:hover img,
.pf-cat:focus-visible img { transform: scale(1.05); }

.pf-cat__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.pf-cat__name {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.1;
}

.pf-cat__count {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
}

.pf-cat__arrow {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.pf-cat:hover .pf-cat__arrow,
.pf-cat:focus-visible .pf-cat__arrow {
  background: rgba(255, 255, 255, 0.26);
  transform: translateX(3px);
}

.pf-cat--empty { pointer-events: none; }

.pf-cat--empty::after { background: rgba(17, 17, 17, 0.55); }

.pf-cat__placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  background: repeating-linear-gradient(
    45deg, var(--bg-secondary), var(--bg-secondary) 12px,
    #efefe9 12px, #efefe9 24px
  );
}

/* === MASONRY GALLERY (category pages) === */
.pf-gallery-wrap {
  padding-top: 8px;
  padding-bottom: var(--section-pad);
}

.pf-gallery {
  column-count: 3;
  column-gap: 20px;
}

.pf-item {
  break-inside: avoid;
  margin-bottom: 20px;
  padding: 0;
  width: 100%;
  display: block;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  background-color: var(--bg-secondary);
  line-height: 0;
}

.pf-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  transition: transform 0.5s var(--ease), filter var(--duration) var(--ease);
}

.pf-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.pf-item:hover img,
.pf-item:focus-visible img { transform: scale(1.03); }

.pf-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* === LIGHTBOX === */
.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pf-lightbox--open {
  opacity: 1;
  visibility: visible;
}

.pf-lightbox__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 6vw;
}

.pf-lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.pf-lightbox__img--ready {
  opacity: 1;
  transform: scale(1);
}

.pf-lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
  z-index: 2;
}

.pf-lightbox__btn:hover { background: rgba(255, 255, 255, 0.22); }

.pf-lightbox__btn:active { transform: scale(0.94); }

.pf-lightbox__close { top: 24px; right: 24px; }

.pf-lightbox__nav--prev { left: 24px; top: 50%; transform: translateY(-50%); }
.pf-lightbox__nav--next { right: 24px; top: 50%; transform: translateY(-50%); }

.pf-lightbox__nav--prev:active { transform: translateY(-50%) scale(0.94); }
.pf-lightbox__nav--next:active { transform: translateY(-50%) scale(0.94); }

.pf-lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
  z-index: 2;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .pf-cats__grid { grid-template-columns: repeat(2, 1fr); }
  .pf-gallery { column-count: 2; }
}

@media (max-width: 640px) {
  .pf-head { padding-top: 128px; }
  .pf-cats__grid { grid-template-columns: 1fr; }
  .pf-gallery { column-count: 1; column-gap: 0; }
  .pf-lightbox__stage { padding: 4vh 4vw; }
  .pf-lightbox__close { top: 16px; right: 16px; }
  .pf-lightbox__nav--prev { left: 10px; }
  .pf-lightbox__nav--next { right: 10px; }
  .pf-lightbox__btn { width: 46px; height: 46px; }
}

/* === REVEAL: no-JS safe ===
   styles.css hides .reveal by default; re-show it unless JS is active,
   so content is never stuck invisible if scripts fail to run. */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(30px); }
html.js .reveal.reveal--visible { opacity: 1; transform: none; }

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; }
  .pf-cat img,
  .pf-item img,
  .pf-lightbox,
  .pf-lightbox__img { transition: none; }
  .pf-cat:hover img,
  .pf-item:hover img { transform: none; }
}
