/*
 * Shared layout (header, mobile menu, footer) for every page.
 * Plain CSS so pages with their own Tailwind build don't need to be rebuilt.
 * Breakpoints: tablet >= 768px, desktop >= 1024px.
 */

/* clip, not hidden: hidden turns body into its own scroll container and the sticky header stops sticking */
html,
body {
	overflow-x: clip;
}

/* Header */
body > header {
	position: sticky;
	top: 0;
	width: 100%;
	z-index: 50;
}

.site-header {
	position: relative;
	height: 64px;
	border-bottom: 1px solid #f1e3cf;
	background: #fefaf7 url(/src/Presentation/assets/images/bg-header.jpg) no-repeat center / cover;
}

.site-header::before {
	content: '';
	position: absolute;
	inset: 0;
	background-color: rgba(254, 250, 247, 0.55);
}

.site-header__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 0 16px;
}

.site-header__logo {
	display: block;
	flex-shrink: 0;
}

.site-header__logo img {
	display: block;
	width: 157px;
	height: 40px;
	object-fit: contain;
}

.site-header__side {
	display: flex;
	align-items: center;
	gap: 16px;
}

.site-header__side--left {
	display: none;
}

.site-header__menu {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-header__menu--other {
	gap: 20px;
}

.site-header__menu--other a {
	font-family: "Inter Medium", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #414651;
	text-decoration: none;
}

.site-header__menu--main {
	display: none;
	gap: 24px;
}

.site-header__menu--main a {
	font-family: "Inter Semi-Bold", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #ca502f;
	text-transform: uppercase;
	text-decoration: none;
}

.site-header__menu a:hover {
	opacity: 0.75;
}

.site-header__lang {
	display: none;
	font-family: "Inter Medium", sans-serif;
	font-size: 14px;
	color: #414651;
	text-decoration: none;
}

.site-header__icon {
	display: block;
	width: 24px;
	height: 24px;
}

.site-header__hamb {
	display: block;
	width: 28px;
	height: 28px;
	cursor: pointer;
}

.site-header__hamb img {
	display: block;
	width: 28px;
	height: 28px;
}

.site-header__hamb .icon-close,
.side-menu:checked ~ .site-header__inner .site-header__hamb .icon-menu {
	display: none;
}

.side-menu:checked ~ .site-header__inner .site-header__hamb .icon-close {
	display: block;
}

.side-menu {
	display: none;
}

/* Search box, opened by the search icon in the header */
.site-header__search {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

/* fixed like .mobile-nav: <header> has overflow hidden */
.site-search {
	position: fixed;
	top: 64px;
	right: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	border-bottom: 1px solid #f1e3cf;
	background-color: #fefaf7;
	box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08);
}

.site-search[hidden] {
	display: none;
}

.site-search__form {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 8px;
	max-width: 720px;
	margin: 0 auto;
	padding: 6px 6px 6px 14px;
	border: 1px solid #d5d7da;
	border-radius: 12px;
	background-color: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.site-search__form:focus-within {
	border-color: #ca502f;
}

.site-search__icon {
	display: block;
	flex-shrink: 0;
}

.site-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	background: transparent;
	font-family: "Inter Regular", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #181d27;
}

.site-search__input::placeholder {
	color: #717680;
}

.site-search__submit {
	flex-shrink: 0;
	padding: 8px 14px;
	border: 0;
	border-radius: 8px;
	background-color: #ca502f;
	font-family: "Inter Semi-Bold", sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: #fff;
	cursor: pointer;
}

.site-search__submit:hover {
	background-color: #b4441f;
}

.site-search__close {
	flex-shrink: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.site-search__close img {
	display: block;
}

/* Mobile menu */
.mobile-nav {
	display: none;
	position: fixed;
	top: 64px;
	right: 0;
	bottom: 0;
	left: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px 16px 24px;
	background-color: #fefaf7;
}

.side-menu:checked ~ .mobile-nav {
	display: block;
}

/* Lock the viewport (html), not body: an overflow on body would make it a scroll container and unstick the header */
@media (max-width: 1023px) {
	html:has(.side-menu:checked) {
		overflow: hidden;
	}
}

.mobile-nav__search {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 16px 0;
	padding: 10px 14px;
	border: 1px solid #d5d7da;
	border-radius: 8px;
	background-color: #fff;
	box-shadow: 0 1px 1px rgba(16, 24, 40, 0.05);
}

.mobile-nav__search input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	background: transparent;
	font-family: "Inter Regular", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #181d27;
}

.mobile-nav__search input::placeholder {
	color: #717680;
}

.mobile-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-nav__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	border-bottom: 1px solid #f1e3cf;
	font-family: "Lora Semi-Bold", serif;
	font-size: 20px;
	color: #181d27;
	text-decoration: none;
}

.mobile-nav__list a.active {
	color: #ca502f;
}

.mobile-nav__langs {
	display: flex;
	gap: 12px;
	padding-top: 24px;
}

.mobile-nav__langs a {
	padding: 8px 14px;
	border: 1px solid #f1d6c9;
	border-radius: 8px;
	background-color: #fff;
	font-family: "Lora Semi-Bold", serif;
	font-size: 16px;
	line-height: 24px;
	color: #ca502f;
	text-decoration: none;
}

.mobile-nav__langs a.active {
	border-color: #ca502f;
	background-color: #ca502f;
	color: #fff;
}

