/* ===== CRESCIAMO INSIEME — Design System ===== */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input { font: inherit; }
ul, ol { list-style: none; }

/* --- CSS Custom Properties (from Stitch Design System) --- */
:root {
  /* Primary */
  --primary: #4a6240;
  --on-primary: #ffffff;
  --primary-container: #627c57;
  --on-primary-container: #f8ffef;
  --primary-fixed: #ceebbf;
  --primary-fixed-dim: #b3cfa4;
  --inverse-primary: #b3cfa4;

  /* Secondary */
  --secondary: #85523a;
  --on-secondary: #ffffff;
  --secondary-container: #fdba9d;
  --on-secondary-container: #794831;
  --secondary-fixed: #ffdbcd;
  --secondary-fixed-dim: #fab79a;

  /* Tertiary */
  --tertiary: #47606a;
  --on-tertiary: #ffffff;
  --tertiary-container: #5f7884;
  --on-tertiary-container: #fafdff;
  --tertiary-fixed: #cce7f4;
  --tertiary-fixed-dim: #b0cbd7;

  /* Surfaces */
  --background: #fbf9f8;
  --on-background: #1b1c1c;
  --surface: #fbf9f8;
  --on-surface: #1b1c1c;
  --on-surface-variant: #434840;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f5f3f3;
  --surface-container: #efeded;
  --surface-container-high: #e9e8e7;
  --surface-container-highest: #e4e2e2;
  --surface-variant: #e4e2e2;
  --surface-bright: #fbf9f8;
  --surface-dim: #dbdad9;
  --surface-tint: #4d6542;
  --inverse-surface: #303030;
  --inverse-on-surface: #f2f0f0;

  /* Outline */
  --outline: #74796f;
  --outline-variant: #c4c8bd;

  /* Error */
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;

  /* Spacing (8px base) */
  --unit: 8px;
  --stack-sm: 12px;
  --stack-md: 24px;
  --stack-lg: 48px;
  --gutter: 16px;
  --container-padding: 24px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-full: 9999px;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Manrope', sans-serif;
}

/* --- Base Typography --- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-background);
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  word-break: break-word;
}

h1, h2, h3 { font-family: var(--font-heading); }
h1 { font-size: 40px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 32px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 24px; font-weight: 600; line-height: 1.4; }

.text-body-lg { font-size: 18px; line-height: 1.6; }
.text-body-md { font-size: 16px; line-height: 1.6; }
.text-label { font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: 0.01em; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--container-padding); }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 var(--container-padding); }
.flex-grow { flex-grow: 1; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(239, 237, 237, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 200, 189, 0.3);
  padding: 16px var(--container-padding);
}
.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.site-nav { display: flex; align-items: center; gap: var(--gutter); }
.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface-variant);
  transition: color 0.2s, transform 0.2s;
  letter-spacing: 0.01em;
}
.nav-link:hover { color: var(--primary); transform: scale(1.05); }
.nav-link.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 4px;
}

/* --- Mobile Menu --- */
.menu-toggle {
  display: none;
  color: var(--primary);
  font-size: 28px;
  padding: 4px;
}
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(251, 249, 248, 0.97);
  backdrop-filter: blur(16px);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  transition: opacity 0.3s;
}
.mobile-nav.open { display: flex; opacity: 1; }
.mobile-nav .nav-link { font-size: 24px; }
.mobile-nav-close {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 32px;
  color: var(--primary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: scale(1.03); }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 8px rgba(74, 98, 64, 0.15);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(74, 98, 64, 0.25); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-lg { font-size: 20px; padding: 16px 32px; }
.btn-cta { font-size: 14px; padding: 12px 24px; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Cards --- */
.card {
  background: var(--surface-container-low);
  border-radius: 32px;
  padding: var(--stack-md);
  border: 1px solid var(--outline-variant);
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  background: var(--surface-container-high);
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.card-blog {
  background: var(--surface);
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  cursor: pointer;
}
.card-blog:hover { transform: translateY(-4px); }
.card-blog .card-img {
  height: 240px;
  overflow: hidden;
}
.card-blog .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.card-blog:hover .card-img img { transform: scale(1.05); }
.card-blog .card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}
.card-blog .card-body h3 { transition: color 0.2s; }
.card-blog:hover .card-body h3 { color: var(--primary); }

/* --- Chips / Tags --- */
.chip {
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.chip-tertiary { background: rgba(71, 96, 106, 0.15); color: var(--tertiary); }
.chip-secondary { background: rgba(133, 82, 58, 0.15); color: var(--secondary); }
.chip-primary { background: rgba(74, 98, 64, 0.15); color: var(--primary); }

/* Filter chips */
.filter-chip {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--outline-variant);
  background: var(--surface);
  color: var(--on-surface-variant);
  transition: all 0.2s;
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(74, 98, 64, 0.2);
}

/* --- Icon Circles --- */
.icon-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-circle-primary { background: var(--primary-fixed); color: var(--primary); }
.icon-circle-secondary { background: var(--secondary-fixed); color: var(--secondary); }
.icon-circle-tertiary { background: var(--tertiary-fixed); color: var(--tertiary); }

/* --- Testimonials --- */
.testimonial {
  background: var(--surface);
  border-radius: 24px;
  padding: var(--stack-md);
  border: 1px solid rgba(196, 200, 189, 0.5);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
}
.testimonial .quote-icon {
  position: absolute;
  top: 16px; left: 16px;
  font-size: 36px;
  color: var(--primary-fixed-dim);
  opacity: 0.5;
}
.testimonial .quote-text {
  margin-top: var(--stack-sm);
  margin-bottom: var(--stack-md);
  font-style: italic;
  color: var(--on-surface-variant);
}
.testimonial .author { display: flex; align-items: center; gap: 12px; }
.testimonial .author-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--on-secondary-container);
}

