/* Title block is the shared .page-title component (see styles.css). */

/* ── Gallery ── */
.press-gallery {
  width: min(100%, var(--container));
  margin: 0 auto 4rem;
  padding: 0 var(--gutter);
}

/* CSS masonry via columns */
.press-grid {
  columns: 300px;
  column-gap: 14px;
}

.press-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  background: var(--fill-bone);
  cursor: pointer;
  transition: border-color 0.18s ease;
}

/* Logo tile: diagonal hatch pattern so white logo reads on a textured dark field */
.press-card--logo {
  background: repeating-linear-gradient(135deg, var(--coal) 0 12px, var(--soot) 12px 24px);
}

.press-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Download overlay: Flare label + size, visible on hover */
.press-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem;
  background: linear-gradient(0deg, rgb(var(--bg-rgb) / 0.88), transparent 50%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

/* Direct download link — R2 serves these with Content-Disposition: attachment,
   so the click downloads instead of opening the lightbox. */
.press-card__dl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.press-card__size {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

/* ── PhotoSwipe: Brutal restyle ── */
.pswp {
  --pswp-bg: var(--bg);
}

.pswp svg {
  fill: none;
}

/* Our custom icons are bare <svg> (no .pswp__icn class), so the vendor's
   absolute icon offsets don't apply — centre them in the button ourselves. */
.pswp__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--text);
  border: 1.5px solid transparent;
  border-radius: 0;
  transition:
    border-color 0.14s ease,
    background 0.14s ease,
    color 0.14s ease;
}

.pswp__button > svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.pswp__button--close {
  margin: 6px 6px 0 0;
}

.pswp__button--arrow {
  width: 60px;
  height: 60px;
  margin-top: -30px;
}

.pswp__button--arrow > svg {
  width: 32px;
  height: 32px;
}

.pswp__counter {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.pswp__img--placeholder {
  --pswp-placeholder-bg: transparent;
}

.pswp__custom-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  padding: 3rem 1rem 2.5rem;
  background: linear-gradient(to top, rgb(var(--bg-rgb) / 0.76), transparent);
  pointer-events: none;
}

.gl-desc,
.gl-actions {
  display: flex;
  justify-content: center;
  pointer-events: auto;
}

/* Download button in lightbox: Brutal square, Flare fill */
.gl-download {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1.5px solid var(--red);
  border-radius: 0;
  padding: 0.75rem 1.5rem;
  color: var(--on-fill);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--red);
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    transform 0.14s ease;
}

.gl-download svg {
  width: 1rem;
  height: 1rem;
}

.dl-size {
  color: rgb(var(--on-fill-rgb) / 0.82);
  font-weight: 400;
}

/* ── Hover ── */
@media (hover: hover) and (pointer: fine) {
  .press-card:hover {
    border-color: var(--line-strong);
  }

  /* :focus-visible, not :focus-within — a mouse click focuses the link and
     would otherwise leave the overlay stuck open after the pointer leaves. */
  .press-card:hover .press-card__overlay,
  .press-card:has(.press-card__dl:focus-visible) .press-card__overlay {
    opacity: 1;
  }

  /* Pointer devices only: the overlay is revealed by the same hover that
     precedes the click, so touch taps still fall through to the lightbox. */
  .press-card__dl {
    pointer-events: auto;
  }

  .press-card__dl:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }

  .pswp__button:hover {
    border: 1.5px solid var(--red);
    background: var(--red);
    color: var(--on-fill);
  }

  .gl-download:hover {
    background: var(--red-hover);
    border-color: var(--red-hover);
    transform: translateY(-2px);
  }
}

@media (max-width: 480px) {
  .press-grid {
    column-gap: 8px;
  }

  .press-card {
    margin-bottom: 8px;
  }
}
