/* ============================================================
   INDIVIDUAL PORTFOLIO PAGE (portafolio-individual.html)
   Load AFTER styles/main.css and styles/home.css. Reuses the
   solid navbar, footer, .section / .section-head, the .split
   "Sobre mí" block, the .project-card carousel, the .cta band
   and button helpers; this file only carries the portfolio-
   specific blocks: the photographer banner (name overlay +
   caption), the portrait crop and the editorial gallery mosaic.
   Consumes design tokens only; no raw hex/px values except
   layout-only aspect ratios / scrim opacities.
   Mobile breakpoint: 768px (in sync with --breakpoint-md).
   ============================================================ */

/* ============================================================
   MOBILE NAVBAR — this page has no hero photo, so the transparent
   .hero__nav exists only to carry the shared mobile bar + hamburger
   menu (styled in home.css under <=768px). Hide it on desktop, where
   the solid navbar is used instead.
   ============================================================ */
@media (min-width: 769px) {
  .hero__nav { display: none; }
}

/* ============================================================
   BANNER — full-bleed photographer photo with the name pinned
   to the lower-left and a small caption tab in the corner.
   A bottom scrim keeps both legible over the photo.
   ============================================================ */
.pf-hero {
  position: relative;
  background-color: var(--color-black);
}

.pf-hero__img {
  display: block;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

/* Directional scrim: darkens the lower-left corner where the name
   and caption sit so they stay legible over any photo, while the
   rest of the image reads clean. */
.pf-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 7, 6, 0.45) 0%, rgba(5, 7, 6, 0) 55%),
              linear-gradient(180deg, rgba(5, 7, 6, 0) 50%, rgba(5, 7, 6, 0.5) 100%);
}

/* Name overlay fills the banner and centers the name vertically;
   the inner .container keeps it on the same gutters as the sections
   below. Sits above the scrim. */
.pf-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
}
.pf-hero__name {
  font-size: var(--font-size-headline-2);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-white);
}

/* Understated caption pinned to the bottom, aligned to the gutter
   via the .container class it also carries — no boxed background. */
.pf-hero__caption {
  position: absolute;
  inset-inline: 0;
  bottom: var(--space-24);
  z-index: 1;
  margin: 0 auto;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-book);
  color: rgba(255, 255, 255, 0.8);
}

.pf-intro-custom-width {
  max-width: 90ch !important;
}

/* ============================================================
   GALLERY — editorial mosaic that alternates a two-photo row
   (equal landscape pair) with a three-photo row of portrait
   frames. Every frame crops its image with cover.
     .pf-gallery__row--pair → two equal landscape frames
     .pf-gallery__row--trio → three equal portrait frames
   ============================================================ */
.pf-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.pf-gallery__row {
  display: grid;
  gap: var(--space-16);
}
.pf-gallery__row--pair { grid-template-columns: 1fr 1fr; }
.pf-gallery__row--trio { grid-template-columns: repeat(3, 1fr); }

.pf-figure {
  margin: 0;
  overflow: hidden;
  background-color: var(--color-grey-light);
}
.pf-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The pair frames share a fixed height so their top and bottom
   edges align; the trio frames stay portrait (layout-only). */
.pf-gallery__row--pair .pf-figure { height: clamp(240px, 32vw, 460px); }
.pf-gallery__row--trio .pf-figure { aspect-ratio: 4 / 5; }

/* ---- "Ver más" — hidden on desktop, shown only on mobile (see media query) */
.gallery-more { display: none; }

/* ============================================================
   CTA — left-aligned prompt with a single action on the right.
   Reuses home's .cta flex layout; keep the title sentence case
   (unlike the capitalised home CTA title).
   ============================================================ */
.pf-cta__title {
  font-weight: var(--font-weight-bold);
  text-transform: none;
}

/* ============================================================
   RESPONSIVE  (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
  .pf-hero__overlay { bottom: var(--space-24); }
  .pf-about__img { max-width: 100%; }

  .portafolio_indi_split { display: flex; flex-direction: column-reverse; }
  .portafolio_indi_split .subtitle--label { font-size: 14px; font-weight: var(--font-weight-bold); text-transform: uppercase; }
  .portafolio_indi_split .split__lead { color: var(--color-black); }
  .portafolio_indi_split .split__img--portrait { background-color: transparent; max-width: 100%; }

  .pf-gallery__row--pair,
  .pf-gallery__row--trio { grid-template-columns: 1fr; }

  .pf-gallery__row--pair .pf-figure {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .pf-gallery__row--trio .pf-figure { aspect-ratio: 4 / 3; }

  /* Collapsed by default: show only the first 4 images. The extra
     figures / rows stay hidden until the gallery is expanded via JS. */
  .pf-gallery:not(.is-expanded) .pf-figure--extra,
  .pf-gallery:not(.is-expanded) .pf-gallery__row--extra { display: none; }

  /* Soft blurred fade at the bottom of the collapsed gallery so the
     last visible image dissolves into the page and hints there's more
     behind "Ver más". */
  .pf-gallery { position: relative; }
  .pf-gallery:not(.is-expanded)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 140px;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.75) 55%,
      var(--color-bg) 100%
    );
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 70%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 70%);
  }

  .gallery-more {
    display: block;
    width: fit-content;
    margin: var(--space-24) auto 0;
    text-align: center;
  }
  /* Once everything is visible there is nothing more to reveal. */
  .pf-gallery.is-expanded ~ .gallery-more { display: none; }

  .portafolio_indi_card_title { font-size: 14px; font-weight: var(--font-weight-bold); text-transform: uppercase; }
  .portafolio_indi_card_year { font-size: 14px; }
  .portafolio_indi_proyectos_card_subtitle { font-size: 14px; }

  .portafolio_indi_cta_title { text-transform: uppercase; }
  .portafolio_indi_cta_btn { 
    color: var(--color-black);
    background-color: transparent;
    border: 1px solid var(--color-black);
    padding: var(--space-8) var(--space-16);
    border-radius: 4px;
    text-decoration: none;
    width: fit-content;
    text-transform: uppercase;
   }
}
