/*
Theme Name: Empack Flexibles
Theme URI: https://empack.cl
Author: Cousoft
Description: Block theme for the Empack Flexibles marketing site. Homepage layout matches the brand landing (hero, why-choose, clients, footer).
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 8.0
Version: 1.2.8
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: empack-flexibles
Tags: one-column, custom-colors, custom-menu, custom-logo, full-site-editing, block-patterns, wide-blocks
*/

:root {
	--empack-green: #48a028;
	--empack-green-dark: #3d8a22;
	--empack-green-nav: #48a028;
	--empack-ink: #1a1a1a;
	--empack-muted: #3a3a3a;
	--empack-max: 1100px;
	--empack-footer-h: 100px;
}

html,
body {
	height: 100%;
	margin: 0;
}

.wp-site-blocks {
	padding: 0;
}

.home,
.page-template-page-maintenance {
	height: 100%;
}

.home .wp-site-blocks,
.page-template-page-maintenance .wp-site-blocks {
	display: flex;
	flex-direction: column;
	gap: 0;
	height: 100dvh;
	min-height: 100dvh;
}

.admin-bar.home .wp-site-blocks,
.admin-bar.page-template-page-maintenance .wp-site-blocks {
	height: calc(100dvh - 32px);
	min-height: calc(100dvh - 32px);
}

.home .wp-site-blocks > *,
.page-template-page-maintenance .wp-site-blocks > * {
	margin-block: 0 !important;
}

a {
	color: inherit;
}

/* ----- Overlay header only on the landing hero ----- */
.empack-front .empack-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
	background: transparent;
}

.empack-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	background: var(--empack-green-nav);
}

.empack-header__inner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
}

.empack-logo {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 20px 28px 0;
	text-decoration: none;
	color: var(--empack-ink);
}

.empack-logo img {
	display: block;
	width: 132px;
	height: auto;
}

.empack-nav {
	background: var(--empack-green-nav);
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 16px 40px 16px 48px;
	margin-left: auto;
}

.empack-nav .wp-block-navigation,
.empack-nav .wp-block-navigation-item a,
.empack-nav a {
	color: #fff !important;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.empack-nav .wp-block-navigation__container {
	gap: 28px;
}

/* Inner pages and maintenance: solid header bar */
body:not(:has(.empack-front)) .empack-header {
	position: relative;
	background: var(--empack-green-nav);
}

body:not(:has(.empack-front)) .empack-header img {
	filter: none;
}

/* ----- Maintenance: full-bleed photo, no gap before footer ----- */
.empack-maint.wp-block-cover {
	flex: 1 1 auto;
	align-self: stretch;
	width: 100% !important;
	max-width: none !important;
	height: calc(100dvh - var(--empack-footer-h)) !important;
	min-height: calc(100dvh - var(--empack-footer-h)) !important;
	margin: 0 !important;
	padding: 0 !important;
	left: auto;
	overflow: hidden;
}

.admin-bar .empack-maint.wp-block-cover {
	height: calc(100dvh - 32px - var(--empack-footer-h)) !important;
	min-height: calc(100dvh - 32px - var(--empack-footer-h)) !important;
}

.empack-maint.wp-block-cover .wp-block-cover__image-background {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: center center !important;
}

