/*
Theme Name:        ASI Bari Test
Theme URI:         https://www.asibari.it/
Description:       Tema industriale per il plugin ASI Bari Core. Palette: #D71635, #111, #ffffff. Font: Mulish Regular. Solo presentazione: tutta la logica è nel plugin. Include un generatore di dati demo (Aspetto → Dati di test).
Version:           1.1.0
Requires at least: 6.5
Requires PHP:      8.1
Author:            Consorzio ASI Bari
Text Domain:       asi-theme
License:           GPL-2.0-or-later
*/

/* =========================================================================
   Font – Mulish Regular (SIL Open Font License), servito localmente.
   ========================================================================= */
@font-face {
	font-family: "Mulish";
	src: url("assets/fonts/Mulish-Regular.woff") format("woff"),
	     url("assets/fonts/Mulish-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* =========================================================================
   Token: SOLO tre colori.
   ========================================================================= */
:root {
	--red: #D71635;
	--blue: #006ba1;
	--black: #111;
	--white: #ffffff;

	--font: "Mulish", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--max: 1240px;
	--rule: 2px solid var(--blue);
	--rule-thick: 4px solid var(--blue);
	--hard-shadow: 6px 6px 0 var(--black);
	--hazard: repeating-linear-gradient(-45deg, var(--red) 0 14px, var(--blue) 14px 28px);

	/* Mappatura sulle variabili del plugin ASI Bari Core. */
	--asi-primary: var(--red);
	--asi-primary-dark: var(--black);
	--asi-text: var(--black);
	--asi-muted: var(--black);
	--asi-border: var(--blue);
	--asi-bg-soft: var(--white);
	--asi-surface: var(--white);
	--asi-on-primary: var(--white);
	--asi-error: var(--red);
	--asi-error-bg: var(--white);
	--asi-success: var(--blue);
	--asi-success-bg: var(--white);
	--asi-warning: var(--red);
	--asi-warning-bg: var(--white);
	--asi-chat-me-bg: var(--white);
	--asi-libero: var(--white);
	--asi-occupato: var(--red);
	--asi-radius: 0;
	--asi-radius-sm: 0;
	--asi-radius-lg: 0;
	--asi-radius-pill: 0;
	--asi-shadow: var(--hard-shadow);
	--asi-backdrop: rgb(17 17 17 / .85);
	--asi-focus: 0 0 0 3px var(--red);
	--asi-weight-strong: 400;
}

/* =========================================================================
   Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-weight: 400;
	font-synthesis: none; /* nessun grassetto/corsivo simulato: si usa solo il Regular */
	font-size: 17px;
	line-height: 1.6;
	color: var(--black);
	background: var(--white);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}
b, strong, th, dt, legend, label { font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .04em;
	line-height: 1.1;
}
img { max-width: 100%; height: auto; }
a { color: var(--black); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
::selection { background: var(--red); color: var(--white); }
hr { border: 0; border-top: var(--rule); }

input, select, textarea, button { font-family: var(--font); border-radius: 0 !important; }

.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;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0; z-index: 1000;
	left: 1rem; top: 1rem; padding: .7rem 1rem; background: var(--red); color: var(--white); position: absolute !important;
}

.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.site-main { flex: 1; padding-block: 3rem 5rem; }
.hazard { height: 10px; background: var(--hazard); }

/* Etichetta tecnica "01 /" in stile industriale. */
.label-tech {
	display: inline-block;
	font-size: .78rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	padding: .2rem .6rem;
	background: var(--blue);
	color: var(--white);
}
.label-tech--red { background: var(--red); }

/* =========================================================================
   Pulsanti: squadrati, nessun border-radius.
   ========================================================================= */
.asi-btn,
.button, button[type=submit], input[type=submit],
.asi-modal #asi-login-form .button-primary {
	border-radius: 0 !important;
	border: 2px solid var(--black);
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 400;
	font-size: .9rem;
	padding: .8em 1.5em;
	transition: background-color .12s, color .12s, transform .12s, box-shadow .12s;
}
.asi-btn--primary, button[type=submit], input[type=submit], .asi-modal #asi-login-form .button-primary {
	background: var(--red);
	border-color: var(--red);
	color: var(--white);
	cursor: pointer;
}
.asi-btn--primary:hover, button[type=submit]:hover, input[type=submit]:hover, .asi-modal #asi-login-form .button-primary:hover {
	background: var(--blue);
	border-color: var(--blue);
	color: var(--white);
	box-shadow: 4px 4px 0 var(--red);
	transform: translate(-2px, -2px);
}
.asi-btn--secondary { background: var(--white); color: var(--black); border-color: var(--blue); }
.asi-btn--secondary:hover { background: var(--blue); color: var(--white); }
.asi-btn--link { border: 0; padding: 0; text-transform: none; letter-spacing: 0; background: none; color: var(--black); }
.asi-btn--danger { color: var(--red); }
.btn-invert { background: transparent; color: var(--white); border-color: var(--white); }
.btn-invert:hover { background: var(--white); color: var(--black); }

