/* ─── Multisite Articles Plugin – Styles ─── */

/* Container */
.msa-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #202124;
}

/* Header - Centré */
.msa-header {
    margin-bottom: 24px;
    text-align: center;
}

.msa-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #202124;
}

.msa-subtitle {
    font-size: 0.95rem;
    color: #5f6368;
    margin: 0 0 16px;
}

/* Count selector - Centré */
.msa-count-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.msa-display-label {
    font-size: 0.9rem;
    color: #5f6368;
    white-space: nowrap;
}

.msa-count-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.msa-count-btn {
    padding: 6px 16px;
    border: 1.5px solid #dadce0;
    border-radius: 20px;
    background: #fff;
    color: #3c4043;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.msa-count-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #e8f0fe;
}

.msa-count-btn.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

/* ─── Grid – Discovery style ─── */
.msa-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ─── Card ─── */
.msa-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(32,33,36,0.12);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.msa-card:hover {
    box-shadow: 0 4px 16px rgba(32,33,36,0.2);
    transform: translateY(-2px);
}

.msa-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f3f4;
}

.msa-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.msa-card:hover .msa-card-img img {
    transform: scale(1.04);
}

/* Carte sans image : pas de bloc image affiché, on ajuste le padding */
.msa-card--no-image .msa-card-body {
    padding: 16px 14px 18px;
}

.msa-card-body {
    padding: 12px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msa-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: #202124;
    /* Max 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msa-card-date {
    font-size: 0.78rem;
    color: #70757a;
    margin-top: auto;
}

/* ─── Category list ─── */
.msa-cat-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.msa-cat-btn {
    padding: 8px 18px;
    border: 1.5px solid #dadce0;
    border-radius: 24px;
    background: #fff;
    color: #3c4043;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.msa-cat-btn:hover,
.msa-cat-btn.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

.msa-cat-count {
    font-size: 0.78rem;
    opacity: 0.75;
    margin-left: 4px;
}

/* Category articles header - Centré */
.msa-cat-articles-header {
    margin-bottom: 20px;
    text-align: center;
}

.msa-cat-articles-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #202124;
}

/* Loading spinner */
.msa-loading {
    text-align: center;
    padding: 32px;
}

.msa-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid #dadce0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: msa-spin 0.7s linear infinite;
}

@keyframes msa-spin {
    to { transform: rotate(360deg); }
}

.msa-no-posts {
    text-align: center;
    color: #5f6368;
    padding: 40px 0;
    font-size: 1rem;
}

/* ─── Responsive – mobile : 1 colonne ─── */
@media (max-width: 640px) {
    .msa-grid {
        grid-template-columns: 1fr;
    }

    .msa-title {
        font-size: 1.3rem;
    }

    .msa-count-selector {
        flex-direction: column;
        align-items: center;
    }
}
