/* ConcordatoFacile.it — Policy unificata
   Minimal dark theme with purple accent (#7E57C2) */

:root {
    --bg: #121212;
    --bg-elevated: #1e1e1e;
    --bg-subtle: #181818;
    --text: #e4e4e4;
    --text-strong: #f5f5f5;
    --text-muted: #9a9a9a;
    --border: #2a2a2a;
    --accent: #C9B8E8;
    --max-width: 760px;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.25rem 5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-strong);
    letter-spacing: -0.01em;
    scroll-margin-top: 1rem;
}

h1 {
    font-size: 1.85rem;
    text-align: center;
    margin-top: 0.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent);
}

h2 {
    font-size: 1.45rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    margin-top: 3rem;
}

h3 {
    font-size: 1.2rem;
    color: var(--accent);
}

h4 {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
}

p {
    margin: 0.8rem 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

a:hover,
a:focus {
    border-bottom-color: var(--accent);
    outline: none;
}

ul, ol {
    margin: 0.6rem 0 0.9rem;
    padding-left: 1.5rem;
}

li {
    margin: 0.3rem 0;
}

li > p {
    margin: 0.3rem 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
    background: var(--bg-elevated);
}

code {
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Consolas, Menlo, monospace;
    font-size: 0.9em;
    background: var(--bg-elevated);
    color: var(--accent);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

pre {
    overflow-x: auto;
    background: var(--bg-elevated);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

pre code {
    background: transparent;
    color: var(--text);
    padding: 0;
}

strong {
    font-weight: 600;
    color: var(--text-strong);
}

em {
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.94rem;
    display: block;
    overflow-x: auto;
}

table thead {
    background: var(--bg-elevated);
}

table th,
table td {
    border: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

table th {
    font-weight: 600;
    color: var(--text-strong);
}

table tbody tr:nth-child(even) {
    background: var(--bg-subtle);
}

/* Text selection uses the accent */
::selection {
    background: var(--accent);
    color: #fff;
}
::-moz-selection {
    background: var(--accent);
    color: #fff;
}

/* Scrollbar (dark) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Mobile */
@media (max-width: 600px) {
    body {
        font-size: 15px;
    }
    main {
        padding: 1.5rem 1rem 3rem;
    }
    h1 {
        font-size: 1.55rem;
    }
    h2 {
        font-size: 1.25rem;
    }
    h3 {
        font-size: 1.1rem;
    }
    table {
        font-size: 0.88rem;
    }
}

/* Print: invert to light for paper */
@media print {
    :root {
        --bg: #ffffff;
        --bg-elevated: #f5f5f5;
        --bg-subtle: #fafafa;
        --text: #111;
        --text-strong: #000;
        --text-muted: #444;
        --border: #ccc;
    }
    body {
        font-size: 11pt;
    }
    main {
        max-width: none;
        padding: 0;
    }
    h1, h2, h3 {
        page-break-after: avoid;
    }
    table, blockquote, pre {
        page-break-inside: avoid;
    }
    a {
        color: #000;
    }
}
