/* PhilCorley Gridzy skin - Fine art portfolio with hover captions
   Place this at: public/vendor/gridzy/skins/gridzySkinPhilCorley/style.css
*/

:root {
  --pc-gap: 22px;
  --pc-mat: 20px;
  --pc-border: rgba(0, 0, 0, 0.18);
  --pc-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
}

/* Grid container spacing */
.pc-gridzy {
  margin-top: 2.5rem;
}

/* Stack mode: below iPad, 1 column (no Gridzy). iPad+ uses grid. */
/* Spacer divs create gap (iOS Safari ignores flex gap and margin on some elements). Gridzy hides non-gridzyItem so spacers hidden in grid mode. */
.pc-gridzy .pc-stack-spacer {
  display: block;
  height: 10px;
  flex-shrink: 0;
}
.pc-gridzy.pc-stack {
  display: flex;
  flex-direction: column;
}
.pc-gridzy.pc-stack > a.pc-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--pc-border);
  box-shadow: var(--pc-shadow);
  border-radius: 2px;
  overflow: hidden;
  text-decoration: none;
}
.pc-gridzy.pc-stack > a.pc-card .pc-mat {
  display: block;
}
.pc-gridzy.pc-stack .pc-card .pc-mat {
  flex: none;
  padding: var(--pc-mat);
  padding-bottom: calc(var(--pc-mat) * 2);
}
.pc-gridzy.pc-stack .pc-card .pc-mat img {
  flex: none;
  height: auto;
  object-fit: unset;
}

/* Card frame - flex so mat/img fill cell when row has mixed aspect ratios */
.pc-gridzy:not(.pc-stack) > a.pc-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--pc-border);
  box-shadow: var(--pc-shadow);
  border-radius: 2px;
  overflow: hidden;
  text-decoration: none;
}

/* Image mat - fills card; object-fit on img below prevents tiny-thumb-in-white when row height exceeds image aspect */
.pc-card .pc-mat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--pc-mat);
  padding-bottom: calc(var(--pc-mat) * 2);
  box-sizing: border-box;
  position: relative;
}

.pc-card .pc-mat img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

/* Cap grid cell height when grid is used on smaller tablets - prevents tall portrait mats */
@media (max-width: 1023px) and (min-width: 768px) {
  .pc-gridzy:not(.pc-stack) .gridzyItem {
    max-height: 70vh;
  }
}

/* Header row */
.pc-genre-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.pc-genre-count {
  font-size: 0.875rem;
  opacity: 0.7;
  white-space: nowrap;
}

/* ============================= */
/* Hover caption (positioned below magnifier icon) */
/* ============================= */

.pc-hovercap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 50;
  transform: translateZ(0); /* Promote to GPU layer for smooth fade */

  display: flex;
  justify-content: center;
  align-items: center;
}

/* Trigger on gridzyItem hover (same as Magnifier overlay) to avoid offset/snap */
.pc-gridzy .gridzyItem:hover .pc-hovercap,
.pc-gridzy .gridzyItem:focus-within .pc-hovercap {
  opacity: 1;
}
/* Stack mode: cards don't have gridzyItem, use .pc-card hover */
.pc-gridzy.pc-stack .pc-card:hover .pc-hovercap,
.pc-gridzy.pc-stack .pc-card:focus-within .pc-hovercap {
  opacity: 1;
}
/* Stack mode: dark overlay on hover for caption readability (no Magnifier ::after) */
.pc-gridzy.pc-stack .pc-card .pc-mat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
  pointer-events: none;
}
.pc-gridzy.pc-stack .pc-card:hover .pc-mat::after,
.pc-gridzy.pc-stack .pc-card:focus-within .pc-mat::after {
  background: rgba(0, 0, 0, 0.5);
}

/* Position caption below center (where magnifier icon is) */
.pc-hovercap-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 20%); /* 20% down from center puts it below the icon */
  text-align: center;
  padding: 0 12px;
  max-width: min(90%, 520px);
  width: 100%;
}

.pc-hovercap-title {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-hovercap-place {
  margin-top: 6px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Darken Magnifier overlay (::after) for better text readability */
.gridzySkinMagnifier .gridzyItem:hover::after,
.gridzySkinMagnifier .gridzyItem:focus-within::after {
  background: rgba(0, 0, 0, 0.62) !important;
}

/* Magnifier icon (::before): always white so it shows on dark hover overlay */
.gridzySkinMagnifier .gridzyItem::before {
  background-color: #fff !important;
}

/* Match Magnifier overlay transition to our hovercap for smooth, unified UX */
.gridzySkinMagnifier .gridzyItem::before,
.gridzySkinMagnifier .gridzyItem::after {
  transition: opacity 0.25s ease !important;
}

/* ============================= */
/* PhotoSwipe Custom Styling */
/* ============================= */

/* Dark grey background */
.pswp {
  --pswp-bg: #2a2a2a !important;
}

/* Disable all animations completely */
.pswp,
.pswp * {
  transition: none !important;
  animation: none !important;
}

/* Remove any PhotoSwipe default styling on images */
.pswp__img {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Hide the default image that PhotoSwipe tries to show */
.pswp__zoom-wrap > img.pswp__img {
  display: none !important;
}

/* Custom lightbox wrapper: PhotoSwipe sets width/height on this; img inside keeps aspect ratio */
.pswp-mat-wrapper {
  z-index: 10 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
}

.pswp-mat-wrapper img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* Custom caption styling */
.pswp__custom-caption-title {
  font-family: "Caveat", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.5rem;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.85);
  text-align: left;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pswp__custom-caption-place {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.55);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Hide default caption */
.pswp__caption {
  display: none !important;
}

/* UI controls */
.pswp__button {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.pswp__button:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Ensure content is centered */
.pswp__zoom-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}