/**
 * Sindesi — Base CSS (Fase 2.1 Tag D1, 16/07/2026).
 *
 * ## Ruolo
 *
 * Baseline CSS Sindesi proprietaria: normalize + typography + form + button
 * + layout + WP core support. Primo passo verso l'eliminazione di `style.css`
 * (3018 righe del framework hivetheme upstream).
 *
 * ## Strategia deploy (D1 → D3)
 *
 * **D1 (questo file, 16/07/2026)**: deploy accanto a `style.css`. Nessuna
 * rimozione. Test visivo in produzione — obiettivo zero regressioni. Se
 * `sindesi-base.css` copre correttamente uno stile, quello vince per
 * cascade (caricato dopo `style.css` via dep chain). Se manca qualcosa,
 * `style.css` fa da fallback silenzioso.
 *
 * **D2**: audit blog templates (`templates/post/*`, `comments.php`, ecc.).
 * Se `/news/`, `/karriere/` non esistono in WP → i template blog sono
 * dead → posts/tags/comments in `style.css` diventano rimuovibili.
 *
 * **D3**: rimozione `style.css` completa dopo verifica zero regressioni
 * in produzione. Tema perde 69KB CSS legacy.
 *
 * ## Cosa NON è qui
 *
 * - Selettori `.hp-*` HP forms/listings: vivono in `sindesi.css` finché HP
 *   Marketplace è attivo. Al distacco HP (Fase 3 strategica) → dead.
 * - Blog templates styling: rimandato a D2 dopo audit.
 * - Header/footer del sito: già Sindesi-native (post Tag A/B/C1/C2).
 * - Dashboard styling: vive in `sindesi-core` plugin (`assets/css/dashboard.css`).
 * - Icone: Phosphor self-hosted, separato.
 *
 * ## Design tokens
 *
 * Coerenti con `sindesi-core/assets/css/dashboard.css` — stesse variabili
 * `--sd-*` per allineamento cross-plugin.
 */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    /* Colors — palette Sindesi */
    --sd-bg:          #f5f7fa;
    --sd-panel:       #ffffff;
    --sd-border:      #e2e8f0;
    --sd-border-hover:#cbd5e1;
    --sd-text:        #1a202c;
    --sd-text-soft:   #334155;
    --sd-muted:       #64748b;
    --sd-muted-soft:  #94a3b8;
    --sd-blue:        #0280DE;
    --sd-blue-dark:   #0269b8;
    --sd-teal:        #08B4BB;
    --sd-danger:      #dc2626;
    --sd-success:     #059669;
    --sd-warning:     #d97706;

    /* Shadows */
    --sd-shadow-sm:   0 1px 3px rgba(15, 23, 42, 0.04);
    --sd-shadow:      0 4px 16px rgba(15, 23, 42, 0.06);
    --sd-shadow-lg:   0 8px 32px rgba(15, 23, 42, 0.12);

    /* Radii */
    --sd-radius:      14px;
    --sd-radius-sm:   10px;
    --sd-radius-xs:   6px;

    /* Typography — Inter con system fallback stack */
    --sd-font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                      Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue',
                      Arial, sans-serif;
    --sd-font-mono:   ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas,
                      'Liberation Mono', monospace;

    /* Layout */
    --sd-container-max: 1200px;
    --sd-container-pad: 20px;

    /* Focus ring */
    --sd-focus-ring:  0 0 0 3px rgba(2, 128, 222, 0.25);
}

/* ==========================================================================
   2. NORMALIZE (moderno, minimale)
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--sd-bg);
    color: var(--sd-text);
    font-family: var(--sd-font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Focus visible universale — accessibilità WCAG AA */
*:focus {
    outline: none;
}
*:focus-visible {
    outline: 2px solid var(--sd-blue);
    outline-offset: 2px;
    border-radius: 3px;
}

hr {
    border: 0;
    border-top: 1px solid var(--sd-border);
    margin: 24px 0;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    color: var(--sd-text);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: 2rem; }      /* 32px */
h2 { font-size: 1.5rem; }    /* 24px */
h3 { font-size: 1.25rem; }   /* 20px */
h4 { font-size: 1.125rem; }  /* 18px */
h5 { font-size: 1rem; }      /* 16px */
h6 { font-size: 0.875rem; }  /* 14px */

