/*
Theme Name: VIVINews
Theme URI: 
Author: fratm
Author URI: 
Description: Tema WordPress creato da zero per VIVINews, il giornale universitario. Design moderno e artistico, tipografia Poppins, palette teal/crema ispirata al logo.
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 7.4
Tested up to: 6.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vivinews
Tags: blog, news, one-column, two-columns, grid-layout, custom-logo, custom-menu, featured-images, footer-widgets, translation-ready
*/

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
	/* Brand colors, dal logo VIVINews */
	--vn-teal: #257C99;
	--vn-teal-dark: #1A5C72;
	--vn-cream: #E8E1D0;
	--vn-cream-light: #F5F1E7;
	--vn-ink: #1C1C1C;
	--vn-gray: #6B6B6B;
	--vn-border: #E4E0D6;
	--vn-white: #FFFFFF;

	/* Tipografia */
	--vn-font: 'Poppins', sans-serif;

	/* Spaziatura */
	--vn-gap: 24px;
	--vn-radius: 10px;
}

* { box-sizing: border-box; }

body {
	font-family: var(--vn-font);
	color: var(--vn-ink);
	background: var(--vn-white);
	margin: 0;
	line-height: 1.55;
}

a { color: var(--vn-teal); text-decoration: none; }
a:hover { color: var(--vn-teal-dark); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--vn-font);
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 .5em;
}

img { max-width: 100%; height: auto; display: block; }

.vn-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Utility */
.screen-reader-text {
	position: absolute !important;
	clip: rect(1px,1px,1px,1px);
	overflow: hidden;
	height: 1px; width: 1px;
}

/* =========================================================
   BANNER IN CIMA (modificabile da Personalizza)
   ========================================================= */
.vn-top-banner { width: 100%; line-height: 0; background: var(--vn-cream-light); }
.vn-top-banner img { width: 100%; height: auto; }

/* =========================================================
   HEADER — mobile-first: logo centrato, menu sotto, hamburger
   ========================================================= */
.vn-header {
	border-bottom: 1px solid var(--vn-border);
	padding: 16px 0;
}
.vn-logo-row { text-align: center; margin-bottom: 12px; }
.vn-logo img { display: inline-block; max-height: 56px; width: auto; }
.vn-site-title { font-size: 22px; font-weight: 800; color: var(--vn-ink); }

.vn-nav-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.vn-primary-nav { display: none; } /* nascosto su mobile, sostituito dal menu a comparsa */
.vn-search-form {
	display: flex;
	align-items: center;
	flex: 1;
	background: var(--vn-cream-light);
	border-radius: 999px;
	padding: 6px 6px 6px 16px;
}
.vn-search-input {
	border: 0; background: transparent; flex: 1; font-family: var(--vn-font); font-size: 14px; outline: none;
}
.vn-search-submit {
	border: 0; background: var(--vn-teal); color: var(--vn-white);
	width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
}
.vn-menu-toggle {
	background: none; border: 0; cursor: pointer; padding: 8px;
	display: flex; flex-direction: column; gap: 5px;
}
.vn-menu-toggle span { width: 22px; height: 2px; background: var(--vn-ink); display: block; }

.vn-mobile-menu {
	max-height: 0; overflow: hidden; transition: max-height .25s ease;
	background: var(--vn-cream-light); border-bottom: 1px solid var(--vn-border);
}
.vn-mobile-menu.is-open { max-height: 400px; }
.vn-mobile-menu-list { list-style: none; margin: 0; padding: 12px 20px; }
.vn-mobile-menu-list li { border-bottom: 1px solid var(--vn-border); }
.vn-mobile-menu-list a { display: block; padding: 12px 0; color: var(--vn-ink); font-weight: 500; }

/* =========================================================
   HOMEPAGE — blocchi per sezione
   ========================================================= */
.vn-home-block { padding: 32px 0; }
.vn-home-block:nth-child(odd) { background: var(--vn-cream-light); }
.vn-block-title {
	font-size: 22px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--vn-teal);
	border-bottom: 3px solid var(--vn-teal);
	display: inline-block;
	padding-bottom: 6px;
	margin-bottom: 20px;
}

