/* ============================================================
   LIDO RESIDENCE – appartamenti.css
   Elenco e schede degli appartamenti
   ============================================================ */
body { background: var(--sand-light); }

.apt-main { padding: 24px 0 64px; }
.apt-main--list { padding-top: calc(var(--nav-height, 72px) + 24px); }

.apt-back {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.apt-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.apt-subtitle {
  color: var(--text-mid);
  margin-bottom: 22px;
}

/* ---- Elenco: riquadri con foto ---- */
.apt-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.apt-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.apt-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.apt-card__image {
  aspect-ratio: 4 / 3;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.apt-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.apt-card__empty {
  color: var(--text-light);
  font-size: .88rem;
}

.apt-card__body { padding: 14px 18px 18px; }
.apt-card__body h2,
.apt-card__body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.apt-card__body p {
  color: var(--text-light);
  font-size: .87rem;
}
.apt-card__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue-sea);
  font-size: .88rem;
  font-weight: 600;
}

/* ---- Scheda: nomi degli appartamenti in alto ---- */
.apt-strip {
  position: sticky;
  top: var(--nav-height, 72px);
  z-index: 50;
  margin-top: var(--nav-height, 72px);
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.apt-strip__row {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.apt-strip__row::-webkit-scrollbar { display: none; }

.apt-pill {
  flex-shrink: 0;
  min-width: 52px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--white);
  color: var(--text-mid);
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
  transition: border-color var(--transition), color var(--transition);
}
.apt-pill:hover {
  border-color: var(--blue-sea);
  color: var(--blue-sea);
}
.apt-pill[aria-current="page"] {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: var(--white);
}

/* ---- Scheda: foto principali ---- */
.apt-mosaic {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 230px 230px;
  gap: 8px;
  border-radius: var(--radius);
  overflow: hidden;
}
.apt-mosaic > a,
.apt-mosaic > .apt-empty {
  display: block;
  overflow: hidden;
  background: var(--border);
}
.apt-mosaic > :first-child { grid-row: 1 / 3; }
.apt-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.apt-mosaic a:hover img { transform: scale(1.03); }

.apt-mosaic__all {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 9px 16px;
  border: none;
  border-radius: 50px;
  background: var(--white);
  color: var(--text-dark);
  font-family: var(--font-sans);
  font-size: .84rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.apt-mosaic__all:hover { color: var(--blue-sea); }

.apt-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: .85rem;
}
.apt-mosaic .apt-empty { border-radius: 0; display: flex; }

/* ---- Scheda: descrizione e richiesta ---- */
.apt-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  margin-top: 30px;
  align-items: start;
}
.apt-detail h2,
.apt-rooms h2,
.apt-others h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.apt-detail > div > p {
  color: var(--text-mid);
  margin-bottom: 14px;
}
.apt-detail > div > h2:not(:first-child) { margin-top: 24px; }
.apt-detail > div > h3 {
  margin: 18px 0 8px;
  color: var(--blue-sea);
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.apt-detail > div > .apt-todo {
  padding: 10px 14px;
  background: #fff8e6;
  border: 1px dashed #d9b95c;
  border-radius: var(--radius-sm);
  color: #6b5a1e;
  font-size: .92rem;
}

.apt-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  color: var(--text-mid);
  font-size: .93rem;
}
.apt-list li {
  position: relative;
  padding-left: 22px;
}
.apt-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--turquoise);
  font-weight: 700;
}

.apt-box {
  position: sticky;
  top: calc(var(--nav-height, 72px) + 76px);
  padding: 22px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.apt-box h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.apt-box p {
  color: var(--text-mid);
  font-size: .9rem;
  margin-bottom: 14px;
}
.apt-box__phone {
  display: block;
  margin-top: 12px;
  color: var(--blue-sea);
  font-size: .86rem;
  font-weight: 500;
  text-align: center;
}

/* ---- Scheda: foto stanza per stanza ---- */
.apt-rooms { margin-top: 40px; }
.apt-room { margin-bottom: 28px; }
.apt-room h3 {
  margin-bottom: 10px;
  color: var(--blue-sea);
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.apt-room__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.apt-room__grid > a,
.apt-room__grid > .apt-empty {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--border);
}
.apt-room__grid > .apt-empty { display: flex; }
.apt-room__grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.apt-room__grid a:hover img { transform: scale(1.04); }

.apt-others { margin-top: 44px; }

.apt-bar { display: none; }

@media (max-width: 860px) {
  .apt-cards {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .apt-card__body { padding: 10px 12px 14px; }
  .apt-card__body h2,
  .apt-card__body h3 { font-size: 1rem; }

  .apt-mosaic {
    display: flex;
    grid-template-rows: none;
    overflow-x: auto;
    gap: 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .apt-mosaic::-webkit-scrollbar { display: none; }
  .apt-mosaic > a,
  .apt-mosaic > .apt-empty {
    flex: 0 0 86%;
    height: 320px;
    scroll-snap-align: center;
  }
  .apt-mosaic__all { display: none; }

  .apt-detail {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .apt-list { grid-template-columns: 1fr; }
  .apt-box { display: none; }
  .apt-room__grid { grid-template-columns: 1fr 1fr; }

  .apt-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 10px 16px;
    background: var(--white);
    box-shadow: 0 -4px 16px rgba(26,82,118,.14);
  }
  .apt-has-bar { padding-bottom: 72px; }
}

@media (max-width: 480px) {
  .apt-back .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ---- Appartamento in allestimento (2026-11-11: Maria): scheda senza link ---- */
.apt-card--soon:hover { transform: none; box-shadow: var(--shadow-sm); }
.apt-card--soon .apt-card__image { position: relative; }
.apt-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: 50px;
  background: var(--blue-deep);
  color: var(--white);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.apt-card__soon {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue-deep);
  font-size: .88rem;
  font-weight: 600;
}
.apt-card__empty { color: var(--text-mid); }   /* era --text-light: 4,1:1 sul grigio del riquadro */

/* Badge "Nuovo" sulle schede (campo "nuovo": true nel JSON): verde scuro, testo bianco 5,3:1 */
.apt-card__image { position: relative; }
.apt-card__badge--new { background: #0e7c66; }

/* Scheda in allestimento con foto provvisoria (Maria): scritte ben leggibili sopra la foto */
.apt-card--soon .apt-card__image img { filter: brightness(.82); }
.apt-card--soon .apt-card__badge {
  top: 14px;
  left: 14px;
  padding: 8px 18px;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid var(--white);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.apt-card__note {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 9px 20px;
  border-radius: 50px;
  background: rgba(12, 32, 48, .88);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

/* ---- Maria nella barra dei nomi: si può cliccare, ma dice solo "in fase di allestimento" ---- */
button.apt-pill { font-family: inherit; line-height: inherit; cursor: pointer; }
.apt-pill--soon { border-style: dashed; }
.apt-soon-msg {
  position: absolute;
  top: calc(100% + 8px);
  left: 16px;
  z-index: 60;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid #c0392b;
  border-radius: 50px;
  background: var(--white);
  color: #b03024;   /* rosso scuro, leggibile sul bianco */
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  pointer-events: none;
}
.apt-soon-msg.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (prefers-reduced-motion: reduce) { .apt-soon-msg { transition: none; } }