.mobile-nav__socials {
	display: flex;
	gap: 20px;
	padding-top: 24px;
}

/* Social icons are white images from the link library, tint them to #ca502f */
.mobile-nav__socials img {
	display: block;
	width: 24px;
	height: 24px;
	filter: brightness(0) saturate(100%) invert(38%) sepia(55%) saturate(1636%) hue-rotate(345deg) brightness(87%) contrast(89%);
}

/* Footer */
.site-footer {
	padding: 48px 16px;
	background-image: linear-gradient(to bottom, #dc7f63, #c94f2e);
	font-family: "Inter Regular", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #fefbfb;
}

.site-footer a {
	color: inherit;
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

.site-footer__inner {
	max-width: 1216px;
	margin: 0 auto;
}

.site-footer__top {
	display: flex;
	flex-direction: column;
	gap: 48px;
	padding-bottom: 48px;
}

.site-footer__logo img {
	display: block;
	width: 188px;
	height: 48px;
}

.site-footer__about {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 32px;
}

.site-footer__about p {
	margin: 0;
}

.site-footer__aside {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.site-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer__menu-title {
	margin-bottom: 16px;
	font-family: "Inter Semi-Bold", sans-serif;
	font-size: 18px;
	line-height: 28px;
	color: #ffe1e1;
}

.site-footer__menu-items {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	font-family: "Inter Semi-Bold", sans-serif;
}

.site-footer__bottom {
	display: flex;
	flex-direction: column;
	gap: 24px;
	color: #ffe1e1;
}

.site-footer__copyright {
	max-width: 640px;
}

.site-footer__links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	font-size: 14px;
	line-height: 20px;
}

.site-footer__socials {
	display: flex;
	align-items: center;
	gap: 12px;
}

.site-footer__socials img {
	display: block;
	width: 24px;
	height: 24px;
}

@media (min-width: 768px) {
	.site-header {
		height: 80px;
	}

	.site-header__inner {
		padding: 0 32px;
	}

	.site-header__logo img {
		width: 188px;
		height: 48px;
	}

	.site-header__lang {
		display: block;
	}

	.site-search {
		top: 80px;
		padding: 20px 32px;
	}

	.mobile-nav {
		top: 80px;
		padding-right: 32px;
		padding-left: 32px;
	}

	.site-footer {
		padding: 64px 32px 48px;
	}

	.site-footer__logo img {
		width: 236px;
		height: 60px;
	}

	.site-footer__links {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 12px 24px;
	}
}

@media (min-width: 1024px) {
	.site-header {
		height: 112px;
	}

	.site-header__inner {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		padding: 0 48px;
	}

	.site-header__side--left {
		display: flex;
	}

	.site-header__side--right {
		justify-content: flex-end;
		gap: 24px;
	}

	.site-header__logo img {
		width: 248px;
		height: 63px;
	}

	.site-header__menu--main {
		display: flex;
	}

	.site-search {
		top: 112px;
		padding: 24px 48px;
	}

	.site-header__lang,
	.site-header__hamb,
	.side-menu:checked ~ .mobile-nav {
		display: none;
	}

	.site-footer {
		padding-right: 112px;
		padding-left: 112px;
	}

	.site-footer__inner {
		display: grid;
		grid-template-columns: 75% 25%;
	}

	.site-footer__top {
		display: contents;
	}

	.site-footer__top > :first-child {
		grid-column: 1;
		grid-row: 1;
	}

	.site-footer__about {
		max-width: 590px;
	}

	.site-footer__aside {
		grid-column: 2;
		grid-row: 1 / span 2;
		padding-top: 92px;
	}

	.site-footer__menu-items {
		flex-direction: column;
		gap: 12px;
	}

	.site-footer__bottom {
		grid-column: 1;
		grid-row: 2;
		gap: 16px;
		margin-top: 32px;
	}

	.site-footer__copyright {
		max-width: 590px;
	}
}

/* Scroll to top */
.scroll-to-top {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: #c94f2e;
	color: #fefbfb;
	box-shadow: 0 4px 12px rgba(201, 79, 46, 0.35);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}

.scroll-to-top--visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
	background-color: #dc7f63;
}

.scroll-to-top:focus-visible {
	outline: 2px solid #fefbfb;
	outline-offset: -4px;
}

.scroll-to-top__icon {
	width: 20px;
	height: 20px;
}

@media (min-width: 768px) {
	.scroll-to-top {
		right: 24px;
		bottom: 24px;
		width: 48px;
		height: 48px;
	}
}

@media (min-width: 1024px) {
	.scroll-to-top {
		right: 40px;
		bottom: 40px;
		width: 56px;
		height: 56px;
	}

	.scroll-to-top__icon {
		width: 24px;
		height: 24px;
	}
}

/* Thin brand scrollbar on every scroll area, only visible while scrolling (see assets/js/scrollbar.js) */
:where(*) {
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
	transition: scrollbar-color .3s;
}

::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	border-radius: 6px;
	background-color: transparent;
}

:where(.--scrolling) {
	scrollbar-color: rgba(202, 80, 47, .6) transparent;
}

.--scrolling::-webkit-scrollbar-thumb {
	background-color: rgba(202, 80, 47, .6);
}

.--scrolling::-webkit-scrollbar-thumb:hover {
	background-color: #CA502F;
}
