/* SP Démarches – Styles publics
   Compatible WordPress + Divi + tous les thèmes
   ================================================ */

/* Reset de base pour isoler le plugin */
.spd-wrapper {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    max-width: 960px;
    margin: 0 auto;
}

.spd-wrapper *,
.spd-wrapper *::before,
.spd-wrapper *::after {
    box-sizing: inherit;
}

/* ---- En-tête ---- */
.spd-header {
    background: #f8f9fb;
    border-left: 4px solid #003189;
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 0 6px 6px 0;
}

.spd-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.spd-logo-sp img {
    max-width: 120px;
    height: auto;
}

.spd-titre {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a1a;
}

.spd-sous-titre {
    font-size: 1em;
    color: #555;
    margin: 0;
}

/* ---- Barre de recherche ---- */
.spd-search-bar {
    display: flex;
    gap: 8px;
}

.spd-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.spd-search-input:focus {
    border-color: #003189;
}

.spd-search-btn {
    padding: 10px 20px;
    background: #003189;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.spd-search-btn:hover {
    opacity: 0.88;
}

.spd-search-results {
    margin-top: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.spd-search-results[hidden] { display: none; }

.spd-search-result-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.spd-search-result-item:last-child { border-bottom: none; }
.spd-search-result-item:hover { background: #f0f4ff; }

.spd-search-result-item strong {
    display: block;
    font-weight: 600;
    color: #003189;
}

.spd-search-result-item span {
    font-size: 13px;
    color: #666;
}

/* ---- Onglets de catégorie ---- */
.spd-category-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 24px;
}

.spd-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.spd-tab:hover { color: #003189; }
.spd-tab.active { font-weight: 700; }

/* ---- Grille de thèmes ---- */
.spd-themes-grid {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.spd-theme-card {
    margin: 0;
}

.spd-theme-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.spd-theme-link:hover {
    border-color: var(--spd-accent, #003189);
    box-shadow: 0 2px 8px rgba(0, 49, 137, 0.12);
    color: var(--spd-accent, #003189);
}

.spd-theme-icon {
    font-size: 10px;
    color: var(--spd-accent, #003189);
    flex-shrink: 0;
}

/* ---- Fiche ---- */
.spd-breadcrumb {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

.spd-breadcrumb a {
    color: #003189;
    text-decoration: none;
}

.spd-breadcrumb a:hover { text-decoration: underline; }

.spd-fiche-titre {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.3;
}

.spd-introduction {
    background: #f8f9fb;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 24px;
}

/* ---- Situations (onglets) ---- */
.spd-situation {
    margin-bottom: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.spd-situation-titre {
    background: #003189;
    color: #fff;
    padding: 12px 20px;
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
}

.spd-situation > *:not(.spd-situation-titre) {
    padding: 16px 20px;
}

/* ---- Paragraphes et listes ---- */
.spd-para {
    margin: 0 0 14px;
}

.spd-liste {
    margin: 0 0 14px;
    padding-left: 24px;
}

.spd-liste li {
    margin-bottom: 6px;
}

/* ---- Tableau ---- */
.spd-tableau-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
}

.spd-tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.spd-tableau th {
    background: #f0f4ff;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border: 1px solid #ddd;
}

.spd-tableau td {
    padding: 9px 14px;
    border: 1px solid #e8e8e8;
}

.spd-tableau tr:nth-child(even) td {
    background: #fafafa;
}

/* ---- Alertes ---- */
.spd-attention,
.spd-anoter {
    border-radius: 6px;
    padding: 14px 16px;
    margin: 14px 0;
}

.spd-attention {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
}

.spd-anoter {
    background: #e8f5e9;
    border-left: 4px solid #43a047;
}

.spd-attention strong,
.spd-anoter strong {
    display: block;
    margin-bottom: 6px;
}

/* ---- Services en ligne ---- */
.spd-teleservices {
    background: #f0f4ff;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 20px 0;
}

.spd-teleservices h3 { margin-top: 0; }

.spd-teleservices ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spd-btn-service {
    display: inline-block;
    padding: 10px 18px;
    background: #003189;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.spd-btn-service:hover { opacity: 0.85; }

/* ---- Informations locales ---- */
.spd-local-info {
    background: #f0f8ff;
    border-left: 4px solid #003189;
    padding: 20px 24px;
    border-radius: 0 6px 6px 0;
    margin: 24px 0;
}

.spd-local-titre {
    margin-top: 0;
    font-size: 1.1em;
}

.spd-organisme {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d0e4f7;
}

.spd-organisme:last-of-type { border-bottom: none; }

.spd-local-link { margin-top: 12px; }

.spd-local-link a {
    color: #003189;
    font-weight: 500;
}

/* ---- Mentions légales ---- */
.spd-footer-legal {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    font-size: 13px;
    color: #888;
}

.spd-footer-legal a { color: #003189; }

/* ---- Notices ---- */
.spd-notice-setup,
.spd-error {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 20px;
}

.spd-notice { color: #666; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .spd-header-inner { flex-direction: column; align-items: flex-start; }
    .spd-search-bar { flex-direction: column; }
    .spd-themes-grid { grid-template-columns: 1fr; }
    .spd-category-tabs { overflow-x: auto; }
    .spd-tab { padding: 8px 14px; font-size: 14px; }
    .spd-fiche-titre { font-size: 1.4em; }
}
