/*
Theme Name: ROPEKO
Description: Small theme for ropeko.sk. Pages, header, menu and footer are built in Elementor.
Version: 0.5.3
Requires at least: 7.1
Requires PHP: 8.2
Text Domain: ropeko
*/

/* Colours, headings and text come from Elementor's site settings (content/templates/kit.json).
   Here is only what those settings can't hold. */

body {
	margin: 0;
	background: #fff;
}

b,
strong {
	font-weight: 700;
}

.elementor-widget-text-editor p {
	margin: 0 0 10px;
}

.elementor-widget-text-editor ul {
	margin: 0 0 10px;
	padding-left: 20px;
}

/* Table with numbers. Where it doesn't fit, it scrolls by itself and the first column stays in view. */
.ropeko-table {
	margin: 0 0 15px;
	overflow-x: auto;
}

.ropeko-table:focus-visible {
	outline: 2px solid #4aa146;
	outline-offset: 2px;
}

.ropeko-table table {
	width: 100%;
	border-collapse: separate; /* Collapsed borders don't move with the first column. */
	border-spacing: 0;
	font-size: 13px;
	line-height: 1.3;
}

.ropeko-table th,
.ropeko-table td {
	padding: 8px 5px;
	border-bottom: 1px solid #ddd;
	background: #fff;
	color: #333;
	text-align: right;
}

.ropeko-table thead th {
	background: #333;
	color: #fff;
	font-weight: 500;
	vertical-align: bottom;
}

.ropeko-table th:first-child {
	position: sticky;
	left: 0;
	text-align: left;
	white-space: nowrap;
}

/* Smaller desktops: the column is half the screen, and the whole table still fits. */
@media (min-width: 1025px) and (max-width: 1600px) {
	.ropeko-table table {
		font-size: 12px;
	}

	.ropeko-table th,
	.ropeko-table td {
		padding: 8px 3px;
	}
}

/* Buttons: one look, five sizes. Settings on a single button still win. */
body[class*="elementor-kit-"] .elementor-button {
	border-radius: 0;
	background-color: #4aa146;
	color: #fff;
	font-family: "Red Hat Text", sans-serif;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 1px;
	text-transform: uppercase;
}

body[class*="elementor-kit-"] .elementor-button:hover,
body[class*="elementor-kit-"] .elementor-button:focus {
	background-color: #000;
	color: #fff;
}

/* Tiles with the default button size have no size class in PRO Elements 4.4.2. Same as "sm". */
body[class*="elementor-kit-"] .elementor-button.elementor-cta__button {
	padding: 9px 16px;
	font-size: 13px;
}

body[class*="elementor-kit-"] .elementor-button.elementor-size-xs {
	padding: 7px 14px;
	font-size: 13px;
}

body[class*="elementor-kit-"] .elementor-button.elementor-size-sm {
	padding: 9px 16px;
	font-size: 13px;
}

body[class*="elementor-kit-"] .elementor-button.elementor-size-md {
	padding: 13px 18px 12px;
	font-size: 15px;
}

body[class*="elementor-kit-"] .elementor-button.elementor-size-lg {
	padding: 16px 26px;
	font-size: 17px;
}

body[class*="elementor-kit-"] .elementor-button.elementor-size-xl {
	padding: 18px 30px;
	font-size: 19px;
}

/* MENU in the topbar: the icon keeps its size when the text gets smaller on phones. */
.ropeko-menu-button .elementor-button-icon svg {
	width: 17px;
	height: 17px;
	margin: -1px 0;
}

/* Dark on light parts of the page. assets/js/contrast.js sets "is-on-light". */
:root {
	--ropeko-on-light: #333;
	--ropeko-on-light-hover: rgba(51, 51, 51, 0.75);
}

body .elementor-widget-button.ropeko-menu-button .elementor-button {
	transition: color 0.2s ease;
}

body .elementor-location-header .elementor-widget-button.ropeko-menu-button .elementor-button svg,
body .elementor-location-header .elementor-widget-button.ropeko-menu-button .elementor-button:hover svg,
body .elementor-location-header .elementor-widget-button.ropeko-menu-button .elementor-button:focus svg {
	fill: currentColor;
	transition: none;
}

