html, body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1; /* prende tutto lo spazio disponibile */
  margin-bottom: 20px;
}
.desc_location_contacts {
    padding-top: 10px;
    font-size: 20px;
    font-family: 'EB Garamond', sans-serif;
}
.title_secondpage{
    font-family: 'Alex Brush', cursive;
    padding-top: 20px;
    text-align: center;
    font-size: 100px;
    line-height: 1;
    margin: 0;
}
.title_zara_secondpage {
  font-family: 'Cinzel', serif;
  font-size: 50px;
  letter-spacing: 6px;
}

.rooms_section {
  display: flex;
  align-items: center;
  gap: 40px;
}
.image img {
  width: 800px;
  height: auto;
}
.text {
  max-width: 500px;
}
.rooms_section.reverse {
  flex-direction: row-reverse;
}
.room_title {
    font-size: 50px;
    text-transform: uppercase;
}
.gallery {
  width: 80%;
  margin-left: 10%;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 150px;
  gap: 10px;
  grid-auto-flow: dense;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}
.gallery img:hover {
  transform: scale(1.05);
}
/* Varianti per effetto casuale */
.big {
  grid-column: span 2;
  grid-row: span 2;
}
.wide {
  grid-column: span 2;
}
.tall {
  grid-row: span 2;
}
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
}
.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    cursor: pointer;
    padding: 10px;
    user-select: none;
}
.left {
    left: 20px;
}
.right {
    right: 20px;
}
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    z-index: 10;
}
.close:hover {
    color: #ccc;
}
.header-hidden {
    display: none !important;
}
.p_rooms_description {
  font-size: 17px;
  margin-bottom: 20px;
  line-height: 1.6;
}


/* ==========================
   ADATTAMENTO PAGINE INTERNE
   ========================== */

@media screen and (max-width: 768px) {

    /* Titolo delle pagine interne */
    .title_secondpage {
        font-size: clamp(48px, 13vw, 72px);
        padding-top: 15px;
        line-height: 1.1;
    }

    .title_zara_secondpage {
        font-size: clamp(22px, 6vw, 36px);
        letter-spacing: 3px;
    }

    /* Sezioni delle camere */
    .rooms_section,
    .rooms_section.reverse {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 100%;
        box-sizing: border-box;
        padding: 0 16px;
    }

    /* Immagini delle camere */
    .image {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .image img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Testo delle camere */
    .text {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .room_title {
        font-size: clamp(26px, 7vw, 36px);
        overflow-wrap: break-word;
    }

    .p_rooms_description {
        font-size: 16px;
        line-height: 1.6;
    }

    /* Galleria fotografica */
    .gallery {
        width: auto;
        margin: 0 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 120px;
        gap: 6px;
    }

    .gallery img {
        min-width: 0;
    }

    /* Immagini ingrandite nella galleria */
    .lightbox img {
        max-width: 90vw;
        max-height: 80vh;
        object-fit: contain;
    }

    /* Frecce e pulsante di chiusura */
    .arrow {
        font-size: 32px;
        padding: 8px;
    }

    .left {
        left: 4px;
    }

    .right {
        right: 4px;
    }

    .close {
        top: 12px;
        right: 16px;
        font-size: 36px;
    }

    /* Testi delle pagine di contatto */
    .desc_location_contacts {
        font-size: 17px;
    }
}