/* --- Newsletter Section --- */
.newsletter-section {
  background: var(--surface-container-low);
  border-radius: 32px;
  padding: 48px 32px;
  text-align: center;
}
.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}
.newsletter-input {
  flex: 1;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--outline-variant);
  background: var(--surface);
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-input:focus { border-color: var(--primary); }
.newsletter-input::placeholder { color: var(--outline); }

/* --- MailerLite Form Customization --- */
/* Rimuoviamo lo sfondo e i bordi del contenitore esterno del modulo MailerLite */
body #newsletter .ml-embedded,
body #newsletter .ml-embedded iframe {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; }
.page-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.page-btn:hover { background: var(--surface-variant); }
.page-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.page-btn:disabled { opacity: 0.5; cursor: default; }

/* --- Footer --- */
.site-footer {
  background: var(--surface-container-low);
  border-radius: 32px 32px 0 0;
  margin-top: var(--stack-lg);
  padding: var(--stack-lg) var(--container-padding);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface-variant);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--secondary); }
.footer-copy { font-size: 14px; color: var(--on-surface-variant); }

/* --- Sections --- */
.section { padding: var(--stack-lg) 0; }
.section-tinted { background: rgba(98, 124, 87, 0.08); }
.section-title { text-align: center; margin-bottom: var(--stack-lg); }

/* --- Grid --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--stack-md);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--stack-md);
}

/* --- Hero Banner --- */
.hero-banner {
  width: 100%;
  background: var(--surface-container-lowest);
}
.hero-banner img {
  width: 100%;
  height: 80vh;
  object-fit: cover;
  object-position: center;
}
.hero-text { text-align: center; padding: var(--stack-lg) var(--container-padding); }
.hero-text h1 { color: var(--primary); margin-bottom: var(--stack-md); }
.hero-text p {
  font-size: 18px;
  color: var(--on-surface-variant);
  max-width: 640px;
  margin: 0 auto var(--stack-lg);
}

/* --- About Preview --- */
.about-preview {
  display: flex;
  align-items: center;
  gap: var(--stack-lg);
}
.about-preview .about-text { flex: 1; }
.about-preview .about-image {
  flex: 1;
  display: flex;
  justify-content: center;
}
.about-preview .about-image .placeholder-img {
  width: 100%;
  max-width: 400px;
  height: 320px;
  border-radius: 32px;
  overflow: hidden;
}
.about-preview .about-image .placeholder-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Material Symbols --- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1;
}

/* --- Utility --- */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-tertiary { color: var(--tertiary); }
.text-muted { color: var(--on-surface-variant); }
.text-outline { color: var(--outline); }
.text-center { text-align: center; }
.mb-sm { margin-bottom: var(--stack-sm); }
.mb-md { margin-bottom: var(--stack-md); }
.mb-lg { margin-bottom: var(--stack-lg); }
.mt-md { margin-top: var(--stack-md); }
.mt-lg { margin-top: var(--stack-lg); }
.inline-flex { display: inline-flex; align-items: center; gap: 8px; }

/* --- Responsive --- */

/* === Tablet (≤ 1024px) === */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .site-nav { display: none; }
  .header-cta { display: none; }
  .menu-toggle { display: block; }

  .section { padding: 36px 0; }
  .section-title { margin-bottom: 36px; }
  .hero-text { padding: 36px var(--container-padding); }
  .hero-banner img { height: 60vh; }

  /* Better touch targets */
  .btn { padding: 14px 28px; min-height: 44px; }
  .btn-lg { padding: 16px 32px; }
  .filter-chip { padding: 12px 24px; min-height: 44px; }
  .nav-link { padding: 8px 4px; }

  /* Footer on tablet */
  .footer-inner { gap: 20px; }
  .site-footer { padding: 36px var(--container-padding); }
}

