/* --- Variables & Reset --- */
:root {
    --primary-color: #550000;
    --secondary-color: #8a1a1a;
    --text-color: #333;
    --bg-card: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-image: url('/data/img/fonds/patrick-fore-0gkw_9fy0eQ-unsplash.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* --- Gallery Section (Slider) --- */
.gallery-section {
    background: rgba(0, 0, 0, 0.5);
    padding: 40px 0;
    margin-bottom: 40px;
    border-bottom: 4px solid var(--primary-color);
}

.gallery-title {
    color: #fff;
    text-align: center;
    font-family: "Cooper Black", serif;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.gallery-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.gallery-card:hover {
    transform: translateY(-5px);
}

.gallery-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-info {
    padding: 20px;
    text-align: center;
}

.gallery-info h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.category-count {
    font-size: 0.9rem;
    color: #888;
    font-weight: normal;
    font-family: 'Segoe UI', sans-serif;
}

.gallery-info p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* --- Articles Section --- */
.articles-section {
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: var(--shadow);
}

.section-header h2 {
    margin: 0;
    font-family: "Cooper Black", serif;
    color: var(--primary-color);
}

/* --- Search Form --- */
.search-form {
    flex-grow: 1;
    max-width: 400px;
}

.search-group {
    display: flex;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
}

.search-group input {
    border: none;
    padding: 10px 20px;
    flex-grow: 1;
    outline: none;
    font-size: 1rem;
}

.search-group button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.search-group button:hover {
    background: var(--secondary-color);
}

/* --- Admin Actions --- */
.admin-actions {
    margin-bottom: 20px;
}

.btn-create {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.btn-create:hover {
    background: #218838;
    color: #fff;
    text-decoration: none;
}

/* --- Articles Grid & Cards --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.no-image {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.placeholder-icon {
    font-size: 4rem;
    color: #ccc;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

/* --- Admin Edit Icon --- */
.edit-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
    transition: var(--transition);
}

.edit-icon:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(15deg);
}

/* --- Visibility Tag --- */
.visibility-tag {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    transition: var(--transition);
    cursor: help;
}

.visibility-tag:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.card-date {
    color: #888;
}

.card-category {
    background: rgba(85, 0, 0, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.card-category:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    transform: scale(1.05);
}

.article-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    line-height: 1.3;
}

.article-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.article-card h3 a:hover {
    color: var(--secondary-color);
}

.article-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    align-self: flex-start;
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.read-more:hover {
    border-bottom-color: var(--primary-color);
    padding-left: 5px;
}

.no-results {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 40px;
    border-radius: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    box-shadow: var(--shadow);
}

/* --- Load More --- */
.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.btn-load-more {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(85, 0, 0, 0.3);
    transition: var(--transition);
}

.btn-load-more:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(85, 0, 0, 0.4);
    text-decoration: none;
}

.btn-load-more i {
    margin-left: 10px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        text-align: center;
        border-radius: 20px;
    }
    
    .search-form {
        width: 100%;
        max-width: none;
    }
    
    .gallery-title {
        font-size: 1.8rem;
    }
}
