/*
Theme Name: U2place
Theme URI: https://www.u2place.it/u2news
Author: U2place
Description: Tema per le notizie di U2place.com. Fondo verde petrolio, rosso acceso, onda sotto la home e menu a pannello su cellulare. Leggero, senza librerie: solo CSS e un piccolo script per il menu.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: u2place
*/

/* ==== Token ==== */
:root {
	color-scheme: dark;
	--fondo: #0d2a32;
	--fondo2: #09191e;
	--rosso: #d92d17;
	--rosso-chiaro: #ff6a52;
	--testo: #eef3f2;
	--muted: #9fb7bc;
	--linea: rgba(255, 255, 255, .18);
	--carta: #f1f5f4;
	--inchiostro: #14232a;
	--inchiostro-soft: #4b6168;
	--link-carta: #a3200f;
	--display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
	--body: "Open Sans", system-ui, "Segoe UI", Arial, sans-serif;
	--bar-h: 3.6rem;
	--adm: 0px;
}

.admin-bar { --adm: 32px; }
@media (max-width: 782px) { .admin-bar { --adm: 46px; } }

/* ==== Base: verde petrolio con trama a fibre ==== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	color: var(--testo);
	font: 400 1rem/1.55 var(--body);
	background-color: var(--fondo);
	background-image:
		repeating-linear-gradient(98deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 10px),
		repeating-linear-gradient(82deg, rgba(0, 0, 0, .2) 0 3px, transparent 3px 15px);
}

img, video, iframe, embed, object { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.wrap { width: min(100% - 2rem, 1240px); margin-inline: auto; }
.page-wrap { padding: 2rem 0 1rem; }
.col-narrow { max-width: 920px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed !important; z-index: 100;
	top: .5rem; left: .5rem;
	width: auto; height: auto; margin: 0; padding: .7rem 1rem;
	clip: auto; clip-path: none;
	color: #000; background: #fff;
}

/* ==== Barra in alto (fissa) ==== */
.site-header {
	position: sticky;
	top: var(--adm);
	z-index: 50;
	height: var(--bar-h);
	background: var(--fondo2);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 100%; }

.brand,
.custom-logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.brand { font: 800 1.7rem/1 var(--display); letter-spacing: .01em; color: var(--rosso-chiaro); }
.custom-logo-link img { display: block; width: auto; max-height: 2.6rem; }

.main-nav .menu { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.main-nav .menu a {
	display: block; padding: .4rem 0;
	font-weight: 600; font-size: .95rem; text-decoration: none; color: #dbe6e5;
}
.main-nav .menu a:hover,
.main-nav .menu .current-menu-item > a,
.main-nav .menu .current_page_item > a {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: var(--rosso-chiaro);
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}
.main-nav .menu li { position: relative; }
.main-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: -1rem; z-index: 5;
	min-width: 13rem; margin: 0; padding: .6rem 1rem; list-style: none;
	background: var(--fondo2); border-top: 3px solid var(--rosso);
}
.main-nav .menu li:hover > .sub-menu,
.main-nav .menu li:focus-within > .sub-menu { display: block; }

.burger {
	display: none; align-items: center; gap: .7rem;
	padding: .5rem .9rem; font: 700 .9rem var(--body); color: #fff;
	background: transparent; border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px; cursor: pointer;
}
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: #fff; }
.bars { position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }
.burger[aria-expanded="true"] .bars { background: transparent; }
.burger[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] .bars::after { top: 0; transform: rotate(-45deg); }

