/* ============================================
   Art Divino - Custom Styles
   Aquarelles au Vin Rouge
   ============================================ */

:root {
    /* Palette de couleurs */
    --color-primary: #8c6078;
    --color-secondary: #917183;
    --color-rose: #b39c9b;
    --color-light: #c9b9bb;
    --color-accent: #aa6f6b;
    --color-muted: #9b7b8f;
    --color-near-black: #020202;
    --color-light-bg: #f5f0f1;
    --color-text: #3a2e32;

    /* Polices */
    --font-title: Georgia, serif;
    --font-subtitle: Georgia, serif;
    --font-body: 'Work Sans', sans-serif;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
    background-color: var(--color-light-bg);
}

/* Typographie */
h1 {
    font-family: var(--font-title);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-primary);
    font-size: 3.5rem;
    letter-spacing: 2px;
}

h2, h3, h4, h5, h6 {
    font-family: var(--font-subtitle);
    font-weight: 400;
    line-height: 1.3;
    color: var(--color-secondary);
}

h2 {
    font-size: 2.5rem;
    letter-spacing: 1px;
}

h3 {
    font-size: 2rem;
}

.handwriting {
    font-family: var(--font-subtitle);
    font-size: 2.5rem;
    color: var(--color-accent);
}

/* ============================================
   Navigation
   ============================================ */

.main-nav {
    background-color: var(--color-light-bg);
    padding: 3rem 3rem 0.75rem;
    position: relative; /* ancrage du menu mobile */
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Liens (NavLink → <a>) */
.main-nav a.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    transition: color 0.2s ease;
}

.main-nav a.nav-link:hover {
    color: var(--color-primary);
}

/* État actif (Blazor NavLink ajoute la classe "active") */
.main-nav a.nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

.nav-logo {
    height: 90px;
    width: auto;
    display: block;
}

/* ---- Hamburger ---- */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Liens container ---- */
.nav-links {
    display: flex;
    align-items: center;
}

/* ---- Sous-menu dropdown ---- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
    color: var(--color-primary);
}

.nav-arrow {
    font-size: 0.65rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    background-color: var(--color-light-bg);
    min-width: 195px;
    box-shadow: 0 6px 20px rgba(58, 46, 50, 0.15);
    border-top: 2px solid var(--color-primary);
    flex-direction: column;
    z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-menu .nav-link {
    padding: 0.65rem 1.2rem !important;
    display: block;
    border-bottom: 1px solid rgba(193, 185, 187, 0.3);
    white-space: nowrap;
}

.nav-dropdown-menu .nav-link:last-child {
    border-bottom: none;
}

/* ---- Utilisateur connecté / déconnexion ---- */
.nav-user {
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--color-muted);
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    text-transform: uppercase;
}

.nav-logout-form {
    display: inline;
}

.nav-logout-btn {
    background: none;
    border: 1px solid var(--color-primary);
    cursor: pointer;
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    margin-left: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-logout-btn:hover {
    background-color: var(--color-primary);
    color: white;
}

/* ---- Formulaire de connexion ---- */
.login-error {
    background-color: #fdecea;
    border-left: 4px solid var(--color-accent);
    color: var(--color-accent);
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.login-field label {
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text);
}

.login-input {
    border: 1px solid var(--color-light);
    padding: 0.65rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background-color: white;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
}

.login-input:focus {
    border-color: var(--color-primary);
}

.login-validation {
    font-size: 0.8rem;
    color: var(--color-accent);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.login-submit {
    width: 100%;
    text-align: center;
    display: block;
    text-decoration: none;
}

/* ---- Overlay mobile ---- */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(58, 46, 50, 0.35);
    z-index: 998;
}

/* ---- Responsive mobile ---- */
@media (max-width: 768px) {
    .main-nav {
        padding: 1.5rem 1.5rem 0.75rem;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-light-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0 1rem;
        box-shadow: 0 6px 20px rgba(58, 46, 50, 0.15);
        z-index: 1000;
    }

    .nav-links.open {
        display: flex;
    }

    .main-nav a.nav-link,
    .nav-dropdown-toggle {
        padding: 0.8rem 1.5rem !important;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(193, 185, 187, 0.2);
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--color-primary);
        margin-left: 1.5rem;
    }
}

/* Hero Home */
.hero-home-wrapper {
    padding: 0 13vw 0;
    background-color: var(--color-light-bg);
}

.hero-home-separator {
    height: 1px;
    background-color: var(--color-light);
    margin-bottom: 1rem;
}

