/* Campus Spaces page: three equal photo tiles per row. Each tile is a photograph with a navy fade,
   a square icon, the title, a short description and a round "+" button. Uses the site's own navy and orange. */

.spaces {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.space {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 5 / 4;
    border-radius: 18px;
    background: var(--navy-900);
    box-shadow: 0 14px 30px -22px rgba(7, 20, 47, 0.7);
}

.space__photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.space:hover .space__photo { transform: scale(1.05); }

/* Navy fade so the caption stays readable on any photograph. */
.space::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(7, 20, 47, 0) 45%, rgba(7, 20, 47, 0.92) 100%);
}

.space__body {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
    color: var(--white);
}

.space__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.space__text { flex: 1; min-width: 0; }

.space__text strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
}

.space__text > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.2rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.88);
}

.space__plus {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    color: var(--white);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.space__plus:hover,
.space__plus:focus-visible { background: var(--orange-500); border-color: var(--orange-500); }

[data-link-disabled] { cursor: default; }

@media (max-width: 960px) {
    .spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .spaces { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .space__photo, .space__plus { transition: none; }
    .space:hover .space__photo { transform: none; }
}
