/* Facilities pages: common intro (director + text + image) and, for Leganés,
   an additional list of spaces (title + photo + text). Shared by all three. */

/* ---- Image placeholder (until real photos are dropped in) ---- */
.img-ph {
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background:
    radial-gradient(600px 300px at 30% 20%, rgba(47,123,255,.18), transparent 60%),
    linear-gradient(140deg, var(--surface-2), var(--surface));
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 1rem;
  overflow: hidden;
}
.img-ph img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Common intro block ---- */
.facility-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  align-items: center;
}
.facility-intro__media { aspect-ratio: 4 / 3; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.facility-intro__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Frameless, full image (e.g. Leganés collage) — no crop, no box */
.facility-intro__media.is-free {
  aspect-ratio: auto; box-shadow: none; border-radius: 0; overflow: visible;
  display: grid; place-items: center;
}
.facility-intro__media.is-free { margin-top: 1.75rem; } /* nudge the collage down to sit with the text */
.facility-intro__media.is-free img { width: 100%; height: auto; object-fit: contain; }

/* Natural size, not upscaled/cropped (e.g. small Colmenarejo image) */
.facility-intro__media.is-natural {
  aspect-ratio: auto; box-shadow: none; overflow: visible;
  display: grid; place-items: center;
}
.facility-intro__media.is-natural img {
  width: auto; height: auto; max-width: 100%; max-height: 340px;
  border-radius: var(--radius);
}

.facility-director {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  padding: .35rem .95rem .35rem .4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.facility-director__avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.facility-director__avatar--ph {
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-muted);
  font-size: .68rem; font-weight: 700; border: 1px solid var(--border);
}
.facility-director strong { color: var(--text); font-weight: 600; }
.facility-director a { color: inherit; text-decoration: underline; text-decoration-color: rgba(47,123,255,.45); text-underline-offset: 3px; transition: color .2s var(--ease), text-decoration-color .2s var(--ease); }
.facility-director a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.facility-intro__info h2 { margin-bottom: .6rem; }
.facility-list { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--text-muted); display: grid; gap: .35rem; }
.facility-list li { line-height: 1.5; }
.facility-list li::marker { color: var(--accent); }
.facility-cta { margin-top: 1.4rem; }

/* ---- Leganés: spaces ---- */
.spaces { border-top: 1px solid var(--border); }
.spaces__head { max-width: 60ch; margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.spaces-list { display: grid; gap: clamp(2.6rem, 5vw, 4.5rem); }

.space-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
}
.space-row:nth-child(even) .space-row__media { order: 2; }
.space-row:nth-child(even) .space-row__info { order: 1; }
.space-row__media { aspect-ratio: 16 / 10; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.space-row__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.space-row__info h3 { font-size: 1.4rem; margin-bottom: .85rem; }
.space-row__info p { color: var(--text-muted); }

@media (max-width: 820px) {
  .facility-intro,
  .space-row { grid-template-columns: 1fr; }
  .space-row:nth-child(even) .space-row__media,
  .space-row:nth-child(even) .space-row__info { order: 0; }
}
