/*
Theme Name: Saexdipinail
Theme URI: https://www.saexdipinail.org/
Description: Tema del sito Sindacato Autonomo Dipendenti INAIL in Pensione. Sostituisce Elementor e Elementor Pro.
Author: No Digital Brain
Author URI: https://nodigitalbrain.com
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietario
Text Domain: saexdipinail
*/

/* ---------- Palette (dal kit Elementor del sito attuale) ---------- */
:root {
	--c-primary: #014A7F;   /* blu: header, footer, titoli */
	--c-secondary: #54595F;
	--c-text: #000000;
	--c-accent: #B30000;    /* in risalto: pulsanti staff */
	--c-bg: #CCC3B7;        /* sfondo della pagina */
	--c-page: #EDE5DA;      /* area contenuti */
	--c-dark: #AFA9A0;      /* sfondo scuro */
	--c-white: #FFFFFF;

	--c-tile-1: #6B7D19;    /* Notiziario Sindacale */
	--c-tile-2: #CE8210;    /* Comunicazioni INAIL */
	--c-tile-3: #933914;    /* Modulistica */

	--font-body: Arial, "Helvetica Neue", Helvetica, sans-serif;
	--font-title: "Libre Franklin", Arial, sans-serif;
	--font-menu: "Michroma", Arial, sans-serif;
	--font-brand: "Anek Bangla", "Libre Franklin", Arial, sans-serif;

	--site-width: 980px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--c-primary);
}

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	width: auto;
	height: auto;
	left: 10px;
	top: 10px;
	padding: 8px 12px;
	background: var(--c-white);
	z-index: 100000;
}

/* ---------- Contenitore ---------- */
.site {
	width: var(--site-width);
	max-width: 100%;
	margin: 0 auto;
	background: var(--c-page);
}

/* ---------- Intestazione ---------- */
.site-header {
	position: relative;
	height: 196px;
	background: var(--c-primary);
}

.site-header__inner {
	height: 100%;
	padding: 40px 60px 0;
}

.site-title {
	display: block;
	text-decoration: none;
	color: var(--c-white);
	text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5);
}

.site-title__name {
	display: block;
	font-family: var(--font-brand);
	font-size: 56px;
	font-weight: 300;
	line-height: 1.1;
}

.site-title__sub {
	display: block;
	font-family: var(--font-title);
	font-size: 36px;
	font-weight: 700;
	line-height: 1.2;
}

.site-title__sub em {
	font-style: italic;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 40px;
	padding: 0 12px;
	background: #000000;
}

.topbar .btn {
	padding: 7px 16px;
	font-size: 14px;
	line-height: 1;
	border-radius: 3px;
	color: var(--c-white);
	text-decoration: none;
}

.btn--add {
	background: var(--c-primary);
}

.btn--logout {
	background: var(--c-accent);
}

/* ---------- Corpo: colonna sinistra + contenuti ---------- */
.site-body {
	display: flex;
	align-items: flex-start;
}

.sidebar {
	flex: 0 0 215px;
	margin: 0 20px;
	width: 215px;
	background: var(--c-white);
	border-radius: 0 0 10px 10px;
	padding-bottom: 20px;
}

.sidebar__nav {
	padding: 12px 0 18px 30px;
}

.menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.menu--primary a {
	display: block;
	font-family: var(--font-menu);
	font-size: 18px;
	line-height: 46px;
	color: var(--c-text);
	text-decoration: none;
}

.menu--primary .current-menu-item > a {
	color: var(--c-secondary);
}

.site-main {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 10px 0 0;
}

/* ---------- Riquadri categorie ---------- */
.tiles--top {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 0 0 20px;
}

.tiles--side {
	padding: 0 10px;
}

.tile {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	text-align: center;
	color: var(--c-white);
	padding: 8px 8px 12px;
}

.tiles--top .tile:nth-child(1) { background: var(--c-tile-1); }
.tiles--top .tile:nth-child(2) { background: var(--c-tile-2); }
.tiles--top .tile:nth-child(3) { background: var(--c-tile-3); }

.tiles--side .tile {
	background: var(--c-bg);
	color: var(--c-text);
	margin-bottom: 20px;
	padding: 6px 6px 28px;
}

.tile__img img {
	width: 100%;
	height: 114px;
	object-fit: cover;
	border-radius: 6px;
}

