/* =============================================================
   Elevamente — Modern Bold UI (Flexbox-only)
   Author: Senior CSS Developer & UI Designer
   Notes:
   - Mobile-first, high-contrast, bold modern aesthetic
   - ONLY Flexbox used for all layouts (no grid/columns)
   - Includes mobile burger menu + cookie banner & modal
   ============================================================= */

/* ---------------------------
   CSS RESET / NORMALIZE
   --------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; }
img, svg, picture, video { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0 0 16px 20px; padding: 0; }
li { margin: 6px 0; }
h1, h2, h3, h4, h5, h6, p, figure { margin: 0 0 12px; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #3ACCC6; outline-offset: 2px; }

/* ---------------------------
   THEME VARIABLES
   --------------------------- */
:root {
  --primary: #0A2A43;    /* deep navy */
  --secondary: #1FA6A1;  /* vibrant teal */
  --secondary-600: #0E8C87; /* darker teal for hover */
  --secondary-400: #3ACCC6; /* lighter teal for focus/accents */
  --accent: #FFFFFF;      /* white */
  --bg: #F3F8FB;         /* airy light background */
  --ink: #0A2A43;        /* primary text */
  --muted: #3C5266;      /* secondary text */
  --line: #D9E7EC;       /* subtle lines */

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-1: 0 8px 24px rgba(10,42,67,0.12);
  --shadow-2: 0 14px 36px rgba(10,42,67,0.16);

  --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px; --space-60: 60px;
}

/* ---------------------------
   TYPOGRAPHY
   --------------------------- */
body {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0.2px;
}

h1, h2, h3, h4 {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.3px;
}

h1 { font-size: 32px; line-height: 1.2; margin-bottom: 12px; }
h2 { font-size: 24px; line-height: 1.25; margin-bottom: 10px; }
h3 { font-size: 18px; line-height: 1.3; margin-bottom: 8px; }

p { color: var(--muted); }
strong { color: var(--ink); font-weight: 800; }