/* =========================================================================
   Topbar (dati dalla dashboard "Dati del Consorzio")
   ========================================================================= */
.topbar { background: var(--black); color: var(--white); font-size: .82rem; letter-spacing: .04em; }
.topbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; min-height: 40px; padding-block: .35rem; }
.topbar__group { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; align-items: center; }
.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover { color: var(--red); }
.topbar .asi-open-status { margin: 0; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; }
.topbar .asi-open-status::before { border-color: var(--white); }
.topbar .asi-open-status.is-open::before { background: var(--white); }

/* =========================================================================
   Header
   ========================================================================= */
.site-header { background: var(--white); border-bottom: var(--rule-thick); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 108px; }
.site-brand { display: block; line-height: 0; }
.site-brand img, .custom-logo { height: 80px; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav a {
	display: block; padding: .9rem 1rem; color: var(--black); text-decoration: none;
	text-transform: uppercase; letter-spacing: .1em; font-size: .85rem;
	border-bottom: 4px solid transparent; margin-bottom: -4px;
}
.site-nav a:hover { color: var(--red); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { border-bottom-color: var(--red); }
.site-nav__toggle { display: none; background: var(--blue); color: var(--white); border: 0; padding: .6rem 1rem; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }
.site-user { display: flex; align-items: center; gap: .8rem; font-size: .85rem; white-space: nowrap; }
.site-user__role { background: var(--blue); color: var(--white); padding: .2rem .55rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.site-user a:not(.asi-btn) { text-decoration: none; }
.site-user .asi-btn { padding: .55em 1em; font-size: .78rem; }

@media (max-width: 1080px) {
	.site-header__inner { flex-wrap: wrap; padding-block: .8rem; min-height: 0; }
	.site-brand img, .custom-logo { height: 56px; }
	.site-nav__toggle { display: inline-block; }
	.site-nav { flex-basis: 100%; display: none; border-top: var(--rule); }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; }
	.site-nav a { border-bottom: 1px solid var(--blue); margin: 0; }
	.site-user { flex-basis: 100%; justify-content: flex-end; }
	.admin-bar .site-header { top: 0; position: relative; }
}

/* =========================================================================
   Titoli pagina
   ========================================================================= */
.page-header { margin-bottom: 2.5rem; border-left: 10px solid var(--red); padding-left: 1.2rem; }
.page-title { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 .3rem; }
.page-subtitle { margin: 0; max-width: 70ch; }
.entry-content > * + * { margin-top: 1.2em; }
.entry-meta { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.breadcrumbs { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 1.2rem; }
.breadcrumbs a { text-decoration: none; }

/* =========================================================================
   Home
   ========================================================================= */
.hero { background: var(--blue); color: var(--white); margin-top: -3rem; position: relative; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.4fr 1fr; min-height: 460px; }
.hero__text { padding: 4.5rem 3rem 4.5rem 0; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); margin: 1rem 0 1.2rem; max-width: 16ch; }
.hero p { font-size: 1.15rem; max-width: 52ch; margin: 0 0 2rem; }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__block { background: var(--red); position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem; }
.hero__block::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: var(--hazard); }
.hero__figure { font-size: clamp(4rem, 9vw, 7.5rem); line-height: .9; letter-spacing: -.02em; }
.hero__caption { text-transform: uppercase; letter-spacing: .16em; font-size: .85rem; border-top: 2px solid var(--white); padding-top: .8rem; margin-top: .8rem; }
@media (max-width: 860px) {
	.hero__inner { grid-template-columns: 1fr; }
	.hero__text { padding: 3rem 0; }
	.hero__block { margin: 0 -1.25rem; }
}

.section { padding-top: 4.5rem; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; border-bottom: var(--rule-thick); padding-bottom: .8rem; margin-bottom: 1.8rem; }
.section__title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: .5rem 0 0; }
.panel { background: var(--white); border: var(--rule-thick); box-shadow: 10px 10px 0 var(--red); padding: 1.8rem; position: relative; margin-top: -4rem; z-index: 2; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: var(--rule-thick); }
.stat { padding: 1.6rem 1.4rem; border-right: var(--rule); }
.stat:last-child { border-right: 0; }
.stat:nth-child(2n) { background: var(--blue); color: var(--white); }
.stat__num { font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; color: var(--red); }
.stat__label { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; margin-top: .6rem; }
@media (max-width: 860px) { .stat { border-right: 0; border-bottom: var(--rule); } }

/* =========================================================================
   Liste
   ========================================================================= */