.tiles--side .tile__img img {
	height: 84px;
}

.tile__title {
	margin: 8px 0 0;
	font-family: var(--font-title);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.2;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
}

.tile__title a {
	color: inherit;
	text-decoration: none;
}

.tiles--side .tile__title {
	text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
	border-bottom: 1px solid var(--c-dark);
	padding-bottom: 6px;
}

.tile__text {
	margin: 8px 0 6px;
	font-size: 14px;
	line-height: 1.35;
}

.tile__more {
	display: inline-block;
	margin-top: 4px;
	color: inherit;
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
}

.tile__more::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 6px;
	vertical-align: -2px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13zM6.2 4.6v6.8L11.6 8z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13zM6.2 4.6v6.8L11.6 8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Pagina 404 ---------- */
.notfound {
	padding: 20px 15px;
}

.notfound__title {
	margin: 0 0 12px;
	font-family: var(--font-title);
	font-size: 28px;
	font-weight: 700;
	color: var(--c-primary);
}

/* ---------- Piè di pagina ---------- */
.site-footer {
	height: 66px;
	background: var(--c-primary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.site-footer__nav {
	width: 100%;
}

.menu--footer {
	display: flex;
	justify-content: center;
	align-items: center;
}

.menu--footer li + li {
	border-left: 1px solid var(--c-white);
}

.menu--footer a {
	display: block;
	padding: 0 20px;
	font-family: var(--font-menu);
	font-size: 12px;
	line-height: 66px;
	color: var(--c-white);
	text-decoration: none;
}

.menu--footer .current-menu-item > a {
	border-bottom: 2px solid var(--c-white);
	line-height: 62px;
}

/* ---------- Adattamento a schermi piccoli (da rifinire in sessione D) ---------- */
@media (max-width: 767px) {
	.site-header__inner {
		padding: 24px 20px 0;
	}

	.site-title__name {
		font-size: 36px;
	}

	.site-title__sub {
		font-size: 22px;
	}

	.site-body {
		flex-direction: column;
	}

	.sidebar {
		margin: 0 10px;
		width: auto;
		flex: none;
	}

	.tiles--top {
		grid-template-columns: 1fr;
	}

	.menu--footer {
		flex-wrap: wrap;
		height: auto;
	}

	.site-footer {
		height: auto;
		padding: 10px 0;
	}
}

/* ---------- Sessione D: home, archivio, articolo, pagina ---------- */
.section-title {
	margin: 34px 0 22px 10px;
	font-family: var(--font-body);
	font-size: 26px;
	font-weight: 700;
	color: var(--c-primary);
}

.news-list {
	padding: 0 10px;
}

.news-item {
	padding: 6px 0 0;
}

.news-item__head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.news-item__date {
	flex: 0 0 96px;
	padding-top: 2px;
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
}

.news-item__title {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
}

.news-item__title a {
	color: var(--c-text);
	text-decoration: none;
}

.news-item__excerpt {
	margin: 6px 0 0 110px;
	font-size: 14px;
}

.news-item__more {
	display: block;
	text-align: right;
	padding: 6px 0 4px;
	color: var(--c-primary);
	font-weight: 700;
	text-decoration: none;
}

.news-item__more::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 6px;
	vertical-align: -2px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13zM6.2 4.6v6.8L11.6 8z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13zM6.2 4.6v6.8L11.6 8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.news-item__rule {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--c-text);
}

.no-posts {
	padding: 0 10px;
}

.archive-title {
	margin: 20px 10px 22px;
	font-family: var(--font-body);
	font-size: 28px;
	font-weight: 600;
}

.entry {
	padding: 20px 20px 10px;
}

.entry__title {
	margin: 0 0 18px;
	font-family: var(--font-body);
	font-size: 28px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--c-text);
}

.entry__content {
	font-size: 16px;
	line-height: 1.6;
}

.entry__content p {
	margin: 0 0 12px;
}

.allegati {
	margin-top: 20px;
}

.allegato a {
	color: var(--c-primary);
	font-weight: 700;
}

.edit-link {
	margin: 20px 0 0;
}

.modifica {
	color: var(--c-accent);
	font-weight: 700;
}

