:root {
    --color-bg: #ffffff;
    --color-text: #0f172a;
    --color-muted: #374151;
    --color-border: #e5e7eb;
    --color-brand: #ffffff;
    --color-surface: #ffffff;
    --header-bg: #ffffffcc;
}

/* Dark theme */
:root[data-theme="dark"] {
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-muted: #9ca3af;
    --color-border: #464646;
    --color-brand: #ffffff;
    --color-surface: #000000;
    --header-bg: rgba(0, 0, 0, 0.7);
}

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

html, body {
    height: 100%;
    margin: 0;
  }  

body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
}

html, body {
    height: 100%;        /* il body occupa tutta l’altezza */
    margin: 0;           /* reset margini */
  }
  
  body {
    display: flex;
    flex-direction: column; /* layout verticale */
  }
  
  main {
    flex: 1; /* occupa lo spazio rimanente tra nav e footer */
    display: flex;
    justify-content: center; /* centro orizzontale */
    align-items: center;     /* centro verticale */
    text-align: center;      /* assicura che il contenuto rimanga centrato */
  }  

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px;
}

.brand-link {
    color: var(--color-text);
    transition: color 0.3s ease;
    font-weight: 700;
  }
  
  .brand-link:hover {
    opacity: 0.85;
    color: var(--color-brand);
  }

  .nav a:hover {
    opacity: 0.85;
    color: var(--color-brand); /* o un altro colore chiaro visibile nel dark mode */
  }

  @media (max-width: 1024px) {
    .px-7 {
      padding-left: 1.5rem !important;
      padding-right: 1.5rem !important;
    }
  }
  

.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 24px;
}

.px-7 {
    padding-left: 25rem !important;
    padding-right: 25rem !important;
  }

.brand {
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.85;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 16px;
}