@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }    /* 40px */
    h2 { font-size: 1.875rem; }  /* 30px */
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--sd-blue);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover,
a:focus-visible {
    color: var(--sd-blue-dark);
    text-decoration: underline;
}

strong, b {
    font-weight: 700;
}

em, i {
    font-style: italic;
}

small {
    font-size: 0.875em;
}

code, kbd, samp, pre {
    font-family: var(--sd-font-mono);
    font-size: 0.9em;
}
code {
    background: var(--sd-bg);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-xs);
    padding: 2px 6px;
}
pre {
    background: var(--sd-bg);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-sm);
    padding: 16px;
    overflow-x: auto;
    line-height: 1.5;
}
pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

blockquote {
    margin: 1em 0;
    padding: 12px 20px;
    border-left: 3px solid var(--sd-blue);
    background: var(--sd-bg);
    color: var(--sd-text-soft);
    font-style: italic;
}

/* Lists */
ul, ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}
li {
    margin-bottom: 0.25em;
}
ul ul, ul ol, ol ul, ol ol {
    margin-bottom: 0.25em;
}

/* Selection */
::selection {
    background: rgba(2, 128, 222, 0.2);
    color: var(--sd-text);
}

/* ==========================================================================
   4. MEDIA
   ========================================================================== */

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}
img {
    vertical-align: middle;
}

figure {
    margin: 0 0 1em;
}
figcaption {
    margin-top: 8px;
    color: var(--sd-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */

button,
.btn,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--sd-radius-sm);
    background: var(--sd-blue);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
    -webkit-appearance: none;
    appearance: none;
}

button:hover,
.btn:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    background: var(--sd-blue-dark);
    color: #ffffff;
    text-decoration: none;
}

button:active,
.btn:active,
input[type="submit"]:active {
    transform: translateY(1px);
}

button:disabled,
.btn:disabled,
input[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: var(--sd-focus-ring);
}

/* Varianti .btn */
.btn--secondary {
    background: var(--sd-panel);
    border-color: var(--sd-border);
    color: var(--sd-text);
}
.btn--secondary:hover {
    border-color: var(--sd-border-hover);
    background: var(--sd-bg);
    color: var(--sd-text);
}

.btn--ghost {
    background: transparent;
    color: var(--sd-blue);
}
.btn--ghost:hover {
    background: rgba(2, 128, 222, 0.08);
    color: var(--sd-blue-dark);
}

.btn--danger {
    background: var(--sd-danger);
}
.btn--danger:hover {
    background: #b91c1c;
}

.btn--sm {
    padding: 6px 14px;
    font-size: 13px;
}
.btn--lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ==========================================================================
   6. FORMS
   ========================================================================== */

label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--sd-text);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-sm);
    background: var(--sd-panel);
    color: var(--sd-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--sd-blue);
    box-shadow: var(--sd-focus-ring);
}

input:disabled,
textarea:disabled,
select:disabled {
    background: var(--sd-bg);
    color: var(--sd-muted);
    cursor: not-allowed;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select — chevron custom */
select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 6 6 11 1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Checkbox / radio */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    accent-color: var(--sd-blue);
    cursor: pointer;
    vertical-align: middle;
}

/* Placeholder */
::placeholder {
    color: var(--sd-muted-soft);
    opacity: 1;
}

/* Fieldset */
fieldset {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}
legend {
    margin-bottom: 8px;
    padding: 0;
    color: var(--sd-text);
    font-weight: 700;
}

/* Search form (searchform.php) */
.search-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.search-form .search-field {
    flex: 1;
}

/* ==========================================================================
   7. LAYOUT
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--sd-container-max);
    margin: 0 auto;
    padding: 0 var(--sd-container-pad);
}

.container--narrow {
    max-width: 800px;
}

.container--wide {
    max-width: 1440px;
}

/* Site content wrapper */
.site-content {
    min-height: 60vh;
}

/* ==========================================================================
   8. WORDPRESS CORE SUPPORT (required per compat WP)
   ========================================================================== */

/* Alignments */
.alignleft {
    float: left;
    margin-right: 20px;
}
.alignright {
    float: right;
    margin-left: 20px;
}
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.alignwide {
    max-width: 1200px;
}
.alignfull {
    max-width: none;
    width: 100%;
}