.hero-home {
    width: 100%;
    min-height: 52vh;
    background-image: url('images/hero.jpg');
    background-size: cover;
    background-position: center;
    background-color: var(--color-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
}

.hero-home-content {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.hero-home h1 {
    color: white;
    font-size: 4.5rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.hero-home h2 {
    color: white;
    font-size: 3.2rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

/* Section Aperçu Home */
.home-preview {
    display: flex;
    align-items: center;
    padding: 3.5rem 13vw;
    background-color: var(--color-light-bg);
    gap: 3rem;
}

.home-preview-logo {
    flex-shrink: 0;
    width: 90px;
}

.home-preview-logo img {
    width: 100%;
    height: auto;
}

.home-preview-info {
    flex-shrink: 0;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.brand-mark {
    border: 1.5px solid var(--color-primary);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1rem;
    font-family: var(--font-title);
    color: var(--color-primary);
    font-size: 1.1rem;
    letter-spacing: 3px;
    line-height: 1.6;
    align-self: flex-start;
}

.home-preview-text {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: justify;
}

.btn-shop-now {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 2px;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.btn-shop-now:hover {
    background-color: var(--color-accent);
    color: white;
}

.home-preview-gallery {
    flex: 1;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.preview-artwork {
    width: auto;
    height: 200px;
    object-fit: contain;
    border-radius: 4px;
    background-color: var(--color-light);
}

@media (max-width: 768px) {
    .hero-home h1 { font-size: 2.8rem; }
    .hero-home h2 { font-size: 2rem; }
    .home-preview { flex-direction: column; padding: 2rem 1.5rem; }
    .home-preview-left { max-width: 100%; }
    .home-preview-gallery { width: 100%; }
    .preview-artwork { height: 140px; }
}

/* Hero Section */
.hero-section {
    /*
     * Effet aquarelle : plusieurs halos radiaux superposés simulent
     * la diffusion du pigment dans l'eau — auréoles claires au centre,
     * bordeaux profond aux bords comme une aquarelle mouillée.
     */
    background:
        radial-gradient(ellipse 85% 130% at 25% 35%, rgba(196, 158, 174, 0.48) 0%, transparent 55%),
        radial-gradient(ellipse 55% 70%  at 78% 65%, rgba(170, 111, 107, 0.42) 0%, transparent 52%),
        radial-gradient(ellipse 40% 50%  at 88% 8%,  rgba(140,  96, 120, 0.38) 0%, transparent 48%),
        radial-gradient(ellipse 50% 65%  at 5%  85%, rgba( 92,  45,  62, 0.60) 0%, transparent 55%),
        radial-gradient(ellipse 38% 48%  at 58% 92%, rgba(122,  58,  80, 0.44) 0%, transparent 46%),
        linear-gradient(150deg, #5c2d3e 0%, #7a4560 45%, #6b3850 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Bloom central lumineux — simule la réserve d'eau au milieu */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 55% at 50% 44%, rgba(255, 240, 245, 0.09) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* Grain papier aquarelle — texture papier 300g visible */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.52' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.14;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section p,
.hero-section .decorative-line,
.hero-section .handwriting,
.hero-section > * {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: white;
    margin-bottom: 1rem;
}

.hero-section h2,
.hero-section h3 {
    color: var(--color-light);
}

.hero-section .decorative-line {
    background: rgba(255, 255, 255, 0.7);
}

.hero-section .handwriting {
    color: white;
}

.hero-section p {
    font-size: 1.3rem;
    font-family: var(--font-body);
}

/* Sections */
.content-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-light {
    background-color: white;
}

.section-dark {
    background-color: var(--color-light-bg);
}

/* Cards */
.art-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.art-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(140, 96, 120, 0.25);
}

/* Boutons */
.btn-primary {
    background-color: var(--color-primary);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--color-accent);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(140, 96, 120, 0.35);
}

/* Grille responsive */
.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Contact */
.contact-info {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
}

.contact-info h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.contact-info a {
    color: var(--color-light-bg);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: white;
    text-decoration: underline;
}

.contact-item {
    margin: 1rem 0;
    font-size: 1.1rem;
}

/* Footer */
.main-footer {
    background-color: var(--color-near-black);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.main-footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background-color: var(--color-light-bg);
    /* Optimisation rendu hors-écran */
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 4rem 1rem;
    }

    .content-section {
        padding: 2rem 1rem;
    }

    .grid-2-cols,
    .grid-3-cols {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Galerie — caption sur les images
   ============================================ */

.gallery-item {
    position: relative;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(58, 46, 50, 0.75));
    color: white;
    padding: 1rem 0.8rem 0.6rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

.gallery-caption-titre {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 1px;
}

.gallery-caption-prix {
    font-size: 0.8rem;
    margin: 0.2rem 0 0;
    opacity: 0.9;
}

/* ============================================
   Administration
   ============================================ */

.admin-form-card {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(58, 46, 50, 0.08);
    margin-bottom: 2rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.admin-feedback {
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    font-size: 0.95rem;
}

.admin-feedback--ok {
    background: #f0faf0;
    border-color: #5a8a5a;
    color: #3a5a3a;
}

.admin-feedback--error {
    background: #fdecea;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.admin-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(193, 185, 187, 0.4);
}

.admin-table th {
    background-color: var(--color-light-bg);
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-muted);
}

.admin-table tr:hover td {
    background-color: rgba(193, 185, 187, 0.1);
}

.admin-tag {
    background-color: var(--color-light);
    color: var(--color-text);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.78rem;
    letter-spacing: 1px;
}

.admin-btn-delete {
    border-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    margin-left: 0.5rem;
}

.admin-btn-delete:hover {
    background-color: var(--color-accent) !important;
    color: white !important;
}

.admin-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(58, 46, 50, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-confirm-box {
    background: white;
    padding: 2rem 2.5rem;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(58, 46, 50, 0.2);
    text-align: center;
    max-width: 400px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* Accents décoratifs */
.decorative-line {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    margin: 2rem auto;
}

/* ============================================
   Modale galerie
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 2, 0.82);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: white;
    border-radius: 6px;
    box-shadow: 0 12px 48px rgba(2, 2, 2, 0.5);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUpModal 0.22s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    z-index: 1;
    padding: 0 0.2rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-accent);
}

.modal-img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 6px 6px 0 0;
    display: block;
    background: var(--color-near-black);
}

.modal-info {
    padding: 1.2rem 1.6rem 1.6rem;
}

.modal-titre {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--color-primary);
    margin: 0 0 0.5rem;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--color-text);
    opacity: 0.8;
    margin: 0 0 0.8rem;
    line-height: 1.6;
}

.modal-prix {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0;
}

.modal-prix--demande {
    font-style: italic;
    font-weight: 400;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .modal-img {
        max-height: 50vh;
    }
    .modal-info {
        padding: 1rem;
    }
}
