@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;700&display=swap');

/* Palette de couleurs et polices */
:root {
    --primary-color: #D2B48C; /* Tan / Beige */
    --secondary-color: #8B4513; /* Marron selle */
    --background-color: #FAF0E6; /* Lin */
    --text-color: #3C3C3C;
    --gold-accent: #CFB53B; /* Or vieilli */
    --white-color: #FFFFFF;
    --font-main: 'Quicksand', sans-serif;
    --font-text: 'Quicksand', sans-serif;
    --avatar-size: 48px;
}

/* Réinitialisation et styles globaux */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-text);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
}

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

h1, h2, h3 {
    font-family: var(--font-main);
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
a { color: var(--gold-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* En-tête et Navigation */
.sticky-header {
    background-color: rgba(250, 240, 230, 0.9);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.sticky-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-main);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo:hover { text-decoration: none; }

.logo-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    object-fit: cover;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    color: var(--secondary-color);
    font-weight: bold;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

/* Menu hamburger - caché par défaut */
.hamburger-menu {
    display: none;
}

/* Navigation mobile - cachée par défaut */
.mobile-nav {
    display: none;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    color: var(--gold-accent);
}

/* Bouton de contact dans la nav */
.main-nav .contact-button a {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 8px 18px;
    border-radius: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav .contact-button a:hover {
    background-color: var(--gold-accent);
    color: var(--white-color);
    text-decoration: none;
}

/* Menu Hamburger (pour mobile) */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 25px;
    height: 25px;
    z-index: 1010;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav ul {
    list-style: none;
    text-align: center;
}

.mobile-nav ul li {
    margin: 20px 0;
}

.mobile-nav ul li a {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Sections principales */
main section {
    padding: 60px 0;
}

#hero {
    background: linear-gradient(rgba(210, 180, 140, 0.2), rgba(210, 180, 140, 0.2)), url('https://via.placeholder.com/1920x1080/FAF0E6/8B4513') no-repeat center center/cover;
    color: var(--secondary-color);
    text-align: center;
    padding: 100px 0;
}

#about .about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}
#about .about-text { flex: 2; }
#about .about-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
#about .about-image img {
    width: 300px;
    height: 300px;
    max-width: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Section aperçu des œuvres avec recherche */
#featured-works {
    padding: 4rem 0;
    background-color: #f8f4f0;
    margin: 2rem 0;
    border-radius: 12px;
}

.featured-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-container {
    margin: 3rem 0 2rem 0;
    text-align: center;
}

.search-title {
    color: var(--secondary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    font-family: var(--font-main);
    font-size: 1rem;
    background-color: var(--white-color);
    color: var(--text-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 3px rgba(207, 181, 59, 0.1);
}

.search-btn {
    background-color: var(--secondary-color);
    color: var(--white-color);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: var(--gold-accent);
}

.search-results {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
}

.search-results.active {
    display: block;
}

.search-results h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.search-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.search-result-item {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--secondary-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.search-result-item:hover {
    transform: translateY(-2px);
}

.search-result-item h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.search-result-item p {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.search-result-item .category {
    font-size: 0.8rem;
    color: var(--gold-accent);
    font-weight: 500;
}

.featured-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.featured-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.featured-item:hover {
    transform: translateY(-5px);
}

.featured-item a {
    display: block;
}

.featured-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-item:hover img {
    transform: scale(1.05);
}

.featured-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(139, 69, 19, 0.9));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.featured-item:hover .featured-item-overlay {
    transform: translateY(0);
}

.featured-item-overlay h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.featured-item:hover .featured-item-overlay h3 {
    color: var(--gold-accent);
}

/* Styles pour les coordonnées et réseaux sociaux */
.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}
.contact-item a, .contact-item span {
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-text);
    text-decoration: none;
}
.contact-item a:hover {
    color: var(--gold-accent);
}
.contact-icon {
    width: 24px;
    height: 24px;
    stroke: var(--secondary-color);
    flex-shrink: 0;
}
.social-media {
    margin-top: 1.5rem;
}
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-weight: 500;
    font-family: var(--font-text);
    text-decoration: none;
    transition: color 0.3s ease;
}
.social-link:hover, .social-link:hover .social-icon {
    color: var(--gold-accent);
    stroke: var(--gold-accent);
    text-decoration: none;
}
.social-icon {
    width: 28px;
    height: 28px;
    stroke: var(--secondary-color);
    transition: stroke 0.3s ease;
}

/* Formulaire de contact */
#contact .contact-content {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.contact-info, .contact-form-container {
    flex: 1;
    min-width: 300px;
    background: var(--white-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}
.btn {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 12px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}
.btn:hover {
    background-color: var(--gold-accent);
}
#form-feedback {
    margin-top: 1rem;
    font-weight: bold;
}
.hidden { display: none; }


/* Pied de page */
footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Bouton Retour en haut */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: none; /* Caché par défaut */
    z-index: 100;
    transition: opacity 0.4s, visibility 0.4s;
}
.back-to-top-btn:hover {
    background-color: var(--gold-accent);
}

/* Boutons de pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination-btn {
    background-color: var(--secondary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--gold-accent);
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* Page Galerie (Aquarelles, Dessins, etc.) */
#gallery-page h2 {
    background-color: var(--primary-color);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

/* Styles pour la galerie avec grille 4x4 */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.gallery-item {
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    border: 1px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 1rem;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.gallery-thumbs .thumb {
    width: 45%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
    position: relative;
}

.gallery-thumbs .thumb:hover {
    border-color: var(--secondary-color);
}

.gallery-item-info {
    text-align: center;
}

.gallery-item-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.artwork-info-toggle {
    display: inline-block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.artwork-info-toggle:hover {
    transform: scale(1.1);
}

.artwork-desc {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.artwork-info {
    width: 100%;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    border-collapse: collapse;
}

.artwork-info td {
    padding: 0.3rem 0.5rem;
    text-align: left;
    color: var(--text-color);
}

.artwork-info td:first-child {
    color: #8B4513;
    font-weight: 500;
    width: auto;
    min-width: 50px;
    max-width: 70px;
    opacity: 0.85;
    text-align: right;
    white-space: nowrap;
}

.artwork-info tr + tr td {
    border-top: 1px solid #f0f0f0;
}



/* Responsive pour la galerie et pagination */
@media (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-results-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .pagination-buttons {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        min-width: 35px;
    }

    .featured-gallery {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-results-list {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    .hamburger-menu {
        display: flex;
    }
    #about .about-content {
        flex-direction: column;
    }
}

.artwork-info {
    border-collapse: collapse;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    font-size: 0.7rem;
}
.artwork-info td {
    border: none;
    padding: 2px 8px 2px 0;
    vertical-align: top;
}
.artwork-info td:first-child {
    color: #8B4513;
    font-weight: 500;
    width: auto;
    min-width: 50px;
    max-width: 70px;
    opacity: 0.85;
    text-align: right;
    white-space: nowrap;
}
.artwork-info tr + tr td {
    padding-top: 2px;
}

.artwork-info-toggle {
    background: none;
    border: none;
    padding: 0 0 0 8px;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
    outline: none;
    transition: opacity 0.2s;
}
.artwork-info-toggle svg {
    display: inline-block;
    vertical-align: middle;
}
.artwork-info-toggle:hover,
.artwork-info-toggle:focus {
    opacity: 0.7;
}

/* Lightbox pour affichage grand format */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Animation d'ouverture du lightbox */
.lightbox.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Curseur pointer pour les vignettes cliquables */
.gallery-thumbs .thumb {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.gallery-thumbs .thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
    opacity: 0.9;
}

/* Indication visuelle que les vignettes sont cliquables */
.gallery-thumbs .thumb::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139, 69, 19, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.gallery-thumbs .thumb:hover::after {
    opacity: 1;
}

/* Message d'aide pour les galeries */
.gallery-help {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-style: italic;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablette (768px et moins) */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    
    /* Navigation mobile */
    .main-nav {
        display: none;
    }
    
    .mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--background-color);
        z-index: 2000;
        transition: left 0.3s ease;
        padding-top: 80px;
    }
    
    .mobile-nav.active {
        left: 0;
    }
    
    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-nav ul li {
        border-bottom: 1px solid var(--primary-color);
    }
    
    .mobile-nav ul li a {
        display: block;
        padding: 20px;
        color: var(--secondary-color);
        font-weight: bold;
        text-decoration: none;
        font-size: 1.2rem;
    }
    
    .mobile-nav ul li a:hover {
        background-color: var(--primary-color);
        color: var(--white-color);
    }
    
    .hamburger-menu {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }
    
    .hamburger-menu span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--secondary-color);
        margin: 5px 0;
        transition: 0.3s;
    }
    
    /* Animation du hamburger menu */
    .hamburger-menu span:nth-child(1) {
        transform-origin: 0% 0%;
    }
    
    .hamburger-menu span:nth-child(2) {
        transform-origin: 0% 100%;
    }
    
    .hamburger-menu span:nth-child(3) {
        transform-origin: 0% 100%;
    }
    
    .hamburger-menu span.active:nth-child(1) {
        transform: rotate(45deg) translate(1px, -1px);
    }
    
    .hamburger-menu span.active:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu span.active:nth-child(3) {
        transform: rotate(-45deg) translate(1px, 1px);
    }
    
    /* Galerie responsive */
    .featured-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-thumbs .thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
    
    /* Section À propos */
    .about-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .about-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Formulaire de contact */
    .contact-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .contact-form-container {
        width: 100%;
    }
    
    /* Services */
    .services-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .page-info {
        order: -1;
    }
}

/* Mobile (480px et moins) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    
    /* Logo plus petit */
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-avatar {
        width: 36px;
        height: 36px;
    }
    
    /* Galerie une colonne */
    .featured-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Images plus petites */
    .gallery-thumbs .thumb {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    /* Section À propos */
    .about-image {
        max-width: 250px;
    }
    
    /* Formulaire */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    /* Boutons */
    .btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Lightbox */
    .lightbox img {
        max-width: 95%;
        max-height: 95%;
    }
    
    /* Pagination */
    .pagination-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* Recherche */
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
    }
}

/* Très petit mobile (320px et moins) */
@media (max-width: 320px) {
    .container {
        padding: 0 5px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo-avatar {
        width: 32px;
        height: 32px;
    }
    
    .gallery-thumbs .thumb {
        max-width: 200px;
    }
    
    .about-image {
        max-width: 200px;
    }
}