/* ===== Members grid and modal ===== */

/* Wrapper för WG-sidor */
.working-group-page {
    padding: 24px 0;
}

/* Header överst på WG-sidan */
.wg-header {
    margin-bottom: 24px;
}

.wg-title {
    font-size: 2rem;
    margin: 0 0 8px;
}

.wg-description {
    color: #555;
    text-align: left;
}

/* ===== Grid med medlemmar ===== */

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.member-card {
    text-align: center;
    max-width: 220px;
    margin: 0 auto;
}

.member-trigger {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    width: 100%;
}

.member-photo {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform .15s ease, box-shadow .15s ease;
    display: block;
    margin: 0 auto;
}

.member-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    background: #eee;
    color: #999;
    border-radius: 8px;
}

.member-trigger:hover .member-photo {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.member-name {
    font-size: 1rem;
    margin: 10px 0 0;
}

/* =========================================================
   MODAL (POPUP) – GLOBAL, INTE BUNDEN TILL SIDLAYOUT
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none; /* JS sätter display: block */
}

/* Mörk bakgrund */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

/* Själva popup-rutan */
.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #fff;
    color: #222;
    width: min(90vw, 520px);
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 24px;
    background: transparent;
    border: 0;
    cursor: pointer;
    line-height: 1;
}

.modal-photo {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.modal-name {
    margin: 8px 0 4px;
    font-size: 1.5rem;
}

.modal-affiliation,
.modal-bio,
.modal-groups {
    margin: 8px 0;
}

.tag {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 0 4px 4px 0;
    font-size: .85rem;
    text-decoration: none;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.linkedin-btn {
    display: inline-block;
    padding: 8px 12px;
    background: #0077b5;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}

/* ===== Responsiv popup ===== */

@media (max-width: 480px) {
    .modal-content {
        width: 92vw;
        padding: 16px;
    }
}

/* =========================================================
   OVERRIDES ENDAST FÖR WG-HELSIDOR
   ========================================================= */

.working-group-page img {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.working-group-page .single-content {
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.working-group-page article.member-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

.working-group-page article.member-card .member-trigger {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}