body .elementor-location-header .elementor-widget-button.ropeko-menu-button.is-on-light .elementor-button {
	color: var(--ropeko-on-light);
}

body .elementor-location-header .elementor-widget-button.ropeko-menu-button.is-on-light .elementor-button:hover,
body .elementor-location-header .elementor-widget-button.ropeko-menu-button.is-on-light .elementor-button:focus {
	color: var(--ropeko-on-light-hover);
}

body .ropeko-menu-button .elementor-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	body .elementor-widget-button.ropeko-menu-button .elementor-button {
		transition: none;
	}
}

.ropeko-plain-menu {
	padding: 50px 20px 15px; /* Below the language tab */
	background: #171717;
}

.ropeko-plain-menu ul {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 25px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ropeko-plain-menu a {
	color: #fff;
}

/* contrast.js has to find the slideshow photo behind the topbar. */
.elementor-background-slideshow__slide__image {
	pointer-events: auto;
}

/* Links in the menu overlay may take two lines on phones. */
.ropeko-menu .elementor-nav-menu .elementor-item {
	white-space: normal;
	text-align: center;
	justify-content: center;
}

/* Current Elementor adds extra space next to icons. */
body .elementor-widget-icon-list .elementor-icon-list-icon + .elementor-icon-list-text {
	padding-inline-start: 0;
}

.elementor-button .elementor-button-icon .e-font-icon-svg {
	width: auto;
}

/* The old form had an empty row above the button. */
.elementor-form .e-form__buttons {
	margin-top: 21px;
}

/* Photo viewer: without this its icons slide under the close button and off the screen. */
.elementor-slideshow__header,
.elementor-slideshow__footer {
	box-sizing: border-box;
}

/* Photo viewer on phones: dark boxes behind the arrows, as before. Elementor has them only for font icons. */
@media (max-width: 767px) {
	.elementor-lightbox .elementor-swiper-button-next svg,
	.elementor-lightbox .elementor-swiper-button-prev svg {
		box-sizing: content-box;
		padding: 10px;
		background-color: rgba(0, 0, 0, 0.5);
	}
}

/* Language tab, as on the old site. Under the menu overlay and the photo viewer, so it doesn't cover their close button. */
.ropeko-languages {
	position: fixed;
	top: 0;
	right: 20px;
	z-index: 1000;
	font: 700 16px/28.9px Arial, Helvetica, sans-serif;
}

.admin-bar .ropeko-languages {
	top: 32px;
}

.ropeko-languages summary {
	padding: 6px 20px 3px;
	background: #5caf03;
	box-shadow: 0 0 9px rgba(0, 0, 0, 0.3);
	color: #fff;
	cursor: pointer;
	list-style: none;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}

.ropeko-languages summary::-webkit-details-marker {
	display: none;
}

.ropeko-languages ul {
	position: absolute;
	top: 50px;
	left: 50%;
	display: flex;
	margin: 0;
	padding: 0;
	border-radius: 2px;
	background: linear-gradient(#d0cbcb, #e7e3e3);
	box-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
	list-style: none;
	transform: translateX(-50%);
}

.ropeko-languages ul::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 50%;
	margin-left: -7px;
	border: 7px solid transparent;
	border-top-width: 0;
	border-bottom-color: #d0cbcb;
}

.ropeko-languages li a {
	position: relative;
	display: block;
	padding: 3px 5px 4px;
}

/* Easier to hit with a finger */
.ropeko-languages li a::after {
	content: "";
	position: absolute;
	inset: -6px 0 -12px;
}

.ropeko-languages img {
	display: block;
	width: 24px;
	height: 18px;
}

.ropeko-languages a[aria-current] {
	box-shadow: inset 0 -3px #4aa146;
}

.ropeko-languages summary:focus-visible,
.ropeko-languages a:focus-visible {
	outline: 2px solid #333;
	outline-offset: -2px;
}

.ropeko-languages summary:focus-visible {
	outline-color: #fff;
}

/* 404 page. Dark, so the topbar over it is white. */
.ropeko-404 {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 60vh;
	padding: 120px 5% 80px;
	background: #171717;
	color: #fff;
	text-align: center;
	text-wrap: balance;
}

body[class*="elementor-kit-"] .ropeko-404 h1 {
	margin: 0;
	color: #fff;
}

.ropeko-404 p {
	margin: 25px 0 35px;
}

.ropeko-404 .elementor-button {
	text-decoration: none;
}

/* The usual black would be lost on the dark background. */
body[class*="elementor-kit-"] .ropeko-404 .elementor-button:hover,
body[class*="elementor-kit-"] .ropeko-404 .elementor-button:focus {
	background-color: #fff;
	color: #333;
}

/* "Back to top" arrow */
body .ropeko-top {
	position: fixed;
	right: 10px;
	bottom: 10px;
	z-index: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(0, 0, 0, 0.2);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
}

body .ropeko-top.is-visible {
	opacity: 1;
	visibility: visible;
}

body .ropeko-top:hover,
body .ropeko-top:focus-visible {
	background: rgba(0, 0, 0, 0.4);
}

body .ropeko-top:focus-visible {
	outline: 2px solid #4aa146;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	body .ropeko-top {
		transition: none;
	}
}

