/* =========================
   CSS RESET & BASE TYPOGRAPHY
========================= */
html {
  box-sizing: border-box;
  font-size: 100%;
}
*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
body {
  min-height: 100vh;
  background: #F6F5EF;
  color: #1B3E3A;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: #1B3E3A;
  text-decoration: underline;
  transition: color 0.18s;
}
a:hover, a:focus {
  color: #D0A96D;
  outline: none;
}
ul, ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}
li {
  margin-bottom: 0.5em;
}
strong {
  font-weight: 700;
}

/* =========================
   BRAND TYPOGRAPHY SCALE
========================= */
h1, .h1 {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-weight: 700;
  font-size: 2.375rem; /* ~38px */
  line-height: 1.13;
  color: #1B3E3A;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}
@media (max-width: 768px) {
  h1, .h1 { font-size: 1.7rem; }
}
h2, .h2 {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-weight: 600;
  font-size: 1.625rem; /* ~26px */
  line-height: 1.25;
  margin-bottom: 14px;
  color: #1B3E3A;
}
@media (max-width: 768px) {
  h2, .h2 { font-size: 1.25rem; }
}
h3, .h3 {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-weight: 500;
  font-size: 1.25rem; /* 20px */
  margin-bottom: 10px;
  color: #1B3E3A;
}
h4, .h4 {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-weight: 500;
  font-size: 1rem;
}
p {
  margin-bottom: 12px;
  color: #1B3E3A;
  font-size: 1rem;
}
blockquote {
  font-style: italic;
  border-left: 4px solid #D0A96D;
  padding-left: 18px;
  color: #1B3E3A;
  margin-bottom: 10px;
  background: #F5F3EC;
}
cite {
  display: block;
  font-style: normal;
  font-size: 0.98rem;
  color: #574611;
  margin-top: 4px;
  opacity: .7;
}

/* =======================
   LAYOUT: CONTAINER & SECTIONS
======================= */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 18px;
}
.section, section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: none;
}
@media (max-width: 768px) {
  .section, section {
    padding: 28px 8px;
    margin-bottom: 34px;
  }
  .container {
    padding: 0 8px;
  }
}
main {
  flex: 1 0 auto;
  min-height: 60vh;
}

/* =======================
   HEADER & NAVIGATION
======================= */
header {
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(27,62,58,0.06);
  padding: 0;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo img {
  height: 44px;
  width: auto;
  margin-right: 10px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-size: 1rem;
  color: #1B3E3A;
  text-decoration: none;
  letter-spacing: 0.01em;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.16s, color 0.15s;
}
.main-nav a:hover, .main-nav a:focus {
  background: #F5F3EC;
  color: #D0A96D;
}
.cta-btn {
  background: #D0A96D;
  color: #1B3E3A;
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  padding: 12px 26px;
  border-radius: 26px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 62, 58, 0.07);
  transition: background 0.15s, color 0.15s, box-shadow 0.18s;
  margin-left: 18px;
  display: inline-block;
}
.cta-btn:hover,.cta-btn:focus {
  background: #1B3E3A;
  color: #FFFFFF;
  box-shadow: 0 4px 24px rgba(27, 62, 58, .10);
}
.mobile-menu-toggle {
  display: none;
  font-size: 2rem;
  background: transparent;
  border: none;
  color: #1B3E3A;
  padding: 8px 8px;
  cursor: pointer;
  transition: color 0.16s, background 0.14s;
  z-index: 103;
  border-radius: 8px;
}
.mobile-menu-toggle:focus, .mobile-menu-toggle:hover {
  color: #D0A96D;
  background: #EFE8D6;
}

@media (max-width: 968px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: inline-block;
  }
  .cta-btn {
    margin-left: 0;
  }
}

