/* ═══════════════════════════════════════════════════════════
   vo-cultes.css — Page CRUD des cultes et religions
   ═══════════════════════════════════════════════════════════ */

/* ─── Sticky header ─── */
.clt-sticky-header { position: sticky; top: 60px; z-index: 50; background: #f9f9f9; padding: 10px 16px; border-bottom: 1px solid #ddd; }
.clt-filtres { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clt-recherche-wrap { position: relative; flex: 1 1 200px; min-width: 150px; }
.clt-recherche-wrap input { width: 100%; padding: 6px 28px 6px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.92em; }
.clt-recherche-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 1.2em; color: #999; cursor: pointer; }
.clt-toggle-label { display: flex; align-items: center; gap: 6px; font-size: 0.85em; cursor: pointer; white-space: nowrap; }
.clt-toggle { width: 36px; height: 20px; border-radius: 10px; background: #ccc; position: relative; transition: background 0.2s; }
.clt-toggle-knob { width: 16px; height: 16px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: left 0.2s; }
.clt-toggle-on { background: #1976d2; }
.clt-toggle-on .clt-toggle-knob { left: 18px; }
.btn-nouveau { background: #1976d2; color: #fff; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.88em; white-space: nowrap; }
.btn-nouveau:hover { background: #1565c0; }

/* ─── Liste de cartes ─── */
#clt-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 16px; }
.clt-card { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 14px; cursor: pointer; transition: box-shadow 0.15s; }
.clt-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.clt-card-head { display: flex; align-items: center; gap: 8px; }
.clt-card-nom { font-weight: 600; font-size: 1.05em; }
.clt-card-dogmes { font-size: 0.82em; color: #666; }
.clt-card-desc { font-size: 0.85em; color: #444; margin-top: 6px; max-height: 60px; overflow: hidden; }
.clt-card-hidden { opacity: 0.5; }
.clt-card-badge { font-size: 0.72em; padding: 1px 6px; border-radius: 4px; background: #e0e0e0; color: #555; }
.clt-card-badge-hidden { background: #ffcdd2; color: #c62828; }

/* ─── Popup détail ─── */
.clt-popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.clt-popup-box { background: #fff; border-radius: 12px; max-width: 800px; width: 100%; padding: 24px; position: relative; }
.clt-popup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.clt-popup-header strong { font-size: 1.3em; }
.clt-popup-fermer { background: none; border: none; font-size: 1.6em; cursor: pointer; color: #666; }

/* ─── Infos texte ─── */
.clt-popup-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 16px; }
.clt-popup-info-item { display: flex; flex-direction: column; gap: 2px; }
.clt-popup-info-item.full-width { grid-column: 1 / -1; }
.clt-popup-info-label { font-size: 0.78em; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.clt-popup-info-val { font-size: 0.92em; }
.edit-btn-inline { background: none; border: none; cursor: pointer; font-size: 0.85em; padding: 0 3px; vertical-align: middle; }

/* Texte long rétractable */
.clt-texte-long { max-height: 100px; overflow: hidden; position: relative; transition: max-height 0.3s; }
.clt-texte-long.expanded { max-height: none; }
.clt-texte-toggle { background: none; border: none; color: #1976d2; cursor: pointer; font-size: 0.82em; padding: 2px 0; }

/* Markdown */
.clt-popup-md p, .clt-popup-md ul, .clt-popup-md ol { margin: 4px 0; }
.clt-popup-md li { margin-left: 16px; }

/* ─── Section sorts connus ─── */
.clt-sorts-section { margin-top: 16px; border-top: 1px solid #eee; padding-top: 12px; }
.clt-sorts-section h4 { margin: 0 0 10px; font-size: 1em; }
.clt-sort-group { margin: 8px 0; padding: 8px; border-left: 3px solid #8e24aa; background: #faf5ff; border-radius: 0 6px 6px 0; }
.clt-sort-group strong { font-size: 0.88em; color: #555; }
.clt-sort-item { display: inline-block; margin: 2px 4px; padding: 2px 8px; background: #f3e5f5; border-radius: 4px; font-size: 0.85em; }
.clt-sort-ou { color: #888; font-size: 0.8em; font-style: italic; }

/* ─── Editeur overlay ─── */
.clt-form-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.clt-editor-card { background: #fff; border-radius: 12px; max-width: 800px; width: 100%; padding: 20px; }
.clt-editor-card h3 { margin-top: 0; }
.clt-editor-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-bottom: 1px solid #f0f0f0; font-size: 0.9em; }
.clt-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.clt-form-group { display: flex; flex-direction: column; flex: 1 1 120px; }
.clt-form-group label { font-size: 0.78em; color: #555; margin-bottom: 2px; }
.clt-form-group input, .clt-form-group select, .clt-form-group textarea { padding: 4px 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9em; }
.clt-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.btn-cancel-clt { background: #eee; border: none; padding: 6px 16px; border-radius: 6px; cursor: pointer; }
.btn-save-clt { background: #1976d2; color: #fff; border: none; padding: 6px 16px; border-radius: 6px; cursor: pointer; }
.btn-save-clt:hover { background: #1565c0; }
.btn-remove { background: none; border: none; color: #c62828; cursor: pointer; font-size: 1.1em; padding: 0 2px; }
.btn-add-sort { background: #43a047; color: #fff; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.88em; }
.btn-admin-action { background: #e3f2fd; border: 1px solid #90caf9; border-radius: 4px; padding: 3px 8px; font-size: 0.78em; cursor: pointer; color: #1565c0; }

/* ─── Toaster ─── */
.clt-toaster { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 24px; border-radius: 8px; z-index: 9999; font-size: 0.9em; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.clt-toaster.show { opacity: 1; }

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .clt-popup-infos { grid-template-columns: 1fr; }
    #clt-liste { grid-template-columns: 1fr; }
    .clt-popup-box { padding: 16px; }
}
