/* ============================================
   Avendor.eu — Risparmio Domestico
   Stile semplice, informativo, infografico
   ============================================ */

:root {
  --color-primary: #2e7d57;
  --color-primary-dark: #1f5a3d;
  --color-primary-light: #e8f5ee;
  --color-accent: #f4a261;
  --color-text: #1f2933;
  --color-text-soft: #52606d;
  --color-bg: #ffffff;
  --color-bg-soft: #f7f9fb;
  --color-border: #e1e7ec;
  --color-warning: #f4d35e;
  --shadow-sm: 0 1px 3px rgba(20, 40, 35, 0.06);
  --shadow-md: 0 6px 18px rgba(20, 40, 35, 0.08);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --container: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --transition: 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 18px;
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ============ TYPOGRAPHY ============ */

h1, h2, h3, h4, h5 {
  color: var(--color-text);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--color-text-soft);
}

.section-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-soft);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

/* ============ HEADER & NAV ============ */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
}

.brand:hover {
  color: var(--color-primary);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.97rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ============ HERO ============ */

.hero {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #fff 100%);
  padding: 80px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-tag {
  display: inline-block;
  background: #fff;
  color: var(--color-primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--color-text-soft);
  margin-bottom: 1.75rem;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============ INFOGRAPHIC STATS ============ */

.stats {
  background: #fff;
  padding: 56px 0;
  border-bottom: 1px solid var(--color-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-card {
  padding: 24px 16px;
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: var(--color-primary-light);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-size: 26px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* ============ SECTIONS ============ */

section.block {
  padding: 72px 0;
}

section.block-alt {
  background: var(--color-bg-soft);
}

/* ============ CATEGORIES ============ */

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

.category-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  text-align: center;
  transition: all var(--transition);
  display: block;
  color: var(--color-text);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.category-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--color-primary-light);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
}

.category-card h3 {
  margin-bottom: 6px;
}

.category-card p {
  font-size: 0.92rem;
  margin: 0;
}

/* ============ ARTICLES ============ */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.article-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.article-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-thumb img {
  transform: scale(1.05);
}

.article-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--color-text-soft);
  margin-bottom: 10px;
  align-items: center;
}

.tag {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
}

.article-card h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.article-card h3 a {
  color: var(--color-text);
}

.article-card h3 a:hover {
  color: var(--color-primary);
}

.article-card p {
  font-size: 0.94rem;
  margin-bottom: 16px;
  flex: 1;
}

.read-more {
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.read-more::after {
  content: "?";
  transition: transform var(--transition);
}

.read-more:hover::after {
  transform: translateX(3px);
}

/* ============ LATEST FEED (LIST) ============ */

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
}

.feed-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}

.feed-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.feed-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-body {
  padding: 18px 20px 18px 0;
}

.feed-body h4 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.feed-body h4 a {
  color: var(--color-text);
}

.feed-body h4 a:hover {
  color: var(--color-primary);
}

.feed-body p {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

/* ============ ABOUT ============ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 5 / 4;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-list {
  list-style: none;
  margin: 1rem 0;
}

.about-list li {
  padding: 8px 0 8px 32px;
  position: relative;
  color: var(--color-text);
}

.about-list li::before {
  content: "?";
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: bold;
}

/* ============ CONTACT FORM ============ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
}

.contact-info {
  background: var(--color-primary);
  color: #fff;
  padding: 36px;
  border-radius: var(--radius-md);
}

.contact-info h3 {
  color: #fff;
  margin-bottom: 1rem;
}

.contact-info p,
.contact-info a {
  color: rgba(255, 255, 255, 0.92);
}

.contact-info a:hover {
  color: #fff;
}

.contact-list {
  list-style: none;
  margin-top: 1.25rem;
}

.contact-list li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  align-items: flex-start;
}

.contact-list li:first-child {
  border-top: none;
}

.contact-list .ico {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.contact-form {
  background: #fff;
  padding: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--color-text);
}

.form-group .req {
  color: #d6435d;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-primary);
}

.form-group textarea {
  min-height: 130px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.checkbox-group label {
  font-size: 0.9rem;
  color: var(--color-text-soft);
  font-weight: 400;
  line-height: 1.5;
}

.form-message {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 0.95rem;
  display: none;
}

.form-message.success {
  background: #e6f7ed;
  color: #1f5a3d;
  border: 1px solid #b8e6c8;
  display: block;
}

.form-message.error {
  background: #fde8ec;
  color: #91283a;
  border: 1px solid #f5c0c8;
  display: block;
}

/* ============ NEWSLETTER / CTA ============ */

.cta-banner {
  background: var(--color-primary);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}

.cta-banner h2 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn {
  background: #fff;
  color: var(--color-primary);
}

.cta-banner .btn:hover {
  background: var(--color-primary-light);
}

/* ============ ARTICLE PAGE ============ */

.article-hero {
  padding: 56px 0 32px;
  background: var(--color-bg-soft);
}

.article-hero .meta {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  margin-bottom: 12px;
  align-items: center;
}

.article-hero h1 {
  max-width: 800px;
}

.article-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px;
}

.article-content .featured-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 32px;
  aspect-ratio: 16 / 9;
}