/* ============================
   MOBILE MENU (burger overlay)
============================ */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #FFFFFF;
  z-index: 110;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(.8,.13,.3,1);
  box-shadow: -4px 0 16px rgba(27,62,58,0.12);
  display: flex;
  flex-direction: column;
  padding: 0;
  will-change: transform;
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateX(0);
  pointer-events: auto;
}
.mobile-menu-close {
  align-self: flex-end;
  margin: 24px 24px 0 0;
  font-size: 2.2rem;
  background: none;
  border: none;
  color: #1B3E3A;
  cursor: pointer;
  transition: color 0.15s, background 0.14s;
  border-radius: 8px;
}
.mobile-menu-close:focus, .mobile-menu-close:hover {
  color: #D0A96D;
  background: #EFE8D6;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 34px;
  padding-left: 40px;
  padding-right: 40px;
}
.mobile-nav a {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-size: 1.18rem;
  color: #1B3E3A;
  padding: 12px 10px;
  background: none;
  border-radius: 12px;
  text-decoration: none;
  transition: color 0.14s, background 0.13s;
  margin-bottom: 8px;
}
.mobile-nav a:active, .mobile-nav a:focus, .mobile-nav a:hover {
  color: #D0A96D;
  background: #F7EFD0;
}
@media (min-width: 969px) {
  .mobile-menu {
    display: none !important;
  }
}

/* ===========================
   HERO STYLES
=========================== */
.hero {
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 6px 38px rgba(27, 62, 58, 0.05);
  margin-bottom: 48px;
  padding: 60px 0 64px 0;
  display: flex;
  flex-direction: column;
}
.hero .container {
  flex-direction: column;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.hero h1, .hero h2 {
  color: #1B3E3A;
}
.hero p {
  color: #344441;
  font-size: 1.18rem;
  margin-bottom: 22px;
}
.hero .cta-btn {
  font-size: 1.08rem;
}
@media (max-width: 768px) {
  .hero {
    border-radius: 12px;
    padding: 27px 0 32px 0;
  }
}

/* ===========================
   LAYOUT WRAPPERS & GRIDS
========================== */
.content-wrapper, .content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
  margin-top: 12px;
}
@media (max-width: 768px) {
  .content-wrapper, .content-grid {
    gap: 14px;
  }
}
.text-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

/* Feature grid for index, servizi, risorse, laboratori etc. */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}
.feature-grid > div {
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 2px 18px rgba(208, 169, 109, 0.07), 0 1.5px 7px rgba(27,62,58,0.04);
  padding: 24px;
  min-width: 225px;
  flex: 1 1 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  transition: box-shadow 0.19s, transform .15s;
  margin-bottom: 20px;
}
.feature-grid > div:hover, .feature-grid > div:focus-within {
  box-shadow: 0 7px 28px rgba(27,62,58,0.10), 0 1.5px 18px rgba(208,169,109,.14);
  transform: translateY(-2px) scale(1.015);
}
.feature-grid img {
  width: 46px;
  height: 46px;
}

/* ==========================
   ARTICLE CARDS & CONTENT
========================== */
.article-card {
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(27,62,58,0.05);
  padding: 24px 18px;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  transition: box-shadow 0.15s, transform 0.11s;
}
.article-card:hover, .article-card:focus-within {
  box-shadow: 0 5px 22px rgba(27,62,58,0.12);
  transform: translateY(-2px) scale(1.013);
}

/* Text links inside cards */
.article-card a {
  color: #1B3E3A;
  font-weight: 500;
  text-decoration: underline;
  margin-top: 8px;
}
.article-card a:hover,
.article-card a:focus {
  color: #D0A96D;
}

/* =======================
   TESTIMONIALS
======================= */
.testimonial-card {
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(27,62,58,0.12);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  color: #1B3E3A;
  flex: 1 1 320px;
  min-width: 230px;
  transition: box-shadow 0.13s, transform 0.11s;
}
.testimonial-card:hover, .testimonial-card:focus-within {
  box-shadow: 0 7px 20px rgba(27,62,58,0.13);
  background: #F5F3EC;
  transform: translateY(-2px);
}
.testimonial-card blockquote {
  background: none;
  border: none;
  padding: 0;
}
.testimonial-card cite {
  color: #7A6130;
  font-size: 0.98em;
}
@media (max-width: 900px) {
  .testimonial-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 14px;
  }
}

