/*
 * Sekce "Historie" - posuvna rada karet (fotka, rok, popisek).
 * Vsechny tridy maji predponu .sh- / .seco-hist, aby nekolidovaly s Woodmartem.
 * Navrh: Historie SECO (kolegyne), layout inspirovan sekci Historie na cubcadet.cz.
 * Fonty Kanit a Montserrat uz web nacita, tady se jen pouzivaji.
 */

.seco-hist {
	--sh-bg: #0e0e10;
	--sh-ink: #ffffff;
	--sh-text: #d6d6d8;
	--sh-muted: #9a9a9f;
	--sh-line: #3a3a3e;
	--sh-paper: #efece6;
	--sh-red: #eb183f;
	--sh-red-dark: #c10f31;
	--sh-gap: 17px;
	--sh-font-head: 'Kanit', 'Arial Narrow', Arial, sans-serif;
	--sh-font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;

	/* Tmave pozadi jako ostatni stranky (napr. /o-nas/), pres celou sirku okna
	   i uvnitr uzke (boxed) sekce: box-shadow + clip-path jen do stran. */
	background: var(--sh-bg);
	box-shadow: 0 0 0 100vmax var(--sh-bg);
	clip-path: inset(0 -100vmax);

	padding-block: 56px 72px;
	font-family: var(--sh-font-body);
	font-size: 15px;
	line-height: 1.6;
	color: var(--sh-text);
}

.seco-hist *,
.seco-hist *::before,
.seco-hist *::after {
	box-sizing: border-box;
}

.seco-hist .sh-wrap {
	max-width: 1480px;
	margin-inline: auto;
	padding-inline: 16px;
}

/* Uvodni nadpis sekce */
.seco-hist .sh-head {
	text-align: center;
	max-width: 760px;
	margin: 0 auto 36px;
}

.seco-hist .sh-eyebrow {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--sh-red);
}

.seco-hist .sh-title {
	margin: 0 0 12px;
	font-family: var(--sh-font-head);
	font-weight: 600;
	font-size: clamp(28px, 3.4vw, 42px);
	line-height: 1.15;
	color: var(--sh-ink);
	text-wrap: balance;
}

.seco-hist .sh-lead {
	margin: 0 auto;
	max-width: 60ch;
}

/* Posuvna rada karet (scroll-snap, bez knihovny) */
.seco-hist .sh-slider {
	position: relative;
}

.seco-hist .sh-track {
	display: flex;
	gap: var(--sh-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.seco-hist .sh-track::-webkit-scrollbar {
	display: none;
}

.seco-hist .sh-track:focus-visible {
	outline: 3px solid var(--sh-red);
	outline-offset: 4px;
}

.seco-hist .sh-card {
	flex: 0 0 calc((100% - 2 * var(--sh-gap)) / 3);
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
}

.seco-hist .sh-photo {
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #1c1c1f;
}

.seco-hist .sh-photo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}

/* Scany dokumentu se nezoruji, aby se neorizl text */
.seco-hist .sh-photo--contain {
	background: var(--sh-paper);
}

.seco-hist .sh-photo--contain img {
	object-fit: contain;
}

/* Cervena tecka na casove care pod fotkou */
.seco-hist .sh-rail {
	position: relative;
	height: 1px;
	width: calc(100% + var(--sh-gap));
	margin: 22px 0 16px;
	background: var(--sh-line);
}

.seco-hist .sh-rail::before {
	content: "";
	position: absolute;
	left: 0;
	top: -4px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--sh-red);
}

.seco-hist .sh-year {
	margin: 0 0 6px;
	font-family: var(--sh-font-head);
	font-weight: 700;
	font-size: 34px;
	line-height: 1;
	color: var(--sh-ink);
	font-variant-numeric: tabular-nums;
}

.seco-hist .sh-cap {
	margin: 0;
	font-family: var(--sh-font-body);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.45;
	color: var(--sh-ink);
}

.seco-hist .sh-txt {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--sh-text);
}

/* Ovladani: sipky, ukazatel postupu, pocitadlo */
.seco-hist .sh-controls {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-top: 34px;
}

