/*
Theme Name: Energia Domani
Theme URI: https://example.com/energia-domani
Author: Smart Italy Communications
Author URI: https://example.com
Description: Tema editoriale WordPress per magazine energia, sostenibilita e innovazione, con homepage configurabile, advertising 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: energia-domani
Tags: news, blog, customizer, featured-images, custom-logo
*/

:root {
  --ed-ink: #073532;
  --ed-ink-2: #0c4b44;
  --ed-green: #137868;
  --ed-mint: #9bcfbe;
  --ed-orange: #ff8618;
  --ed-bg: #f6f9f7;
  --ed-line: #dfe8e3;
  --ed-text: #142623;
  --ed-muted: #64736f;
  --ed-white: #fff;
  --ed-serif: Georgia, "Times New Roman", serif;
  --ed-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ed-text);
  background: var(--ed-bg);
  font-family: var(--ed-sans);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ed-green); }
img { display: block; max-width: 100%; height: auto; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ed-container {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}
.ed-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(90deg, #053b39, #052d30);
  color: var(--ed-white);
  box-shadow: 0 2px 20px rgba(3, 34, 34, .2);
}
.ed-header-inner {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}
.ed-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 225px;
}
.ed-logo-mark {
  width: 70px;
  height: 46px;
  flex: 0 0 auto;
}
.ed-brand-text {
  color: var(--ed-mint);
  font-weight: 900;
  font-size: 25px;
  letter-spacing: 0;
}
.ed-brand-description {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.65);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ed-main-nav ul {
  display: flex;
  justify-content: center;
  gap: 26px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ed-main-nav a {
  color: var(--ed-white);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.ed-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ed-icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ed-white);
  cursor: pointer;
}
.ed-social {
  color: var(--ed-white);
  font-weight: 800;
  font-size: 16px;
  opacity: .95;
}
.ed-search-panel {
  display: none;
  padding: 0 0 18px;
}
.ed-search-panel.is-open { display: block; }
.ed-search-form {
  display: flex;
  gap: 8px;
}
.ed-search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
}
.ed-button,
.ed-search-form button,
.form-submit .submit {
  border: 0;
  border-radius: 999px;
  background: var(--ed-orange);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  padding: 13px 23px;
  cursor: pointer;
}

.ed-ad {
  display: grid;
  place-items: center;
  margin: 24px auto;
  width: 100%;
  overflow: hidden;
}
.ed-ad-label {
  color: var(--ed-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 6px;
}
.ed-ad--leaderboard { min-height: 90px; }
.ed-ad--rectangle { min-height: 250px; }
.ed-ad-placeholder {
  width: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  border: 1px dashed #b7c8c1;
  color: #8a9894;
  background: #fff;
  font-size: 13px;
}

.ed-hero {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  background: var(--ed-white);
  border-bottom: 1px solid var(--ed-line);
}
.ed-hero-copy {
  padding: 72px 58px 48px max(58px, calc((100vw - 1180px) / 2 + 18px));
}
.ed-kicker {
  display: inline-flex;
  color: var(--ed-orange);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .04em;
  margin-bottom: 14px;
}
.ed-hero h1,
.ed-page-title,
.ed-single-title {
  margin: 0;
  color: #082d2c;
  font-family: var(--ed-serif);
  font-weight: 700;
  line-height: .98;
}
.ed-hero h1 { font-size: clamp(42px, 5vw, 68px); max-width: 680px; }
.ed-hero p { max-width: 560px; margin: 24px 0 26px; color: #28423e; font-size: 18px; }
.ed-hero-image {
  min-height: 430px;
  background: linear-gradient(135deg, rgba(12,75,68,.15), rgba(255,134,24,.1));
}
.ed-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.ed-fallback-image {
  width: 100%;
  height: 100%;
  min-height: 210px;
  background:
    linear-gradient(140deg, rgba(255,134,24,.32), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(155,207,190,.8), transparent 22%),
    linear-gradient(135deg, #0b5b55, #d8e9df 56%, #f6b45f);
}

.ed-top-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.ed-feature-card,
.ed-section-card,
.ed-list-section {
  background: var(--ed-white);
  border: 1px solid var(--ed-line);
}
.ed-feature-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  padding: 12px;
  min-height: 155px;
}
.ed-feature-card img,
.ed-feature-card .ed-fallback-image {
  height: 130px;
  object-fit: cover;
}
.ed-card-title {
  margin: 8px 0 0;
  font-family: var(--ed-serif);
  font-size: 20px;
  line-height: 1.12;
}
.ed-card-arrow {
  display: block;
  margin-top: 16px;
  text-align: right;
  color: var(--ed-ink);
  font-size: 24px;
}

.ed-section {
  margin: 24px 0;
}
.ed-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--ed-ink);
  margin-bottom: 18px;
}
.ed-section-title {
  margin: 0 0 9px;
  font-family: var(--ed-serif);
  color: #143532;
  font-size: 28px;
}
.ed-view-all {
  color: var(--ed-green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.ed-latest {
  padding: 20px;
  background: #eef5f2;
}
.ed-latest-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
}
.ed-latest-card img,
.ed-latest-card .ed-fallback-image {
  aspect-ratio: 1.45;
  object-fit: cover;
}
.ed-latest-card h3 {
  margin: 8px 0 8px;
  font-family: var(--ed-serif);
  font-size: 17px;
  line-height: 1.18;
}
.ed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--ed-muted);
  font-size: 12px;
}
.ed-meta a { color: var(--ed-green); font-weight: 800; text-transform: uppercase; }

