
/* cineforum.css - versione corretta e ottimizzata (correzioni tranne punto 8) */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

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

html{ 
  font-family: Poppins, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100%;
}

body{
  background-image: linear-gradient(to bottom, #eff508, #d5f53b, #bdf457, #a8f16e, #97ed83, #8aee93, #7feea3, #77edb1, #6df1c2, #65f5d2, #60f8e2, #5ffbf1);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 6rem; /* spazio per la barra */
}

/* header/menu */
.menu{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-image: linear-gradient(to left, #f08a06, #f19203, #f19a00, #f1a100, #f1a901, #e3b71e, #d6c436, #c9cf4e, #b2dd7c, #a6e8a8, #abeecd, #c1f2e7);
  opacity: 0.95;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  z-index: 50;
}

.menu ul{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  gap: 1rem;
}

.home{
  background-color: #e89932;
  color: #02083e;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
}

/* logo: assicurati che il file sia servito come /images/... (express.static public) */
.cat{
  width: 3rem;
  height: 3rem;
  background: url(/images/logostone.png) no-repeat center;
  background-size: contain;
}

/* titolo pagina */
.title{
  color:white;
  margin-top: 2.5rem;
  text-align: center;
  font-size: 2rem;
  text-shadow: 3px 2px 2px rgba(108,165,226,0.7);
  margin-bottom: 1rem;
}

/* idea */
.idea{
  margin-top: 1.5rem;
  margin-left: 1rem;
  width: calc(100% - 2rem);
  min-height: 300px;
  background: url(/images/grid-img/cineforum.jpeg) no-repeat left center;
  background-size: contain;
  background-attachment: scroll; /* evita fixed su mobile */
  padding: 2rem 2rem 2rem 38vw;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

/* responsive: disattiva background-attachment e ridimensiona immagine */
@media (max-width: 768px) {
  .idea {
    padding: 6rem 1rem 2rem 1rem;
    background-position: bottom center;
    background-size: 55% auto;
  }
}

/* film/archivio cards e sezioni */
.film-section {
  width: 100%;
  padding: 1.5rem;
  background-image: linear-gradient(to right, #cbeeed, #9fddea, #79c8ed, #69b0ef, #7894e8);
  border-radius: 0.5rem;
  border-left: 4px solid #e89932;
}

/* archivio styles */
#archivio .toggle-img img {
    width: 40vw;
    max-width: 85vw;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(245, 245, 64, 0.8);
}

/* cineforumInsert area */
.locandina {
  width: 90%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: azure;
  border-radius: 1rem;
  margin: 2rem auto;
  padding: 2rem;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(3,10,38,0.95), rgba(70,110,150,0.9));
}

/* Rendere gli h2 cliccabili non selezionabili su tutti i browser (incluso Safari/iOS) */
h2.clickable,
.clickable {
  -webkit-user-select: none; /* Safari, Chrome (WebKit) */
  -moz-user-select: none;    /* Firefox (storico) */
  -ms-user-select: none;     /* IE10+ / Edge legacy */
  user-select: none;         /* standard */
  -webkit-touch-callout: none; /* disabilita il callout (iOS) al long-press */
  cursor: pointer;
}

/* Mantieni accessibilità: evidenzia il focus quando si usa tastiera */
h2.clickable:focus,
.clickable:focus {
  outline: 3px solid rgba(50, 90, 160, 0.25);
  outline-offset: 4px;
}

/* forms/buttons */
.btn {
  padding: 0.6rem 1rem;
  border-radius: 0.8rem;
  background: linear-gradient(135deg,#325278,#2a4568);
  color: #fff;
  border: none;
  cursor: pointer;
}

/* file input label as button */
#carica { display: inline-block; cursor: pointer; }

/* fix percorso immagini: usa /images/... */
.dev {
  background: url(/images/deviltailnoback.png) top center no-repeat;
  background-size: 18%;
  color: white;
  text-shadow: 10px 8px 8px black;
}

/* textarea migliorato (evita usare vw per height) */
#salvaTrama textarea, #salvaDiscussione textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border-radius: 1rem;
  border: 2px solid #ccc;
  font-size: 1rem;
  resize: vertical;
}

/* delete locandina button */
#deleteLocandina {
  padding: 0.6rem 1rem;
  border-radius: 0.8rem;
  background: linear-gradient(135deg,#5b0202,#c71c4e);
  color: #fff;
  border: none;
  cursor: pointer;
}

/* hide forms by default; visibility will be handled by JS clicks */
#formSalva, #formPubblica {
  display: none;
}

/* fallback JS mostrera #formSalva se necessario; manteniamo CSS leggero */

/* layout mobile adjustments */
@media (max-width: 640px) {
  .title { font-size: 1.8rem; margin-top: 4rem; }
  .cat { width: 40px; height: 40px; }
  .locandina { padding: 1rem; margin: 1rem; }
  .btn { padding: 0.6rem 0.8rem; font-size: 0.95rem; }
  #archivio .toggle-img img { width: 70vw; max-width: 90vw; }
}