/* Phones and tablets: no single short word left on the last line. */
@media (max-width: 1024px) {
	.elementor-heading-title,
	.elementor-cta__title {
		text-wrap: balance;
	}

	.elementor-widget-text-editor p,
	.elementor-widget-text-editor li {
		text-wrap: pretty;
	}

	/* Section headings with a very long word ("dvojplášťových") stay inside their column. */
	body .elementor .elementor-element.ropeko-long-word h3.elementor-heading-title {
		font-size: 3.6vw;
	}
}

/* Product photos on white: show the whole product, not a cut-out or a blown-up detail.
   On tablets the photo column is narrow and very tall, so the photo goes to the top. */
@media (max-width: 1024px) {
	.ropeko-whole-photo > .elementor-widget-wrap {
		background-color: #fff !important;
		background-position: center !important;
		background-repeat: no-repeat !important;
		background-size: contain !important;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.ropeko-whole-photo > .elementor-widget-wrap {
		background-position: center top 60px !important;
	}
}

/* Phones: page titles get smaller with the screen, so the longest word fits. */
@media (max-width: 767px) {
	body[class*="elementor-kit-"] .ropeko-404 h1,
	body .elementor-location-single .elementor-element.elementor-widget-heading h1.elementor-heading-title {
		font-size: clamp(24px, 9vw, 46px);
		line-height: 1.1;
		overflow-wrap: break-word;
	}

	body .elementor .elementor-element.ropeko-long-word h3.elementor-heading-title {
		font-size: min(8vw, 34px);
	}
}

/* The old theme changed heading sizes at 850 and 1050 px, Elementor changes everything else at 767 and 1024 px.
   Sizes are the phone and tablet sizes from kit.json. */
@media (min-width: 768px) and (max-width: 850px) {
	body[class*="elementor-kit-"] {
		--e-global-typography-the7_h1-font-size: 46px;
		--e-global-typography-the7_h2-font-size: 40px;
		--e-global-typography-the7_h3-font-size: 34px;
		--e-global-typography-the7_h4-font-size: 26px;
		--e-global-typography-the7_h5-font-size: 20px;
	}

	body[class*="elementor-kit-"] h1 {
		font-size: 46px;
	}

	body[class*="elementor-kit-"] h2 {
		font-size: 40px;
	}

	body[class*="elementor-kit-"] h3 {
		font-size: 34px;
	}

	body[class*="elementor-kit-"] h4 {
		font-size: 26px;
	}

	body[class*="elementor-kit-"] h5 {
		font-size: 20px;
	}
}

@media (min-width: 1025px) and (max-width: 1050px) {
	body[class*="elementor-kit-"] {
		--e-global-typography-the7_h1-font-size: 54px;
		--e-global-typography-the7_h2-font-size: 46px;
		--e-global-typography-the7_h3-font-size: 38px;
		--e-global-typography-the7_h4-font-size: 30px;
	}

	body[class*="elementor-kit-"] h1 {
		font-size: 54px;
	}

	body[class*="elementor-kit-"] h2 {
		font-size: 46px;
	}

	body[class*="elementor-kit-"] h3 {
		font-size: 38px;
	}

	body[class*="elementor-kit-"] h4 {
		font-size: 30px;
	}
}