/* =======================
   TABLES (PRICING, ETC)
======================= */
.pricing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 28px;
  margin-bottom: 18px;
  font-size: 1rem;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(27,62,58,0.04);
  overflow: hidden;
}
.pricing-table caption {
  font-family: 'Montserrat';
  font-weight: 600;
  margin-bottom: 8px;
  color: #1B3E3A;
}
.pricing-table th, .pricing-table td {
  padding: 18px 12px;
  text-align: left;
  border-bottom: 1px solid #EFE8D6;
}
.pricing-table th {
  background: #F5F3EC;
  font-weight: 700;
  font-size: 1.07rem;
  color: #7A6130;
}
.pricing-table tbody tr:last-child td {
  border-bottom: none;
}
@media (max-width: 600px) {
  .pricing-table th, .pricing-table td {
    padding: 10px 6px;
    font-size: 0.95rem;
  }
}

/* =======================
   FOOTER
======================= */
footer {
  background: #F5F3EC;
  color: #1B3E3A;
  padding: 0;
}
footer .container {
  padding-top: 32px;
  padding-bottom: 24px;
}
footer .content-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  justify-content: space-between;
}
footer img {
  width: 64px;
  margin-bottom: 12px;
}
footer nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
footer nav a {
  color: #1B3E3A;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 3.5px 7px;
  transition: color 0.13s, background 0.11s;
}
footer nav a:hover, footer nav a:focus {
  color: #D0A96D;
  background: #EFE8D6;
}
@media (max-width: 900px) {
  footer .content-wrapper {
    flex-direction: column;
    gap: 24px;
  }
}

/* =======================
   BUTTONS, LINKS, INTERACTION
======================= */
button, .btn {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  font-size: 1rem;
  background: #D0A96D;
  color: #1B3E3A;
  border: none;
  border-radius: 24px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.14s, color 0.13s, box-shadow 0.14s;
  margin: 0 0 8px 0;
  font-weight: 600;
}
button:focus, button:hover, .btn:focus, .btn:hover {
  background: #1B3E3A;
  color: #FFFFFF;
  outline: none;
}

/* =======================
   CATEGORY, FILTERS, MISC
======================= */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  align-items: center;
}
.category-filters span {
  font-weight: 600;
  color: #7A6130;
}
.category-filters a {
  color: #1B3E3A;
  background: #F6F5EF;
  padding: 5px 18px;
  border-radius: 16px;
  font-family: 'Montserrat';
  font-size: 0.98rem;
  text-decoration: none;
  margin-bottom: 8px;
  transition: background 0.13s, color 0.13s;
}
.category-filters a:hover, .category-filters a:focus {
  background: #D0A96D;
  color: #FFFFFF;
}

/* =======================
   FAQ
======================= */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.faq-list li {
  background: #FFFFFF;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 1px 7px rgba(27,62,58,0.04);
  margin-bottom: 0px;
}
.faq-list strong {
  color: #7A6130;
}

/* =======================
   RESOURCES: icons in text
======================= */
p img, li img {
  vertical-align: middle;
  width: 1.1em;
  height: 1.1em;
  margin-right: 8px;
}

/* =======================
   UTILITY FLEX CLASSES (Mandatory Layouts)
======================= */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  margin-bottom: 20px;
  position: relative;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 2px 18px rgba(27,62,58,0.08);
  padding: 26px 21px;
  display: flex;
  flex-direction: column;
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .text-image-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}
.testimonial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

/* Section spacing override for last child */
.section:last-child, section:last-of-type {
  margin-bottom: 0;
}

/* ===============================
   RESPONSIVE & FLUID LAYOUTS
=============================== */
@media (max-width: 680px) {
  .feature-grid, .content-wrapper, .card-container, .content-grid {
    flex-direction: column;
    gap: 13px;
  }
  .feature-grid > div, .card, .article-card, .testimonial-card {
    min-width: 0 !important;
    width: 100%;
  }
}
@media (max-width: 480px) {
  .hero, .feature-grid > div, .article-card, .testimonial-card, .card {
    padding: 14px 7px;
    font-size: 0.97rem;
  }
}