/* ==== Menu "Traduci" ==== */
.lang select {
	max-width: 9.5rem; padding: .45rem 1.6rem .45rem .7rem;
	font: 700 .85rem var(--body); color: #fff; cursor: pointer;
	background: transparent; border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px;
}
.lang select option { color: #111; background: #fff; }
body { top: 0 !important; }
.skiptranslate iframe, .goog-te-banner-frame { display: none !important; }
.goog-te-spinner-pos { display: none !important; }

/* ==== Hero della home ==== */
.hero {
	position: relative; overflow: hidden;
	background: var(--fondo2); color: #fff; text-align: center;
}
.hero--image { background-size: cover; background-position: center; }
/* Sul bordo inferiore l'immagine sfuma nel colore dell'onda, senza stacchi. */
.hero--image::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to bottom, rgba(9, 25, 30, .45) 0%, rgba(9, 25, 30, .7) 55%, var(--fondo2) 100%);
}
.hero-in { position: relative; padding: 4rem 0 3rem; }
.hero-title { max-width: 12em; margin: 0 auto; font: 800 clamp(2.8rem, 7vw, 5.6rem)/.92 var(--display); text-wrap: balance; }
.hero-lead { max-width: 40ch; margin: 1.1rem auto 0; font-size: 1.05rem; color: #d3e0e1; }
.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin: 2rem 0 0; }