.post-list { list-style: none; padding: 0; display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.post-card { border: var(--rule); background: var(--white); display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.post-card:hover { transform: translate(-3px, -3px); box-shadow: var(--hard-shadow); }
.post-card__thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: var(--rule); }
.post-card__body { padding: 1.1rem 1.2rem 1.4rem; }
.post-card__title { margin: 0 0 .5rem; font-size: 1.1rem; }
.post-card__title a { text-decoration: none; }
.pagination, .nav-links { display: flex; gap: 0; flex-wrap: wrap; margin-top: 2.5rem; }
.page-numbers { padding: .5rem .95rem; border: var(--rule); margin-right: -2px; text-decoration: none; }
.page-numbers.current { background: var(--red); border-color: var(--red); color: var(--white); position: relative; }

/* =========================================================================
   Componenti del plugin: rifinitura industriale
   ========================================================================= */
.asi-search { background: var(--white); padding: 0; }
.asi-search__filters summary { text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; }
.asi-field label, .asi-checkboxes legend, .asi-fieldset legend { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; }
.asi-field input:not([type=checkbox]):not([type=radio]), .asi-field select, .asi-field textarea, .asi-chat textarea {
	border: 2px solid var(--black) !important; padding: .7em .8em;
}
.asi-field :is(input, select, textarea):focus { border-color: var(--red) !important; box-shadow: none; outline: 3px solid var(--red); outline-offset: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--red); width: 1.05em; height: 1.05em; }
.asi-fieldset { border: var(--rule); }
.asi-notice { border: var(--rule); border-left: 10px solid var(--black); }
.asi-notice--error { border-color: var(--red); border-left-color: var(--red); }
.asi-status { border: var(--rule); }
.asi-status--pending { border-left: 10px solid var(--red); }
.asi-status--ok { border-left: 10px solid var(--black); }
.asi-badge { background: var(--red); }
.asi-card { border: var(--rule); transition: transform .12s, box-shadow .12s; }
.asi-card:hover { transform: translate(-3px, -3px); box-shadow: var(--hard-shadow); }
.asi-card__media img { border-bottom: var(--rule); }
.asi-card__title { text-transform: uppercase; letter-spacing: .03em; font-weight: 400; }
.asi-tags li { border: var(--rule); background: var(--white); text-transform: uppercase; font-size: .72rem; letter-spacing: .1em; }
.asi-contact { border: var(--rule-thick); }
.asi-gallery__main { border: var(--rule-thick); }
.asi-gallery__thumb-btn { border: var(--rule); }
.asi-gallery__thumb-btn:focus-visible, .asi-gallery__thumb-btn:hover { border-color: var(--red); }
.asi-map { border: var(--rule-thick); }
.asi-lotti-map__legend { border: var(--rule); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.asi-modal { border: var(--rule-thick); border-top: 10px solid var(--red); }
.asi-modal__close { color: var(--black); }
.asi-chat__bubble { border: var(--rule); }
.asi-chat__bubble--me { border-color: var(--red); }
.asi-table th { text-transform: uppercase; font-size: .78rem; letter-spacing: .1em; }
.asi-scheda__ragione { letter-spacing: .14em; font-size: .85rem; }
.asi-orari__table th { text-transform: uppercase; font-size: .78rem; letter-spacing: .1em; white-space: nowrap; }

/* =========================================================================
   Annuncio singolo
   ========================================================================= */
.annuncio-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; }
@media (max-width: 900px) { .annuncio-layout { grid-template-columns: 1fr; } }
.annuncio-azienda { border: var(--rule-thick); padding: 1.4rem; align-self: start; }
.annuncio-azienda h2 { font-size: .85rem; letter-spacing: .14em; margin: 0 0 .6rem; }

.theme-alert { border: var(--rule); border-left: 10px solid var(--red); padding: 1rem 1.2rem; }
.demo-bar { background: var(--red); color: var(--white); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; padding: .4rem 0; }
.demo-bar a { color: var(--white); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--black); color: var(--white); font-size: .95rem; }
.site-footer__main { padding: 3.5rem 0 2.5rem; }
.site-footer a { color: var(--white); text-decoration-color: var(--red); }
.site-footer a:hover { color: var(--red); }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 960px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: .8rem; letter-spacing: .18em; margin: 0 0 1.1rem; padding-bottom: .6rem; border-bottom: 2px solid var(--red); display: inline-block; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: .4rem; }
.site-footer .asi-consorzio__nome { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; line-height: 1.3; }
.site-footer .asi-consorzio__list { grid-template-columns: 1fr; gap: 0; }
.site-footer .asi-consorzio__list dt { text-transform: uppercase; font-size: .7rem; letter-spacing: .16em; margin-top: .7rem; color: var(--red); }
.site-footer .asi-orari__table th, .site-footer .asi-orari__table td { border-bottom: 1px solid var(--white); }
.site-footer .asi-orari__table .is-closed-day td { color: var(--red); }
.site-footer .asi-open-status::before { border-color: var(--white); }
.site-footer__bottom { border-top: 2px solid var(--white); padding: 1.1rem 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

.login-required { text-align: center; padding: 3rem 1rem; }

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