/* Content links (in-body) */
main p a, .text-section a { color: var(--secondary); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
main p a:hover, .text-section a:hover { color: var(--secondary-600); }

/* Breadcrumbs */
main nav[aria-label="Percorso"] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
main nav[aria-label="Percorso"] a { color: var(--secondary); font-weight: 700; text-decoration: none; }
main nav[aria-label="Percorso"] a:hover { text-decoration: underline; }
main nav[aria-label="Percorso"] span { color: var(--muted); }

/* ---------------------------
   GLOBAL LAYOUT (FLEX-ONLY)
   --------------------------- */
.container { width: 100%; padding: 0 16px; display: flex; justify-content: center; }
.content-wrapper { width: 100%; max-width: 1100px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }

/* Section base spacing (and REQUIRED .section class) */
section { margin-bottom: 60px; padding: 40px 20px; position: relative; }
.section { margin-bottom: 60px; padding: 40px 20px; }

/* Light card-like sections on default; hero overrides later */
main > section { background: var(--accent); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }

/* Decorative geometric accent (allowed: decorative absolute) */
main > section::after {
  content: "";
  position: absolute; inset: auto 16px -14px auto; width: 80px; height: 14px;
  background: var(--secondary);
  border-radius: 6px;
  opacity: 0.14; pointer-events: none;
}

/* ---------------------------
   HEADER & NAVIGATION
   --------------------------- */
header { background: var(--accent); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
header .container { padding-top: 10px; padding-bottom: 10px; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }

.logo img { height: 32px; width: auto; }

.main-nav { display: none; align-items: center; gap: 20px; }
.main-nav a { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 14px; padding: 10px 6px; border-radius: 8px; transition: color .2s ease, background-color .2s ease; }
.main-nav a:hover { color: var(--accent); background: var(--secondary); }

.header-cta { display: none; align-items: center; gap: 12px; }
.header-cta a { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 12px; font-weight: 900; letter-spacing: 0.02em; transition: transform .15s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.header-cta a:first-child { background: var(--secondary); color: var(--accent); box-shadow: var(--shadow-1); }
.header-cta a:first-child:hover { background: var(--secondary-600); transform: translateY(-1px); }
.header-cta a:last-child { background: transparent; color: var(--secondary); border: 2px solid var(--secondary); }
.header-cta a:last-child:hover { background: var(--secondary); color: var(--accent); }

/* Mobile burger */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; color: var(--accent); background: var(--primary); box-shadow: var(--shadow-1); }
.mobile-menu-toggle:hover { background: #0C3655; }

/* Mobile full-screen menu overlay */
.mobile-menu {
  position: fixed; inset: 0; background: var(--primary);
  color: var(--accent); display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 20px; gap: 20px;
  transform: translateX(100%); transition: transform .35s ease; z-index: 9999;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; width: 44px; height: 44px; border-radius: 10px; color: var(--primary); background: var(--accent); font-weight: 900; }
.mobile-menu-close:hover { background: #EAF3F6; }
.mobile-nav { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.mobile-nav a { display: flex; align-items: center; padding: 14px 12px; border-radius: 10px; font-weight: 800; color: var(--accent); background: rgba(255,255,255,0.06); }
.mobile-nav a:hover { background: rgba(255,255,255,0.14); }

/* ---------------------------
   HERO (first section on each page)
   --------------------------- */
main > section:first-of-type { background: var(--primary); color: var(--accent); box-shadow: var(--shadow-2); }
main > section:first-of-type h1, 
main > section:first-of-type h2, 
main > section:first-of-type h3, 
main > section:first-of-type p { color: var(--accent); }
main > section:first-of-type .text-section { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); }

/* CTA groups inside content wrappers (buttons) */
main .content-wrapper > div a { display: inline-flex; align-items: center; justify-content: center; padding: 14px 18px; border-radius: 14px; font-weight: 900; letter-spacing: 0.02em; margin-right: 10px; margin-bottom: 10px; transition: transform .15s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease; }
main > section:first-of-type .content-wrapper > div a:first-child { background: var(--secondary); color: var(--accent); box-shadow: var(--shadow-1); }
main > section:first-of-type .content-wrapper > div a:first-child:hover { background: var(--secondary-600); transform: translateY(-1px); }
main > section:first-of-type .content-wrapper > div a:last-child { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
main > section:first-of-type .content-wrapper > div a:last-child:hover { background: var(--accent); color: var(--primary); }

/* Non-hero CTAs */
main section:not(:first-of-type) .content-wrapper > div a:first-child { background: var(--secondary); color: var(--accent); box-shadow: var(--shadow-1); }
main section:not(:first-of-type) .content-wrapper > div a:first-child:hover { background: var(--secondary-600); transform: translateY(-1px); }
main section:not(:first-of-type) .content-wrapper > div a:last-child { background: transparent; color: var(--secondary); border: 2px solid var(--secondary); }
main section:not(:first-of-type) .content-wrapper > div a:last-child:hover { background: var(--secondary); color: var(--accent); }

/* ---------------------------
   CARDS / TEXT BLOCKS / FEATURES
   --------------------------- */
.text-section { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--radius-md); background: #F7FCFC; border: 1px solid var(--line); }
    .text-section strong,
    .cookie-content strong,
    .content-wrapper nav span{
        color: #fff !important;
    }
    /* REQUIRED FLEX PATTERNS */
    .card-container {
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
    }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-md); background: var(--accent); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.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; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: var(--radius-md); background: #FFFFFF; border: 2px solid #E6F3F2; box-shadow: var(--shadow-1); color: var(--ink); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Testimonials readability (dark text on light background ensured) */
.testimonial-card p { color: var(--ink); }
.testimonial-card strong { color: var(--primary); }

/* Lists in text-section and content */
.text-section ul, .text-section ol, main ul, main ol { display: flex; flex-direction: column; gap: 8px; margin-left: 18px; }
.text-section li, main li { color: var(--ink); }

/* Catalog/course/resource blocks (treat .text-section as cards) */
.text-section h3 { color: var(--primary); }

/* ---------------------------
   FOOTER
   --------------------------- */
footer { background: var(--primary); color: var(--accent); border-top: 6px solid var(--secondary); }
footer .container { padding-top: 30px; padding-bottom: 30px; }
footer .content-wrapper { flex-direction: row; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
footer .text-section { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16); color: var(--accent); }
footer .text-section p, footer .text-section h3 { color: var(--accent); }
footer nav { display: flex; flex-direction: column; gap: 10px; }
footer nav a { color: var(--accent); font-weight: 700; padding: 6px 0; }
footer nav a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Contact icons inline in paragraphs */
footer .text-section img, main .text-section img { width: 18px; height: auto; display: inline-block; margin-right: 8px; vertical-align: text-bottom; }

/* ---------------------------
   ACCESSIBILITY & MICRO-INTERACTIONS
   --------------------------- */
::selection { background: var(--secondary-400); color: var(--primary); }
[role="button"], a, button { transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease; }

/* ---------------------------
   RESPONSIVE LAYOUT (MOBILE-FIRST)
   --------------------------- */
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

  .content-wrapper { gap: 24px; }
  .text-image-section { flex-direction: row; }
}

@media (min-width: 992px) {
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

  footer .content-wrapper { justify-content: space-between; }
}

@media (min-width: 1140px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
}

/* ---------------------------
   UTILITIES & LAYOUT HELPERS
   --------------------------- */
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--secondary-400); color: var(--primary); font-weight: 900; font-size: 12px; }
.muted { color: var(--muted); }

/* ---------------------------
   MOBILE MENU ANIMATIONS
   --------------------------- */
@keyframes slideUpIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideUpOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(16px); opacity: 0; } }

