/*
Theme Name: Voce Energia
Theme URI: https://example.com/voce-energia
Author: Smart Italy Communications
Author URI: https://example.com
Description: Tema editoriale WordPress per voce-energia con homepage configurabile, ricerca in header, pubblicita, box autore e infinite scroll.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: voce-energia
Tags: blog, news, custom-logo, featured-images, custom-menu, editor-style
*/

:root {
  --ve-black: #020508;
  --ve-ink: #071522;
  --ve-blue: #005d91;
  --ve-cyan: #00a8df;
  --ve-sky: #58bde9;
  --ve-orange: #ff6b00;
  --ve-muted: #6f7d89;
  --ve-line: #dce5ec;
  --ve-soft: #f4f8fb;
  --ve-white: #ffffff;
  --ve-max: 1150px;
  --ve-radius: 4px;
  --ve-shadow: 0 18px 46px rgba(3, 23, 42, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ve-black);
  background: var(--ve-white);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ve-orange); }
img { display: block; max-width: 100%; height: auto; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ve-wrap {
  width: min(var(--ve-max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #000;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-bar .site-header { top: 32px; }

.header-inner {
  min-height: 96px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.site-branding { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.custom-logo { max-height: 46px; width: auto; }
.site-title {
  color: var(--ve-cyan);
  font-size: clamp(22px, 2.3vw, 34px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.site-title span { color: var(--ve-orange); }

.main-navigation ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-navigation a {
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.social-link {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.search-toggle,
.menu-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
}

.menu-toggle { display: none; }

.header-search {
  display: none;
  position: absolute;
  inset: 96px 0 auto 0;
  background: rgba(0, 14, 24, .98);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 18px 0;
}

.header-search.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-field {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(255,255,255,.26);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 14px 16px;
  border-radius: var(--ve-radius);
}
.search-submit,
.ve-button,
.form-submit .submit {
  border: 0;
  background: var(--ve-orange);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--ve-radius);
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.site-main .search-form {
  max-width: 720px;
  margin-top: 20px;
}

.site-main .search-field {
  color: var(--ve-black);
  background: var(--ve-white);
  border-color: var(--ve-line);
}

.hero {
  position: relative;
  min-height: 560px;
  color: #fff;
  background: linear-gradient(105deg, rgba(0, 13, 22, .86), rgba(0, 85, 133, .36)), var(--ve-hero-image, linear-gradient(120deg, #0b3859, #031525));
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::after,
.newsletter::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background-image: radial-gradient(circle, rgba(0,168,223,.7) 1px, transparent 1.8px);
  background-size: 14px 14px;
  opacity: .34;
  mask-image: linear-gradient(transparent, #000);
}

.hero-inner {
  position: relative;
  z-index: 1;
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 385px;
  gap: 56px;
  align-items: center;
  padding: 56px 0 28px;
}

.hero-kicker,
.card-kicker,
.section-kicker,
.meta-category {
  color: var(--ve-cyan);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.hero-kicker { color: var(--ve-orange); margin-bottom: 12px; }
.hero-title {
  max-width: 660px;
  margin: 0 0 18px;
  font-size: clamp(40px, 6vw, 66px);
  line-height: 1.08;
  letter-spacing: 0;
}
.hero-excerpt {
  max-width: 430px;
  margin: 0 0 28px;
  font-size: 20px;
}

.featured-panel {
  background: rgba(0, 30, 52, .82);
  padding: 28px 24px;
  box-shadow: var(--ve-shadow);
}

.featured-list { display: grid; gap: 18px; margin-top: 18px; }
.featured-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.featured-item img {
  width: 92px;
  height: 76px;
  object-fit: cover;
}
.featured-item h3 { margin: 4px 0 4px; font-size: 16px; line-height: 1.3; }
.post-date { color: var(--ve-muted); font-size: 13px; }
.hero .post-date { color: rgba(255,255,255,.72); }

.section {
  padding: 38px 0;
  border-bottom: 1px solid var(--ve-line);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.1;
  text-transform: uppercase;
}

.view-all {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.post-card img {
  width: 100%;
  aspect-ratio: 4 / 2.6;
  object-fit: cover;
  background: var(--ve-soft);
}

.post-card h3 {
  margin: 10px 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.image-wrap { position: relative; overflow: hidden; background: var(--ve-soft); }
.image-wrap .meta-category {
  position: absolute;
  left: 0;
  bottom: 0;
  color: #fff;
  background: var(--ve-cyan);
  padding: 5px 10px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 28px;
  align-items: start;
}

.focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(230px, .85fr);
  gap: 28px;
  align-items: center;
}

.focus-card img {
  width: 100%;
  aspect-ratio: 1.55 / 1;
  object-fit: cover;
}

.focus-card h3 { margin: 8px 0 12px; font-size: 29px; line-height: 1.18; }

.compact-list {
  display: grid;
  gap: 18px;
}
.compact-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: start;
}
.compact-item img {
  width: 96px;
  height: 78px;
  object-fit: cover;
}
.compact-item h3 { margin: 4px 0 2px; font-size: 16px; line-height: 1.3; }

.rank-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 34px;
}

.rank-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
.rank-number {
  color: var(--ve-sky);
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
}
.rank-card img {
  width: 100%;
  aspect-ratio: 1.45 / 1;
  object-fit: cover;
  margin-bottom: 8px;
}
.rank-card h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.25; }

.newsletter {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #001729, #003a61);
  color: #fff;
  padding: 42px 0;
}
.newsletter-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 44px;
  align-items: center;
}
.newsletter h2 { margin: 0 0 8px; font-size: 25px; line-height: 1.1; text-transform: uppercase; }
.newsletter form { display: flex; gap: 8px; }
.newsletter input {
  min-width: 0;
  flex: 1;
  padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.34);
  color: #fff;
  background: rgba(255,255,255,.08);
}

.site-footer {
  background: #000;
  color: #fff;
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.footer-menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 22px;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.ad-slot {
  width: 100%;
  margin: 26px 0;
  display: grid;
  place-items: center;
  color: var(--ve-muted);
  background: repeating-linear-gradient(135deg, #f6f9fb, #f6f9fb 12px, #edf3f7 12px, #edf3f7 24px);
  border: 1px solid var(--ve-line);
  min-height: 90px;
  overflow: hidden;
}
.ad-slot.is-empty::before {
  content: attr(data-label);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}
.ad-home-top { min-height: 90px; }
.ad-home-mid,
.ad-single-mid { min-height: 250px; }

.site-main {
  padding: 42px 0;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 320px;
  gap: 48px;
  align-items: start;
}

.entry-header { margin-bottom: 24px; }
.entry-title {
  margin: 8px 0 14px;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
}
.entry-meta,
.entry-meta a {
  color: var(--ve-muted);
  font-size: 14px;
}
.entry-meta a { font-weight: 700; }
.entry-thumbnail img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.entry-content {
  margin-top: 26px;
  font-size: 19px;
  line-height: 1.72;
}
.entry-content a { color: var(--ve-blue); text-decoration: underline; }
.entry-content h2,
.entry-content h3 { line-height: 1.2; margin-top: 1.6em; }
.entry-content blockquote {
  border-left: 4px solid var(--ve-orange);
  padding-left: 22px;
  margin-left: 0;
  color: #253747;
  font-size: 22px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}
.post-tags a {
  padding: 7px 10px;
  border: 1px solid var(--ve-line);
  color: var(--ve-blue);
  font-size: 13px;
  font-weight: 800;
}

.author-box {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 24px;
  margin-top: 32px;
  background: var(--ve-soft);
  border-top: 4px solid var(--ve-cyan);
}
.author-box img { border-radius: 50%; }
.author-box h2 { margin: 0 0 6px; font-size: 20px; }

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 34px;
}
.article-nav a {
  display: block;
  padding: 18px;
  border: 1px solid var(--ve-line);
  font-weight: 800;
}

.sidebar-widget {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ve-line);
}
.sidebar-widget h2,
.sidebar-widget h3 {
  margin: 0 0 14px;
  text-transform: uppercase;
  font-size: 18px;
}

.archive-header,
.search-header {
  padding: 36px 0 10px;
}

.load-more {
  margin: 34px auto 0;
  display: block;
}

.infinite-status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--ve-muted);
  text-align: center;
}

.next-article-loader {
  display: grid;
  place-items: center;
  min-height: 100px;
  color: var(--ve-muted);
}

@media (max-width: 980px) {
  .header-inner { grid-template-columns: auto auto; justify-content: space-between; }
  .menu-toggle { display: inline-grid; }
  .main-navigation {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    padding-bottom: 20px;
  }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { display: grid; justify-content: stretch; gap: 0; }
  .main-navigation li { border-top: 1px solid rgba(255,255,255,.12); }
  .main-navigation a { display: block; padding: 14px 0; }
  .header-actions { grid-column: 2; }
  .hero-inner,
  .two-column,
  .content-layout,
  .newsletter-inner { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .ve-wrap { width: min(100% - 28px, var(--ve-max)); }
  .admin-bar .site-header { top: 0; }
  .site-branding { min-width: 0; }
  .site-title { font-size: 22px; }
  .header-inner { min-height: 76px; gap: 12px; }
  .header-search { inset: 76px 0 auto 0; }
  .social-link { display: none; }
  .hero,
  .hero-inner { min-height: auto; }
  .hero-inner { padding: 42px 0; gap: 34px; }
  .featured-panel { padding: 22px 16px; }
  .post-grid,
  .focus-card,
  .article-nav,
  .rank-card { grid-template-columns: 1fr; }
  .rank-grid { gap: 22px; }
  .rank-number { font-size: 34px; }
  .newsletter form,
  .footer-inner { flex-direction: column; align-items: stretch; }
  .footer-inner { display: grid; }
  .entry-title { font-size: 38px; }
  .entry-content { font-size: 18px; }
}
