:root {
  --colore-bg: #D5DDDF;
  --colore-1: #1b2727;
  --colore-2: #3c5148;
  --colore-3: #6B8E4E;
  --colore-4: #B2C5B2;
  --pixel-riga: 2px;
}

/* RESET BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', sans-serif;
  background-color: var(--colore-bg);
  color: var(--colore-1);
  line-height: 1.6;
}

/* =============================
   HEADER + LOGO + SOTTOTITOLO
============================= */
header {
  background-color: var(--colore-bg);
  padding: 1rem 0.5rem 0.5rem;
  border-bottom: var(--pixel-riga) solid #ccc;
  text-align: center;
}

header h1 {
  font-size: 3rem;
  letter-spacing: var(--pixel-riga);
  margin-bottom: 0.5rem;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.logo-link:hover {
  opacity: 0.8;
}

header .res {
  color: var(--colore-1);
  font-family: 'Playfair Display', serif;
}

header .publica {
  color: var(--colore-3);
  font-family: 'Raleway', sans-serif;
}

header .sottotitolo {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--colore-1);
  margin-top: 0.5rem;
}

/* =============================
   NAVIGAZIONE
============================= */
nav {
  background-color: var(--colore-bg);
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.25rem 0.5rem;
  border-bottom: var(--pixel-riga) solid #ccc;
}

nav a {
  color: var(--colore-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover {
  background-color: var(--colore-2);
  color: var(--colore-4);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 60px;
  background-color: var(--colore-bg);
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  border-bottom: var(--pixel-riga) solid #ccc;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 30px;
  background-color: var(--colore-2);
  border-radius: 2px;
  margin: 4px 0;
  transition: all 0.8s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive Nav */
@media (max-width: 768px) {
  .nav {
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: var(--colore-bg);
    border-bottom: var(--pixel-riga) solid #ccc;
  }

  .nav.nav-open,
  .nav.show {
    display: flex;
  }

  .hamburger {
    display: flex;
  }
}

/* =============================
   CONTENUTO PRINCIPALE
============================= */
.content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  border-top: var(--pixel-riga) solid #ccc;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* =============================
   CARDS ARTICOLI
============================= */
.article-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s;
}

.article-card:hover {
  transform: translateY(-5px);
}

.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.article-content {
  padding: 1rem;
}

.article-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--colore-2);
}

.article-content p {
  font-size: 0.95rem;
  color: var(--colore-3);
}

.article-card a {
  text-decoration: none;
}

/* =============================
   AUTORE E ARTICOLO LAYOUT
============================= */
.main-img-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.main-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.articolo-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.articolo-corpo {
  flex: 3;
  background-color: var(--colore-bg);
}

.articolo-corpo h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--colore-2);
}

.articolo-corpo h3 {
  margin-top: 2rem;
  color: var(--colore-2);
}

.articolo-corpo p {
  margin-bottom: 1rem;
  color: var(--colore-1);
  line-height: 1.7;
}

.data-articolo {
  font-size: 0.9rem;
  color: gray;
  margin-bottom: 1rem;
  font-style: italic;
}

.autore-box {
  flex: 1;
  background-color: var(--colore-4);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.autore-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  display: inline-block;
}

/* =============================
   BARRA DI LETTURA E STICKY
============================= */
.progress-container {
  position: fixed;
  top: 0;
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  z-index: 9999;
}

.progress-bar {
  position: sticky;
  top: 0;
  height: 5px;
  background-color: var(--colore-3);
  z-index: 1000;
}

.sticky-top {
  position: sticky;
  top: 0;
  background-color: var(--colore-bg);
  z-index: 1000;
}

/* =============================
   FOOTER
============================= */
.footer {
  background-color: var(--colore-2);
  color: var(--colore-bg);
  text-align: center;
  padding: 20px 0;
  width: 100%;
}

.footer p {
  font-size: 14px;
  margin: 0;
}

.social-icons {
  margin-bottom: 10px;
}

.social-icons a {
  color: var(--colore-bg);
  margin: 0 10px;
  font-size: 28px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--colore-3);
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-nav li {
  margin: 0 10px;
}

.footer-nav a {
  color: var(--colore-bg);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--colore-3);
  text-decoration: underline;
}

/* =============================
   Table
============================= */

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 2px 8px var(--colore-4);
  border-radius: 8px;
  overflow: hidden;
  background: var(--colore-4);
  color: var(--colore-1);
}

thead {
  background-color: var(--colore-3);
  color: var(--colore-1);
}

th, td {
  padding: 12px 15px;
  text-align: left;
}

tbody tr:nth-child(odd) {
  background-color: var(--color-row-odd-bg);
}

tbody tr:hover {
  background-color: var(--color-row-hover-bg);
}

/* =============================
   Links
============================= */

.sources_link {
    color: var(--colore-3); /* colore blu acceso */
    text-decoration: underline;
    cursor: pointer;
}

.sources_link:hover {
    color: var(--colore-2); /* cambia colore al passaggio del mouse */
}
