/* ==========================================================================
   CSS Document — Innovation Agency
   ========================================================================== */


/* ==========================================================================
   1. FONT LOCALI
   ========================================================================== */

@font-face {
  font-family: 'TitleFont';
  src: url('../fonts/playfair-display-v40-latin-700italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'SubTitleFont';
  src: url('../fonts/dm-serif-display-v17-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SubTitleFont';
  src: url('../fonts/dm-serif-display-v17-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'MainFont';
  src: url('../fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MainFont';
  src: url('../fonts/dm-sans-v17-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'MainFont';
  src: url('../fonts/dm-sans-v17-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MainFont';
  src: url('../fonts/dm-sans-v17-latin-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'MainFont', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  line-height: 1.7;
  color: #333;
  font-weight: 400;
  background-color: #fafafa;
}

.custom-link {
  text-decoration: none;
}

.custom-link:hover {
  text-decoration: underline;
}


/* ==========================================================================
   3. LAYOUT — CONTENITORI GENERALI
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}


/* ==========================================================================
   4. HEADER & NAVIGAZIONE
   ========================================================================== */

.header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-family: 'TitleFont', ui-serif, Georgia, 'Times New Roman', Times, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #012a60;
  text-decoration: none;
}

.logo img {
  max-height: 40px;
  width: auto;
  display: block;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  text-decoration: none;
  color: #012a60;
  font-weight: 400;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: #3498db;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #333;
  transition: 0.3s;
}


/* ==========================================================================
   5. HERO
   ========================================================================== */

.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero h1 {
  font-family: 'TitleFont', ui-serif, Georgia, 'Times New Roman', Times, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #012a60;
  margin-bottom: 1rem;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: #5a6c7d;
  max-width: 600px;
  margin: 0 auto;
}


/* ==========================================================================
   6. SEZIONE CONTENUTI
   ========================================================================== */

.content {
  background: #fff;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.content-block {
  max-width: 920px;
  width: 100%;
  padding: 2.5rem;
  margin-left: auto;
  margin-right: auto;
}

/* Titolo principale dell'articolo (era <h1>, ora correttamente <h2>) */
.content-block h2.article-title {
  font-family: 'TitleFont', ui-serif, Georgia, 'Times New Roman', Times, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  font-style: italic;
  color: #012a60;
  margin-bottom: 1.2rem;
}

/* Sottotitoli interni all'articolo */
.content-block h2 {
  font-family: 'SubTitleFont', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  color: #012a60;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.content-block p {
  margin-bottom: 1.2rem;
  color: #3a4353;
  font-size: 1rem;   /* era 1.1rem, allineato al font-size base del body */
  line-height: 1.4;
}

/* Immagini dentro il contenuto */
.content-block p img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

/* scope limitato a .content-block per evitare conflitti con altri selettori a */
.content-block a {
  color: #012a60;
  text-decoration: none;
}

.content-block a:hover {
  text-decoration: underline;
}


/* Titoletto interno all'articolo */
.titoletto {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3a4353;   /* stesso colore del testo paragrafo, ma puoi variare */
}

/* Firma autore */
.nome {
  font-family: 'MainFont', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; /* FIX: fallback corretto per font sans-serif */
  font-size: 1rem;
  font-weight: 400;
  font-style:italic;
  line-height: 1.4;
  color: #012a60;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
}

.nome a {
  color: #012a60;
  text-decoration: none;
  font-style:normal;
}

.nome a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   7. RIFERIMENTI BIBLIOGRAFICI
   ========================================================================== */

.ref-card {
  margin-bottom: 1.8rem;
  padding: 1.2rem 1.5rem;
  background-color: #f8f9fa;
  border: 1px solid #c3cfe2;        /* bordo su tutti i lati */
  border-left: 3px solid #2c3e50;   /* bordo sinistro più spesso e scuro */
  border-radius: 6px;               /* arrotondamento uniforme su tutti gli angoli */
}

.ref-card:last-child {
  margin-bottom: 0;
}

/* Citazione APA con rientro sporgente */
.ref-apa {
  padding-left: 2em;
  text-indent: -2em;
  margin: 0 0 0.5rem 0 !important;
  line-height: 1.5 !important;
  color: #111 !important;
  font-size: 1rem !important;
  font-weight: 500;
}

/* Nota descrittiva */
.ref-desc {
  margin: 0 0 0 2em !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  color: #555 !important;
}


/* ==========================================================================
   8. FOOTER
   ========================================================================== */

.footer {
  background: #2c3e50;
  color: #ecf0f1;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer p {
  font-size: 0.95rem;
}


/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */

@media (min-width: 768px) {
  .content-block {
    padding: 3rem;
  }

  .article-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: #fff;
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  .content-block {
    padding: 1.2rem;
  }
}