.ed-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ed-section-card {
  padding: 22px;
  min-height: 315px;
}
.ed-section-card h2 {
  margin: 0 0 14px;
  font-family: var(--ed-serif);
  font-size: 30px;
}
.ed-section-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
}
.ed-section-body img,
.ed-section-body .ed-fallback-image {
  aspect-ratio: .95;
  object-fit: cover;
}
.ed-mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ed-mini-list li {
  padding: 0 0 13px;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--ed-line);
  font-weight: 700;
  line-height: 1.25;
}

.ed-newsletter {
  margin: 26px 0 0;
  color: #fff;
  background: linear-gradient(90deg, #053d3b, #064d48);
  padding: 28px 36px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  align-items: center;
}
.ed-newsletter h2 {
  margin: 0 0 4px;
  font-family: var(--ed-serif);
  font-size: 30px;
}
.ed-newsletter form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
}
.ed-newsletter input {
  border: 0;
  padding: 16px;
  min-width: 0;
}
.ed-newsletter button {
  border-radius: 0 4px 4px 0;
}

.ed-site-footer {
  background: #fff;
  border-top: 1px solid var(--ed-line);
}
.ed-footer-main {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  gap: 28px;
  padding: 42px 0;
}
.ed-footer-main h3 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
}
.ed-footer-main ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ed-footer-main li { margin: 7px 0; color: #334844; font-size: 14px; }
.ed-footer-bottom {
  background: var(--ed-ink);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  padding: 18px 0;
}
.ed-footer-bottom .ed-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.ed-main {
  padding: 34px 0 48px;
}
.ed-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
.ed-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.ed-post-card {
  background: #fff;
  border: 1px solid var(--ed-line);
  padding: 14px;
}
.ed-post-card img,
.ed-post-card .ed-fallback-image {
  aspect-ratio: 1.45;
  object-fit: cover;
}
.ed-post-card h2 {
  font-family: var(--ed-serif);
  font-size: 23px;
  line-height: 1.08;
}
.ed-page-title { font-size: clamp(38px, 5vw, 62px); margin-bottom: 24px; }

.ed-single-wrap {
  background: #fff;
  border-bottom: 1px solid var(--ed-line);
}
.ed-single-header {
  padding: 52px 0 24px;
  max-width: 850px;
}
.ed-single-title {
  font-size: clamp(42px, 6vw, 76px);
}
.ed-single-excerpt {
  color: #405551;
  font-size: 20px;
  margin: 22px 0;
}
.ed-single-image img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}
.ed-article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 0 22px;
  font-family: var(--ed-serif);
  font-size: 21px;
  line-height: 1.72;
}
.ed-article-body a {
  color: var(--ed-green);
  text-decoration: underline;
}
.ed-article-body blockquote {
  margin: 28px 0;
  padding: 6px 0 6px 24px;
  border-left: 4px solid var(--ed-orange);
  color: #24413c;
}
.ed-author-box {
  max-width: 760px;
  margin: 28px auto 44px;
  padding: 22px;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  background: #eef5f2;
  border: 1px solid var(--ed-line);
}
.ed-author-box img {
  border-radius: 50%;
}
.ed-author-box h2 {
  margin: 0 0 4px;
  font-family: var(--ed-serif);
}
.ed-post-nav {
  max-width: 760px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ed-post-nav a {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--ed-line);
  font-weight: 800;
}
.ed-load-status {
  text-align: center;
  color: var(--ed-muted);
  padding: 26px 0;
}
.ed-load-more {
  display: block;
  width: max-content;
  margin: 26px auto 0;
}
[data-ed-next-page] a {
  display: block;
  width: max-content;
  margin: 26px auto 0;
  border-radius: 999px;
  background: var(--ed-orange);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  padding: 13px 23px;
}

@media (max-width: 980px) {
  .ed-header-inner {
    grid-template-columns: 1fr auto;
  }
  .ed-main-nav {
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 14px;
  }
  .ed-main-nav ul { justify-content: flex-start; }
  .ed-hero,
  .ed-content-grid,
  .ed-newsletter {
    grid-template-columns: 1fr;
  }
  .ed-hero-copy {
    padding: 44px 24px;
  }
  .ed-top-cards,
  .ed-topic-grid,
  .ed-archive-grid {
    grid-template-columns: 1fr;
  }
  .ed-latest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ed-footer-main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ed-container { width: min(100% - 24px, 1180px); }
  .ed-header-inner { min-height: 78px; gap: 12px; }
  .ed-brand { min-width: 0; }
  .ed-brand-text { font-size: 20px; }
  .ed-social { display: none; }
  .ed-hero-image { min-height: 270px; }
  .ed-feature-card,
  .ed-section-body,
  .ed-author-box,
  .ed-post-nav {
    grid-template-columns: 1fr;
  }
  .ed-latest-grid {
    grid-template-columns: 1fr;
  }
  .ed-newsletter {
    padding: 24px 18px;
  }
  .ed-newsletter form {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ed-newsletter button { border-radius: 999px; }
  .ed-footer-main,
  .ed-footer-bottom .ed-container {
    grid-template-columns: 1fr;
    display: grid;
  }
  .ed-article-body {
    font-size: 19px;
  }
}