.seco-hist .sh-btn {
	flex: none;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1.5px solid #fff;
	border-radius: 50%;
	background: transparent;
	color: var(--sh-ink);
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.seco-hist .sh-btn:hover:not(:disabled) {
	background: var(--sh-red);
	border-color: var(--sh-red);
	color: #fff;
}

.seco-hist .sh-btn:focus-visible {
	outline: 3px solid var(--sh-red);
	outline-offset: 3px;
}

.seco-hist .sh-btn:disabled {
	opacity: .3;
	cursor: default;
}

.seco-hist .sh-btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.seco-hist .sh-progress {
	position: relative;
	flex: 1;
	min-width: 0;
	height: 3px;
	background: var(--sh-line);
}

.seco-hist .sh-bar {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 30%;
	background: var(--sh-red);
	transition: left .2s, width .2s;
}

.seco-hist .sh-count {
	font-family: var(--sh-font-head);
	font-weight: 500;
	font-size: 15px;
	color: var(--sh-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Tlacitko "Cela historie firmy" */
.seco-hist .sh-more {
	display: flex;
	justify-content: center;
	margin-top: 44px;
}

.seco-hist .sh-pill {
	display: inline-block;
	padding: 15px 44px;
	border-radius: 99px;
	background: var(--sh-red);
	color: #fff;
	font-family: var(--sh-font-body);
	font-weight: 500;
	font-size: 14px;
	text-decoration: none;
	transition: background .15s;
}

.seco-hist .sh-pill:hover {
	background: var(--sh-red-dark);
	color: #fff;
}

.seco-hist .sh-pill:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/* Tablet: 2 karty vedle sebe */
@media (max-width: 1000px) {
	.seco-hist .sh-card {
		flex-basis: calc((100% - var(--sh-gap)) / 2);
	}
}

/* Mobil: jedna karta s kouskem dalsi */
@media (max-width: 620px) {
	.seco-hist {
		padding-block: 48px 56px;
	}

	.seco-hist .sh-card {
		flex-basis: 82%;
	}

	.seco-hist .sh-year {
		font-size: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.seco-hist .sh-track {
		scroll-behavior: auto;
	}

	.seco-hist .sh-bar {
		transition: none;
	}
}

/* ------------------------------------------------------------------
 * Odkaz na zvetseni fotky + ikona lupy
 * ------------------------------------------------------------------ */
.seco-hist .sh-zoom {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
	-webkit-user-drag: none;
}

.seco-hist .sh-zoom img {
	-webkit-user-drag: none;
	user-select: none;
	transition: transform .35s ease;
}

.seco-hist .sh-zoom:hover img,
.seco-hist .sh-zoom:focus-visible img {
	transform: scale(1.03);
}

.seco-hist .sh-zoom:focus-visible {
	outline: 3px solid var(--sh-red);
	outline-offset: -3px;
}

.seco-hist .sh-zoom-ico {
	position: absolute;
	right: 10px;
	bottom: 10px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(36, 36, 36, .72);
	color: #fff;
	opacity: 0;
	transition: opacity .2s, background .2s;
	pointer-events: none;
}

.seco-hist .sh-zoom-ico svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.seco-hist .sh-zoom:hover .sh-zoom-ico,
.seco-hist .sh-zoom:focus-visible .sh-zoom-ico {
	opacity: 1;
}

/* Na dotykovych zarizeni je lupa videt stale (neni hover) */
@media (hover: none) {
	.seco-hist .sh-zoom-ico {
		opacity: .9;
	}
}

/* ------------------------------------------------------------------
 * Tazeni mysi (JS pridava tridu is-drag a .sh-draggable)
 * ------------------------------------------------------------------ */
.seco-hist .sh-track.sh-draggable {
	cursor: grab;
}

.seco-hist .sh-track.is-drag {
	cursor: grabbing;
	user-select: none;
	scroll-snap-type: none;
	scroll-behavior: auto;
}

.seco-hist .sh-track.is-drag .sh-zoom {
	cursor: grabbing;
}

/* ------------------------------------------------------------------
 * Napoveda "pretahni do strany" (ruka + sipky, animace)
 * ------------------------------------------------------------------ */
.seco-hist .sh-hint {
	position: absolute;
	top: 0;
	left: 0;
	width: calc((100% - 2 * var(--sh-gap)) / 3);
	aspect-ratio: 3 / 2;
	display: grid;
	place-items: center;
	pointer-events: none;
	opacity: 0;
	z-index: 2;
}

.seco-hist .sh-hint.is-play {
	/* 3x animace ruky (3 x 1,8 s) a pak plynule zmizi */
	animation: sh-hint-in .3s ease forwards, sh-hint-out .5s ease 5.6s forwards;
}

.seco-hist .sh-hint.is-hidden {
	animation: none;
	opacity: 0;
	transition: opacity .25s;
}

.seco-hist .sh-hint-box {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 18px;
	border-radius: 99px;
	background: rgba(36, 36, 36, .78);
	color: #fff;
}

.seco-hist .sh-hint-arrow {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: .55;
}

.seco-hist .sh-hint-hand {
	width: 44px;
	height: 44px;
	overflow: visible;
	fill: #fff;
	stroke: #242424;
	stroke-width: 1.6;
	stroke-linejoin: round;
	transform-origin: 50% 90%;
}

.seco-hist .sh-hint-lines {
	fill: none;
	stroke: #bdbdbd;
	stroke-linecap: round;
}

.seco-hist .sh-hint.is-play .sh-hint-hand {
	animation: sh-hint-swipe 1.8s ease-in-out 3;
}

.seco-hist .sh-hint.is-play .sh-hint-arrow--l {
	animation: sh-hint-pulse-l 1.8s ease-in-out 3;
}

.seco-hist .sh-hint.is-play .sh-hint-arrow--r {
	animation: sh-hint-pulse-r 1.8s ease-in-out 3;
}

@keyframes sh-hint-in {
	to {
		opacity: 1;
	}
}

@keyframes sh-hint-out {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

/* Ruka se naklona a posune doleva, pak doprava (gesto "tahni do strany") */
@keyframes sh-hint-swipe {
	0%   { transform: translateX(14px) rotate(8deg); }
	45%  { transform: translateX(-14px) rotate(-10deg); }
	55%  { transform: translateX(-14px) rotate(-10deg); }
	100% { transform: translateX(14px) rotate(8deg); }
}

@keyframes sh-hint-pulse-l {
	0%, 100% { opacity: .35; transform: translateX(0); }
	45%, 55% { opacity: 1; transform: translateX(-5px); }
}

@keyframes sh-hint-pulse-r {
	0%, 100% { opacity: 1; transform: translateX(5px); }
	45%, 55% { opacity: .35; transform: translateX(0); }
}

@media (max-width: 1000px) {
	.seco-hist .sh-hint {
		width: calc((100% - var(--sh-gap)) / 2);
	}
}

@media (max-width: 620px) {
	.seco-hist .sh-hint {
		width: 82%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.seco-hist .sh-hint.is-play .sh-hint-hand,
	.seco-hist .sh-hint.is-play .sh-hint-arrow--l,
	.seco-hist .sh-hint.is-play .sh-hint-arrow--r {
		animation: none;
	}
}

/* ------------------------------------------------------------------
 * Bez bileho pruhu kolem sekce: obal obsahu Woodmartu ma vlastni odsazeni
 * a bile pozadi, na strance s Historii ho zrusime a obarvime na tmavo.
 * ------------------------------------------------------------------ */
body.seco-historie-page .main-page-wrapper {
	background-color: #0e0e10;
	margin-top: 0;
	padding-top: 0;
	padding-bottom: 0;
}

body.seco-historie-page .site-content,
body.seco-historie-page .wd-entry-content,
body.seco-historie-page .entry-content {
	margin-bottom: 0;
	padding-bottom: 0;
}

body.seco-historie-page .entry-content > p:empty {
	display: none;
}
