/**
 * Vinye - Parcelles Viticoles de Bourgogne
 * Design System - Élégant, Minimaliste, Mobile-First
 */

/* ===== Variables CSS ===== */
:root {
    /* Couleurs - Palette sobre inspirée du logo */
    --color-primary: #2c2c2c;
    --color-primary-light: #4a4a4a;
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #2c2c2c;
    --color-text-muted: #757575;
    --color-border: #e0e0e0;
    --color-accent: #7c6f5d;

    /* Typography */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Espacements */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* Bordures */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    padding: var(--space-sm) 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: none;
    gap: var(--space-lg);
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width var(--transition);
}

.nav-link:hover {
    color: var(--color-accent);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
    height: 24px;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    transition: var(--transition);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .nav-toggle {
        display: none;
    }
}

/* ===== Page d'accueil - Hero ===== */
.home-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(60px + var(--space-lg)) var(--space-md) var(--space-xl);
}

.hero-content {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.hero-logo {
    max-width: 280px;
    margin: 0 auto var(--space-md);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
    letter-spacing: 0.02em;
}

/* ===== Barre de recherche ===== */
.search-box {
    position: relative;
    width: 100%;
    margin-bottom: var(--space-md);
}

.search-input {
    width: 100%;
    height: 56px;
    padding: 0 120px 0 52px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.page-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.page-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

.dept-selector {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.dept-btn {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-weight: 500;
    transition: all var(--transition);
}

.dept-btn.active,
.dept-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.communes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md) var(--space-xl);
}

.commune-card {
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
}

.commune-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-accent);
}

.commune-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.commune-count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ===== Page À propos ===== */
.about-page {
    padding-top: 60px;
}

.about-content {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

.about-content h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin: var(--space-xl) 0 var(--space-md);
}

.about-content h2:first-child {
    margin-top: 0;
}

.about-content p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
    color: var(--color-text);
}

.about-content ul {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.about-content li {
    margin-bottom: var(--space-sm);
    line-height: 1.8;
}

/* ===== Map View ===== */
.map-view {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.map {
    width: 100%;
    height: 100%;
}

.map-controls {
    position: absolute;
    right: var(--space-md);
    top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.map-btn {
    width: 44px;
    height: 44px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all var(--transition);
}

.map-btn:hover {
    background: var(--color-bg);
    transform: scale(1.05);
}

.parcel-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    padding: var(--space-lg) var(--space-md);
    z-index: 10;
    max-height: 50vh;
    overflow-y: auto;
}

.parcel-info-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

.parcel-info-details {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    .hero-logo {
        max-width: 360px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .search-input {
        height: 64px;
        font-size: 1.125rem;
    }

    .search-btn {
        height: 56px;
    }
}

@media (min-width: 1024px) {
    .communes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    margin-top: auto;
}

footer p {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.color-bar-signature {
    height: 4px;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    border-radius: 2px;
    background: linear-gradient(to right,
            #8B5CF6 0%, #8B5CF6 20%,
            /* Violet */
            #3B82F6 20%, #3B82F6 40%,
            /* Bleu */
            #22C55E 40%, #22C55E 60%,
            /* Vert */
            #FFDB59 60%, #FFDB59 80%,
            /* Orange */
            #EF4444 80%, #EF4444 100%
            /* Rouge */
        );
}