/*
Theme Name: EHS Italia
Theme URI: https://ehsitalia.com
Author: Studio di Ingegneria Ing. Antonio Levrone
Description: Tema per lo studio di ingegneria per la sicurezza sul lavoro EHS Italia: consulenza, documenti di sicurezza e formazione. Home con ricerca corsi, area aula, risorse e modulo di richiesta preventivo.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ehs-italia
*/

/* ==========================================================================
   1. Font (Archivo, variabile, incluso nel tema: nessuna richiesta a Google)
   ========================================================================== */
@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/archivo-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

/* ==========================================================================
   2. Colori e misure
   ========================================================================== */
:root {
	--navy: #0B1F3A;
	--navy-2: #14305A;
	--yellow: #FFC20E;
	--yellow-2: #FFD24A;
	--red: #C62828;
	--black: #000;
	--ink: #111827;
	--muted: #4B5563;
	--line: #D9DFE7;
	--soft: #F3F5F8;
	--tint: #EEF2F8;
	--field: #6B7686;
	--on-dark: #D5DDEB;
	--radius: 10px;
	--radius-sm: 6px;
	--wrap: 1200px;
	--space-section: clamp(48px, 7vw, 88px);
}

/* ==========================================================================
   3. Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: "Archivo", Arial, Helvetica, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--ink);
	background: #fff;
}

img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h3 { letter-spacing: 0; }
p { text-wrap: pretty; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; margin: 0 0 20px; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 1.3rem; font-weight: 700; margin: 14px 0 8px; }

:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--yellow); }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: var(--yellow); color: var(--navy); clip: auto; clip-path: none;
	display: block; font-weight: 700; height: auto; left: 8px; padding: 12px 18px;
	top: 8px; width: auto; z-index: 100000;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--space-section) 0; }
.section--soft { background: var(--soft); }
.lead { font-size: 1.125rem; color: var(--muted); margin: 0 0 36px; max-width: 640px; }
.on-dark { color: #fff; }

/* Fascia gialla e nera: la segnaletica di cantiere */
.hazard {
	height: 12px;
	background: repeating-linear-gradient(-45deg, var(--yellow) 0 16px, var(--black) 16px 32px);
}

/* ==========================================================================
   4. Pulsanti
   ========================================================================== */
