/* ═══════════════════════════════════════
   O-CMS "Flavor" Theme
   Elegante, minimale, responsive
   ═══════════════════════════════════════ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #a78bfa;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255,255,255,0.06);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-light: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: rgba(0,0,0,0.08);
}
[data-theme="light"] .site-header {
    background: rgba(248,250,252,0.9);
}
[data-theme="light"] .site-logo {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text; background-clip: text;
}
[data-theme="light"] .article-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--secondary); }

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

/* ─── HEADER ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

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

.site-logo {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-nav {
    display: flex;
    gap: 32px;
}

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

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

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

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

/* ─── RICERCA HEADER ─── */
.site-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.site-search-form:focus-within {
    border-color: var(--primary);
}
.site-search-input {
    background: none;
    border: none;
    color: var(--text);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    width: 160px;
    transition: width 0.2s;
}
.site-search-input:focus {
    width: 220px;
}
.site-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}
.site-search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.site-search-btn:hover {
    color: var(--primary-light);
}

/* ─── HERO ─── */
.hero {
    padding: 100px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .content {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ─── PAGE CONTENT ─── */
.page-content {
    padding: 80px 0;
}

.page-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
}

.page-content .content {
    max-width: 720px;
}

.page-content .content h2 { font-size: 1.6rem; margin: 40px 0 16px; font-weight: 700; }
.page-content .content h3 { font-size: 1.3rem; margin: 32px 0 12px; font-weight: 600; }
.page-content .content p { margin-bottom: 16px; color: var(--text-muted); }
.page-content .content ul, .page-content .content ol { margin-bottom: 16px; padding-left: 24px; color: var(--text-muted); }
.page-content .content li { margin-bottom: 8px; }
.page-content .content blockquote {
    border-left: 3px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-style: italic;
}

.page-content .content pre {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.9rem;
}

.page-content .content code {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.875em;
}

/* ─── BUTTONS ─── */
.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.3);
    color: white;
}

/* ─── FOOTER ─── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── BLOG GRID ─── */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.article-cover {
    height: 200px;
    background-size: cover;
    background-position: center;
}
.article-body { padding: 24px; }
.article-cat {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.article-body h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.article-body h2 a { color: var(--text); }
.article-body h2 a:hover { color: var(--primary-light); }
.article-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}
.article-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 60px 0 40px; }
    .site-nav { gap: 16px; }
    .nav-link { font-size: 0.8rem; }
    .page-content h1 { font-size: 1.8rem; }
    .articles-grid { grid-template-columns: 1fr; }
}
