:root {
    --primary-color: #4a7c59;
    --secondary-color: #7ba05b;
    --accent-color: #f4f7f4;
    --text-color: #2c3e50;
    --border-color: #e8ede8;
    --shadow-color: rgba(74, 124, 89, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

header {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Menu nel body */
.nav-menu {
    display: flex;
    gap: 0rem;
    margin: 0.1rem 0;
    justify-content: left;
}

.nav-menu a {
    color: white;
    text-decoration: none;
	background: #2d5a27;
    padding: 0.40rem 1rem;
    border-radius: 0px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: #1a3319;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
    color: white;
}

/* Freccia ritorno al top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2d5a27;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 89, 0.4);
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #4a7c59;
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 0.5rem;
}


/* Descrizione */
.section-title {
    text-align: center;
    color: #2d5a27;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.articles-intro {
    flex: 1;
    text-align: justify;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.articles-outer {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.articles-side-left {
  flex: 1;
  overflow: hidden;
}

.articles-side-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* ritaglia proporzionalmente per coprire tutto lo spazio */
  object-position: center;
  display: block;
}

.articles-side-right {
  flex: 1;
}

.articles-intro {
  flex: 0 1 1000px;
  min-width: 0;
  font-family: "Comic Sans MS", cursive !important;
  background-image: url('/img/contenuti/carta-pergamena.jpg');
  background-repeat: repeat;
}

.articles-intro p {
  margin-bottom: 1.1rem;
}

.articles-side-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.articles-side-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.articles-side-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  text-align: center;
  padding: 3px;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.7rem;
}

/* hover: immagine zoom lieve + overlay visibile */
.articles-side-link:hover img {
  transform: scale(1.05);
}

.articles-side-link:hover .articles-side-overlay {
  opacity: 1;
}

.album {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 8px;
  background-color: #0f0e0d;
}

.album-colonna {
  flex: 1;
}

.album-item {
  margin-bottom: 1.5rem;
}

.album-item img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border: 4px solid #f0e8d0;
  padding: 2px;
  background: #f0e8d0;
}

.album-item img.orizzontale {
  width: 350px !important;
  height: auto !important;
}

.album-item img.verticale {
  width: 250px !important;
  height: auto !important;
}

.album-item p {
  width: 300px;
  margin: 1.5rem auto 0 auto;
  font-size: 1rem;
  font-family: "Comic Sans MS", cursive !important;
  color: #ccc;
  text-align: left;
}

footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}


@media (max-width: 850px) {
  /* Menu navigazione */
  .nav-menu {
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.5rem;
      margin: 0.5rem 0;
  }
  
  .nav-menu a {
      font-size: 0.85rem;
      padding: 0.35rem 0.8rem;
  }

  .articles-outer {
    flex-wrap: wrap;
  }

  .articles-side-right {
    display: none;
  }

  .articles-side-left {
    order: 2;        /* va dopo il testo */
    flex: 0 0 100%;  /* occupa tutta la larghezza */
    height: 60px;    /* altezza a piacere */
  }

  .articles-intro {
    order: 1;
    flex: 0 0 100%;
    padding: 0;
  }

  .articles-side-overlay {
    opacity: 1;
  }

  .album {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
    .intro-wrapper {
        flex-direction: column;
        align-items: center;
    }
}    