/* Captions */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1em;
}
.wp-caption img {
    display: block;
    margin: 0 auto;
}
.wp-caption-text {
    margin-top: 8px;
    color: var(--sd-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Gallery */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 1em 0;
}
.gallery-item {
    flex: 1 1 200px;
    text-align: center;
}
.gallery-caption {
    display: block;
    margin-top: 6px;
    color: var(--sd-muted);
    font-size: 0.875rem;
}

/* Screen reader only */
.screen-reader-text,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.screen-reader-text:focus,
.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--sd-panel);
    border: 2px solid var(--sd-blue);
    border-radius: var(--sd-radius-sm);
}

/* Sticky posts */
.sticky {
    display: block;
}

/* Bypost author */
.bypostauthor {
    display: block;
}

/* ==========================================================================
   9. WORDPRESS WIDGETS (sidebar / footer widgets)
   ========================================================================== */

.widget {
    margin-bottom: 32px;
}
.widget-title {
    margin: 0 0 16px;
    color: var(--sd-text);
    font-size: 1.125rem;
    font-weight: 700;
}
.widget ul {
    padding-left: 0;
    list-style: none;
}
.widget li {
    padding: 6px 0;
    border-bottom: 1px solid var(--sd-border);
}
.widget li:last-child {
    border-bottom: 0;
}

/* ==========================================================================
   10. GUTENBERG BLOCKS BASE
   ========================================================================== */

.wp-block-image,
.wp-block-embed,
.wp-block-video,
.wp-block-audio {
    margin: 1em 0;
}

.wp-block-quote {
    margin: 1em 0;
    padding: 12px 20px;
    border-left: 3px solid var(--sd-blue);
    background: var(--sd-bg);
    color: var(--sd-text-soft);
    font-style: italic;
}
.wp-block-quote cite {
    display: block;
    margin-top: 8px;
    color: var(--sd-muted);
    font-size: 0.875rem;
    font-style: normal;
}

.wp-block-code {
    display: block;
    padding: 16px;
    background: var(--sd-bg);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-sm);
    font-family: var(--sd-font-mono);
    font-size: 0.9em;
    overflow-x: auto;
}

.wp-block-separator {
    max-width: 100px;
    margin: 32px auto;
    border-top: 2px solid var(--sd-border);
}

.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--sd-blue);
    color: #ffffff;
    border-radius: var(--sd-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s;
}
.wp-block-button__link:hover {
    background: var(--sd-blue-dark);
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================================================
   11. MODALS BASE
   ========================================================================== */

.modal,
[role="dialog"] {
    background: var(--sd-panel);
    border-radius: var(--sd-radius);
    box-shadow: var(--sd-shadow-lg);
    padding: 24px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
}

/* ==========================================================================
   12. PAGINATION
   ========================================================================== */

.pagination,
.nav-links,
.wp-pagenavi {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 32px 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}
.pagination a,
.pagination span,
.nav-links a,
.nav-links span,
.wp-pagenavi a,
.wp-pagenavi span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-sm);
    background: var(--sd-panel);
    color: var(--sd-text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pagination a:hover,
.nav-links a:hover,
.wp-pagenavi a:hover {
    border-color: var(--sd-blue);
    color: var(--sd-blue);
    text-decoration: none;
}
.pagination .current,
.nav-links .current,
.wp-pagenavi .current {
    background: var(--sd-blue);
    border-color: var(--sd-blue);
    color: #ffffff;
}

/* ==========================================================================
   13. TABLES BASE
   ========================================================================== */

table {
    width: 100%;
    margin: 0 0 1em;
    border-collapse: collapse;
}
th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--sd-border);
}
th {
    background: var(--sd-bg);
    color: var(--sd-text);
    font-weight: 700;
    font-size: 14px;
}
tbody tr:hover {
    background: rgba(2, 128, 222, 0.02);
}

/* ==========================================================================
   14. UTILITIES
   ========================================================================== */

.clear::after {
    content: '';
    display: block;
    clear: both;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-muted  { color: var(--sd-muted); }
.text-blue   { color: var(--sd-blue); }
.text-danger { color: var(--sd-danger); }
.text-success{ color: var(--sd-success); }

/* ==========================================================================
   15. PRINT
   ========================================================================== */

@media print {
    body {
        background: #ffffff;
        color: #000000;
        font-size: 12pt;
    }
    a {
        color: #000000;
        text-decoration: underline;
    }
    .no-print,
    header,
    footer,
    .sindesi-dash__sidebar {
        display: none !important;
    }
}
