/*
Theme Name: Vivai Pozzi
Description: Tema leggero per Grandi Vivai Ernesto Pozzi. Sostituisce Vigor mantenendone l'aspetto.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: vivaipozzi
*/

@font-face { font-family: "Oswald"; font-weight: 300; font-display: swap; src: url(fonts/oswald-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 400; font-display: swap; src: url(fonts/oswald-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 300; font-display: swap; src: url(fonts/open-sans-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 300; font-style: italic; font-display: swap; src: url(fonts/open-sans-latin-300-italic.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url(fonts/open-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/open-sans-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url(fonts/open-sans-latin-700-normal.woff2) format("woff2"); }

:root {
	--frame: #0a1c0a;
	--text: #7d7b79;
	--heading: #111;
	--accent: #818570;
	--accent-strong: #00540c;
	--link: #ba2525;
	--menu-active: #ede621;
	--rule: #a2a3a0;
	--footer: #27301b;
	--footer-band: #514d30;
	--footer-text: #8a8b86;
	--gutter: clamp(16px, 2vw, 27px);
	--display: "Oswald", "Arial Narrow", sans-serif;
	--body: "Open Sans", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--frame);
	color: var(--text);
	font: 300 16px/1.65 var(--body);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }
strong, b { font-weight: 700; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--display);
	font-weight: 400;
	color: var(--heading);
	text-transform: uppercase;
	line-height: 1.25;
	margin: 0 0 .6em;
	text-wrap: balance;
}
h2 { font-size: 34px; }
h3 { font-size: 24px; }
h4 { font-family: var(--body); font-weight: 300; font-style: italic; text-transform: none; font-size: 18px; color: var(--text); }
p { margin: 0 0 1em; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }
.skip-link:focus { left: 8px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--menu-active); outline-offset: 2px; }

/* Cornice scura (passepartout) attorno alla pagina */
.frame {
	position: relative;
	margin: 36px var(--gutter) 0;
	background: #fff;
	min-height: calc(100vh - 36px);
	display: flex;
	flex-direction: column;
}

/* Header sovrapposto all'immagine */
.site-header {
	position: absolute;
	inset: 0 0 auto;
	z-index: 10;
	background: rgba(10, 28, 10, .5);
}
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; justify-content: center; flex-wrap: wrap; }
.main-nav li { position: relative; }
.main-nav a {
	display: block;
	padding: 4px 17px;
	font: 300 18px/32px var(--display);
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a { color: var(--menu-active); }
.main-nav .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 230px;
	padding: 8px 0;
	background: rgba(0, 0, 0, .7);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s .2s;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.main-nav .sub-menu a { font-size: 14px; line-height: 22px; padding: 6px 20px; }
.menu-toggle { display: none; }

/* Fascia titolo pagina */
.page-title {
	position: relative;
	display: grid;
	place-content: center;
	text-align: center;
	min-height: 286px;
	padding: 76px 20px 40px;
	background: var(--frame) center / cover no-repeat;
	isolation: isolate;
}
.page-title.has-image::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .25); z-index: -1; }
.page-title h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(32px, 5vw, 50px);
	line-height: 1.3;
	letter-spacing: 5px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.page-title__sub { margin: 4px 0 0; color: #fff; font: italic 400 18px/1.4 var(--body); text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

/* Slider della home: dissolvenza in CSS */
.hero { position: relative; height: clamp(360px, 62vw, 650px); overflow: hidden; background: #000; }
.hero__slide {
	position: absolute;
	inset: 0;
	background: center / cover no-repeat;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 60px 8%;
	opacity: 0;
	animation: hero-fade 18s infinite;
}
.hero__slide:nth-child(1) { animation-delay: 0s; }
.hero__slide:nth-child(2) { animation-delay: 6s; }
.hero__slide:nth-child(3) { animation-delay: 12s; }
@keyframes hero-fade {
	0% { opacity: 0; }
	5%, 33% { opacity: 1; }
	38%, 100% { opacity: 0; }
}
.hero__text { text-align: right; max-width: 560px; }
.hero__title {
	margin: 0;
	color: #fff;
	font: 400 clamp(36px, 6vw, 70px)/1.06 var(--display);
	letter-spacing: 6px;
	text-transform: uppercase;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.hero__place { margin: 12px 0 0; color: #fff; font: italic 400 19px/30px var(--body); }
@media (prefers-reduced-motion: reduce) {
	.hero__slide { animation: none; }
	.hero__slide:first-child { opacity: 1; }
}

/* Contenuto */
.content {
	flex: 1;
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 50px 20px 60px;
}
.content > * + * { margin-top: 0; }
.content .alignwide { max-width: 1140px; }
.content .alignfull { margin-inline: -20px; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
.has-text-align-justify { text-align: justify; }

.wp-block-separator {
	border: 0;
	border-top: 1px dotted var(--rule);
	margin: 30px 0;
	opacity: 1;
}
.wp-block-columns { gap: 44px; margin-bottom: 30px; }
.wp-block-image { margin: 0 0 1em; }
.wp-block-image.is-style-rounded img { max-width: 330px; border-radius: 50%; padding: 6px; border: 1px solid #eee; background: #fff; }
.wp-block-image.vp-shadow img { padding: 6px; box-shadow: 0 0 4px rgba(0, 0, 0, .12); }

/* Gallerie a griglia quadrata come nel vecchio sito */
.wp-block-gallery.has-nested-images { margin: 0 0 20px; }
.wp-block-gallery.has-nested-images figure.wp-block-image { aspect-ratio: 1; min-width: 0; flex-grow: 0; }
.wp-block-gallery.has-nested-images figure.wp-block-image img { width: 100%; height: 100%; object-fit: cover; }
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	background: none;
	color: var(--text);
	font-size: 13px;
	padding: 6px 0 0;
	text-shadow: none;
	text-align: left;
	max-height: none;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before { display: none; }
.wp-block-gallery figure.wp-block-image { transition: opacity .2s ease; }
.wp-block-gallery figure.wp-block-image:hover { opacity: .85; }

/* Citazione */
.wp-block-quote {
	position: relative;
	border: 0;
	margin: 30px 0;
	padding: 0 0 0 110px;
}
.wp-block-quote::before {
	content: "\201D";
	position: absolute;
	left: 30px;
	top: -10px;
	font: 400 110px/1 Georgia, serif;
	color: var(--accent);
}
.wp-block-quote p { font: 400 24px/1.35 var(--display); text-transform: uppercase; color: var(--accent); letter-spacing: .5px; }

/* Riquadro con bordi verdi (home) */
.vp-boxed { border-inline: 4px solid var(--accent-strong); padding: 10px 40px; margin: 50px 0 40px; }

/* Titolo in riquadro con linee (Azienda) */
.vp-boxed-title { display: flex; align-items: center; gap: 0; margin: 20px 0 40px; }
.vp-boxed-title::before, .vp-boxed-title::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.vp-boxed-title span { border: 1px solid var(--rule); padding: 12px 40px; font: 700 16px/1.4 var(--body); letter-spacing: 6px; color: #333; text-transform: uppercase; }

/* Barre percentuali (Azienda) */
.vp-bars { list-style: none; margin: 0; padding: 0; }
.vp-bars li { margin-bottom: 18px; font-size: 14px; font-weight: 400; }
.vp-bars .bar { display: block; height: 15px; border-radius: 25px; background: #f5f5f4; margin-top: 4px; overflow: hidden; }
.vp-bars .bar span { display: block; height: 100%; border-radius: 25px; background: #adb0a3; }

/* Mappa */
.vp-map iframe { display: block; width: 100%; height: 480px; border: 0; filter: grayscale(.9) brightness(1.05); }

.button, .wp-block-button__link {
	display: inline-block;
	background: #454642;
	color: #fff;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 12px 34px;
	border-radius: 0;
}
.button:hover, .wp-block-button__link:hover { background: var(--accent); color: #fff; }

/* Footer */
.site-footer {
	background: var(--footer);
	border-top: 25px solid var(--footer-band);
	color: var(--footer-text);
	font-size: 13px;
	text-align: center;
	padding: 30px 20px 25px;
}
.site-footer p { margin: 0 0 12px; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.site-footer p a { color: var(--link); }
.footer-menu { list-style: none; margin: 0 0 16px; padding: 0; }

/* Mobile */
@media (max-width: 1000px) {
	.frame { margin-top: 0; }
	.site-header { position: relative; background: var(--frame); min-height: 64px; }
	.menu-toggle {
		display: block;
		position: absolute;
		left: 12px;
		top: 10px;
		width: 44px;
		height: 44px;
		background: none;
		border: 0;
		cursor: pointer;
	}
	.menu-toggle__bar, .menu-toggle__bar::before, .menu-toggle__bar::after {
		display: block;
		position: absolute;
		left: 11px;
		width: 22px;
		height: 2px;
		background: #fff;
		transition: transform .2s ease, opacity .2s ease;
	}
	.menu-toggle__bar { top: 21px; }
	.menu-toggle__bar::before, .menu-toggle__bar::after { content: ""; left: 0; }
	.menu-toggle__bar::before { top: -7px; }
	.menu-toggle__bar::after { top: 7px; }
	.menu-open .menu-toggle__bar { background: transparent; }
	.menu-open .menu-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
	.menu-open .menu-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }
	.main-nav { display: none; padding: 64px 0 12px; }
	.menu-open .main-nav { display: block; }
	.main-nav > ul { display: block; }
	.main-nav a { padding: 8px 24px; font-size: 16px; }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; background: none; padding: 0 0 0 16px; }
	.page-title { min-height: 200px; padding-top: 40px; }
	.hero__slide { padding: 30px 6%; }
}
@media (max-width: 781px) {
	.vp-boxed { padding: 10px 20px; }
	.wp-block-quote { padding-left: 70px; }
	.wp-block-quote::before { left: 0; font-size: 90px; }
	.wp-block-quote p { font-size: 20px; }
	.has-text-align-justify { text-align: left; }
	.wp-block-columns .has-text-align-right { text-align: left; }
	.vp-map iframe { height: 340px; }
}
