/* IFF Galérie – web */
.iffg {
	--iffg-cols: var(--iffg-cols-m, 4);
	--iffg-text: #16161a;
	--iffg-muted: #5b5b66;
	--iffg-line: #e4e4e8;
	--iffg-border: #d4d4da;
	color: var(--iffg-text);
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	gap: 24px;
}
@media (min-width: 600px) {
	.iffg { --iffg-cols: var(--iffg-cols-t, 6); }
}
@media (min-width: 1024px) {
	.iffg { --iffg-cols: var(--iffg-cols-d, 9); }
}
.iffg *, .iffg *::before, .iffg *::after { box-sizing: border-box; }
.iffg [hidden] { display: none !important; }

/* Vyhľadávanie (tab „Hľadať“) */
.iffg .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.iffg-searchbox { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 8px; }
.iffg-searchbox__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.iffg .iffg-searchbox__label { margin: 0; padding: 0; font-size: 14px; font-weight: 500; color: #3a3a44; white-space: nowrap; line-height: 1.2; }
.iffg .iffg-searchbox__input {
	flex: 1 1 220px; max-width: 480px; width: auto; margin: 0; box-shadow: none;
	height: 44px; padding: 0 14px; font: inherit; font-size: 15px;
	color: var(--iffg-text); background: #fff;
	border: 1px solid #c9c9d1; border-radius: 6px;
}
.iffg-help {
	flex: none; width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 50%;
	border: 1.5px solid var(--iffg-border); background: #fff; color: #3a3a44; cursor: pointer;
	font: italic 600 15px/1 Georgia, "Times New Roman", serif; display: inline-flex; align-items: center; justify-content: center;
}
.iffg-help:hover { border-color: var(--iffg-accent, #b4232c); color: var(--iffg-accent, #b4232c); }
.iffg-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.iffg .iffg-scope__label { float: left; margin: 0 4px 0 0; padding: 0; font-size: 13px; color: var(--iffg-muted); }
.iffg-scope__opt { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.iffg-scope__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.iffg-scope__opt span {
	display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
	border: 1px solid var(--iffg-border); background: #fff; color: var(--iffg-text); font-size: 13px; line-height: 1.2;
}
.iffg-scope__opt span::before { content: ""; width: 14px; height: 14px; margin-right: 6px; border: 1.5px solid currentColor; border-radius: 3px; box-sizing: border-box; flex: none; }
.iffg-scope__opt input:checked + span { background: var(--iffg-text); border-color: var(--iffg-text); color: #fff; }
.iffg-scope__opt input:checked + span::before { background: #fff; box-shadow: inset 0 0 0 2px var(--iffg-text); }
.iffg-scope__opt input:focus-visible + span { outline: 2px solid var(--iffg-accent, #b4232c); outline-offset: 2px; }
.iffg-tab--search svg { flex: none; }
.iffg-scope__opt input:disabled + span { opacity: .45; cursor: not-allowed; }
.iffg-mode { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-size: 14px; color: var(--iffg-text); align-self: flex-start; }
.iffg-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.iffg-mode__switch { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: #c9c9d1; transition: background .15s; }
.iffg-mode__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.iffg-mode input:checked + .iffg-mode__switch { background: var(--iffg-accent, #b4232c); }
.iffg-mode input:checked + .iffg-mode__switch::after { transform: translateX(18px); }
.iffg-mode input:focus-visible + .iffg-mode__switch { outline: 2px solid var(--iffg-accent, #b4232c); outline-offset: 2px; }
.iffg .iffg-hits-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0; font-size: 14px; color: var(--iffg-muted); }
.iffg .iffg-full-link { color: var(--iffg-accent, #b4232c); font-weight: 500; }
.iffg-dialog { max-width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); color: var(--iffg-text); }
.iffg-dialog::backdrop { background: rgba(14, 14, 16, .55); }
.iffg-dialog[open]:not([role]) { position: fixed; inset: 0; margin: auto; z-index: 100000; }
.iffg-dialog__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.iffg .iffg-dialog__title { margin: 0; font-size: 18px; line-height: 1.3; }
.iffg-dialog__body p { margin: 0; font-size: 15px; line-height: 1.55; }
.iffg-dialog__close {
	align-self: flex-end; min-height: 40px; padding: 0 16px; border-radius: 6px; cursor: pointer;
	border: 1px solid var(--iffg-accent, #b4232c); background: var(--iffg-accent, #b4232c); color: #fff; font: inherit; font-size: 14px;
}

/* Taby */
.iffg-tabs {
	display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0;
	border-top: 1px solid var(--iffg-line); border-bottom: 1px solid var(--iffg-line);
	position: sticky; top: 0; z-index: 5; background: #fff;
}
.admin-bar .iffg-tabs { top: 32px; }
@media (max-width: 782px) { .admin-bar .iffg-tabs { top: 0; } }
@media (max-width: 599px) {
	.iffg-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
}
.iffg-tab {
	flex: none; display: inline-flex; align-items: center; gap: 8px;
	min-height: 44px; padding: 0 16px; margin: 0;
	border-radius: 999px; border: 1px solid var(--iffg-border); background: #fff; color: var(--iffg-text);
	font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer;
	text-transform: none; letter-spacing: normal; box-shadow: none;
}
.iffg-tab:hover { border-color: var(--iffg-accent, #b4232c); }
.iffg-tab[aria-pressed="true"] { background: var(--iffg-accent, #b4232c); border-color: var(--iffg-accent, #b4232c); color: #fff; }
.iffg-tab__count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #efeff2; color: #3a3a44; }
.iffg-tab[aria-pressed="true"] .iffg-tab__count { background: rgba(255, 255, 255, .22); color: #fff; }

/* Galéria */
.iffg-panel { display: flex; flex-direction: column; }
.iffg-panel.is-loading { opacity: .5; transition: opacity .15s; }
.iffg-gallery:focus { outline: none; }
.iffg-gallery { display: flex; flex-direction: column; gap: 14px; padding: 28px 0; border-bottom: 1px solid var(--iffg-line); scroll-margin-top: 96px; }
.iffg-gallery:first-child { padding-top: 8px; }
.iffg-gallery--bare { padding-top: 12px; }
.iffg-gallery.is-target { animation: iffg-flash 1.6s ease-out; }
@keyframes iffg-flash { 0% { background: rgba(180, 35, 44, .08); } 100% { background: transparent; } }
.iffg-gallery__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.iffg-gallery__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.iffg .iffg-gallery__title {
	margin: 0; padding: 0; line-height: 1.25;
	font-size: var(--iffg-title-size, 22px); font-weight: var(--iffg-title-weight, 600); color: var(--iffg-title-color, #16161a);
}
.iffg .iffg-gallery__desc {
	margin: 0; font-size: var(--iffg-desc-size, 15px); font-weight: var(--iffg-desc-weight, 400); color: var(--iffg-desc-color, #3a3a44);
}
.iffg .iffg-gallery__meta { margin: 0; font-size: 13px; color: var(--iffg-muted); }
.iffg-copy {
	flex: none; width: 44px; height: 44px; padding: 0; margin: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--iffg-border); border-radius: 6px; background: #fff; color: #3a3a44; cursor: pointer;
	position: relative;
}
.iffg-copy:hover { color: var(--iffg-accent, #b4232c); border-color: currentColor; }
.iffg-copy.is-copied::after {
	content: attr(data-msg); position: absolute; right: 0; top: calc(100% + 6px); white-space: nowrap;
	font-size: 12px; padding: 4px 8px; border-radius: 4px; background: #16161a; color: #fff;
}

.iffg-grid { display: grid; grid-template-columns: repeat(var(--iffg-cols), minmax(0, 1fr)); gap: 8px; }
.iffg-tile { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px; background: #e4e4e8; }
.iffg-tile img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border: 0; border-radius: 0; box-shadow: none; transition: transform .25s ease; }
.iffg-tile:hover img { transform: scale(1.03); }
.iffg-tile__more {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: rgba(22, 22, 26, .62); color: #fff; font-size: 22px; font-weight: 600;
}

.iffg-links { display: flex; flex-wrap: wrap; gap: 8px; }
.iffg .iffg-link {
	display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
	border: 1px solid var(--iffg-border); border-radius: 6px; color: var(--iffg-text);
	font-size: 14px; font-weight: 500; text-decoration: none;
}
.iffg .iffg-link svg { color: var(--iffg-accent, #b4232c); flex: none; }
.iffg .iffg-link:hover { border-color: var(--iffg-accent, #b4232c); color: var(--iffg-text); }

.iffg-empty { padding: 32px 0; color: var(--iffg-muted); }

/* Ďalšie galérie */
.iffg-more { overflow-anchor: none; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0; color: var(--iffg-muted); font-size: 14px; }
.iffg-more__spinner {
	width: 20px; height: 20px; border-radius: 50%;
	border: 2.5px solid var(--iffg-line); border-top-color: var(--iffg-accent, #b4232c);
	visibility: hidden;
}
.iffg-tile--extra { display: none !important; }
.iffg-more.is-loading .iffg-more__spinner { visibility: visible; animation: iffg-spin .8s linear infinite; }
@keyframes iffg-spin { to { transform: rotate(360deg); } }
.iffg-more__btn {
	min-height: 44px; padding: 0 18px; border: 1px solid var(--iffg-border); border-radius: 6px;
	background: #fff; color: var(--iffg-text); font: inherit; font-size: 14px; cursor: pointer;
}
.iffg-credits { padding-top: 20px; border-top: 1px solid var(--iffg-text); font-size: 14px; color: #3a3a44; max-width: 760px; }

/* Fokus */
.iffg :focus-visible { outline: 2px solid var(--iffg-accent, #b4232c); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.iffg-tile img, .iffg-panel.is-loading { transition: none; }
	.iffg-tile:hover img { transform: none; }
	.iffg-more.is-loading .iffg-more__spinner, .iffg-gallery.is-target { animation: none; }
}
