/* Mon Blog - Design Ultra-Moderne (2024+) */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #eef2f6; /* Softer, slightly darker background to reduce glare */
    --text-color: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 30px 60px -15px rgba(79, 70, 229, 0.2);
    --border-radius: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Page Layout */
#page-wrapper {
    width: 100%;
    margin: 0;
}

/* Header & Nav */
#main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

#logo a {
    color: var(--text-color);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
}

#logo span {
    color: var(--primary-color);
}

#main-nav {
    margin-top: 0;
}

#main-nav ul {
    list-style: none;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

#main-nav a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

#main-nav a:hover, #main-nav a.active {
    color: var(--text-color);
}

#main-nav a:hover::after, #main-nav a.active::after {
    width: 100%;
}

/* Content Area */
#content-wrapper {
    display: flex;
    gap: 60px;
    padding-top: 80px;
    padding-bottom: 80px;
}

#main-content {
    flex: 2;
}

#sidebar {
    flex: 1;
}

/* Horizone Inspired Styles */

/* Full Width Carousel */
.full-width-carousel {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
    margin-bottom: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: -80px; /* Annule le padding-top de #content-wrapper */
}

.carousel-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.full-width-carousel::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); /* Overlay for text readability */
    z-index: 3;
}

.carousel-content {
    position: relative;
    z-index: 4;
    color: white;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

.carousel-content h2 {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.04em;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.carousel-content p {
    font-size: 1.4rem;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Blog Header & Filters */
.blog-header {
    margin-bottom: 40px;
}

.blog-header-text h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
}

.blog-header-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 600px;
}

.blog-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.category-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.category-pills .pill {
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.category-pills .pill:hover {
    background: #f1f5f9;
}

.category-pills .pill.active {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

.sort-by {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Modern Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px 30px;
    margin-bottom: 80px;
}

.modern-card {
    display: flex;
    flex-direction: column;
}

.modern-card-link {
    display: block;
    color: inherit;
}

.modern-card-link:hover {
    color: inherit;
}

.modern-card-image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 220px;
    margin-bottom: 20px;
    background: #f1f5f9;
}

.modern-card-image-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.modern-card-link:hover .modern-card-image-wrapper img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 16px; left: 16px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.modern-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.modern-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.modern-card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modern-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-author-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.post-thumbnail {
    width: 100%;
    height: 300px;
    margin-bottom: 24px;
    border-radius: calc(var(--border-radius) - 8px);
    overflow: hidden;
    background-color: #f8fafc;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.post-featured-image {
    width: 100%;
    margin-bottom: 40px;
    border-radius: calc(var(--border-radius) - 4px);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 32px;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
}

.read-more-btn::after {
    content: ' →';
    transition: transform 0.2s ease;
}

.read-more-btn:hover::after {
    transform: translateX(4px);
}

/* Sidebar Widgets */
.widget {
    margin-bottom: 56px;
}

.widget h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: 16px;
}

.widget li a {
    color: var(--text-color);
    font-weight: 500;
}

.widget li a:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.search-form input {
    flex: 1;
    background: #fff;
    border: 2px solid #f1f5f9;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-form input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.search-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.search-form button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.search-form button:active {
    transform: translateY(0);
}

/* Footer */
#main-footer {
    background-color: #0f172a; /* Horizone Dark Footer */
    color: #cbd5e1;
    padding: 80px 0;
    margin-top: 80px;
    border-top: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 40px;
}

#logo-footer a {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

#logo-footer span {
    color: var(--primary-color);
}

.footer-brand p {
    margin-top: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-brand .copyright {
    margin-top: 40px;
    font-size: 0.85rem;
    opacity: 0.5;
}

.footer-links h3, .footer-newsletter h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 24px;
    font-weight: 700;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 16px;
}

.footer-links a {
    color: #cbd5e1;
}

.footer-links a:hover {
    color: white;
}

.newsletter-form {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4px;
}

.newsletter-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 12px 16px;
    outline: none;
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

.newsletter-form button {
    background: white;
    color: #0f172a;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.footer-admin-link {
    margin-top: 40px;
}

.footer-admin-link a {
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
}

.footer-admin-link a:hover {
    color: white;
}

/* Admin Section Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    min-width: 600px;
}

.admin-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.admin-table td {
    background: #fff;
    padding: 20px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table td:first-child { border-left: 1px solid #f1f5f9; border-radius: 8px 0 0 8px; }
.admin-table td:last-child { border-right: 1px solid #f1f5f9; border-radius: 0 8px 8px 0; }

.btn-new {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    transition: all 0.3s ease;
}

.btn-new:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: inherit;
}

.btn-edit {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.btn-edit:hover {
    background-color: rgba(79, 70, 229, 0.2);
    color: var(--primary-hover);
}

.btn-delete {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* Admin Form Styles */
.admin-form-container {
    max-width: 800px;
    margin: 0 auto 60px;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-md);
}

.admin-form .form-group {
    margin-bottom: 32px;
}

.admin-form label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.admin-form input[type="text"],
.admin-form textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-color);
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.admin-form input[type="file"] {
    width: 100%;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
}

.admin-form input[type="file"]::file-selector-button {
    background: #f1f5f9;
    color: var(--text-color);
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-form input[type="file"]::file-selector-button:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.admin-form input:focus,
.admin-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.admin-form small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-form .form-errors ul {
    list-style: none;
    padding: 10px 15px;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #f1f5f9;
}

.btn-save {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Specific styling for TinyMCE to match the form */
.tox-tinymce {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}

/* RESPONSIVE BREAKPOINTS */

@media (max-width: 1024px) {
    #page-wrapper {
        margin: 0 12px;
    }

    #content-wrapper {
        flex-direction: column;
        gap: 60px;
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #main-header {
        padding: 12px 20px;
        margin: 12px 12px 40px;
        border-radius: 20px;
    }

    .full-width-carousel {
        height: 50vh;
        min-height: 400px;
        margin-top: -40px; /* Annule le padding-top réduit sur mobile */
    }

    .carousel-content h2 {
        font-size: 2.5rem;
    }

    #main-nav ul {
        justify-content: center;
        gap: 16px;
    }

    #logo a {
        font-size: 1.8rem;
    }

    .admin-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #page-wrapper {
        margin: 0 8px;
    }
    .container {
        padding: 0 16px;
    }

    #main-nav ul {
        display: none; /* Hide nav on very small screens for now, or add hamburger */
    }

    .full-width-carousel {
        height: 40vh;
        min-height: 300px;
    }
    
    .carousel-content h2 {
        font-size: 2rem;
    }

    .carousel-content p {
        font-size: 1.1rem;
    }
}

/* Comments Section */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #f1f5f9;
}

.comments-section h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

.comments-list {
    margin-bottom: 50px;
}

.comment-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 700;
    color: var(--text-color);
    margin-right: 8px;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-content {
    color: var(--text-color);
    line-height: 1.6;
}

.no-comments {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px 0;
}

.comment-form-container {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.comment-form-container h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.comment-form .form-group {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.comment-form .checkbox-group label {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

