/* =========================================================================
   Realizace – frontend styly
   Vše je izolované pod .rm-scope, aby se plugin nehádal se šablonou webu.
   Typografii dědí z šablony – barvy a kompozice jsou vlastní.
   ========================================================================= */

.rm-scope {
	--rm-accent: #b3823f;          /* teplý bronz – mění se v nastavení pluginu */
	--rm-accent-ink: #ffffff;
	--rm-ink: #221c15;
	--rm-muted: #6f675d;
	--rm-paper: #ffffff;
	--rm-line: rgba(34, 28, 21, 0.14);
	--rm-radius: 16px;
	--rm-radius-s: 11px;
	--rm-shadow: 0 12px 32px -14px rgba(34, 28, 21, 0.35);
	--rm-cols: 3;

	box-sizing: border-box;
	color: var(--rm-ink);
	font-size: 16px;
	line-height: 1.55;
}

.rm-scope *,
.rm-scope *::before,
.rm-scope *::after {
	box-sizing: inherit;
}

.rm-scope img {
	max-width: 100%;
	height: auto;
	border: 0;
}

.rm-scope button {
	font: inherit;
	cursor: pointer;
}

/* Atribut hidden má VŽDY přednost – i před vlastními display pravidly níže.
   Bez tohoto pravidla by např. display: grid u skrytého prvku vyhrál nad
   [hidden] a prvek by byl trvale viditelný. */
.rm-scope [hidden] {
	display: none !important;
}

.rm-scope :focus-visible {
	outline: 2px solid var(--rm-accent);
	outline-offset: 2px;
	border-radius: 6px;
}

/* -------------------------------------------------------------------------
   Tlačítka
   ------------------------------------------------------------------------- */

.rm-scope .rm-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 12px 26px;
	border: 1px solid var(--rm-accent);
	border-radius: 999px;
	background: var(--rm-accent);
	color: var(--rm-accent-ink);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.rm-scope .rm-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--rm-accent) 70%, transparent);
}

.rm-scope .rm-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.rm-scope .rm-btn-ghost {
	background: transparent;
	color: var(--rm-ink);
	border-color: var(--rm-line);
}

.rm-scope .rm-btn-ghost:hover:not(:disabled) {
	border-color: var(--rm-accent);
	color: var(--rm-accent);
	box-shadow: none;
}

/* -------------------------------------------------------------------------
   Filtrační lišta
   ------------------------------------------------------------------------- */

.rm-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 26px;
}

.rm-pill {
	padding: 8px 18px;
	border: 1px solid var(--rm-line);
	border-radius: 999px;
	background: transparent;
	color: var(--rm-ink);
	font-size: 0.88rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.rm-pill:hover {
	border-color: var(--rm-accent);
	color: var(--rm-accent);
}

.rm-pill.is-active {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-accent-ink);
}

/* -------------------------------------------------------------------------
   Grid a karty
   ------------------------------------------------------------------------- */

.rm-grid {
	display: grid;
	grid-template-columns: repeat(var(--rm-cols), minmax(0, 1fr));
	gap: 24px;
	transition: opacity 0.25s ease;
}

.rm-gallery.is-loading .rm-grid {
	opacity: 0.35;
	pointer-events: none;
}

.rm-card {
	margin: 0;
}

.rm-card-inner {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--rm-radius);
	overflow: hidden;
	background: #ece7e0;
	text-align: left;
	cursor: zoom-in;
	aspect-ratio: 4 / 3;
	box-shadow: 0 1px 2px rgba(34, 28, 21, 0.08);
	transition: transform 0.28s ease, box-shadow 0.28s ease;
	isolation: isolate;
}

.rm-card-inner:hover {
	transform: translateY(-3px);
	box-shadow: var(--rm-shadow);
}

.rm-card-media {
	position: absolute;
	inset: 0;
	display: block;
}

.rm-card-media img,
.rm-scope .rm-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.rm-card-inner:hover .rm-card-media img {
	transform: scale(1.055);
}

.rm-card-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(178deg, rgba(20, 15, 10, 0) 38%, rgba(20, 15, 10, 0.28) 62%, rgba(20, 15, 10, 0.78) 100%);
	transition: opacity 0.3s ease;
}

.rm-card-body {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
	padding: 18px 20px 17px;
	color: #fff;
}

/* Kategorie jako „eyebrow" – drobné verzálky s bronzovou linkou */
.rm-card-cat {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--rm-accent) 72%, #ffffff);
}

