﻿/* =================================
   RESET ET BASE
   ================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    color: #333;
    margin-top: 0;
}

/* =================================
   LAYOUT GÉNÉRAL
   ================================= */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* Bannières */
.banner {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-banner {
    width: 100%;
    height: 250px;
    background: #4a5568;
    color: white;
    text-align: center;
    line-height: 250px;
    font-size: 28px;
    font-weight: bold;
}

/* =================================
   NAVIGATION
   ================================= */

.main-nav {
    background: #333;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.nav-link {
    display: inline-block;
    padding: 15px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover:not(.active) {
    color: white;
    background: #4a5568;
    border-bottom-color: #007acc;
}

.nav-link.active {
    color: white;
    background: #4a5568;
    border-bottom-color: #007acc;
}

.nav-dropdown {
    display: inline-block;
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #333;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 200;
}

.submenu-link {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid #555;
}

.submenu-link:hover:not(.active) {
    background: #4a5568;
    color: white;
}

.submenu-link.active {
    background: #4a5568;
    color: white;
}

/* =================================
   FOOTER
   ================================= */

footer {
    background: #333;
    color: white;
    padding: 0px 0;
    margin-top: auto;
}

footer .container {
    flex: none;
}

footer h3 {
    margin-bottom: 15px;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer li {
    margin-bottom: 8px;
}

footer a {
    color: #ccc;
    text-decoration: none;
}

footer a:hover {
    color: white;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

hr {
    border-color: #555;
    margin: 30px 0;
}

.footer-bottom {
    text-align: center;
    color: #999;
}

/* =================================
   PAGE D'ACCUEIL
   ================================= */

.welcome-message {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
}

.main-content-area {
    margin-bottom: 30px;
}

.main-content-area h2 {
    color: #333;
    margin-bottom: 15px;
}

.main-content-area p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* =================================
   ARTICLES DE BLOG
   ================================= */

.blog-post {
    max-width: 700px;
    margin: 0 auto;
}

.blog-post-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.blog-post-title {
    margin-bottom: 15px;
    color: #333;
    font-size: 2.2em;
    line-height: 1.3;
}

.blog-post-meta {
    color: #666;
    font-size: 0.95em;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.blog-post-meta .author {
    margin-left: 20px;
}

.blog-post-content {
    font-size: 1.1em;
    line-height: 1.7;
    color: #444;
    margin-bottom: 40px;
}

.featured-image {
    margin: 20px 0;
    text-align: center;
}

.featured-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
}

.article-content {
    line-height: 1.6;
    margin: 20px 0;
}

.post-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 40px;
    background: white;
}

.post-footer a {
    color: #4a5568;
    background: white;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid #4a5568;
    border-radius: 5px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.post-footer a:hover {
    background: #4a5568;
    color: white;
}

/* =================================
   ARTICLES HOBBY
   ================================= */

.hobby-article-meta {
    color: #666;
    margin-bottom: 20px;
}

.hobby-article-meta .author {
    margin-left: 20px;
}

.hobby-article-meta .category {
    margin-left: 20px;
}

.hobby-article-meta .category a {
    color: #4a5568;
    text-decoration: none;
}

.hobby-article-meta .category a:hover {
    color: #333;
}

.difficulty-level,
.estimated-time {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #4a5568;
}

/* Galerie d'images */
.image-gallery {
    margin: 30px 0;
}

.image-gallery h3 {
    margin-bottom: 15px;
    color: #333;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev {
    left: -50px;
}

.lightbox-next {
    right: -50px;
}

/* =================================
   LISTES ET CATÉGORIES
   ================================= */

.page-content {
    margin-bottom: 40px;
    font-size: 1.1em;
    line-height: 1.6;
}

.blog-intro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.hobby-articles h2,
.blog-posts h2 {
    border-bottom: 2px solid #4a5568;
    padding-bottom: 10px;
    margin-bottom: 30px;
    color: #333;
}

/* Preview d'articles */
.hobby-article-preview,
.blog-post-preview {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: box-shadow 0.2s;
}

.hobby-article-preview:hover,
.blog-post-preview:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.hobby-article-preview .content,
.blog-post-preview .content {
    flex: 1;
}

.hobby-article-preview h3,
.blog-post-preview h2 {
    margin: 0 0 10px 0;
}

.hobby-article-preview h3 a,
.blog-post-preview h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.hobby-article-preview h3 a:hover,
.blog-post-preview h2 a:hover {
    color: #4a5568;
}

.hobby-article-preview .meta,
.blog-post-preview .date,
.blog-post-preview .author {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.hobby-article-preview .meta .author {
    margin-left: 15px;
}

.hobby-article-preview .summary,
.blog-post-preview .summary {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.hobby-article-preview .read-more,
.blog-post-preview .read-more {
    color: #4a5568;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.hobby-article-preview .read-more:hover,
.blog-post-preview .read-more:hover {
    color: #333;
}

.hobby-article-preview .image,
.blog-post-preview .image {
    width: 150px;
    flex-shrink: 0;
}

.hobby-article-preview .image img,
.blog-post-preview .image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a {
    color: #4a5568;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background: #f8f9fa;
    border-color: #4a5568;
}

.pagination .current {
    background: #4a5568;
    color: white;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Message aucun article */
.no-articles {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-articles em {
    color: #999;
}

/* =================================
   PAGE CONTACT
   ================================= */

.intro-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Formulaire */
.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a5568;
    box-shadow: 0 0 5px rgba(74, 85, 104, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form button {
    background: #4a5568;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.contact-form button:hover {
    background: #2d3748;
}

.contact-info {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* =================================
   PAGE DE RECHERCHE
   ================================= */

.search-page {
    max-width: 800px;
    margin: 0 auto;
}

/* Formulaire de recherche */
.search-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-form .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.search-form .form-group {
    margin-bottom: 0;
}

.search-form .form-group.search-input {
    flex: 1;
    min-width: 250px;
}

.search-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.search-form input,
.search-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.search-form button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background: #0056b3;
}

/* Résultats de recherche */
.search-results h2 {
    margin-bottom: 10px;
    color: #333;
}

.search-results .results-count {
    color: #666;
    margin-bottom: 20px;
}

.search-results .filter-info {
    color: #666;
}

/* Éléments de résultat */
.search-result-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    display: flex;
    gap: 15px;
    transition: box-shadow 0.2s;
}

.search-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-item .content {
    flex: 1;
}

.search-result-item h3 {
    margin: 0 0 10px 0;
}

.search-result-item h3 a {
    color: #007bff;
    text-decoration: none;
}

.search-result-item h3 a:hover {
    text-decoration: underline;
}

.search-result-item .meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.search-result-item .meta span {
    margin-right: 10px;
}

.search-result-item .meta a {
    color: #666;
}

.search-result-item .meta a:hover {
    color: #333;
}

/* Badges de type */
.content-type-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 10px;
    display: inline-block;
}

.content-type-badge.hobby {
    background: #e3f2fd;
    color: #1976d2;
}

.content-type-badge.blog {
    background: #f3e5f5;
    color: #7b1fa2;
}

.search-result-item .excerpt {
    margin: 0;
    color: #555;
    line-height: 1.4;
}

.search-result-item .image {
    width: 150px;
    flex-shrink: 0;
}

.search-result-item .image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
}

/* Messages */
.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.search-error {
    color: red;
    font-weight: bold;
}

/* =================================
   PAGE HOBBIES
   ================================= */

.hobbies-list {
    margin-top: 30px;
}

.hobbies-list h2 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #4a5568;
    padding-bottom: 10px;
}

.hobbies-list ul {
    list-style: none;
    padding: 0;
}

.hobbies-list li {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    transition: background 0.2s;
}

.hobbies-list li:hover {
    background: #e9ecef;
}

.hobbies-list a {
    color: #4a5568;
    text-decoration: none;
    font-weight: bold;
    display: block;
}

.hobbies-list a:hover {
    color: #333;
}

/* =================================
   RESPONSIVE
   ================================= */

@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        text-align: left;
        padding: 0 10px;
    }
    
    .nav-link {
        display: block;
        padding: 10px 15px;
        border-bottom: 1px solid #555;
    }
    
    .nav-dropdown .submenu {
        position: static;
        display: block;
        box-shadow: none;
        background: #2d3748;
    }

    /* Blog et articles */
    .blog-post-meta {
        flex-direction: column;
        gap: 10px;
    }

    .blog-post-title {
        font-size: 1.8em;
    }

    .blog-post-preview,
    .hobby-article-preview {
        flex-direction: column;
        gap: 15px;
    }
    
    .blog-post-preview .image,
    .hobby-article-preview .image {
        width: 100%;
        align-self: center;
        max-width: 300px;
    }

    .blog-post-preview .author,
    .hobby-article-preview .meta .author {
        margin-left: 0;
        display: block;
        margin-top: 5px;
    }

    /* Galerie */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .lightbox-nav {
        font-size: 20px;
        padding: 8px;
    }
    
    .lightbox-prev {
        left: -35px;
    }
    
    .lightbox-next {
        right: -35px;
    }

    /* Pagination */
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        margin: 2px;
        font-size: 0.9em;
    }

    /* Recherche */
    .search-form .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .search-form .form-group.search-input {
        min-width: auto;
    }
    
    .search-result-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-result-item .image {
        width: 100%;
        align-self: center;
        max-width: 300px;
    }
    
    .search-result-item .meta span {
        display: block;
        margin-bottom: 5px;
        margin-right: 0;
    }

    /* Contact */
    .contact-form {
        max-width: 100%;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .banner,
    .default-banner {
        height: 150px;
        line-height: 150px;
        font-size: 20px;
    }

    .blog-post-preview,
    .hobby-article-preview {
        padding: 15px;
        margin: 15px 0;
    }

    .search-form {
        padding: 15px;
    }
    
    .pagination {
        padding: 10px;
    }
}