/* =========================================================
   CARD ARTICOLO — foto grande piena larghezza + testo sotto
   ========================================================= */
.vn-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--vn-gap);
}
.vn-card { background: var(--vn-white); border-radius: var(--vn-radius); overflow: hidden; border: 1px solid var(--vn-border); }
.vn-card-thumb { display: block; aspect-ratio: 16/10; background: var(--vn-cream); overflow: hidden; }
.vn-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vn-card-thumb-placeholder { width: 100%; height: 100%; background: var(--vn-cream); }
.vn-card-body { padding: 16px; }
.vn-card-category {
	display: inline-block; color: var(--vn-teal); font-size: 12px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.vn-card-title { font-size: 18px; margin: 0 0 8px; }
.vn-card-title a { color: var(--vn-ink); }
.vn-card-meta { font-size: 13px; color: var(--vn-gray); display: flex; gap: 10px; }

/* =========================================================
   ARTICOLO SINGOLO
   ========================================================= */
.vn-single-layout { padding: 32px 0; display: grid; grid-template-columns: 1fr; gap: 32px; }
.vn-single-title { font-size: 28px; margin: 8px 0 12px; }
.vn-single-meta { font-size: 13px; color: var(--vn-gray); display: flex; gap: 10px; margin-bottom: 16px; }
.vn-single-thumb { border-radius: var(--vn-radius); overflow: hidden; margin-bottom: 20px; }
.vn-single-content { font-size: 17px; line-height: 1.7; }
.vn-single-content p { margin: 0 0 1.2em; }

/* Tempo di lettura, tra immagine e contenuto */
.vn-reading-time {
	font-size: 13px; color: var(--vn-gray); text-transform: uppercase;
	letter-spacing: .03em; margin-bottom: 16px;
}

/* Box autore + condivisione a fine articolo */
.vn-single-footer {
	display: flex; align-items: center; justify-content: space-between;
	margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--vn-border);
	flex-wrap: wrap; gap: 16px;
}
.vn-author-box {
	display: flex; align-items: center; gap: 14px;
	background: var(--vn-cream-light);
	border-radius: var(--vn-radius);
	padding: 14px 18px;
	flex: 1;
	min-width: 220px;
}
.vn-author-avatar { border-radius: 50%; flex-shrink: 0; }
.vn-author-info { display: flex; flex-direction: column; gap: 2px; }
.vn-author-name { font-weight: 700; color: var(--vn-ink); font-size: 15px; }
.vn-author-bio { font-size: 13px; color: var(--vn-gray); line-height: 1.4; max-width: 46ch; }
.vn-author-published-date { font-size: 12px; color: var(--vn-gray); text-transform: uppercase; letter-spacing: .03em; }
.vn-share-button {
	background: var(--vn-teal); color: var(--vn-white); border: 0;
	padding: 10px 20px; border-radius: 999px; font-family: var(--vn-font);
	font-weight: 600; font-size: 14px; cursor: pointer;
}
/* Nascosto di default: lo script lo mostra solo se il browser supporta la condivisione nativa */

/* Barra di progresso lettura, fissa in cima alla pagina */
.vn-reading-progress {
	position: fixed; top: 0; left: 0; height: 3px; width: 0%;
	background: var(--vn-teal); z-index: 9999; transition: width .1s linear;
}

/* Bottone "torna su" */
.vn-back-to-top {
	position: fixed; bottom: 20px; right: 20px; width: 44px; height: 44px;
	border-radius: 50%; background: var(--vn-teal); color: var(--vn-white);
	border: 0; font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none;
	transition: opacity .2s ease; z-index: 999;
}
.vn-back-to-top.is-visible { opacity: 1; pointer-events: auto; }

/* =========================================================
   PAGINA 404
   ========================================================= */