.btn {
	display: inline-block;
	padding: 14px 22px;
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	font: inherit;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--yellow); color: var(--navy); }
.btn--primary:hover { background: var(--yellow-2); }
.btn--ghost { border-color: #fff; color: #fff; }
.btn--ghost:hover { background: var(--navy-2); }
.btn--outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--outline:hover { background: var(--tint); }
.btn--small { padding: 10px 16px; }

/* ==========================================================================
   5. Barra superiore (nera) e intestazione
   ========================================================================== */
.topbar { background: var(--black); color: #fff; font-size: .875rem; padding: 8px 0; }
.topbar__in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; }
.topbar__group { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.topbar a { text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-header__in {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding-top: 12px; padding-bottom: 12px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--navy); font-weight: 800; font-size: 1.4rem; }
.brand img, .brand .custom-logo { display: block; height: 72px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-list { display: flex; gap: 4px 22px; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 6px 0; font-weight: 600; color: var(--navy); text-decoration: none; }
.nav-list a:hover,
.nav-list .current-menu-item > a { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--yellow); text-underline-offset: 6px; }
.site-nav__cta { display: flex; gap: 10px; align-items: center; }

.menu-toggle {
	display: none; background: none; border: 2px solid var(--navy); border-radius: var(--radius-sm);
	padding: 8px 14px; font: inherit; font-weight: 700; color: var(--navy); cursor: pointer;
}

/* ==========================================================================
   6. Home: hero
   ========================================================================== */
.hero { background: var(--navy); color: #fff; padding: clamp(48px, 7vw, 80px) 0 clamp(52px, 7vw, 88px); }
.hero__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; margin-bottom: 20px; }
.hero__kicker { margin: 0 0 16px; color: var(--yellow); font-weight: 700; font-size: 1rem; }
.hero__lead { margin: 0 0 32px; font-size: 1.25rem; line-height: 1.5; color: var(--on-dark); max-width: 560px; }
.hero__lead strong { color: #fff; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__card { background: #fff; color: var(--ink); border-radius: 12px; padding: 32px; }
.hero__card h2 { font-size: 1.25rem; margin: 0 0 16px; }

/* Passi del metodo: qui l'ordine conta, quindi i numeri hanno senso */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 10px 0 10px 46px; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 4px; }
.steps li::before {
	content: counter(step); position: absolute; left: 0; top: 8px;
	width: 32px; height: 32px; border-radius: 50%;
	background: var(--red); color: #fff; font-weight: 800; line-height: 32px; text-align: center;
}
.steps li:first-child::before { top: 2px; }
.steps strong { color: var(--navy); }

/* ==========================================================================
   7. Home: fascia dati, servizi, corsi, aula, risorse, area clienti
   ========================================================================== */
.facts { background: var(--soft); padding: 26px 0; }
.facts__in { display: flex; flex-wrap: wrap; gap: 10px 40px; justify-content: space-between; margin: 0; padding: 0; list-style: none; font-weight: 600; color: var(--navy); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.card > :last-child { margin-bottom: 0; }
.card--service { border-top: 6px solid var(--yellow); }
.card__text { margin: 0 0 14px; color: var(--muted); }
.card__more { margin: auto 0 0; padding-top: 18px; }
.card__more a { font-weight: 700; color: var(--navy); text-underline-offset: 4px; }
.card__more a:hover { text-decoration-color: var(--red); }
.card svg { flex: none; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding: 6px 0 6px 28px; position: relative; color: var(--ink); }
.checks li::before {
	content: ""; position: absolute; left: 2px; top: 12px; width: 12px; height: 7px;
	border-left: 3px solid var(--red); border-bottom: 3px solid var(--red); transform: rotate(-45deg);
}

/* Riquadro nero per i messaggi importanti */
.callout {
	margin: 32px 0 0; max-width: 760px; padding: 20px 24px;
	background: var(--black); color: #fff; border-left: 8px solid var(--red);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout strong { color: var(--yellow); }

.tag { display: inline-block; font-size: .8125rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--tint); color: var(--navy); margin: 0 6px 6px 0; }
.tag--red { background: var(--red); color: #fff; }

/* Ricerca corsi */
.card.finder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: end; margin-bottom: 16px; }
.finder__status { margin: 0 0 24px; min-height: 1.6em; font-weight: 600; color: var(--navy); }
.finder__status a { color: var(--navy); }
.course[hidden] { display: none; }

.cta-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.cta-row__text { max-width: 560px; }
.cta-row__text .lead { margin: 0; }
.cta-row__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.soon { font-weight: 600; color: var(--muted); }

.clients { background: var(--navy); color: #fff; padding: clamp(44px, 6vw, 64px) 0; }
.clients h2 { color: #fff; }
.clients p { margin: 0; font-size: 1.125rem; color: var(--on-dark); max-width: 640px; }

/* ==========================================================================
   8. Contatti e modulo
   ========================================================================== */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.contact address { font-style: normal; margin: 0 0 18px; }
.contact address strong { color: var(--navy); }
.contact__lines { margin: 0 0 20px; }
.contact__lines a { font-weight: 600; }

label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
label .req { color: var(--red); }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
	width: 100%; padding: 12px; border: 1px solid var(--field); border-radius: var(--radius-sm);
	font: inherit; color: var(--ink); background: #fff;
}
textarea { resize: vertical; }
.field { margin-bottom: 14px; }
.field--check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.field--check input { flex: none; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--navy); }
.field--check label { font-weight: 400; font-size: .9375rem; margin: 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { margin: 0 0 20px; padding: 14px 16px; border-radius: var(--radius-sm); border-left: 6px solid; font-weight: 600; }
.notice--ok { background: #E8F5E9; border-color: #2E7D32; color: #1B5E20; }
.notice--error { background: #FDECEA; border-color: var(--red); color: #8E1B1B; }

/* ==========================================================================
   9. Pagine, articoli, archivi
   ========================================================================== */
.page-head { background: var(--navy); color: #fff; padding: clamp(36px, 5vw, 56px) 0; }
.page-head h1 { color: #fff; margin: 0; }
.page-head p { margin: 12px 0 0; color: var(--on-dark); font-size: 1.125rem; }
.page-head .meta { font-size: .9375rem; }

.content { padding: var(--space-section) 0; }
.content__in { max-width: 760px; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content a { color: var(--navy); text-underline-offset: 3px; text-decoration-color: var(--red); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 6px solid var(--yellow); color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--tint); color: var(--navy); }
.entry-content .wp-block-button__link { background: var(--yellow); color: var(--navy); font-weight: 700; border-radius: var(--radius-sm); text-decoration: none; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption, .wp-block-image figcaption, .gallery-caption { font-size: .875rem; color: var(--muted); }
.sticky, .bypostauthor { display: block; }

.post-card h2, .post-card h3 { font-size: 1.3rem; margin: 10px 0 8px; }
.post-card h2 a, .post-card h3 a { text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; }
.post-card .card__text { flex: 1; }

.pagination, .post-nav { margin-top: 40px; }
.pagination .nav-links, .post-nav .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.pagination .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; color: var(--navy); }
.pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.post-nav a { font-weight: 700; color: var(--navy); }

/* ==========================================================================
   10. Footer
   ========================================================================== */
.site-footer { background: var(--navy); color: #C9D3E3; font-size: .9375rem; }
.site-footer__in { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding: 44px 24px; }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 10px; letter-spacing: 0; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: #fff; }
.footer-logo { display: inline-block; background: #fff; border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 14px; }
.footer-logo img { display: block; height: 64px; width: auto; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin: 0 0 6px; }
.legal { background: var(--black); color: #B8C2D2; font-size: .8125rem; padding: 12px 0; }
.legal__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.legal a { color: #fff; }

/* ==========================================================================
   11. Schermi piccoli
   ========================================================================== */
@media (max-width: 900px) {
	.hero__grid { grid-template-columns: 1fr; gap: 32px; }
	.hero__lead { font-size: 1.125rem; }
	.menu-toggle { display: inline-block; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 16px;
		background: #fff; border-bottom: 4px solid var(--yellow); padding: 12px 24px 24px;
		box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
	}
	.site-nav.is-open { display: flex; }
	.nav-list { flex-direction: column; gap: 0; }
	.nav-list a { padding: 12px 0; border-bottom: 1px solid var(--line); }
	.site-nav__cta { flex-direction: column; align-items: stretch; }
	.brand img, .brand .custom-logo { height: 56px; }
}

@media (max-width: 520px) {
	.topbar__in { flex-direction: column; }
	.card { padding: 22px; }
	.hero__card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