.article-content .featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content h2 {
  margin: 32px 0 14px;
}

.article-content h3 {
  margin: 24px 0 10px;
}

.article-content p {
  margin-bottom: 1.1rem;
  font-size: 1.04rem;
  color: var(--color-text);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.25rem 1.25rem;
  color: var(--color-text);
}

.article-content li {
  margin-bottom: 0.5rem;
}

.callout {
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
}

.callout strong {
  color: var(--color-primary-dark);
}

/* ============ LEGAL PAGES ============ */

.legal-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px;
}

.legal-content h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.legal-content h3 {
  margin-top: 22px;
}

.legal-content p,
.legal-content li {
  color: var(--color-text);
}

.legal-content ul {
  margin: 0 0 1rem 1.25rem;
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.legal-content th,
.legal-content td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
}

.legal-content th {
  background: var(--color-bg-soft);
  font-weight: 700;
}

/* ============ FOOTER ============ */

.site-footer {
  background: #1f2933;
  color: #c1cad4;
  padding: 56px 0 24px;
  font-size: 0.93rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-grid h4 {
  color: #fff;
  margin-bottom: 14px;
  font-size: 1rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a {
  color: #c1cad4;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-brand p {
  color: #c1cad4;
  margin-top: 12px;
  max-width: 320px;
}

.footer-bottom {
  border-top: 1px solid #34404d;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.86rem;
  color: #8a96a3;
}

/* ============ COOKIE CONSENT BANNER ============ */

.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 540px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(20, 40, 35, 0.15);
  padding: 22px 24px;
  z-index: 1000;
  display: none;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner h4 {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-banner p {
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.cookie-banner p a {
  font-weight: 600;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-actions .btn {
  flex: 1;
  padding: 10px 18px;
  font-size: 0.92rem;
  min-width: 120px;
}

.cookie-prefs {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.cookie-prefs.is-open {
  display: block;
}

.pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.pref-row:last-child {
  border-bottom: none;
}

.pref-row .pref-info strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.pref-row .pref-info small {
  color: var(--color-text-soft);
  font-size: 0.82rem;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 14px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: #c1cad4;
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
}

.switch input:checked + .slider {
  background: var(--color-primary);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.switch input:disabled + .slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    display: none;
    box-shadow: var(--shadow-md);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  section.block,
  .hero {
    padding: 48px 0;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .feed-item {
    grid-template-columns: 110px 1fr;
  }

  .feed-body {
    padding: 12px 12px 12px 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .stats-grid,
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .hero-actions .btn {
    width: 100%;
  }

  .cookie-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 18px;
  }
}
