/* ===== Variables & Reset ===== */
:root {
    --rose-100: #fff5f7;
    --rose-200: #ffe0e8;
    --rose-300: #f5b8c8;
    --rose-400: #d4849a;
    --rose-500: #b85c78;
    --rose-600: #8c3a5a;
    --text: #4a3040;
    --text-light: #7a5a6a;
    --bg: #fffbfc;
    --white: #ffffff;
    --border: #f0dce3;
    --shadow: 0 2px 12px rgba(180, 100, 130, 0.08);
    --radius: 10px;
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--rose-500);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--rose-600);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Header ===== */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--rose-500);
    letter-spacing: -0.5px;
}
.logo::before {
    content: '✿ ';
    font-size: 1.2rem;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.2s;
}
nav a:hover, nav a.active {
    background: var(--rose-200);
    color: var(--rose-600);
}
nav .nav-logout {
    color: var(--text-light);
    opacity: 0.7;
    font-size: 0.85rem;
}

/* ===== Main ===== */
main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: var(--rose-100);
}
.footer-admin-link {
    color: var(--text-light);
    opacity: 0.5;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}
.footer-admin-link:hover {
    opacity: 1;
}

/* ===== Blog List ===== */
.blog-list h1 {
    font-size: 1.8rem;
    color: var(--rose-600);
    margin-bottom: 1rem;
}
.blog-list h1::after {
    content: ' ❀';
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Filtre catégories */
.categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.cat-tag {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    background: var(--rose-100);
    color: var(--rose-500);
    font-size: 0.85rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.cat-tag:hover, .cat-tag.active {
    background: var(--rose-400);
    color: var(--white);
    border-color: var(--rose-400);
}

/* Grille articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(180, 100, 130, 0.12);
}
.article-card a {
    display: block;
    color: inherit;
}

.article-thumb {
    height: 200px;
    overflow: hidden;
    background: var(--rose-100);
}
.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info {
    padding: 1rem 1.2rem;
}
.article-info time {
    font-size: 0.8rem;
    color: var(--text-light);
}
.article-info h2 {
    font-size: 1.1rem;
    margin: 0.3rem 0;
    color: var(--rose-600);
}
.article-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-msg {
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
    text-align: center;
}

/* ===== Article complet ===== */
.article-full {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 2rem 2.5rem;
}

.article-header h1 {
    font-size: 2rem;
    color: var(--rose-600);
    margin-bottom: 0.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.article-body {
    margin-top:15px;
}
.article-cats {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Paragraphes */
.article-body .paragraphe {
    margin-bottom: 2rem;
    overflow: hidden;
}

.article-body .paragraphe .para-photo {
    width: 100%;
}

.article-body .paragraphe .para-text {
    width: 100%;
}

.article-body .paragraphe.has-photo-portrait {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 1.5rem;
    align-items: start;
}
.article-body .paragraphe.has-photo-portrait .para-subtitle {
    grid-column: 1 / -1;
}
.article-body .paragraphe.has-photo-portrait .para-text {
    grid-column: 1;
    grid-row: 2;
}
.article-body .paragraphe.has-photo-portrait .para-photo {
    grid-column: 2;
    grid-row: 2;
    width: auto;
}

.para-photo {
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    display: block;
}
.para-photo img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
}
.para-photo figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
}

.para-photo.landscape {
    max-width: 100%;
    width: 100%;
}
.para-photo.portrait img {
    max-height: 450px;
    width: auto;
    margin: 0 auto;
}

.para-text {
    font-size: 1rem;
    line-height: 1.8;
}
.para-text a {
    text-decoration: underline;
    color: var(--rose-500);
}

.para-subtitle {
    font-size: 1.2rem;
    color: var(--rose-500);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.5rem 1rem;
    background: var(--rose-100);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ===== Login ===== */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 380px;
}
.login-box h1 {
    text-align: center;
    color: var(--rose-600);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--font);
    background: var(--white);
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--rose-400);
    box-shadow: 0 0 0 3px rgba(212, 132, 154, 0.15);
}

.checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.flex-1 { flex: 1; min-width: 150px; }
.flex-2 { flex: 2; min-width: 200px; }

.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.inline-form {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--rose-100);
    border-radius: var(--radius);
}

.categories-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}
.checkbox-label {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: var(--rose-400);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--rose-500);
    color: var(--white);
}
.btn-secondary {
    background: var(--rose-100);
    color: var(--rose-500);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--rose-200);
    color: var(--rose-500);
}
.btn-sm {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    background: var(--rose-100);
    border: 1px solid var(--border);
    text-decoration: none;
}
.btn-sm:hover {
    background: var(--rose-200);
}
.btn-danger {
    color: #c44;
}
.btn-danger:hover {
    background: #fee;
}

/* ===== Admin ===== */
.admin-section h1 {
    font-size: 1.5rem;
    color: var(--rose-600);
    margin-bottom: 1.5rem;
}
.admin-section h2 {
    font-size: 1.2rem;
    color: var(--rose-500);
    margin: 1.5rem 0 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.admin-header h1 {
    margin-bottom: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table th {
    background: var(--rose-100);
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    color: var(--rose-600);
    font-weight: 600;
}
.admin-table td {
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}
.admin-table .actions {
    display: flex;
    gap: 0.4rem;
}
.row-masked {
    opacity: 0.6;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-publie {
    background: #d4edda;
    color: #2d6a3a;
}
.badge-masque {
    background: var(--rose-200);
    color: var(--rose-600);
}

/* ===== Paragraphe blocks (admin) ===== */
.para-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}
.para-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--rose-500);
    font-size: 0.9rem;
}
.btn-remove-para {
    background: none;
    border: 1px solid #dcc;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    color: #c44;
    transition: all 0.2s;
}
.btn-remove-para:hover {
    background: #fee;
}

.current-photo {
    margin-bottom: 0.5rem;
}
.current-photo img {
    max-width: 120px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ===== Alerts ===== */
.alert {
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-success {
    background: #d4edda;
    color: #2d6a3a;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 0.5rem;
    }
    nav {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .article-full {
        padding: 1.5rem 1rem;
    }
    .article-header h1 {
        font-size: 1.5rem;
    }
    .article-body .paragraphe.has-photo-portrait {
        display: block;
    }
    .article-body .paragraphe.has-photo-portrait .para-photo,
    .article-body .paragraphe.has-photo-portrait .para-text {
        width: 100%;
    }
    .form-row {
        flex-direction: column;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
}