.empack-maint .wp-block-cover__inner-container {
	position: relative;
	width: 100%;
	min-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.empack-maint__logo {
	position: absolute;
	top: 24px;
	left: 28px;
	margin: 0;
	width: 88px;
	z-index: 2;
}

.empack-maint__logo img {
	width: 88px !important;
	max-width: 88px !important;
	height: auto !important;
	filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

.empack-maint__cta {
	position: relative;
	z-index: 1;
	width: 92%;
	max-width: 1100px;
	transform: translateY(calc(10vh));
}

.empack-maint__cta.empack-hero-cta {
	max-width: 1000px;
	padding: 18px 18px;
	background: rgb(72 160 40 / 70%);
}

.empack-maint__cta h1,
.empack-maint__cta p {
	color: #fff !important;
}

.empack-maint__cta h1 {
	margin: 0;
	font-size: clamp(1rem, 2vw, 1.25rem);
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.35;
	text-transform: uppercase;
}

.empack-maint__cta p {
	margin: 8px 0 0;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
	opacity: 0.95;
}

.empack-header--simple {
	padding: 20px 32px;
}

/* ----- Hero ----- */
.empack-hero {
	position: relative;
	min-height: min(78vh, 720px);
}

.empack-hero .wp-block-cover__inner-container {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.empack-hero-cta {
	background: rgb(72 160 40 / 78%);
	color: #fff;
	border-radius: 999px;
	padding: 8px 28px;
	max-width: 720px;
	margin: 0 auto;
	text-align: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.empack-hero-cta p,
.empack-hero-cta .wp-block-heading {
	color: #fff !important;
	font-size: clamp(0.95rem, 1.6vw, 1.15rem);
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.35;
	text-transform: uppercase;
	margin: 0;
}

/* ----- Why choose ----- */
.empack-why {
	padding: 72px 24px 48px;
}

.empack-why__title {
	text-align: center;
	font-size: clamp(1.6rem, 3vw, 2rem);
	font-weight: 800;
	margin: 0 0 20px;
}

.empack-why__intro {
	max-width: 820px;
	margin: 0 auto 48px;
	text-align: center;
	font-size: 0.98rem;
	line-height: 1.65;
	color: var(--empack-muted);
}

.empack-why__grid {
	max-width: var(--empack-max);
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px 64px;
}

.empack-feature {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: 16px 18px;
	align-items: start;
}

.empack-feature__icon {
	width: 56px;
	height: 56px;
	color: var(--empack-green-dark);
}

.empack-feature h3 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	font-weight: 800;
}

.empack-feature p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--empack-muted);
}

/* ----- Clients ----- */
.empack-clients {
	padding: 24px 24px 72px;
	text-align: center;
}

.empack-clients__label {
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	margin: 0 0 28px;
}

.empack-clients__row {
	max-width: 980px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
}

.empack-clients__btn {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	font-size: 1.8rem;
	line-height: 1;
	color: #111;
	cursor: pointer;
}

.empack-clients__track {
	display: flex;
	align-items: center;
	gap: 48px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	flex: 1;
	padding: 8px 0;
}

.empack-clients__track::-webkit-scrollbar {
	display: none;
}

.empack-clients__item {
	flex: 0 0 auto;
	scroll-snap-align: center;
	min-width: 140px;
	max-width: 180px;
	filter: grayscale(1);
	opacity: 0.9;
}

.empack-clients__item img,
.empack-clients__item svg {
	display: block;
	width: 100%;
	height: 56px;
	object-fit: contain;
}

/* ----- Footer ----- */
.home footer.wp-block-template-part,
.page-template-page-maintenance footer.wp-block-template-part {
	margin: 0;
	width: 100%;
	max-width: none;
}

.empack-footer {
	background: var(--empack-green);
	color: #fff;
	padding: 16px 32px;
	width: 100%;
	margin: 0;
}

.empack-footer__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	text-align: center;
}

.empack-footer .empack-footer__logo img,
.empack-footer .empack-footer__logo {
	width: 62px;
	margin: 0;
}

.empack-footer .empack-footer__logo img {
	filter: brightness(0) invert(1);
}

.empack-footer__nav {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
	color: #fff;
	text-align: center;
}

.empack-footer__nav p {
	margin: 0;
	color: #fff !important;
	font-size: 0.95rem;
	line-height: 1.55;
}

.empack-footer__heading {
	font-weight: 800;
	margin-bottom: 0 !important;
}

.empack-footer__nav a,
.empack-footer .wp-block-navigation-item a {
	color: #fff !important;
	text-decoration: none;
	font-size: 0.95rem;
	line-height: 1.5;
}

.empack-footer__nav a:hover {
	text-decoration: underline;
}

@media (max-width: 782px) {
	.empack-header {
		flex-direction: column;
		align-items: stretch;
	}

	.empack-nav {
		width: 100%;
		justify-content: center;
		padding: 12px 16px;
		flex-wrap: wrap;
		gap: 16px;
	}

	.empack-why__grid {
		grid-template-columns: 1fr;
	}

	.empack-footer__inner {
		flex-direction: column;
		align-items: center;
		padding: 0;
	}

	.empack-hero-cta {
		margin: 0 16px;
		padding: 16px 20px;
		border-radius: 28px;
	}

	.empack-maint__cta {
		width: 90%;
		transform: translateY(calc(10vh));
	}

	.empack-maint__cta.empack-hero-cta {
		padding: 8px 20px;
	}

	.empack-maint__logo {
		top: 16px;
		left: 16px;
		width: 72px;
	}

	.empack-maint__logo img {
		width: 72px !important;
		max-width: 72px !important;
	}
}
