/* ==========================================================================
   Bowhunter — fotógaléria (oldali rács + nézetváltó) és PhotoSwipe lightbox
   ========================================================================== */

/* --- Eszköztár (képszám + nézetváltó gombok) --- */
.bhm-gallery { margin: 2rem 0; }
.bhm-gallery__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--bhm-line);
}
.bhm-gallery__count {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--bhm-secondary);
}
.bhm-gallery__views { display: flex; gap: 0.25rem; }
.bhm-gallery__view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--bhm-line);
  border-radius: 8px;
  background: var(--bhm-surface);
  color: var(--bhm-contrast-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bhm-gallery__view:hover { border-color: var(--bhm-primary); color: var(--bhm-primary); }
.bhm-gallery__view.is-active {
  background: var(--bhm-primary);
  border-color: var(--bhm-primary);
  color: var(--bhm-base);
}
.bhm-gallery__view svg { width: 17px; height: 17px; display: block; }

/* --- Rács nézetek --- */
.bhm-gallery__grid { --bhm-gap: 8px; }

/* Alap: sűrű rács, négyzetes bélyegképek */
.bhm-gallery__grid.is-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--bhm-gap);
}
.bhm-gallery__grid.is-view-grid .bhm-gallery__item { aspect-ratio: 1 / 1; }

/* Nagy: kevesebb oszlop, nagyobb képek, 4:3 */
.bhm-gallery__grid.is-view-large {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--bhm-gap);
}
.bhm-gallery__grid.is-view-large .bhm-gallery__item { aspect-ratio: 4 / 3; }

/* Mozaik: valódi masonry (CSS columns), a képek eredeti aránya megmarad */
.bhm-gallery__grid.is-view-masonry {
  column-count: 3;
  column-gap: var(--bhm-gap);
}
.bhm-gallery__grid.is-view-masonry .bhm-gallery__item {
  display: block;
  width: 100%;
  margin: 0 0 var(--bhm-gap);
  break-inside: avoid;
}
.bhm-gallery__grid.is-view-masonry .bhm-gallery__item img { aspect-ratio: auto; height: auto; }

/* Bélyegkép-elem */
.bhm-gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bhm-line);
  cursor: zoom-in;
}
.bhm-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}
.bhm-gallery__item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(30,42,27,0.28));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.bhm-gallery__item:hover img { transform: scale(1.05); }
.bhm-gallery__item:hover::after { opacity: 1; }

@media (max-width: 720px) {
  .bhm-gallery__grid.is-view-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .bhm-gallery__grid.is-view-masonry { column-count: 2; }
}

/* ==========================================================================
   PhotoSwipe testreszabás (feliratsáv + thumbnail filmszalag)
   ========================================================================== */
.pswp { --pswp-bg: #14181a; }
.pswp__bg { background: #14181a; }

/* Feliratsáv fent */
.bhm-pswp-caption {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 14px 56px;
  text-align: center;
  font-family: var(--bhm-font-sans, sans-serif);
  font-size: 0.92rem;
  color: #f3eee3;
  background: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
  pointer-events: none;
  z-index: 10;
}

/* Thumbnail filmszalag lent */
.bhm-pswp-thumbs {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 76px;
  background: rgba(10,12,10,0.72);
  backdrop-filter: blur(6px);
  z-index: 10;
  display: flex;
  align-items: center;
}
.bhm-pswp-thumbs__track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  width: 100%;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.bhm-pswp-thumbs__track::-webkit-scrollbar { height: 6px; }
.bhm-pswp-thumbs__track::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }
.bhm-pswp-thumbs__item {
  flex: 0 0 auto;
  width: 76px; height: 60px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.bhm-pswp-thumbs__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bhm-pswp-thumbs__item:hover { opacity: 0.9; }
.bhm-pswp-thumbs__item.is-active {
  opacity: 1;
  border-color: #b3781f;
  transform: translateY(-2px);
}

/* Adjunk helyet a lightbox alján a szalagnak */
.pswp--bhm-has-thumbs .pswp__scroll-wrap { bottom: 76px; }

@media (max-width: 640px) {
  .bhm-pswp-thumbs { height: 60px; }
  .bhm-pswp-thumbs__item { width: 58px; height: 44px; }
}

/* ==========================================================================
   Teljes galéria ("Galéria" oldal) — justified elrendezés, évekre bontva
   ========================================================================== */
/* Keretezett, középre zárt szélesség — ne érjen faltól falig. */
.bhm-gallery-all {
  max-width: 1400px;
  margin: 0.5rem auto 0;
  padding: 0 clamp(1rem, 4vw, 3rem);
}
.bhm-gallery-year { margin: 0 0 3.4rem; }
.bhm-gallery-year:last-child { margin-bottom: 0; }

/* Év-fejléc: nagy szerif évszám balra, halvány darabszám jobbra, vékony vonal alattuk */
.bhm-gallery-year__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bhm-line, #DED5C2);
}
.bhm-gallery-year__title {
  font-family: var(--bhm-font-serif, Georgia, serif);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
  color: var(--bhm-primary, #3B5A38);
  margin: 0;
}
.bhm-gallery-year__count {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bhm-secondary, #B3781F);
  white-space: nowrap;
}
.bhm-gallery-year .bhm-gallery { margin: 0; }

/* --- Justified (Flickr-szerű) sorok: a képek eredeti aránya megmarad --- */
.bhm-gallery__grid.is-view-justified {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bhm-gallery__grid.is-view-justified .bhm-gallery__item {
  --row-h: 250px;
  height: var(--row-h);
  flex-grow: var(--ar, 1.5);
  flex-shrink: 1;
  flex-basis: calc(var(--row-h) * var(--ar, 1.5));
  aspect-ratio: auto;
}
.bhm-gallery__grid.is-view-justified .bhm-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Az utolsó (részleges) sor ne nyúljon szét: egy üres flex-elem elnyeli a maradékot. */
.bhm-gallery__grid.is-view-justified::after {
  content: "";
  flex-grow: 999999;
}
@media (max-width: 1024px) {
  .bhm-gallery__grid.is-view-justified .bhm-gallery__item { --row-h: 200px; }
}
@media (max-width: 640px) {
  .bhm-gallery__grid.is-view-justified { gap: 6px; }
  .bhm-gallery__grid.is-view-justified .bhm-gallery__item { --row-h: 150px; }
}