/* ==============================
   COOKIE CONSENT BANNER & MODAL
============================== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 600;
  background: #FFFDF8;
  color: #1B3E3A;
  box-shadow: 0 -2px 16px rgba(27,62,58,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 10px 18px 10px;
  gap: 18px;
  width: 100%;
  animation: fadeInCookie .62s ease;
}
@keyframes fadeInCookie {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: none; }
}
.cookie-banner p {
  color: #1B3E3A;
  margin-bottom: 0;
  font-size: 1.02rem;
}
.cookie-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.cookie-btn,
.cookie-settings-btn {
  font-family: 'Montserrat', 'Lato', Arial, sans-serif;
  padding: 8px 20px;
  border-radius: 18px;
  border: none;
  background: #D0A96D;
  color: #1B3E3A;
  font-weight: 600;
  transition: background 0.15s, color 0.13s, box-shadow .15s;
  cursor: pointer;
  margin: 0 2px;
  font-size: 0.98rem;
}
.cookie-btn:hover, .cookie-btn:focus,
.cookie-controls .cookie-settings-btn:hover, .cookie-controls .cookie-settings-btn:focus {
  background: #1B3E3A;
  color: #FFFFFF;
}
.cookie-reject-btn {
  background: #EFE8D6;
  color: #574611;
  border: 1px solid #D0A96D;
}
.cookie-reject-btn:hover, .cookie-reject-btn:focus {
  background: #D0A96D;
  color: #1B3E3A;
}
.cookie-settings-modal-overlay {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(27,62,58,.18);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInModalBg .45s;
}
@keyframes fadeInModalBg {
  from { opacity: 0; } to { opacity: 1; }
}
.cookie-settings-modal {
  background: #FFFDF8;
  color: #1B3E3A;
  border-radius: 22px;
  box-shadow: 0 4px 36px rgba(27,62,58,0.13);
  max-width: 420px;
  width: 92vw;
  padding: 34px 30px 26px 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideInModal .38s cubic-bezier(.7,.15,.35,1);
}
@keyframes slideInModal {
  from { opacity: 0; transform: translateY(80px) scale(.92); }
  to { opacity:1; transform: none; }
}
.cookie-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: #1B3E3A;
  font-size: 2.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.14s, color 0.12s;
}
.cookie-modal-close:focus, .cookie-modal-close:hover {
  color: #D0A96D;
  background: #EFE8D6;
}
.cookie-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cookie-category {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 7px 0;
}
.cookie-category-label {
  flex: 1 1 60%;
  font-weight: 500;
  color: #1B3E3A;
}
.cookie-category-toggle {
  appearance: none;
  width: 38px;
  height: 20px;
  background: #EFE8D6;
  border-radius: 12px;
  position: relative;
  outline: none;
  margin-left: 4px;
  transition: background 0.16s;
  cursor: pointer;
  border: none;
}
.cookie-category-toggle:checked {
  background: #D0A96D;
}
.cookie-category-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cookie-category-toggle::before {
  content: '';
  position: absolute;
  top: 2.2px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #FFF;
  border-radius: 50%;
  transition: 0.19s cubic-bezier(.7,.13,.3,1);
  box-shadow: 0 1px 4px rgba(27,62,58,.04);
}
.cookie-category-toggle:checked::before {
  left: 18px;
  background: #F5F3EC;
}

/* ====================
   MISC (THANK YOU PAGE etc)
==================== */
.thank-you {
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
  padding: 44px 20px 64px 20px;
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 6px 32px rgba(27,62,58,.10);
}

/* ====================
   SCREENREADER-ONLY
==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =====================
   FOCUS VISIBLE HIGHLIGHT
===================== */
a:focus-visible,
button:focus-visible,
.cta-btn:focus-visible,
.cookie-btn:focus-visible {
  outline: 2.5px solid #D0A96D;
  outline-offset: 2px;
}

/* =====================
   PRINT STYLES BASICS
===================== */
@media print {
  header, footer, .mobile-menu, .cookie-banner, .cookie-settings-modal-overlay {
    display: none !important;
  }
  main, .container {
    padding: 0 !important;
    margin: 0 !important;
  }
}