/* ---------------------------
   COOKIE CONSENT BANNER & MODAL
   --------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
  display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center;
  background: var(--primary); color: var(--accent);
  padding: 16px; border-top: 4px solid var(--secondary);
  transform: translateY(100%); transition: transform .35s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1100px; padding: 0 16px; }
.cookie-banner p { margin: 0; color: var(--accent); }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-buttons .btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 12px; font-weight: 900; letter-spacing: 0.02em; }
.btn-accept { background: var(--secondary); color: var(--accent); }
.btn-accept:hover { background: var(--secondary-600); }
.btn-reject { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-reject:hover { background: var(--accent); color: var(--primary); }
.btn-settings { background: transparent; color: var(--secondary); border: 2px solid var(--secondary); }
.btn-settings:hover { background: var(--secondary); color: var(--accent); }

/* Cookie preferences modal */
.cookie-modal {
  position: fixed; inset: 0; background: rgba(10,42,67,0.72);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 10000;
}
.cookie-modal.open { display: flex; }
.cookie-modal-content {
  background: var(--accent); color: var(--ink);
  width: 100%; max-width: 720px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 16px; padding: 20px;
}
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.cookie-category .label { font-weight: 800; color: var(--primary); }
.cookie-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* Simple toggle style (analytics / marketing) */
.cookie-toggle { position: relative; width: 46px; height: 28px; background: #CBDDE3; border-radius: 999px; display: inline-flex; align-items: center; padding: 3px; transition: background-color .2s ease; }
.cookie-toggle::after { content: ""; width: 22px; height: 22px; background: var(--accent); border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transform: translateX(0); transition: transform .2s ease; }
.cookie-toggle.on { background: var(--secondary); }
.cookie-toggle.on::after { transform: translateX(18px); }

/* ---------------------------
   MISC ELEMENT TWEAKS
   --------------------------- */
/* Ensure minimum spacing between any stacked content blocks */
.text-section + .text-section, .testimonial-card + .testimonial-card, .card + .card { margin-top: 20px; }

/* Tables (if ever present in articles) */
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; }
th, td { border: 1px solid var(--line); padding: 10px; text-align: left; }
th { background: #EEF6F7; color: var(--primary); }

/* Images inside content should have rounded corners for modern look */
main img { border-radius: 10px; }

/* ---------------------------
   PAGE-SPECIFIC POLISH
   --------------------------- */
/* Ratings / mini notes at bottom of testimonial sections */
#testimonianze + p,
#piani + p,
#faq + p { color: var(--muted); }

/* Breadcrumb divider style (› already in markup) */
main nav[aria-label="Percorso"] { opacity: 0.95; }

/* ---------------------------
   PRINT (basic)
   --------------------------- */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  main > section { box-shadow: none; border: 1px solid #CCC; }
}