.btn {
	display: inline-block; padding: .8rem 1.5rem;
	font: 700 .95rem var(--body); text-decoration: none; color: #fff;
	background: var(--rosso); border: 2px solid var(--rosso); border-radius: 4px;
}
.btn:hover { background: #b82410; border-color: #b82410; }
.btn--ghost { background: transparent; border-color: #fff; }
.btn--ghost:hover { color: var(--fondo2); background: #fff; border-color: #fff; }

/* ==== Onda rossa e fascia inclinata ==== */
.wave { display: block; width: 100%; height: clamp(40px, 6vw, 90px); margin-top: -1px; }
.wave-top { fill: var(--fondo2); }
.wave-red { fill: var(--rosso); }
.band { overflow: hidden; padding: .8rem 0 .4rem; }
.band p {
	margin: 0 -6%; transform: rotate(-1.6deg); text-align: center; white-space: nowrap; text-transform: uppercase;
	font: 800 clamp(2.4rem, 8vw, 5.5rem)/1.05 var(--display); color: #fff;
}

/* ==== Titoli di sezione ==== */
.section-title {
	margin: 0 0 1.4rem; padding-bottom: .35rem;
	border-bottom: 3px solid var(--rosso);
	font: 800 2rem/1.1 var(--display); color: #fff;
}
.news .section-title { padding-bottom: 0; border-bottom: 0; }
.archive-header { margin-bottom: 1.6rem; }
.archive-header .section-title { margin-bottom: .6rem; }
.archive-description { color: var(--muted); }

/* ==== Elenco di notizie: il titolo comanda ==== */
.news-list { border-top: 3px solid var(--rosso); }
.item { display: block; padding: 1.5rem 0 1.6rem; border-bottom: 1px solid var(--linea); }
.item.has-thumb { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.item-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #06151a; }
.item-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.item-body { min-width: 0; }
.item-title { margin: 0; font: 800 clamp(1.9rem, 3.4vw, 2.7rem)/1.05 var(--display); letter-spacing: .005em; }
.item-title a { color: #fff; text-decoration: none; }
.item-title a:hover,
.nav-links a:hover .nav-title { text-decoration: underline; text-decoration-color: var(--rosso-chiaro); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.item-meta { margin: .55rem 0 0; font-size: .85rem; color: var(--muted); }
.item-meta .byline::before { content: "\2014\00a0"; }
.item-excerpt { margin: .6rem 0 0; max-width: 70ch; font-size: .95rem; line-height: 1.55; color: #c3d3d5; }
.news-list .item:first-child .item-title { font-size: clamp(2.3rem, 4.6vw, 3.4rem); }
.more { margin: 2rem 0 0; text-align: center; }

/* ==== Paginazione ==== */
.pagination { margin-top: 2.4rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.page-numbers {
	padding: .5rem .9rem; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--testo);
	border: 1px solid var(--linea); border-radius: 4px;
}
a.page-numbers:hover { border-color: var(--rosso-chiaro); }
.page-numbers.current { background: var(--rosso); border-color: var(--rosso); }
.page-numbers.dots { border-color: transparent; }

/* ==== Articolo e pagina: "carta" chiara per leggere bene ==== */
.layout { display: block; }
.layout--sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
.col-main { min-width: 0; }

.paper {
	margin-bottom: 1.5rem; padding: 1.6rem 1.8rem 2rem;
	background: var(--carta); color: var(--inchiostro);
	font-size: 1rem; line-height: 1.7; border-radius: 6px;
	overflow-wrap: break-word;
	overflow-x: auto;
}
.paper a { color: var(--link-carta); }
.paper a:hover { color: #6e1408; }
.entry-title { margin: 0 0 .4rem; font: 800 clamp(2rem, 4.4vw, 3rem)/1.05 var(--display); color: #0d2a32; }
.entry-header { margin-bottom: 1.2rem; padding-bottom: .9rem; border-bottom: 3px solid var(--rosso); }
.entry-meta { margin: .5rem 0 0; font-size: .85rem; color: var(--inchiostro-soft); }
.entry-meta .byline::before { content: "\2014\00a0"; }

.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin: 1.8rem 0 .6rem; font-family: var(--display); line-height: 1.1; color: #0d2a32; }
.entry-content h2 { font-size: 2rem; }
.entry-content h3 { font-size: 1.5rem; }
.entry-content h4 { font-size: 1.25rem; }
.entry-content p { margin: 0 0 1.1rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.entry-content blockquote { margin: 1.4rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 4px solid var(--rosso); color: var(--inchiostro-soft); }
.entry-content img { max-width: 100%; height: auto; }
.entry-content figure { max-width: 100%; margin: 1.2rem 0; }
.entry-content figcaption, .wp-caption-text { margin-top: .4rem; font-size: .82rem; color: var(--inchiostro-soft); }
.entry-content table { width: 100%; max-width: 100%; margin: 0 0 1.2rem; border-collapse: collapse; font-size: .92rem; }
.entry-content th, .entry-content td { padding: .45rem .6rem; border: 1px solid #c3d1d3; text-align: left; }
.entry-content iframe[src*="youtube"], .entry-content iframe[src*="youtu.be"], .entry-content iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.entry-content ins, .entry-content ins > * { max-width: 100%; }
.entry-content ins { overflow: hidden; }
.entry-content pre { overflow-x: auto; padding: 1rem; background: #e3ebea; font-size: .85rem; }
.page-links { margin: 1rem 0 0; }

.entry-footer { margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid #c3d1d3; font-size: .88rem; }
.entry-footer p { margin: 0 0 .4rem; }
.entry-footer .label { margin-right: .4rem; font-weight: 700; color: var(--inchiostro-soft); }

/* Classi storiche di WordPress */
.alignleft { float: left; margin: .3rem 1.4rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.4rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.sticky, .bypostauthor { display: block; }
.gallery { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }
.gallery-item { margin: 0; flex: 1 1 140px; }
.gallery-caption { font-size: .8rem; }

/* Articolo precedente / successivo */
.post-navigation { margin: 0 0 1.5rem; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.post-navigation a { display: block; text-decoration: none; padding-top: .6rem; border-top: 3px solid var(--rosso); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.nav-sub { display: block; font-size: .8rem; color: var(--muted); }
.nav-title { display: block; font: 700 1.3rem/1.15 var(--display); }

/* ==== Barra laterale: sul fondo scuro ==== */
.sidebar .widget { margin: 0 0 2rem; }
.widget-title {
	margin: 0 0 .7rem; padding-top: .4rem; border-top: 3px solid var(--rosso);
	font: 800 1.4rem/1.2 var(--display); color: #fff;
}
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: .4rem 0; border-bottom: 1px dashed var(--linea); font-size: .9rem; color: var(--muted); }
.widget a { font-weight: 600; text-decoration: none; color: var(--testo); }
.widget a:hover { text-decoration: underline; text-decoration-color: var(--rosso-chiaro); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.widget_search .search-form { margin: 0; }

/* ==== Modulo di ricerca ==== */
.search-form { display: flex; gap: .5rem; max-width: 30rem; }
.search-field {
	flex: 1; min-width: 0; padding: .6rem .8rem; font: inherit; color: #111;
	background: #fff; border: 1px solid var(--linea); border-radius: 4px;
}
.search-submit, .comment-form .submit, .wpforms-submit {
	padding: .6rem 1.1rem; font: 700 .9rem var(--body); color: #fff;
	background: var(--rosso); border: 0; border-radius: 4px; cursor: pointer;
}
.search-submit:hover, .comment-form .submit:hover, .wpforms-submit:hover { background: #b82410; }
.none .search-form { margin-top: 1rem; }

/* ==== Commenti ==== */
.comments-title, .comment-reply-title { margin: 0 0 1rem; font: 800 1.6rem/1.1 var(--display); color: #0d2a32; }
.comment-list { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.comment-list .children { padding-left: 1.5rem; list-style: none; }
.comment-body { margin-bottom: 1.2rem; padding-bottom: 1rem; border-bottom: 1px solid #c3d1d3; font-size: .95rem; }
.comment-meta { font-size: .82rem; color: var(--inchiostro-soft); }
.comment-form label { display: block; margin-bottom: .2rem; font-size: .85rem; font-weight: 600; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea,
.wpforms-container input[type="text"], .wpforms-container input[type="email"], .wpforms-container input[type="tel"], .wpforms-container textarea, .wpforms-container select {
	width: 100%; max-width: 100%; padding: .6rem .7rem; font: inherit; color: #111;
	background: #fff; border: 1px solid #9bb0b4; border-radius: 4px;
}
.wpforms-container .wpforms-field { padding: .5rem 0; }
.wpforms-container .wpforms-field-label { font-weight: 600; }

/* ==== Piè di pagina ==== */
.site-footer { margin-top: 3.5rem; padding: 2.2rem 0 2.6rem; background: var(--fondo2); color: var(--muted); }
.copyright { margin: 0 0 .8rem; font-weight: 600; font-size: .95rem; color: #fff; }
.footer-nav .menu { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.legal { max-width: 78ch; margin: 0; font-size: .78rem; line-height: 1.65; }
.site-footer a { color: var(--rosso-chiaro); }

/* ==== Tablet e mobile: menu a pannello ==== */
@media (max-width: 1024px) {
	.burger { display: inline-flex; }
	.bar { justify-content: flex-start; }
	.brand, .custom-logo-link { margin-right: auto; }
	.lang { order: 2; }
	.burger { order: 3; }
	.main-nav {
		display: none; position: fixed; z-index: 40;
		top: calc(var(--adm) + var(--bar-h)); right: 0; bottom: 0; left: 0;
		overflow-y: auto; padding: .5rem 1.2rem 2.5rem;
		background: var(--fondo2); border-top: 3px solid var(--rosso);
	}
	.menu-open { overflow: hidden; }
	.menu-open .main-nav { display: block; }
	.main-nav .menu { display: block; columns: 14rem 2; column-gap: 2rem; }
	.main-nav .menu li { break-inside: avoid; }
	.main-nav .menu a { padding: .75rem 0; font: 800 1.5rem/1.15 var(--display); border-bottom: 1px solid var(--linea); }
	.main-nav .menu a:hover { text-decoration: none; color: var(--rosso-chiaro); }
	.main-nav .sub-menu { display: block; position: static; min-width: 0; padding: 0 0 0 1rem; border: 0; }
	.main-nav .sub-menu a { font-size: 1.15rem; }

	.layout--sidebar { display: block; }
	.sidebar { margin-top: 2rem; }
}

@media (max-width: 760px) {
	.item.has-thumb { grid-template-columns: 130px minmax(0, 1fr); gap: 1rem; }
	.item-excerpt { display: none; }
	.hero-in { padding: 2.6rem 0 2.2rem; }
	.paper { padding: 1.1rem 1.1rem 1.5rem; }
	.alignleft, .alignright { float: none; display: block; margin: 1rem auto; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { grid-column: 1; text-align: left; }
}

@media (max-width: 520px) {
	.item.has-thumb { grid-template-columns: 96px minmax(0, 1fr); }
	.item-title { font-size: 1.6rem; }
	.news-list .item:first-child .item-title { font-size: 1.9rem; }
	.search-form { flex-wrap: wrap; }
}

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

@media (max-width: 520px) {
	.bar { gap: .6rem; }
	.brand { font-size: 1.5rem; }
	.lang select { max-width: 6.8rem; padding: .45rem 1.3rem .45rem .5rem; font-size: .8rem; }
	.burger { padding: .5rem .7rem; gap: .5rem; }
}