.vn-404 { padding: 60px 0; }
.vn-404-inner { text-align: center; max-width: 480px; margin: 0 auto; }
.vn-404-code { font-size: 72px; color: var(--vn-teal); margin-bottom: 0; }
.vn-404-title { margin-bottom: 12px; }
.vn-404-text { color: var(--vn-gray); margin-bottom: 24px; }
.vn-404-home-link {
	display: inline-block; background: var(--vn-teal); color: var(--vn-white);
	padding: 12px 28px; border-radius: 999px; font-weight: 600; margin-bottom: 32px;
}
.vn-404-search { max-width: 320px; margin: 0 auto; }

/* =========================================================
   PAGINA MANUTENZIONE
   ========================================================= */
.vn-maintenance-body { margin: 0; background: var(--vn-white); }
.vn-maintenance-page {
	min-height: 100vh; display: flex; flex-direction: column;
	align-items: center; justify-content: center; text-align: center;
	padding: 40px 20px;
}
.vn-maintenance-logo { margin-bottom: 24px; }
.vn-maintenance-logo img { max-height: 70px; width: auto; }
.vn-maintenance-title { font-size: 26px; color: var(--vn-teal); margin-bottom: 12px; }
.vn-maintenance-text { color: var(--vn-gray); max-width: 420px; font-size: 16px; }

@media (max-width: 767px) {
	.vn-single-layout { padding: 28px 0; }
	.vn-container.vn-single-layout { padding-left: 28px; padding-right: 28px; }
	.vn-single-title { font-size: 24px; }
}
.vn-widget { background: var(--vn-cream-light); border-radius: var(--vn-radius); padding: 16px; margin-bottom: var(--vn-gap); }
.vn-widget-title { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--vn-teal); }

/* =========================================================
   COMMENTI
   ========================================================= */
.vn-comments { padding: 32px 0; border-top: 1px solid var(--vn-border); }
.vn-comments-title { font-size: 20px; margin-bottom: 16px; }
.vn-comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.vn-comment-list .comment-body { padding: 16px 0; border-bottom: 1px solid var(--vn-border); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%; padding: 10px 14px; border: 1px solid var(--vn-border);
	border-radius: 8px; font-family: var(--vn-font); margin-bottom: 12px;
}
.comment-form .form-submit input {
	background: var(--vn-teal); color: var(--vn-white); border: 0;
	padding: 10px 24px; border-radius: 999px; cursor: pointer; font-weight: 600;
}

/* =========================================================
   FOOTER — semplice
   ========================================================= */
.vn-footer { border-top: 1px solid var(--vn-border); padding: 24px 0; margin-top: 40px; }
.vn-footer-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.vn-footer-menu { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.vn-footer-socials { list-style: none; display: flex; gap: 14px; margin: 0 0 4px; padding: 0; }
.vn-footer-socials a {
	display: flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: 50%; background: var(--vn-cream-light);
	font-size: 15px; overflow: hidden;
}
/* Dimensioni forzate per le icone social caricate dal pannello: qualunque immagine
   venga caricata (grande, rettangolare, ecc.) viene ridotta e ritagliata al centro
   in un quadrato di 20x20px, per restare coerente indipendentemente dal file sorgente. */
.vn-footer-socials img {
	width: 20px;
	height: 20px;
	object-fit: cover;
	object-position: center;
	display: block;
}
.vn-footer-copy { font-size: 13px; color: var(--vn-gray); }

/* =========================================================
   DESKTOP (min-width 768px): nav orizzontale sotto il logo, no hamburger
   ========================================================= */
@media (min-width: 768px) {
	.vn-primary-nav { display: block; }
	.vn-menu-toggle, .vn-mobile-menu { display: none; }
	.vn-menu { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; justify-content: center; }
	.vn-menu a { color: var(--vn-ink); font-weight: 500; }
	.vn-menu a:hover { color: var(--vn-teal); }
	.vn-nav-row { justify-content: center; gap: 32px; }
	.vn-search-form { flex: 0 0 260px; }

	.vn-card-grid { grid-template-columns: repeat(2, 1fr); }
	.vn-single-layout { grid-template-columns: 2fr 1fr; }
}

@media (min-width: 1024px) {
	.vn-card-grid { grid-template-columns: repeat(4, 1fr); }
}