/* === Mobile Landscape / Small Tablet (≤ 768px) === */
@media (max-width: 768px) {
  /* Typography scale down */
  h1 { font-size: 28px; line-height: 1.25; }
  h2 { font-size: 24px; line-height: 1.3; }
  h3 { font-size: 19px; }
  .text-body-lg { font-size: 16px; }

  /* Single column grids */
  .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 16px; }

  /* Layout stacks */
  .about-preview { flex-direction: column; text-align: center; gap: 24px; }
  .about-preview .about-text { order: 1; }
  .about-preview .about-image { order: 2; width: 100%; }
  .about-preview .about-image .placeholder-img { max-width: 100%; height: 240px; border-radius: 20px; }

  /* Hero */
  .hero-banner img { height: 45vh; min-height: 220px; }
  .hero-text { padding: 28px 16px; }
  .hero-text p { font-size: 16px; }

  /* Newsletter */
  .newsletter-form { flex-direction: column; }
  .newsletter-section { padding: 36px 20px; }

  /* Footer */
  .footer-inner { flex-direction: column; text-align: center; gap: 16px; }
  .footer-links { justify-content: center; gap: 16px; flex-wrap: wrap; }
  .site-footer { border-radius: 24px 24px 0 0; padding: 32px 16px; margin-top: 32px; }

  /* Containers */
  .container { padding: 0 16px; }
  .container-narrow { padding: 0 16px; }

  /* Cards — single column, full width, no overflow */
  .card { padding: 20px; border-radius: 24px; }
  .card-blog { border-radius: 24px; }
  .card-blog .card-img { height: 200px; }
  .card-blog .card-body h3 { font-size: 18px; word-break: break-word; overflow-wrap: break-word; }
  .card-blog .card-body p { font-size: 14px; }

  /* Testimonials */
  .testimonial { padding: 20px; border-radius: 20px; }
  .testimonial .quote-text { font-size: 15px; }

  /* Header */
  .site-header { padding: 12px 16px; }
  .site-logo { font-size: 20px; }

  /* Mobile menu improvements */
  .mobile-nav .nav-link { font-size: 22px; padding: 10px 0; }
  .mobile-nav { gap: 24px; }

  /* Pagination */
  .page-btn { width: 44px; height: 44px; }

  /* Chips */
  .chip { font-size: 13px; padding: 4px 14px; }

  /* Icon circles */
  .icon-circle { width: 56px !important; height: 56px !important; font-size: 24px !important; }

  /* Sections */
  .section { padding: 32px 0; }
  .section-title { margin-bottom: 24px; }
}

/* === Small Mobile (≤ 480px) === */
@media (max-width: 480px) {
  /* Further typography reduction */
  h1 { font-size: 24px; }
  h2 { font-size: 21px; }
  h3 { font-size: 17px; }
  body { font-size: 15px; }

  /* Hero */
  .hero-banner img { height: 35vh; min-height: 180px; }
  .hero-text h1 { margin-bottom: 16px; }
  .hero-text p { margin-bottom: 24px; }

  /* Buttons */
  .btn { font-size: 13px; padding: 12px 20px; }
  .btn-lg { font-size: 16px; padding: 14px 24px; }

  /* Newsletter */
  .newsletter-section { padding: 24px 16px; border-radius: 24px; }
  .newsletter-input { padding: 12px 18px; }

  /* Filter chips row — scrollable on small screens */
  .filter-chip { padding: 10px 16px; font-size: 13px; white-space: nowrap; }

  /* Cards — full width, comfortable reading */
  .card { padding: 16px; border-radius: 20px; }
  .card-blog .card-body { padding: 16px; gap: 10px; }
  .card-blog .card-img { height: 180px; }
  .card-blog { border-radius: 20px; }

  /* Footer */
  .site-footer { padding: 24px 16px; }
  .footer-links { flex-direction: column; align-items: center; gap: 12px; }
  .footer-copy { font-size: 12px; }

  /* Testimonials */
  .testimonial { padding: 16px; border-radius: 16px; }
  .testimonial .author-avatar { width: 40px; height: 40px; }
  .testimonial .quote-text { font-size: 14px; margin-top: 8px; margin-bottom: 16px; }

  /* Header */
  .site-logo { font-size: 18px; }

  /* Icon circles — also override inline styles for team avatars */
  .icon-circle { width: 48px !important; height: 48px !important; font-size: 20px !important; }
  .icon-circle .material-symbols-outlined { font-size: 24px !important; }

  /* About section */
  .about-preview .about-image .placeholder-img { height: 200px; border-radius: 16px; }
}
