.person {
    display: block;
    width: 250px;
    aspect-ratio: 0.66;
    margin: 1em auto;
    text-align: center;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.person:hover {
    cursor: pointer;
    transform: scale(1.05);
}

.person a {
    display: block;
    padding: 0;
    width: 100%;
    height: 100%;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
}

.person img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.person h2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.3em;
    margin: 0;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0, 0.5);
    background: rgba(0,0,0, 0.5);
    backdrop-filter: blur(3px);
    text-align: center;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.banner {
    width: 100%;
    height: 75vh;
    position: relative;
    background: #f0f0f0;
}

.banner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    vertical-align: middle;
}

.banner p {
    position: absolute;
    bottom: 3%;
    padding: 0 10%;
    width: 80%;
    text-align: center;
    font-size: 2.5rem;
    font-family: 'Josefin Sans', sans-serif;
    color: white;
    text-shadow: 0 0 8px black;
}

@media (max-width: 768px) {
    .banner {
        height: 50vh;
    }
    .banner p {
        font-size: 1.5rem;
    }
}

.hover-gallery {
    /* Desktop: single row, no wrapping; horizontal scroll if needed */
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    padding-bottom: 1.8rem;
    max-width: 100vw;
    gap: 3px;
    overflow: hidden;
}

.hover-gallery .item {
    /* Do not grow; keep fixed row height so images preserve their aspect ratio */
    flex: 0 0 auto;
    height: 260px; /* row height on desktop */
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    will-change: transform;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.hover-gallery .item:hover {
    /* smaller hover scale */
    transform: scale(1.06);
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.hover-gallery .item img {
    /* preserve original aspect ratio:
       on desktop we size by height so width auto keeps natural ratio */
    display: block;
    height: 100%;
    width: 100%;
    max-width: none;
    object-fit: cover; /* fallback if the image is stretched */
}

/* Mobile: 2 images per row, multiple rows; images keep natural aspect ratio */
@media (max-width: 600px) {
    .hover-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        overflow: visible;
        padding-bottom: 0;
    }
    .hover-gallery .item {
        height: auto; /* allow height to follow content */
        margin: 0;
    }
    .hover-gallery .item img {
        width: 100%;
        height: auto; /* natural aspect ratio */
        border-radius: 8px;
    }
    .hover-gallery .item:hover {
        transform: none;
        box-shadow: none;
    }
}
