.member-grid {
    display: flex;
    flex-wrap: wrap;
    /*grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));*/
    justify-content: center;
    gap: 20px;
}

.member-wrapper {
    flex: 0 0 320px;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.member-card {
    width: 320px;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
}

.member-name {
    margin-top:10px; 
    font-size:1.1em; 
    font-weight:bold;
}

.member-socials { 
    display: grid;
    gap: 10px;
    width: 100%;
}

/* Member socials has exactly one button */ 
.member-socials:has(.wp-block-button:nth-child(1):last-child){
  display: flex;
  justify-content: center;
}


/* Member socials has exactly two buttons */
.member-socials:has(.wp-block-button:nth-child(2):last-child) {
  display: flex;
  justify-content: center;
}

/* Member socials has exactly three buttons */
.member-socials:has(.wp-block-button:nth-child(3):last-child) {
  grid-template-areas:
    "top top"
    "left right";
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  width:max-content;
}

.member-socials:has(.wp-block-button:nth-child(3):last-child) .wp-block-button:nth-child(1) {
  grid-area: top;
}

.member-socials:has(.wp-block-button:nth-child(3):last-child) .wp-block-button:nth-child(2) {
    grid-area: left;
}

.member-socials:has(.wp-block-button:nth-child(3):last-child) .wp-block-button:nth-child(3) {
    grid-area: right;
}

.member-image {
    border-radius: 50%;
    border-style:none;
    border-width:0px;
    width:160px;
    display:block; 
    margin:0 auto;
    max-width:150px;
    max-height:150px;
}


/**
* Profile content
*/


/* center content */
.member-profile-wrapper {
    max-width: 900px;
    margin: 50px auto;               /* vertical spacing from top/bottom */
    padding-top: calc( var(--header-height, 100px) + 50px );   /* header is most likely sticky */
    padding-right: 20px;
    padding-bottom: calc (var(--footer-height, 100px) - 50px);
    padding-left: 20px;
    position: relative;             /* normal flow */
}

.member-profile {
    background-color: #ffffff;
    padding: 60px 30px 40px 30px;  /* top, sides, bottom */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;           /* ensures content stays in block */
    z-index: 1;                   /* stays above background but below fixed header */
}

/* Profile image */
.member-profile img {
    width: 100%;
    max-width: 350px;             
    height: auto;
    border-radius: 12px;           /* rounded corners */
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    margin: 0px auto 30px;     
    display: block;
    background-color: #fff;        /* prevents transparency */
    padding: 10px;
}


/* Member title */
.member-profile h1 {
    font-size: 2.5em;      /* large and prominent */
    margin-bottom: 20px;
    color: #222;
}

/* Member bio content */
.member-profile p {
    font-size: 1.0em;
    max-width: 700px;      /* easier to read on wide screens */
    margin: 0 auto 30px;   /* center and add bottom spacing */   
}

/* Back button */
.member-profile .button {
    display: inline-block;
    padding: 10px 25px;
    font-size: 1em;
    background-color: darkgray;
    color: black;
    text-decoration: none;
    border-width: 1px;
    border-color: rgb(137, 137, 137);
    border-radius: 16px;
    transition: background-color 0.3s ease;
}

.member-profile .button:hover {
    background-color: lightgray;
}

/* Ensure spacing below profile for footer */
.member-profile-wrapper::after {
    content: '';
    display: block;
    height: 50px;  /* extra space so content doesn’t touch footer */
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .member-profile img {
        max-width: 250px;
        margin-top: -80px;
    }

    .member-profile {
        padding: 40px 20px 30px 20px;
    }

    .member-profile h1 {
        font-size: 2em;
    }

    .member-profile p {
        font-size: 1em;
    }
}

@media screen and (max-width: 480px) {
    .member-profile-wrapper {
        padding: 120px 10px 80px 10px;
    }

    .member-profile img {
        max-width: 250px;
    }

    .member-profile h1 {
        font-size: 1.8em;
    }

    .member-profile p {
        font-size: 0.95em;
    }
}