.nav a {
    text-decoration: none;
    color: var(--color-text);
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav a:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.hero {
    text-align: center;
    padding: 96px 0 12px;
    animation: fadeInUp 0.8s ease-out;
}

.hero h1 {
    font-size: clamp(44px, 7vw, 64px);
    line-height: 1.03;
    margin-bottom: 6px;
    font-weight: 800;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.subtitle {
    opacity: 0.75;
    font-weight: 600;
    margin-bottom: 14px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.tagline {
    font-size: clamp(16px, 2.4vw, 20px);
    opacity: 0.92;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.social {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

.social a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    opacity: 0.9;
}

.help {
    padding: 36px 0 12px;
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

.help h2 {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.help h3 {
    font-size: clamp(22px, 3vw, 28px);
    margin-bottom: 8px;
}

.section-intro {
    opacity: 0.85;
    margin-bottom: 18px;
}

.topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.topic {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--color-surface);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.topic:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.topic h4 {
    margin-bottom: 6px;
    font-size: 18px;
}

.topic ul {
    padding-left: 18px;
}

.articles {
    padding: 28px 0 48px;
    animation: fadeInUp 0.8s ease-out 1.4s both;
}

.articles h2 {
    margin-bottom: 10px;
}

.load-more {
    appearance: none;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.site-footer {
    padding: 20px 24px;
    color: var(--color-muted);
    background: var(--color-surface);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-size: 13px;
    color: #c4c4c4;
}

.site-footer .footer-brand {
    font-weight: 600;
}

.site-footer .footer-links,
.site-footer .footer-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer a {
    text-decoration: none;
    color: #c4c4c4;
    transition: opacity 0.2s ease;
}

.site-footer a:hover {
    opacity: 0.8;
}

/* Mobile nav trigger */
.nav-toggle {
    display: none;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 8px;
    padding: 6px 10px;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    transform: translateY(-1px);
}

/* Hero avatar */
.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 18px auto;
}

/* CTA group */
.cta-group {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.btn:hover .btn-icon {
    transform: scale(1.1);
}

.btn-outline {
    background: rgba(255,255,255,0.03);
    color: var(--color-text);
    border: 1px solid rgb(199 199 199 / 18%);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 0 0 1px rgba(255,255,255,0.02);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.06);
    box-shadow: 0 2px 0 rgba(255,255,255,0.08) inset, 0 0 0 1px rgba(255,255,255,0.04), 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #ffffff;
    color: #111827;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.btn-primary:hover {
    background: #f8fafc;
    box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

.btn.big {
    display: inline-flex;
    margin: 18px auto 0 auto;
    padding: 16px 26px;
    border-radius: 999px;
    font-size: 18px;
    animation: fadeInUp 0.8s ease-out 1s both;
}

/* Header theme icon button */
.theme-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: 1px solid rgba(255, 0, 0, 0.18);
	background: rgba(255,255,255,0.03);
	color: var(--color-text);
	cursor: pointer;
	transition: all 0.3s ease;
}

.theme-icon {
	font-size: 18px;
	line-height: 1;
	transition: transform 0.3s ease;
    color: var(--color-text);
}
.theme-icon svg{
	width: 18px;
	height: 18px;
	display: block;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.theme-btn:hover .theme-icon {
	transform: rotate(180deg);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Reveal animations */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-delay-1 { transition-delay: 120ms; }
    .reveal-delay-2 { transition-delay: 240ms; }
    .reveal-delay-3 { transition-delay: 360ms; }
    .reveal-delay-4 { transition-delay: 480ms; }
    .reveal-delay-5 { transition-delay: 600ms; }
}

@media (max-width: 720px) {
    .topics {
        grid-template-columns: 1fr;
    }
    .nav-links {
        display: none;
    }
    .nav-toggle {
        display: inline-block;
    }
    .hero {
        padding-top: 42px;
    }

    .btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border-radius: 14px;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
        transform: translateY(0);
    }

    .cta-group {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 16px;
        flex-wrap: wrap;
        animation: fadeInUp 0.8s ease-out 0.8s both;
    }

    .theme-btn:hover .theme-icon {
        transform: none;
    }
}
  
/* Theme toggle button - minimal */
[data-theme-toggle] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text);
    transition: transform 0.3s ease, color 0.3s ease;
}

[data-theme-toggle]:hover {
    transform: scale(1.2); /* leggero ingrandimento al passaggio del mouse */
    color: var(--color-brand); /* opzionale: cambia colore al hover */
}

.theme-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease, stroke 0.3s ease;
}

[data-theme-toggle]:hover .theme-icon svg {
    transform: rotate(20deg); /* rotazione leggera all’hover */
}

[data-theme-toggle] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;   /* niente background */
    border: none;       /* niente bordo */
    padding: 0;
    cursor: pointer;
    color: var(--color-text);
    transition: transform 0.3s ease, color 0.3s ease;
    outline: none;      /* rimuove il bordo di focus predefinito */
}

[data-theme-toggle]:hover {
    transform: rotate(20deg); /* rotazione icona */
    color: var(--color-brand); 
    background: none;         /* forza niente background */
    box-shadow: none;         /* niente shadow */
}

[data-theme-toggle]:focus,
[data-theme-toggle]:active {
    outline: none;
    background: none;
    box-shadow: none;
}

[data-theme-toggle] {
    --bs-btn-active-bg: transparent; /* nessun background quando cliccato */
}

.nav a:hover {
    opacity: 0.85;
    color: var(--color-brand-light); /* usa colore leggibile in tema chiaro */
}

:root[data-theme="dark"] .nav a:hover {
    color: var(--color-brand-dark); /* cambia colore in dark mode */
}

.brand-link {
    color: var(--color-text); /* prende il colore del testo del tema */
    transition: color 0.3s ease;
  }
  
  .brand-link:hover {
    color: #b4b4b4; /* blu acceso, sempre visibile */
  }

  @media (max-width: 720px){
  [data-theme-toggle]:hover .theme-icon svg {
    transform: none; /* rotazione leggera all’hover */
}}

/* Link menu */
.nav a {
    color: white; /* colore leggibile in base al tema */
    transition: color 0.3s ease;
}

.nav a:hover {
    color: var(--color-brand); /* colore brand già definito per ogni tema */
}

/* Dark mode già gestito dalle variabili */

/* Navbar brand e link */
.navbar-brand,
.nav-link {
    color: var(--color-text);  /* testo leggibile in base al tema */
    transition: color 0.3s ease;
}

.navbar-brand:hover,
.nav-link:hover {
    color: var(--color-border);
}

/* Override dell'icona hamburger di Bootstrap */
.navbar-toggler-icon {
    background-image: none; /* rimuove il background SVG predefinito */
    position: relative;
    width: 24px;
    height: 2px;
    background-color: var(--color-text); /* linea centrale */
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text); /* linee superiore e inferiore */
    transition: all 0.3s ease;
}

.navbar-toggler-icon::before { top: -8px; }
.navbar-toggler-icon::after { top: 8px; }

/* Dark mode automatico già gestito dalle variabili */



/* Icona hamburger personalizzata */
.navbar-toggler-icon {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background-color: var(--color-text); /* linea centrale */
    transition: all 0.3s ease;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    left: 0;
    transition: all 0.3s ease;
}

/* Linea superiore e inferiore */
.navbar-toggler-icon::before { top: -8px; }  /* distanza dalla linea centrale */
.navbar-toggler-icon::after { top: 8px; }    /* distanza dalla linea centrale */

.navbar-toggler{
    border-color: transparent;
}

.navbar-toggler:focus{
    box-shadow: none;
}

/* Link della navbar */
.nav-link {
    color: var(--color-text);  /* testo leggibile in base al tema */
    transition: color 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}

.nav-link:hover {
    color: var(--color-border); /* colore brand in hover */
    opacity: 1;
}

/* Card hover effect */
.hover-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .hover-scale:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  }
  
  /* Rounded image inside card */
  .card-img-top {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    object-fit: cover;
    height: 220px; /* adjust depending on your images */
  }
  
  /* Button styling */
  .btn-primary {
    background: #4f46e5;
    border: none;
    transition: all 0.3s ease;
  }
  .btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  }
  
  /* Responsive text alignment */
  @media (max-width: 768px) {
    .card-body {
      text-align: center;
    }
  }
  