.pagination {
	padding: 10px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.pagination a,
.pagination .current {
	padding: 4px 9px;
	background: var(--c-white);
	color: var(--c-primary);
	text-decoration: none;
	border-radius: 4px;
}

.pagination .current {
	background: var(--c-primary);
	color: var(--c-white);
}

/* Menu categorie: visibile solo da mobile */
.mobile-menu {
	display: none;
}

@media (max-width: 767px) {
	.sidebar {
		display: none;
	}

	.mobile-menu {
		display: block;
		background: var(--c-white);
		border-radius: 0 0 10px 10px;
		margin: 0 0 16px;
	}

	.menu--mobile a {
		display: block;
		padding: 8px 16px;
		font-family: var(--font-menu);
		font-size: 16px;
		color: var(--c-text);
		text-decoration: none;
	}

	.site-main {
		padding: 10px 6px;
	}

	.section-title {
		margin: 20px 10px 14px;
		font-size: 22px;
	}

	.news-item__head {
		flex-direction: column;
		gap: 2px;
	}

	.news-item__excerpt {
		margin-left: 0;
	}

	.entry {
		padding: 14px 10px;
	}
}

/* ---------- Correzioni mobile (sessione D) ---------- */
@media (max-width: 767px) {
	.site,
	.site-body,
	.site-main,
	.tiles--top,
	.tile,
	.news-list {
		min-width: 0;
		max-width: 100%;
	}

	.tiles--top {
		grid-template-columns: minmax(0, 1fr);
	}

	.tile__img img {
		height: auto;
		aspect-ratio: 216 / 114;
	}

	.site-header {
		height: auto;
		padding-bottom: 18px;
	}

	.site-header__inner {
		height: auto;
		padding: 20px 16px 0;
	}

	.btn--staff {
		position: static;
		display: inline-block;
		margin-top: 10px;
	}

	.news-item__date {
		flex-basis: auto;
	}

	.news-item__title {
		font-size: 15px;
	}
}

.tile__img {
	display: block;
	width: 100%;
}

.tile__img img {
	width: 100%;
}

@media (max-width: 767px) {
	.site-body {
		align-items: stretch;
	}
}

/* ---------- Sessione E: form articoli e pagine ---------- */
.btn {
	display: inline-block;
	padding: 9px 18px;
	border: 0;
	border-radius: 4px;
	font-family: var(--font-body);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.btn--primary {
	background: var(--c-primary);
	color: var(--c-white);
}

.btn--accent {
	background: var(--c-accent);
	color: var(--c-white);
}

.saex-form label {
	font-weight: 700;
}

.saex-input {
	width: 100%;
	max-width: 680px;
	padding: 7px 9px;
	border: 1px solid var(--c-dark);
	border-radius: 3px;
	background: var(--c-white);
	font-family: var(--font-body);
	font-size: 15px;
}

.saex-form select.saex-input {
	max-width: 360px;
}

.saex-allegati {
	margin: 18px 0;
	padding: 10px 14px;
	border: 1px solid var(--c-dark);
	border-radius: 4px;
}

.saex-allegati legend {
	font-weight: 700;
	padding: 0 6px;
}

.saex-note {
	font-size: 13px;
	color: var(--c-secondary);
}

.form-esito {
	margin: 0 0 16px;
	padding: 10px 14px;
	background: var(--c-white);
	border-left: 4px solid var(--c-primary);
	font-weight: 700;
}

.cancella {
	color: var(--c-accent);
	font-weight: 700;
}

/* ---------- Sessione F: pagina Contatti ---------- */
.entry--contatti .entry__title {
	color: var(--c-primary);
}

.gform_wrapper button.gform_button,
.gform_wrapper input.gform_button {
	background: transparent;
	color: #C2185B;
	border: 1px solid #C2185B;
	border-radius: 2px;
	padding: 8px 14px;
	font-family: var(--font-body);
	font-size: 16px;
	cursor: pointer;
}

/* ---------- Footer verticale su mobile ---------- */
@media (max-width: 767px) {
	.menu--footer {
		flex-direction: column;
		align-items: stretch;
	}

	.menu--footer li + li {
		border-left: 0;
		border-top: 1px solid var(--c-white);
	}

	.menu--footer a {
		padding: 0 20px;
		line-height: 44px;
		text-align: center;
	}

	.menu--footer .current-menu-item > a {
		line-height: 40px;
	}
}
