/* Pagina "Affitto per studenti" (affitto-studenti-nizza.html): stili specifici della pagina.
   Collegato con <link rel="stylesheet" href="css/studenti.css?v=1">: cambia il numero di versione a ogni modifica. */

/* ========== Schede studenti responsive ========== */
.student-rentals { padding: 20px 0 45px; }

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.student-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e9ed;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(25,55,80,.10);
  transition: transform .2s ease, box-shadow .2s ease;
}
.student-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 9px 24px rgba(25,55,80,.16);
}

.student-photo-link {
  display: block;
  position: relative;
  overflow: hidden;
  background: #e8eff3;
  aspect-ratio: 4 / 3;
}
.student-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.student-photo-link:hover img,
.student-photo-link:focus img { transform: scale(1.05); }

.student-photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 16px;
  background: rgba(18,48,68,.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.student-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #1684b5;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

.student-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 18px 18px;
}
.student-card h3 {
  margin: 0 0 4px;
  color: #34495e;
  font-size: 19px;
  line-height: 1.25;
}
.student-price {
  color: #1684b5;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  margin: 6px 0 2px;
}
.student-price small {
  color: #667784;
  font-size: 13px;
  font-weight: 400;
}
.student-includes {
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.student-includes li {
  margin: 6px 0;
  color: #52616b;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.student-includes .fa { color: #1684b5; margin-top: 3px; flex-shrink: 0; }

/* Riga disponibilità con pallino verde/rosso */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 14px;
  margin-top: auto;      /* spinge la riga in fondo, allineando tutte le schede */
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  align-self: flex-start; /* non si allarga a tutta la card, resta "badge" */
}
.availability.is-available { background: #e6f6ea; color: #1e7e34; }
.availability.is-unavailable { background: #fdeceb; color: #b02a37; }
.availability .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
.availability.is-available .dot { background: #28a745; }
.availability.is-unavailable .dot { background: #dc3545; }


.student-card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;   /* SEMPRE in colonna, uno sopra l'altro */
  gap: 8px;
}
.student-card-actions .btn {
  width: 100%;
  border-radius: 5px;
  font-size: 14px;
  padding: 10px 12px;
  line-height: 1.3;
  margin: 0;
  white-space: normal;
}
.student-card-actions .btn-default {
  color: #0571c4;
  border-color: #0571c4;
  background: #fff;
}
/* Pannello dettagli inline (solo mobile) */
.student-details {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #d5dee6;
  font-size: 14px;
  color: #52616b;
  animation: detailsFade .2s ease;
}
.student-details[hidden] { display: none; }
@keyframes detailsFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.student-details h4 {
  margin: 14px 0 6px;
  color: #34495e;
  font-size: 15px;
  font-weight: 700;
}
.student-details h4:first-child { margin-top: 0; }
.student-details p { margin: 0 0 8px; }
.student-details .detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.student-details .detail-list li {
  margin: 5px 0;
  line-height: 1.45;
}
.student-details .detail-list strong { color: #34495e; }



/* ========== Griglia servizi nei dettagli ========== */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 6px 0 14px;
  padding: 0;
  list-style: none;
}
.services-grid li {
  padding: 6px 0;
  border-bottom: 1px solid #eef2f6;
  color: #34495e;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.services-grid li::before {
  content: "✓";
  color: #1684b5;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ========== Modal dettagli (desktop) ========== */
.student-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,30,45,.65);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .2s ease;
}
.student-modal-backdrop.is-open {
  display: flex;
  opacity: 1;
}
.student-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  transform: translateY(12px) scale(.98);
  transition: transform .2s ease;
}
.student-modal-backdrop.is-open .student-modal { transform: none; }
.student-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.student-modal-close:hover { background: rgba(0,0,0,.75); }
.student-modal-header {
  padding: 22px 24px 14px;
  border-bottom: 1px solid #eef2f6;
}
.student-modal-header h3 {
  margin: 0 0 4px;
  color: #34495e;
  font-size: 22px;
}
.student-modal-price {
  color: #1684b5;
  font-size: 24px;
  font-weight: 700;
}
.student-modal-price small { color: #667784; font-size: 14px; font-weight: 400; }
.student-modal-body { padding: 18px 24px 24px; }
.student-modal-body h4 {
  margin: 16px 0 8px;
  color: #34495e;
  font-size: 15px;
  font-weight: 700;
  padding-bottom: 4px;
  border-bottom: 1px solid #eef2f6;
}
.student-modal-body h4:first-child { margin-top: 0; }
.student-modal-body .detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}
.student-modal-body .detail-list li {
  margin: 5px 0;
  line-height: 1.45;
  color: #52616b;
  font-size: 14px;
}
.student-modal-body .detail-list strong { color: #34495e; }
.student-modal-body .services-grid {
  margin-top: 4px;
}
.student-modal-body .services-grid li {
  font-size: 13px;
  padding: 5px 0;
}
.student-modal-cta {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}
.student-modal-cta .btn { flex: 1; border-radius: 5px; }

/* Mobile: una colonna */
@media (max-width: 575px) {
  .student-grid { grid-template-columns: 1fr; gap: 18px; }
  .student-photo-link { aspect-ratio: 16 / 10; }
  .student-card h3 { font-size: 18px; }
  .student-price { font-size: 23px; }
  .student-card-actions { flex-direction: column; }
  .student-card-actions .btn { width: 100%; }
}

/* Tablet: due colonne */
@media (min-width: 576px) and (max-width: 991px) {
  .student-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Riquadri info ========== */
.info-block {
  margin: 30px 0;
  padding: 24px 26px;
  background: #f3f8fb;
  border-left: 4px solid #1684b5;
  border-radius: 6px;
}
.info-block h2 {
  margin: 0 0 16px;
  color: #34495e;
  font-size: 21px;
}
.info-block h2 .fa { color: #1684b5; margin-right: 8px; }
.info-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.info-block li {
  margin: 10px 0;
  color: #34495e;
  line-height: 1.5;
}
.info-block li strong { color: #0571c4; }
.info-block li span { color: #52616b; }

/* ========== Contatti e condizioni ========== */
.student-contact { margin: 30px 0 0; padding: 28px; background: #f3f8fb; border-radius: 6px; }
.student-contact h2 { margin-top: 0; color: #34495e; }
.student-contact-choice { min-height: 24px; margin: 0 0 18px; color: #34495e; font-weight: 600; }
.student-contact .form-control { margin-bottom: 12px; }
.student-contact .help-block { margin: 12px 0 0; }
.student-conditions { margin: 20px 0 35px; padding: 24px; background: #f3f8fb; border-left: 4px solid #1684b5; border-radius: 5px; }
.student-conditions h2 { margin-top: 0; color: #34495e; }
.student-conditions ul { padding-left: 20px; margin-bottom: 0; }
.student-conditions li { margin: 8px 0; }

/* Mappe bloccate fino al consenso (Iubenda) */
.map-embed { margin: 0 0 14px; }
.map-embed iframe { display: block; width: 100%; height: 300px; border: 0; }
.map-embed iframe[src="about:blank"] { display: none; }
.map-embed .map-consent { display: none; padding: 18px; border: 1px solid #d8dee6; background: #f4f7fa; text-align: center; }
.map-embed iframe[src="about:blank"] + .map-consent { display: block; }
.map-embed .map-consent p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: #2f3b47; }
.map-embed .map-consent .btn { margin: 3px 4px; }
/* Classe energetica (scala A-G) */
.energy-class { margin: 12px 0 6px; }
.energy-class-label { display: block; margin-bottom: 5px; font-size: 13px; color: #2f3b47; }
.energy-scale { display: flex; align-items: center; gap: 3px; }
.energy-scale span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; font-size: 12px; font-weight: 700; line-height: 1; color: #111; border-radius: 2px; }
.energy-scale span.is-active { width: 38px; height: 32px; font-size: 18px; box-shadow: 0 0 0 2px #1d2733; }
.energy-scale .e-a { background: #4caf50; } .energy-scale .e-b { background: #8bc34a; } .energy-scale .e-c { background: #cddc39; }
.energy-scale .e-d { background: #ffeb3b; } .energy-scale .e-e { background: #ffc107; } .energy-scale .e-f { background: #ff9800; } .energy-scale .e-g { background: #f44336; }
/* ========== Sezione mappa uMap ========== */
.map-section {
  padding: 20px 0 30px;
}
.umap-embed {
  position: relative;
  width: 100%;
  height: 420px;
  margin: 10px 0 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e9ed;
  box-shadow: 0 5px 18px rgba(25,55,80,.10);
  background: #e8eff3;
}
.umap-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.umap-fullscreen-link {
  margin: 0;
  text-align: right;
  font-size: 14px;
}
.umap-fullscreen-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0571c4;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.umap-fullscreen-link a:hover,
.umap-fullscreen-link a:focus {
  color: #034a82;
  border-bottom-color: #034a82;
}
.umap-fullscreen-link .fa {
  font-size: 13px;
}

/* Mobile: mappa più bassa per non occupare tutto lo schermo */
@media (max-width: 767px) {
  .umap-embed { height: 320px; }
  .umap-fullscreen-link { text-align: left; }
}

/* ========== Mappa uMap bloccata fino al consenso (Iubenda) ========== */
.umap-embed .map-consent { display: none; height: 100%; padding: 24px; text-align: center; background: #f4f7fa; flex-direction: column; align-items: center; justify-content: center; }
.umap-embed iframe[src="about:blank"] { display: none; }
.umap-embed iframe[src="about:blank"] + .map-consent { display: flex; }
.umap-embed .map-consent p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: #2f3b47; max-width: 520px; }
.umap-embed .map-consent .btn { margin: 3px 4px; }