.rm-card-cat::before {
	content: "";
	width: 18px;
	height: 2px;
	background: var(--rm-accent);
	border-radius: 2px;
}

.rm-card-title {
	font-size: 1.08rem;
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: 0.002em;
	text-wrap: balance;
}

.rm-card-count {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.82);
}

/* Vstupní animace nově přidaných karet */
.rm-card.rm-in {
	animation: rm-rise 0.45s ease both;
}

@keyframes rm-rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Prázdný stav a „Načíst další" */
.rm-empty {
	padding: 46px 20px;
	border: 1px dashed var(--rm-line);
	border-radius: var(--rm-radius);
	text-align: center;
	color: var(--rm-muted);
}

.rm-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 30px;
}

/* -------------------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------------------- */

.rm-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	background: rgba(16, 12, 9, 0.93);
	-webkit-backdrop-filter: blur(7px);
	backdrop-filter: blur(7px);
}

.rm-lb.is-open {
	display: block;
	animation: rm-fade 0.22s ease;
}

@keyframes rm-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

html.rm-noscroll,
html.rm-noscroll body {
	overflow: hidden;
}

.rm-lb-top {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	color: rgba(255, 255, 255, 0.9);
	background: linear-gradient(180deg, rgba(16, 12, 9, 0.55), transparent);
}

.rm-lb-count {
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
	color: color-mix(in srgb, var(--rm-accent, #b3823f) 80%, #ffffff);
	white-space: nowrap;
}

.rm-lb-title {
	font-size: 0.95rem;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rm-lb-close {
	margin-left: auto;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-size: 1rem;
	transition: background-color 0.16s ease, border-color 0.16s ease;
}

.rm-lb-close:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.45);
}

.rm-lb-stage {
	position: absolute;
	inset: 0;
	margin: 0;
	display: grid;
	place-items: center;
	padding: 68px 76px 56px;
}

.rm-lb-img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 10px;
	box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.28s ease, transform 0.28s ease;
}

.rm-lb-img.is-in {
	opacity: 1;
	transform: none;
}

.rm-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-size: 1.05rem;
	line-height: 1;
	transition: background-color 0.16s ease, border-color 0.16s ease;
}

