.sa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.sa-single {
    margin: 20px 0;
    max-width: 600px;
}

.sa-single.sa-align-center {
    margin-left: auto;
    margin-right: auto;
}

.sa-single.sa-align-right {
    margin-left: auto;
    margin-right: 0;
}

.sa-single.sa-align-left {
    margin-right: auto;
    margin-left: 0;
}

.sa-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* Photo Positions */
.sa-card.sa-photo-right {
    flex-direction: row-reverse;
}

.sa-card.sa-photo-right .sa-photo-wrap {
    border-right: none;
    border-left: 1px solid #eee;
}

.sa-card.sa-photo-top {
    flex-direction: column;
    text-align: center;
}

.sa-card.sa-photo-top .sa-photo-wrap {
    width: 100%;
    height: 300px; /* Fixed height for top photo */
    border-right: none;
    border-bottom: 1px solid #eee;
}

.sa-card.sa-photo-top .sa-info {
    align-items: center;
}

.sa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.sa-photo-wrap {
    width: 250px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-right: 1px solid #eee;
    flex-shrink: 0;
}

.sa-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.sa-no-photo {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ccc;
}

.sa-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sa-name {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
}

.sa-name span {
    display: block;
    line-height: 1.2;
}

.sa-name-surname {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1em;
    margin-bottom: 2px;
}

.sa-name-first, 
.sa-name-patronymic {
    font-weight: 400;
    font-size: 1.1em;
}

.sa-position {
    color: #0073aa;
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.sa-schedule {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-bottom: 15px;
    border-left: 3px solid #0073aa;
    color: #555;
}

.sa-schedule strong {
    display: block;
    margin-bottom: 3px;
    color: #333;
}

.sa-contacts {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.sa-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #000;
}

.sa-contact-item:last-child {
    margin-bottom: 0;
}

.sa-contact-item .dashicons {
    margin-right: 8px;
    color: #999;
}

.sa-contact-item a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.sa-contact-item a:hover {
    color: #0073aa;
}

/* Tablet: keep desktop feel, reduce card density */
@media (max-width: 1024px) {
    .sa-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 16px;
    }

    .sa-photo-wrap {
        width: 220px;
    }

    .sa-info {
        padding: 16px;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    .sa-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .sa-card,
    .sa-card.sa-photo-right {
        flex-direction: column;
    }

    .sa-photo-wrap,
    .sa-card.sa-photo-right .sa-photo-wrap,
    .sa-card.sa-photo-top .sa-photo-wrap {
        width: 100% !important;
        height: 240px;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid #eee;
    }

    .sa-card.sa-photo-top .sa-info {
        align-items: flex-start;
        text-align: left;
    }

    .sa-single {
        max-width: 100% !important;
    }

    .sa-photo {
        object-fit: contain;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    .sa-grid,
    .sa-single {
        margin: 14px 0;
    }

    .sa-info {
        padding: 12px;
    }

    .sa-name {
        font-size: 1.08em;
    }

    .sa-name-surname,
    .sa-name-first,
    .sa-name-patronymic {
        font-size: 1em;
    }

    .sa-position,
    .sa-schedule,
    .sa-contact-item {
        font-size: 0.88em;
    }

    .sa-photo-wrap,
    .sa-card.sa-photo-right .sa-photo-wrap,
    .sa-card.sa-photo-top .sa-photo-wrap {
        height: 210px;
    }
}