/* ============================================================
   ATLANTE 5.0 — Main stylesheet
   Dark theme + CSS variables per accent dinamico per-atlante
   ============================================================ */

/* Variabili — sovrascritte inline da PHP per ogni atlante */
:root {
    --accent:        #f59e0b;   /* amber (atlante arte) — default */
    --accent-dark:   #d97706;
    --bg:            #111827;
    --card:          rgba(17,24,39,0.78);
    --card-hover:    rgba(38,53,72,0.82);
    --border:        rgba(55,65,81,0.85);
    --card-blur:     0px;
    --text:          #f3f4f6;
    --muted:         #9ca3af;
    --radius:        0.5rem;
    /* Stile visivo per atlante — sovrascrivibili via inline style da PHP */
    --font-heading:  'Cormorant Garamond', Georgia, serif;
    --font-body:     'Inter', 'Segoe UI', system-ui, sans-serif;
    --bg-image:      none;
    --bg-overlay:    rgba(0,0,0,0);
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    background-image: linear-gradient(var(--bg-overlay), var(--bg-overlay)), var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.hero-title, .section-title, .card-title {
    font-family: var(--font-heading);
}

/* ── Links ──────────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: rgba(17,24,39,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 3.5rem;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: .03em;
    color: var(--accent);
    white-space: nowrap;
}

.navbar-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    flex: 1;
}

.navbar-links a {
    color: var(--muted);
    font-size: .9rem;
    padding: .25rem .5rem;
    border-radius: .375rem;
    transition: color .15s, background .15s;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--accent);
    background: rgba(255,255,255,.05);
}

.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 18%, rgba(0,0,0,.45));
    background: var(--card-hover);
}

.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--border);
}

.card-body { padding: 1rem 1.25rem 1.25rem; }
.card-title { font-size: 1.3rem; font-weight: 500; color: var(--accent); margin-bottom: .35rem; line-height: 1.2; }
.card-meta  { font-size: .8rem; color: var(--muted); }

/* ── Atlante card (homepage globale) ────────────────────────── */
.atlante-card {
    position: relative;
    cursor: pointer;
}

.atlante-card .accent-bar {
    height: 4px;
    width: 100%;
    background: var(--card-accent, #f59e0b);
}

.atlante-card .badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--card-accent, #f59e0b) 20%, transparent);
    color: var(--card-accent, #f59e0b);
    border: 1px solid color-mix(in srgb, var(--card-accent, #f59e0b) 40%, transparent);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
    padding: 5rem 1.5rem 4rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.75rem, 7vw, 5rem);
    font-weight: 400;
    letter-spacing: -.01em;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    font-family: var(--font-body);
    font-weight: 400;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: .5rem;
    font-weight: 600;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s, opacity .15s;
    text-decoration: none;
}

.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--accent);
    color: #111827;
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #111827;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: rgba(255,255,255,.05);
    color: var(--text);
}

.btn-ghost:hover { background: rgba(255,255,255,.1); }

/* ── Grid layouts ───────────────────────────────────────────── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

/* ── Container ──────────────────────────────────────────────── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 3rem 0; }

.section-title {
    font-size: 1.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    margin-top: 4rem;
}
/* I link del footer restano discreti: sono servizio, non contenuto. */
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--text); }

/* ── Utility ────────────────────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--muted); }
.text-center  { text-align: center; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded-full { border-radius: 9999px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .navbar-links { display: none; }
    .hero { padding: 3rem 1rem 2rem; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
