/* com_bhggalerie – galerie fotek z akcí. Barvy přebírá ze šablony (currentColor, proměnné s výchozími hodnotami). */
.bhggal {
	--bhggal-gap: clamp(.375rem, 1vw, .75rem);
	--bhggal-radius: var(--bhg-radius-card, 6px);
	--bhggal-accent: var(--gold, var(--bs-primary, #b8963e));
	--bhggal-overlay: rgba(10, 10, 10, .94);
	margin-block: clamp(1rem, 3vw, 2.5rem);
}

@media (max-width: 991.98px) { .bhggal { padding-top: var(--bhggal-top-m, 0px); } }
@media (min-width: 992px) { .bhggal { padding-top: var(--bhggal-top, 0px); } }

/* ---------- hlavička stránek (stavba jako hero webu; typografii dodávají utility šablony typo-* / ff-* / text-*) */
.bhggal-hero { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.bhggal-hero__eyebrow a { color: inherit !important; text-decoration: none !important; }
.bhggal-hero__eyebrow a:hover, .bhggal-hero__eyebrow a:focus-visible { text-decoration: underline !important; }
.bhggal-hero__eyebrow a:hover, .bhggal-hero__eyebrow a:focus-visible { text-decoration: underline; }
.bhggal-hero__title { margin-top: 0; }
.bhggal-hero__meta, .bhggal-hero__text { max-width: 60ch; }

.bhggal svg { width: 1.15em; height: 1.15em; flex: none; }
.bhggal-btn { display: inline-flex; align-items: center; gap: .5em; text-decoration: none; }

/* ---------- hlavička alba */
.bhggal__head { margin-bottom: clamp(1rem, 2.5vw, 2rem); }
.bhggal__title { margin-bottom: .25em; }
.bhggal__date { opacity: .75; margin-bottom: .75rem; }
.bhggal__desc { max-width: 70ch; margin-bottom: 1rem; }
.bhggal__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.bhggal__count { opacity: .75; }
.bhggal__hint { font-size: .9em; opacity: .7; margin: .75rem 0 0; }
.bhggal__empty { opacity: .75; }

/* ---------- mřížka fotek */
.bhggal__grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: var(--bhggal-gap);
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 576px) { .bhggal__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .bhggal__grid { grid-template-columns: repeat(4, 1fr); } }

.bhggal__item { margin: 0; position: relative; }

/* ikony Stáhnout / Sdílet na náhledu: na počítači po najetí, na dotykovém displeji pořád */
.bhggal__acts {
	position: absolute; right: .4rem; bottom: .4rem; z-index: 1;
	display: flex; gap: .35rem;
	opacity: 0; transition: opacity .2s;
}
.bhggal__item:hover .bhggal__acts, .bhggal__item:focus-within .bhggal__acts { opacity: 1; }
@media (hover: none) { .bhggal__acts { opacity: 1; } }
.bhggal__act {
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 50%;
	background: rgba(10, 10, 10, .62); color: #fff !important; text-decoration: none !important;
	cursor: pointer; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.bhggal__act:hover { background: rgba(10, 10, 10, .85); }
.bhggal__act:focus-visible { outline: 3px solid var(--bhggal-accent); outline-offset: 2px; }
.bhggal__act svg { width: 1.2rem; height: 1.2rem; }
.bhggal__tile {
	display: block; position: relative; overflow: hidden;
	aspect-ratio: 1 / 1; border-radius: var(--bhggal-radius);
	background: rgba(127, 127, 127, .15);
}
.bhggal__tile img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	transition: transform .35s ease;
}
.bhggal__tile:hover img, .bhggal__tile:focus-visible img { transform: scale(1.04); }
.bhggal__tile:focus-visible { outline: 3px solid var(--bhggal-accent); outline-offset: 2px; }

/* ---------- seznam alb */
.bhggal__albums {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: clamp(1rem, 2vw, 1.5rem);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.bhggal__album-link { display: block; color: inherit; text-decoration: none !important; }
.bhggal__album-link img {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
	border-radius: var(--bhggal-radius); transition: opacity .2s;
}
.bhggal__album-link:hover img { opacity: .85; }
.bhggal__album-body { display: block; padding-top: .6rem; }
.bhggal__album-title { display: block; font-weight: 600; font-size: 1.1em; }
.bhggal__album-meta { display: block; opacity: .7; font-size: .9em; }

/* ---------- detail fotky */
.bhggal__crumbs { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.bhggal__photo { margin: 0 0 1rem; text-align: center; }
.bhggal__photo img { max-width: 100%; height: auto; max-height: 80vh; width: auto; border-radius: var(--bhggal-radius); }
.bhggal__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem 1rem; margin-bottom: 1.5rem; }
.bhggal__pager { display: flex; justify-content: space-between; gap: 1rem; }
.bhggal-link {
	background: none; border: 0; padding: .25rem; color: inherit; opacity: .75;
	text-decoration: underline; text-underline-offset: 3px; font-size: .9em; cursor: pointer;
}
.bhggal-link:hover { opacity: 1; }

/* ---------- prohlížeč */
.bhggal-lock { overflow: hidden; }
.bhggal-lb {
	position: fixed; inset: 0; z-index: 10050;
	background: var(--bhggal-overlay, rgba(10, 10, 10, .94)); color: #fff;
	display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto;
	align-items: center;
}
.bhggal-lb[hidden] { display: none; }
.bhggal-lb svg { width: 1.4rem; height: 1.4rem; }
.bhggal-lb__stage { grid-column: 2; grid-row: 1; margin: 0; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 3.5rem .5rem .5rem; }
.bhggal-lb__img { max-width: 100%; max-height: calc(100vh - 8.5rem); max-height: calc(100dvh - 8.5rem); width: auto; height: auto; object-fit: contain; user-select: none; }
.bhggal-lb__btn {
	background: rgba(255, 255, 255, .08); color: #fff; border: 0; border-radius: 50%;
	width: 3rem; height: 3rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.bhggal-lb__btn:hover, .bhggal-lb__btn:focus-visible { background: rgba(255, 255, 255, .2); }
.bhggal-lb__btn:focus-visible, .bhggal-lb__tool:focus-visible, .bhggal-lb__link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bhggal-lb__close { position: absolute; top: .75rem; right: .75rem; z-index: 2; }
.bhggal-lb__prev { grid-column: 1; grid-row: 1; margin-left: .5rem; }
.bhggal-lb__next { grid-column: 3; grid-row: 1; margin-right: .5rem; }
.bhggal-lb__nav[hidden] { visibility: hidden; display: inline-flex; }
.bhggal-lb__bar {
	grid-column: 1 / -1; grid-row: 2;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
	padding: .75rem max(1rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-bottom));
}
.bhggal-lb__counter { opacity: .8; font-variant-numeric: tabular-nums; }
.bhggal-lb__tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.bhggal-lb__tool {
	display: inline-flex; align-items: center; gap: .5em;
	background: #fff; color: #111; border: 0; border-radius: 999px;
	padding: .6rem 1.1rem; font-weight: 600; text-decoration: none !important; cursor: pointer; line-height: 1.2;
}
.bhggal-lb__tool:hover { background: var(--gold, #d8b45a); color: #111; }
.bhggal-lb__share { background: rgba(255, 255, 255, .14); color: #fff; }
.bhggal-lb__link { background: none; border: 0; color: #fff; opacity: .7; text-decoration: underline; font-size: .85em; cursor: pointer; padding: .4rem; }
.bhggal-lb__link:hover { opacity: 1; }

@media (max-width: 575.98px) {
	.bhggal-lb { grid-template-columns: 1fr; }
	.bhggal-lb__stage { grid-column: 1; padding: 3.5rem 0 0; }
	.bhggal-lb__prev, .bhggal-lb__next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, .35); width: 2.5rem; height: 2.5rem; }
	.bhggal-lb__prev { left: .25rem; margin: 0; }
	.bhggal-lb__next { right: .25rem; margin: 0; }
	.bhggal-lb__bar { justify-content: center; }
	.bhggal-lb__tools { justify-content: center; }
	.bhggal-lb__counter { width: 100%; text-align: center; }
}

/* ---------- nabídka sdílení */
.bhggal-share {
	z-index: 10060; min-width: 200px; padding: .35rem;
	background: #fff; color: #111; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	display: flex; flex-direction: column;
}
.bhggal-share__item {
	display: block; width: 100%; text-align: left; padding: .6rem .8rem; border: 0; background: none;
	color: inherit; text-decoration: none !important; border-radius: 6px; font: inherit; cursor: pointer;
}
.bhggal-share__item:hover, .bhggal-share__item:focus-visible { background: rgba(0, 0, 0, .07); outline: none; }
.bhggal-share__item--native { font-weight: 600; }

/* ---------- okna */
.bhggal-dialog {
	border: 0; padding: 0; border-radius: 12px; max-width: min(460px, calc(100vw - 2rem)); width: 100%;
	background: #fff; color: #111; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.bhggal-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.bhggal-dialog__box { position: relative; padding: 1.75rem 1.5rem 1.5rem; margin: 0; }
.bhggal-dialog__close {
	position: absolute; top: .5rem; right: .5rem; width: 2.25rem; height: 2.25rem;
	border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: inherit; border-radius: 50%;
}
.bhggal-dialog__close:hover { background: rgba(0, 0, 0, .07); }
.bhggal-dialog__title { font-size: 1.3rem; margin: 0 2rem .75rem 0; color: inherit; }
.bhggal-dialog__text { margin-bottom: 1rem; }
.bhggal-dialog__small { font-size: .8rem; opacity: .75; margin: .75rem 0 0; }
.bhggal-dialog__small a { color: inherit; }
.bhggal-dialog__msg { min-height: 1.25em; margin: .75rem 0 0; font-size: .9rem; font-weight: 600; }
.bhggal-dialog__actions { margin-top: 1rem; display: flex; justify-content: flex-end; }
.bhggal-field { display: block; margin-bottom: .85rem; }
.bhggal-field > span { display: block; font-size: .9rem; margin-bottom: .3rem; font-weight: 600; }
.bhggal-field input, .bhggal-field textarea {
	width: 100%; padding: .65rem .75rem; border: 1px solid #bbb; border-radius: 6px; font: inherit; color: #111; background: #fff;
}
.bhggal-field input:focus, .bhggal-field textarea:focus { outline: 2px solid var(--bhggal-accent, #b8963e); border-color: transparent; }
.bhggal-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.bhggal-check input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: none; }
.bhggal-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.bhggal__tile img { transition: none; }
}
