/* Container & Direction */
.ma-card, .ma-grid, .ma-single-profile {
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    font-family: inherit;
}

/* --- Card Styles --- */
.ma-card {
    display: flex;
    flex-wrap: nowrap;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
    align-items: stretch; /* Make children equal height */
}

.ma-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ma-card-media {
    flex: 0 0 30%;
    max-width: 300px;
    min-width: 200px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.ma-card-image {
    width: 100%;
    height: 100%;
    max-height: 250px;
    object-fit: contain; /* Prevents stretching */
    border-radius: 8px;
}

.ma-card-image-fallback {
    color: #999;
    font-size: 14px;
}

.ma-card-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ma-card-name {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
}

.ma-card-resume {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
}

.ma-card-resume li {
    position: relative;
    padding-right: 25px;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
    line-height: 1.6;
}

.ma-card-resume li::before {
    content: "✓";
    position: absolute;
    right: 0;
    top: 0;
    color: #4CAF50;
    font-weight: bold;
}

.ma-card-action {
    margin-top: auto;
}

.ma-btn {
    display: inline-block;
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    transition: opacity 0.2s;
}

.ma-btn:hover {
    opacity: 0.85;
}

/* --- Grid for Multiple Teachers --- */
.ma-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    gap: 20px;
}

/* --- Single Profile Page --- */
.ma-single-profile {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.ma-single-header {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ma-single-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid #f5f5f5;
}

.ma-social-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.ma-social-btn {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #333 !important;
    text-decoration: none;
}

.ma-single-resume ul {
    list-style: none;
    padding-right: 0;
}
.ma-single-resume li {
    padding-right: 25px;
    position: relative;
    margin-bottom: 10px;
}
.ma-single-resume li::before {
    content: "■";
    position: absolute;
    right: 5px;
    top: 0;
    color: #0073aa;
    font-size: 0.8em;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .ma-card {
        flex-direction: column;
    }
    .ma-card-media {
        max-width: 100%;
        border-bottom: 1px solid #eee;
        padding: 20px;
    }
    .ma-card-image {
        max-height: 200px;
    }
    .ma-single-header {
        flex-direction: column;
        text-align: center;
    }
    .ma-social-links {
        justify-content: center;
    }
}