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

/* Corpo pagina */
body {
  font-family: "Georgia", "Times New Roman", serif;
  color: #7a3e1d; /* marrone caldo simile al biglietto */
  line-height: 1.6;

  /* Sfondo */
  background-image: "/static/immagini/sfondo.jpg";
  /*background-size: cover;          /* copre tutto senza deformare */
  /*background-position: center;     /* centrato */
  /*background-repeat: no-repeat;*/
  background-size: 100vw auto;/*oppure anche: 100% auto;   /* tutta la larghezza visibile */
  background-repeat: repeat-y;  /* ripete in verticale */
  background-position: top center;
  background-attachment: scroll;   /* scorre con la pagina */

  min-height: 100vh;
  padding: 20px;
}

/* Contenitore principale */
.container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;

  /* NUOVO */
  width: 65%;         /* lascia spazio ai lati */
  padding: 10px;
}

/* Titoli principali (stile calligrafico) */
.corinthia-regular {
  font-family: "Corinthia", cursive;
  font-weight: 400;
  font-style: normal;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  /*font-family: "Brush Script MT", cursive; */
  font-family: "Corinthia", cursive;
}

/* Sottotitoli */
h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

/* Testo */
p {
  font-size: 1rem;
  margin-bottom: 15px;
}

/* Sezioni */
.section {
  margin-bottom: 30px;
}

/* BOTTONI */
button,
.btn {
  display: inline-block;
  padding: 12px 20px;
  background-color: #7a3e1d;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s ease;
}

button:hover,
.btn:hover {
  background-color: #a0522d;
}

/* FORM */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input,
textarea {
  padding: 10px;
  border: 1px solid #c9a891;
  border-radius: 10px;
  font-size: 1rem;
  width: 100%;
}

input[type="file"] {
  border: none;
}

/* IMMAGINI */
img {
  max-width: 100%;
  border-radius: 10px;
  margin: 10px 0;
}

/* GIF o immagini contenuto */
.media {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.media img {
  max-width: 80%;   /* non a pieno schermo */
  height: auto;
}

.media video {
  max-width: 80%;   /* non a pieno schermo */
  height: auto;
}

/* SEZIONI TESTO (giochi, descrizioni) */
.article {
  text-align: left;
}

.article h3 {
  margin-top: 15px;
  font-size: 1.2rem;
}

.article p {
  font-size: 0.95rem;
}

.article ul {
  list-style-type: "• ";
  margin: 15px 0;
  padding-left: 30px; /* rientro rispetto al paragrafo */
}

.article ol {
  list-style-type: decimal;
  margin: 15px 0;
  padding-left: 30px; /* rientro rispetto al paragrafo */
}

/* FOOTER */
footer {
  margin-top: 40px;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* RESPONSIVE (tablet e su) */
@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  .container {
    max-width: 700px;
  }
}

/* PER FOTO */
.upload-box {
  margin-bottom: 30px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.preview-item {
  position: relative;
}

.preview-item img,
.preview-item video {
  width: 100%;
  border-radius: 10px;
}

.remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery img,
.gallery video {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
}

.pagination {
  margin-top: 20px;
}

/* GRID moderna */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Tablet */
@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* MODALE */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 80%;
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 30px;
  cursor: pointer;
}