/*
 * Luminescenza Madagascar — Main Stylesheet
 * Design System: Raw Luxury Geometry
 */

/* ========== IMPORT FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,opsz,wght@0,5..72,400;0,5..72,500;0,5..72,600;0,5..72,700;1,5..72,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
    --color-bg: #F7F2EB;
    --color-fg: #142319;
    --color-primary: #142319;
    --color-secondary: #A3472E;
    --color-accent: #D4AF37;
    --color-muted: #E8E2D8;
    --color-card: #FFFFFF;
    --color-border: #E0D6C8;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', system-ui, sans-serif;

    --max-width: 1400px;
    --header-height: 80px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-fg);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* ========== UTILITIES ========== */
.tracking-label {
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.text-balance { text-wrap: balance; }

.golden-thread {
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.glass-panel {
    background: rgba(247, 242, 235, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ========== LAYOUT ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .container { padding: 0 48px; }
}

/* ========== SCROLLBAR ========== */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ========== ANIMATIONS ========== */
@keyframes fade-rise {
    from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.animate-fade-rise {
    animation: fade-rise 0.8s ease-out forwards;
}

@keyframes draw-line {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ========== GHOST NAVBAR ========== */
.site-header {
    height: var(--header-height);
}

.site-header.is-scrolled {
    background: var(--color-bg);
    box-shadow: 0 1px 0 rgba(20, 35, 25, 0.08);
    color: var(--color-fg);
}

.site-header:not(.is-scrolled) {
    background: transparent;
    color: #F7F2EB;
}

/* ========== HERO ========== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.hero-section .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-section .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,35,25,1) 0%, rgba(20,35,25,0.6) 40%, rgba(20,35,25,0.3) 100%);
}

/* ========== CARDS ========== */
.card-image-zoom {
    overflow: hidden;
}

.card-image-zoom img {
    transition: transform 700ms ease-out;
}

.card-image-zoom:hover img {
    transform: scale(1.05);
}

.card-aspect-4-5 {
    aspect-ratio: 4/5;
}

.card-aspect-3-4 {
    aspect-ratio: 3/4;
}

/* ========== DIFFICULTY BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 3px 10px;
    border: 1px solid;
}

.badge-facile { border-color: var(--color-accent); color: var(--color-accent); }
.badge-moderato { border-color: var(--color-accent); color: var(--color-accent); }
.badge-avventuroso { border-color: var(--color-secondary); color: var(--color-secondary); }
.badge-esperto { border-color: var(--color-secondary); color: var(--color-secondary); }

/* ========== TACCUINO FLOATING BADGE ========== */
#taccuino-badge {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
}

.taccuino-badge-desktop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--color-accent);
    color: var(--color-fg);
    padding: 14px 8px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: background 300ms;
    user-select: none;
}

.taccuino-badge-desktop:hover {
    background: #c5a030;
}

.taccuino-badge-desktop .badge-days {
    font-family: var(--font-heading);
    font-size: 28px;
    writing-mode: horizontal-tb;
    line-height: 1;
}

.taccuino-badge-desktop .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-fg);
    animation: pulse-dot 2s infinite;
}

/* Mobile FAB */
.taccuino-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 45;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-fg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    border: none;
}

.taccuino-fab .fab-days {
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1;
}

.taccuino-fab .fab-label {
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .taccuino-badge-desktop { display: none; }
    .taccuino-fab { display: flex; }
}

/* ========== LEAFLET OVERRIDES ========== */
.leaflet-container {
    background: #1a2820 !important;
    font-family: var(--font-body) !important;
}
.leaflet-control-attribution { display: none !important; }
.leaflet-popup-content-wrapper {
    background: #142319 !important;
    color: #F7F2EB !important;
    border-radius: 2px !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}
.leaflet-popup-tip { background: #142319 !important; }
.leaflet-popup-content { margin: 12px 16px !important; }

/* ========== WIZARD STEPS ========== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 60px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 14px;
    transition: all 300ms;
}

.wizard-step.active .wizard-step-number {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-fg);
}

.wizard-step.done .wizard-step-number {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-fg);
}

.wizard-step.pending .wizard-step-number {
    border-color: rgba(247, 242, 235, 0.2);
    color: rgba(247, 242, 235, 0.3);
}

.wizard-step-label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wizard-step.active .wizard-step-label { color: #F7F2EB; }
.wizard-step.pending .wizard-step-label { color: rgba(247, 242, 235, 0.3); }

.wizard-connector {
    width: 40px;
    height: 1px;
    background: rgba(247, 242, 235, 0.15);
    margin: 0 8px;
}

.wizard-connector.done {
    background: var(--color-accent);
}

/* ========== TABLES / FORMS ========== */
input, select, textarea {
    font-family: var(--font-body);
    font-size: 14px;
}

/* ========== PROSE ========== */
.prose p { margin-bottom: 1.2em; }
.prose h2, .prose h3 { font-family: var(--font-heading); margin-top: 1.5em; margin-bottom: 0.5em; }
.prose ul { list-style: disc; padding-left: 1.5em; }
.prose li { margin-bottom: 0.3em; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body { font-size: 16px; }
    .hero-section { min-height: 90vh; }
}
