/* =============================================================================
   DETAIL REFERENCE (single-reference.php)
   Sekce se střídají: šedá hlavička, bílý průběh s CTA, šedý carousel,
   bílá konzultace. Barvy a rádiusy z tokenů v style.css (:root).
   ============================================================================= */

.ib-rs {
	color: var(--ib-text, #2d2d2d);
}

/* ── 1. hlavička (šedá) ───────────────────────────────────────────────── */
.ib-rs-hero {
	background: var(--ib-bg, #f6f8fb);
	padding: 56px 0 72px;
}

.ib-rs-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 1px solid #bcd4ec;
	border-radius: var(--ib-radius-btn, 9px);
	background: #fff;
	color: #0e66a9;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	margin-top: 28px;
	transition: background .2s, border-color .2s;
}
.ib-rs-back:hover,
.ib-rs-back:focus {
	background: #eef5fc;
	border-color: #9fc3e6;
	color: #0e66a9;
	text-decoration: none;
}
.ib-rs-back svg {
	width: 16px;
	height: 16px;
	transition: transform .2s;
}
.ib-rs-back:hover svg {
	transform: translateX(-3px);
}

.ib-rs-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	gap: 64px;
	align-items: start;
}

.ib-rs-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-bottom: 22px;
}
.ib-rs-done {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px 5px 8px;
	border-radius: 999px;
	background: rgba(33, 172, 24, .1);
	color: #168a10;
	font-size: 13px;
	font-weight: 700;
}
.ib-rs-done svg {
	width: 16px;
	height: 16px;
	padding: 3px;
	border-radius: 50%;
	background: var(--ib-cta-green, #21ac18);
	color: #fff;
}
.ib-rs-tag {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--ib-border, #dce3ef);
	font-size: 13px;
	font-weight: 600;
	color: var(--ib-muted, #6b7b95);
}

.ib-rs-title {
	font-size: 34px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--ib-heading-blue, #1972b6);
	margin: 0 0 18px;
	letter-spacing: 0;
	text-align: left;
}

.ib-rs-sub {
	font-size: 16px;
	line-height: 1.6;
	color: var(--ib-text-soft, #4f4f4f);
	margin: 0 0 36px;
	max-width: 640px;
}

/* parametry jako tichý pás pod podtitulkem */
.ib-rs-params {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	margin: 0;
	border-top: 1px solid var(--ib-border-soft, #e5e9ef);
}
.ib-rs-param {
	padding: 14px 16px 14px 0;
	border-bottom: 1px solid var(--ib-border-soft, #e5e9ef);
}
.ib-rs-param dt {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--ib-muted, #6b7b95);
	margin: 0 0 4px;
}
.ib-rs-param dd {
	font-size: 15px;
	font-weight: 600;
	color: var(--ib-text, #2d2d2d);
	margin: 0;
	line-height: 1.35;
}

.ib-rs-hero-media {
	position: relative;
	align-self: center;
	aspect-ratio: 4 / 3;
	border-radius: var(--ib-radius-photo, 14px);
	overflow: hidden;
	background: linear-gradient(135deg, #e8ecf1, #f3f5f8);
}
.ib-rs-hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ib-rs-hero-media.is-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b8cfe0;
}
.ib-rs-hero-media.is-empty > svg {
	width: 48px;
	height: 48px;
}
/* razítko "Prodáno v roce / rok" v levém horním rohu fotky */
.ib-rs-sold {
	position: absolute;
	top: 16px;
	left: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 13px 9px;
	border-radius: 10px;
	background: var(--ib-cta-green, #21ac18);
	color: #fff;
	box-shadow: 0 6px 18px rgba(14, 80, 20, .28);
	text-align: center;
	line-height: 1;
}
.ib-rs-sold-lbl {
	font-size: 11.5px;
	font-weight: 600;
	opacity: .9;
	margin-bottom: 4px;
	white-space: nowrap;
}
.ib-rs-sold-year {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: .3px;
}

/* ── 2. průběh transakce + CTA (bílá) ─────────────────────────────────── */
.ib-rs-story {
	background: #fff;
	padding: 64px 0 64px;
}

.ib-rs-main {
	max-width: 820px;
}

.ib-rs-h2 {
	font-size: 24px;
	font-weight: 700;
	color: var(--ib-heading-blue, #1972b6);
	margin: 0 0 16px;
	text-align: left;
	letter-spacing: 0;
}

.ib-rs-content {
	font-size: 16px;
	line-height: 1.75;
	color: var(--ib-text, #2d2d2d);
}
.ib-rs-content p {
	margin: 0 0 1.1em;
}
.ib-rs-content > :last-child {
	margin-bottom: 0;
}
.ib-rs-content h2,
.ib-rs-content h3 {
	color: var(--ib-heading-blue, #1972b6);
	font-weight: 700;
	margin: 1.6em 0 .6em;
	text-align: left;
}
.ib-rs-content ul,
.ib-rs-content ol {
	padding-left: 1.3em;
	margin: 0 0 1.1em;
}
.ib-rs-content li {
	margin-bottom: .4em;
}
.ib-rs-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ib-radius-photo, 14px);
}

.ib-rs-quote {
	max-width: 820px;
	margin: 32px 0 0;
	padding: 24px 28px;
	background: var(--ib-bg, #f6f8fb);
	border-left: 4px solid var(--ib-cta-blue, #1972b6);
	border-radius: 0 var(--ib-radius-card, 18px) var(--ib-radius-card, 18px) 0;
}
.ib-rs-quote blockquote {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	font-size: 17px;
	line-height: 1.6;
	font-style: italic;
	color: var(--ib-text, #2d2d2d);
}
.ib-rs-quote figcaption {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 14px;
	color: var(--ib-muted, #6b7b95);
}
.ib-rs-quote figcaption strong {
	display: block;
	font-size: 15px;
	color: var(--ib-text, #2d2d2d);
}
.ib-rs-quote-logo {
	max-height: 40px;
	max-width: 110px;
	width: auto;
	object-fit: contain;
}

/* CTA - stejně tiché jako .ib-detail-ctabox na detailu nabídky */
.ib-rs-cta {
	margin-top: 40px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 22px;
	padding: 34px 36px;
	background: var(--ib-bg-tint, #bdcae314);
	border: 1px solid var(--ib-border-soft, #e5e9ef);
	border-radius: 16px;
}
.ib-rs-cta-intro {
	max-width: 760px;
}
.ib-rs-cta-h {
	font-size: 24px;
	line-height: 1.4;
	font-weight: 700;
	color: var(--ib-heading-blue, #1972b6);
	margin: 0 0 6px;
	text-align: left;
	letter-spacing: 0;
}
.ib-rs-cta-intro p {
	font-size: 15px;
	line-height: 1.6;
	color: var(--ib-text-soft, #4f4f4f);
	margin: 0;
}
.ib-rs-cta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.ib-rs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 16px;
	border-radius: var(--ib-radius-btn, 9px);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	transition: background .2s, border-color .2s;
}
.ib-rs-btn svg {
	width: 16px;
	height: 16px;
	flex: none;
}
.ib-rs-btn--green {
	padding: 12px 24px;
	font-weight: 700;
	background: var(--ib-cta-green, #21ac18);
	color: #fff;
	border: 1px solid var(--ib-cta-green, #21ac18);
	box-shadow: 0 4px 14px rgba(33, 172, 24, .25);
}
.ib-rs-btn--green:hover,
.ib-rs-btn--green:focus {
	background: var(--ib-cta-green-hover, #0e8f1b);
	border-color: var(--ib-cta-green-hover, #0e8f1b);
	color: #fff;
	text-decoration: none;
}
.ib-rs-btn--ghost {
	border: 1px solid #bcd4ec;
	background: #fff;
	color: #0e66a9;
}
.ib-rs-btn--ghost:hover,
.ib-rs-btn--ghost:focus {
	background: #eef5fc;
	border-color: #9fc3e6;
	color: #0e66a9;
	text-decoration: none;
}

/* ── 3. carousel dalších referencí (šedá) ─────────────────────────────── */
.ib-rs-more {
	background: var(--ib-bg, #f6f8fb);
}

/* ── 4. konzultace - na detailu reference bílá, ať se sekce dál střídají ── */
.single-reference .ib-konzultace {
	background: #fff;
}
/* nadpis carouselu ve stejném měřítku jako zbytek detailu (na homepage je 36px) */
.ib-rs-more .ref-head__title {
	font-size: 28px;
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ib-rs-back,
	.ib-rs-back svg,
	.ib-rs-btn {
		transition: none;
	}
}

/* ── tablet ───────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
	.ib-rs-hero-grid {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 40px;
	}
	.ib-rs-params {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ── telefon (boční odsazení drží .container přes --ib-gutter) ──────────── */
@media (max-width: 767px) {
	.ib-rs-hero {
		padding: 24px 0 44px;
	}
	.ib-rs-back {
		margin-top: 24px;
	}
	.ib-rs-hero-grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}
	/* fotka nahoru, nižší */
	.ib-rs-hero-media {
		order: -1;
		aspect-ratio: 16 / 9;
	}
	.ib-rs-sold {
		top: 12px;
		left: 12px;
		padding: 6px 11px 7px;
	}
	.ib-rs-sold-year {
		font-size: 15px;
	}
	.ib-rs-meta {
		margin-bottom: 16px;
	}
	.ib-rs-title {
		font-size: 26px;
		margin-bottom: 14px;
	}
	.ib-rs-sub {
		font-size: 15px;
		margin-bottom: 26px;
	}
	.ib-rs-param {
		padding: 12px 12px 12px 0;
	}
	.ib-rs-story {
		padding: 44px 0 48px;
	}
	.ib-rs-h2 {
		font-size: 21px;
	}
	.ib-rs-quote {
		padding: 20px var(--ib-card-pad, 20px);
	}
	.ib-rs-quote blockquote {
		font-size: 16px;
	}
	.ib-rs-cta {
		margin-top: 32px;
		align-items: stretch;
		padding: 30px var(--ib-card-pad, 20px) 32px;
	}
	.ib-rs-cta-h {
		font-size: 21px;
	}
	.ib-rs-cta-row {
		flex-direction: column;
		align-items: stretch;
	}
	.ib-rs-btn {
		white-space: normal;
	}
	.ib-rs-more .ref-head__title {
		font-size: 22px;
	}
}

/* ── tisk ─────────────────────────────────────────────────────────────── */
@media print {
	.ib-rs-back,
	.ib-rs-cta,
	.ib-rs-more {
		display: none !important;
	}
	.ib-rs-hero,
	.ib-rs-story {
		background: none;
		padding: 0 0 24px;
	}
}
