/* ==========================================================================
   Layout — page shell, containers, header, footer, full-screen sections.
   ========================================================================== */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1;
}

/* The header is fixed: push content down everywhere except the homepage,
   whose first section is full-screen and sits under the header. */
body:not(.home) .site-main {
	padding-top: var(--wp--custom--header--height);
}

/* Containers ------------------------------------------------------------ */
.container {
	width: 100%;
	max-width: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
}

.container--narrow {
	max-width: calc(var(--wp--style--global--content-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
}

/* Vertical rhythm helper: direct children spaced evenly. */
.stack > * {
	margin-block: 0;
}

.stack > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* Sections -------------------------------------------------------------- */
.section {
	padding-block: var(--wp--preset--spacing--60);
}

/* Homepage sections: full viewport height, content vertically centered. */
.fp-section {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	padding-block: 24px;
	overflow: hidden;
}

/* Section titles */
.fp-title {
	margin: 0 0 var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.fp-title--md {
	font-size: var(--wp--preset--font-size--xx-large);
	color: var(--wp--preset--color--primary);
	text-align: center;
}

.fp-title--xl {
	font-size: var(--wp--preset--font-size--huge);
}

/* Grids ----------------------------------------------------------------- */
.grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

.grid--cards {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* Header ---------------------------------------------------------------- */
.site-header {
	position: fixed;
	inset-inline: 0;
	top: 0;
	z-index: 50;
	pointer-events: none; /* Transparent bar: only its children are clickable. */
}

.admin-bar .site-header {
	top: var(--wp-admin--admin-bar--height, 0px);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	max-width: none;
	min-height: 86px; /* logo top at 24px, as in the original */
	padding-inline: var(--wp--preset--spacing--40);
}

.site-header__inner > * {
	pointer-events: auto;
}

.site-branding a {
	display: block;
}

.site-branding__title {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.site-branding .custom-logo {
	display: block;
	width: 190px;
	height: auto;
}

/* Footer ---------------------------------------------------------------- */
.site-footer {
	min-height: 408px;
	padding: 60px 0 34px;
	/* Brushed-metal texture (assets/images/footer-bg.jpg); the gradient is the fallback. */
	background:
		url("../images/footer-bg.jpg") center / cover no-repeat,
		linear-gradient(110deg, #ececec 0%, #c9c9c9 35%, #e6e6e6 60%, #b4b4b4 100%);
	color: var(--wp--preset--color--primary-dark);
	font-size: var(--wp--preset--font-size--x-small);
}

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

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

.site-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--40);
}

@media (min-width: 782px) {
	.site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Desktop: logo | menu | contacts, with the social/legal/copyright block
   sitting in the same third column, pushed to the bottom right. */
@media (min-width: 1024px) {
	.site-footer__grid {
		grid-template-columns: 285px 285px minmax(0, 1fr);
		gap: 0;
		padding-inline-end: 34px; /* 24px container padding + 10px */
		align-items: start;
	}

	.site-footer__brand {
		padding-inline: 10px;
	}

	.site-footer__contacts {
		grid-column: 3;
		grid-row: 1;
		max-width: 285px;
	}

	.site-footer__info {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
		width: 436px;
		margin-top: 208px;
	}
}

.site-footer__info {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	text-align: end;
}

.site-footer__info .social-links {
	min-height: 36px;
	align-items: flex-start;
}

.site-footer__copyright {
	margin: 11px 0 0;
}

@media (min-width: 1024px) {
	.site-footer__copyright {
		white-space: nowrap;
	}
}

@media (max-width: 1023.98px) {
	.site-footer__info {
		align-items: flex-start;
		text-align: start;
	}
}

/* Phones — measured against timsteel.pt at 375px. */
@media (max-width: 781.98px) {
	.fp-section {
		padding-block: 120px 60px;
	}

	.fp-title,
	.fp-title--md,
	.fp-title--xl {
		margin-inline-start: 0;
		font-size: 30px;
		line-height: 1;
		text-align: center;
	}

	.fp-title--md,
	.fp-title--xl {
		font-size: 33px;
	}

	/* Header: 68px bar, the icon replaces the full logo. */
	.site-header__inner {
		min-height: 68px;
	}

	.site-header .site-branding.has-mobile-logo .custom-logo-link,
	.site-header .site-branding.has-mobile-logo .site-branding__title {
		display: none;
	}

	.site-header .site-branding .site-branding__icon {
		display: block;
	}

	.site-header .site-branding__icon img {
		display: block;
		width: 50px;
		height: auto;
	}

	/* Footer: one centered column. */
	.site-footer {
		min-height: 0;
		padding: 70px 0 69px;
	}

	.site-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		gap: 0;
		text-align: center;
	}

	.site-footer__brand .site-branding {
		display: flex;
		justify-content: center;
	}

	.footer-nav {
		margin-top: 10px;
		width: 100%;
	}

	.site-footer .site-footer__contacts {
		margin-top: 38px;
	}

	.site-footer__info {
		align-items: center;
		margin-top: 71px;
		text-align: center;
	}

	.site-footer__info .social-links {
		justify-content: center;
	}

	.legal-nav__menu {
		justify-content: center;
	}
}

.site-branding .site-branding__icon {
	display: none;
}

@media (max-width: 781.98px) {
	body:not(.home) .site-main {
		padding-top: 68px; /* mobile header height */
	}
}
