/* Fun Center HPC Theme 1.0.37 — Core-rendered Art Gallery V3.
   Core 1.0.15 emits this markup directly. There is no legacy-gallery DOM rewrite.
   The grid uses 12 columns so landscape and portrait previews can mix in source order:
   Smaller: landscape 4/12 (3/row), portrait 3/12 (4/row)
   Medium/default: landscape 6/12 (2/row), portrait 4/12 (3/row)
   Bigger: landscape 12/12 (1/row), portrait 6/12 (2/row)
*/

.fchpc-gallery-v3-shell {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 10px 0 25px !important;
  padding: 0 !important;
}

.fchpc-gallery-v3-controls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  color: rgba(7,27,70,.52) !important;
  font-family: "Tauri", Arial, Helvetica, sans-serif !important;
  font-size: .9rem !important;
  line-height: 1.2 !important;
}

.fchpc-gallery-v3-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #086aa8 !important;
  font: inherit !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px !important;
  cursor: pointer !important;
}
.fchpc-gallery-v3-control:hover,
.fchpc-gallery-v3-control:focus-visible { color: #064c79 !important; }
.fchpc-gallery-v3-control:focus-visible {
  outline: 2px solid var(--fchpc-sky, #4eb4f6) !important;
  outline-offset: 3px !important;
  border-radius: 2px !important;
}
.fchpc-gallery-v3-control[disabled] {
  color: rgba(7,27,70,.42) !important;
  cursor: default !important;
  text-decoration: none !important;
}

.fchpc-gallery-v3 {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-rows: max-content !important;
  column-gap: 18px !important;
  row-gap: 18px !important;
  align-items: start !important;
  align-content: start !important;
  justify-items: stretch !important;
  justify-content: stretch !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* all:unset is deliberate isolation from WordPress/theme/plugin figure rules. */
.fchpc-gallery-v3-item {
  all: unset;
  display: block !important;
  box-sizing: border-box !important;
  grid-column: span 6;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: start !important;
  overflow: visible !important;
}

.fchpc-gallery-v3[data-fchpc-gallery-size="normal"] > .fchpc-gallery-v3-item[data-fchpc-orientation="landscape"] { grid-column: span 6 !important; }
.fchpc-gallery-v3[data-fchpc-gallery-size="normal"] > .fchpc-gallery-v3-item[data-fchpc-orientation="portrait"]  { grid-column: span 4 !important; }
.fchpc-gallery-v3[data-fchpc-gallery-size="smaller"] > .fchpc-gallery-v3-item[data-fchpc-orientation="landscape"] { grid-column: span 4 !important; }
.fchpc-gallery-v3[data-fchpc-gallery-size="smaller"] > .fchpc-gallery-v3-item[data-fchpc-orientation="portrait"]  { grid-column: span 3 !important; }
.fchpc-gallery-v3[data-fchpc-gallery-size="bigger"] > .fchpc-gallery-v3-item[data-fchpc-orientation="landscape"] { grid-column: span 12 !important; }
.fchpc-gallery-v3[data-fchpc-gallery-size="bigger"] > .fchpc-gallery-v3-item[data-fchpc-orientation="portrait"]  { grid-column: span 6 !important; }

.fchpc-gallery-v3-open {
  all: unset;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: var(--fchpc-visible-media-max-height, 68svh) !important;
  aspect-ratio: var(--fchpc-media-ratio, auto) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  line-height: 0 !important;
  text-align: left !important;
  vertical-align: top !important;
  cursor: zoom-in !important;
  overflow: visible !important;
}

.fchpc-gallery-v3-open img {
  all: unset;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: var(--fchpc-media-ratio, auto) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain !important;
  object-position: left top !important;
  vertical-align: top !important;
}

.fchpc-gallery-v3-open:focus-visible {
  outline: 3px solid var(--fchpc-sky, #4eb4f6) !important;
  outline-offset: 4px !important;
}

@media (max-width: 700px) {
  .fchpc-gallery-v3 { column-gap: 14px !important; row-gap: 14px !important; }
  .fchpc-gallery-v3[data-fchpc-gallery-size="normal"] > .fchpc-gallery-v3-item,
  .fchpc-gallery-v3[data-fchpc-gallery-size="bigger"] > .fchpc-gallery-v3-item { grid-column: span 12 !important; }
  .fchpc-gallery-v3[data-fchpc-gallery-size="smaller"] > .fchpc-gallery-v3-item[data-fchpc-orientation="landscape"] { grid-column: span 6 !important; }
  .fchpc-gallery-v3[data-fchpc-gallery-size="smaller"] > .fchpc-gallery-v3-item[data-fchpc-orientation="portrait"] { grid-column: span 6 !important; }
}