.rm-lb-nav:hover {
	background: color-mix(in srgb, var(--rm-accent, #b3823f) 55%, rgba(255, 255, 255, 0.1));
	border-color: transparent;
}

.rm-lb-prev { left: 16px; }
.rm-lb-next { right: 16px; }

.rm-lb-spin {
	position: absolute;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, 0.18);
	border-top-color: var(--rm-accent, #b3823f);
	border-radius: 50%;
	opacity: 0;
	animation: rm-spin 0.8s linear infinite;
}

.rm-lb.is-loading .rm-lb-spin {
	opacity: 1;
}

@keyframes rm-spin {
	to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------
   Formulář
   ------------------------------------------------------------------------- */

.rm-formwrap {
	max-width: 680px;
}

.rm-field {
	margin: 0 0 20px;
}

.rm-label {
	display: block;
	margin-bottom: 7px;
	font-size: 0.86rem;
	font-weight: 650;
	letter-spacing: 0.015em;
}

.rm-req {
	color: var(--rm-accent);
}

.rm-opt {
	font-weight: 400;
	color: var(--rm-muted);
}

.rm-scope .rm-input {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid var(--rm-line);
	border-radius: var(--rm-radius-s);
	background: var(--rm-paper);
	color: var(--rm-ink);
	font: inherit;
	font-size: 0.97rem;
	transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.rm-scope .rm-input:focus {
	outline: none;
	border-color: var(--rm-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rm-accent) 22%, transparent);
}

.rm-scope textarea.rm-input {
	resize: vertical;
	min-height: 84px;
}

/* Drop zóna */
.rm-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 34px 22px;
	border: 2px dashed var(--rm-line);
	border-radius: var(--rm-radius);
	background: color-mix(in srgb, var(--rm-ink) 2.5%, var(--rm-paper));
	color: var(--rm-muted);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.rm-drop:hover,
.rm-drop.is-drag {
	border-color: var(--rm-accent);
	background: color-mix(in srgb, var(--rm-accent) 7%, var(--rm-paper));
	color: var(--rm-ink);
}

.rm-drop-ico {
	color: var(--rm-accent);
}

.rm-drop-main {
	margin: 2px 0 0;
	font-size: 0.98rem;
	color: var(--rm-ink);
}

.rm-drop-note {
	margin: 0;
	font-size: 0.8rem;
}

/* Náhledy nahrávaných fotek */
.rm-previews {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 10px;
	margin-top: 12px;
}

.rm-previews:empty {
	display: none;
}

.rm-prev {
	position: relative;
	aspect-ratio: 1;
	border-radius: var(--rm-radius-s);
	overflow: hidden;
	background: #ece7e0;
}

.rm-prev img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rm-prev.is-up img {
	filter: grayscale(0.25) brightness(0.92);
}

.rm-prev-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: rgba(0, 0, 0, 0.35);
}

.rm-prev-bar i {
	display: block;
	height: 100%;
	width: 0;
	background: var(--rm-accent);
	transition: width 0.15s linear;
}

.rm-prev.is-done .rm-prev-bar {
	opacity: 0;
	transition: opacity 0.4s ease 0.3s;
}

.rm-prev-x {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 24px;
	height: 24px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 999px;
	background: rgba(20, 15, 10, 0.6);
	color: #fff;
	font-size: 0.7rem;
	line-height: 1;
	transition: background-color 0.15s ease;
}

.rm-prev-x:hover {
	background: rgba(20, 15, 10, 0.85);
}

/* Zelená fajfka – fotka je úspěšně nahraná */
.rm-prev-ok {
	position: absolute;
	top: 6px;
	left: 6px;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: #2e9e5b;
	color: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.rm-prev-flag {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(160, 40, 30, 0.55);
	color: #fff;
	font-size: 1.3rem;
	font-weight: 700;
}

.rm-prev.is-err {
	outline: 2px solid #b3402f;
	outline-offset: -2px;
}

/* Akce, chyby, stav */
.rm-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.rm-form-status {
	font-size: 0.86rem;
	color: var(--rm-muted);
}

.rm-error {
	margin: 0 0 18px;
	padding: 12px 16px;
	border: 1px solid rgba(179, 64, 47, 0.4);
	border-radius: var(--rm-radius-s);
	background: rgba(179, 64, 47, 0.08);
	color: #8e3325;
	font-size: 0.9rem;
}

.rm-notice {
	padding: 16px 20px;
	border: 1px solid var(--rm-line);
	border-left: 3px solid var(--rm-accent);
	border-radius: var(--rm-radius-s);
	background: color-mix(in srgb, var(--rm-accent) 5%, var(--rm-paper));
	font-size: 0.95rem;
}

.rm-notice a {
	color: var(--rm-accent);
	font-weight: 600;
}

/* Úspěšné odeslání */
.rm-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 40px 26px;
	border: 1px solid color-mix(in srgb, var(--rm-accent) 35%, transparent);
	border-radius: var(--rm-radius);
	background: color-mix(in srgb, var(--rm-accent) 7%, var(--rm-paper));
	text-align: center;
}

.rm-success-ico {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin-bottom: 6px;
	border-radius: 999px;
	background: var(--rm-accent);
	color: var(--rm-accent-ink);
}

.rm-success-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
}

.rm-success-note {
	margin: 0 0 14px;
	color: var(--rm-muted);
	font-size: 0.92rem;
}

/* Stav odesílání */
.rm-submit.is-busy {
	position: relative;
	color: transparent;
}

.rm-submit.is-busy::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rm-spin 0.7s linear infinite;
}

/* -------------------------------------------------------------------------
   Responzivita
   ------------------------------------------------------------------------- */

@media (max-width: 920px) {
	.rm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}
}

@media (max-width: 600px) {
	.rm-grid {
		grid-template-columns: 1fr;
	}

	.rm-card-body {
		padding: 15px 16px 14px;
	}

	.rm-lb-stage {
		padding: 64px 12px 46px;
	}

	.rm-lb-nav {
		width: 42px;
		height: 42px;
		bottom: 14px;
		top: auto;
		transform: none;
	}

	.rm-lb-prev { left: 18px; }
	.rm-lb-next { right: 18px; }

	.rm-lb-img {
		border-radius: 6px;
	}
}

/* -------------------------------------------------------------------------
   Omezený pohyb
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.rm-scope *,
	.rm-lb,
	.rm-lb-img,
	.rm-card.rm-in {
		animation: none !important;
		transition: none !important;
	}
}
