/* Éditeur d'affiche personnalisée */

.ps-breadcrumb {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}
.ps-breadcrumb a { color: var(--text-light); text-decoration: none; }
.ps-breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.ps-breadcrumb span[aria-hidden] { margin: 0 6px; color: var(--text-muted); }

.ps-hero {
    padding: 44px 0 32px;
    background: linear-gradient(180deg, #fdf7f1 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-light);
}
.ps-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 14px;
}
.ps-h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4.4vw, 2.85rem);
    line-height: 1.14;
    color: var(--text);
    max-width: 20ch;
    margin-bottom: 18px;
}
.ps-lede {
    font-size: 1.06rem;
    line-height: 1.65;
    color: var(--text-light);
    max-width: 64ch;
    margin-bottom: 10px;
}
.ps-lede-2 {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
    max-width: 64ch;
    padding-left: 14px;
    border-left: 3px solid var(--primary);
}

/* --- Éditeur --- */
.ps-editor-wrap { padding: 36px 0 8px; }
.ps-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.ps-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
}
.ps-form-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 16px;
}
.ps-form-title + .ps-field { margin-top: 0; }
.ps-form h2.ps-form-title:not(:first-child) {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border-light);
}

.ps-field { margin-bottom: 18px; border: 0; padding: 0; }
/* Enfant DIRECT seulement : sinon cette regle ecrase le display:flex des
   labels de palette (.ps-swatch), qui sont aussi des <label> dans un .ps-field. */
.ps-field > label,
.ps-field > legend,
.ps-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    padding: 0;
}
.ps-opt { font-weight: 400; color: var(--text-muted); }
.ps-field input[type="text"],
.ps-field input[type="number"],
.ps-field select {
    width: 100%;
    padding: 11px 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.ps-field input:focus,
.ps-field select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}
.ps-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.ps-date-row {
    display: grid;
    grid-template-columns: 0.8fr 1.4fr 1fr;
    gap: 8px;
}

.ps-swatches {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.ps-swatch {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 400;
    margin: 0;
}
.ps-swatch.is-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ps-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ps-swatch-chip {
    flex: 0 0 auto;
    width: 26px;
    height: 34px;
    border-radius: 3px;
    border: 1px solid;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    padding: 3px;
}
.ps-swatch-chip i { display: block; height: 5px; border-radius: 1px; }
.ps-swatch-label { font-size: 0.82rem; color: var(--text); line-height: 1.25; }

.ps-radios { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-radio {
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}
.ps-radio.is-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ps-radio input { position: absolute; opacity: 0; width: 0; height: 0; }

.ps-submit { width: 100%; margin-top: 6px; }
/* .btn pose un display explicite, qui l'emporte sur le display:none que le
   navigateur applique a [hidden]. Sans cette regle, le bouton « Mettre a jour
   l'apercu » reste affiche alors que le JS a pris la main. */
.ps-submit[hidden] { display: none; }

/* --- Aperçu --- */
.ps-preview-sticky { position: sticky; top: 20px; }
.ps-canvas {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
    background: #fff;
    line-height: 0;
}
.ps-canvas svg { width: 100%; height: auto; display: block; }
.ps-canvas.is-loading { opacity: 0.55; transition: opacity 0.12s ease; }

.ps-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}
.ps-dl { text-align: center; }
.ps-reassure {
    margin-top: 10px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --- Contenu --- */
.ps-section { padding: 46px 0 60px; }
.ps-narrow { max-width: 720px; }
.ps-narrow h2 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    line-height: 1.25;
    color: var(--text);
    margin: 38px 0 14px;
}
.ps-narrow h2:first-child { margin-top: 0; }
.ps-narrow h3 {
    font-size: 1.05rem;
    color: var(--text);
    margin: 24px 0 8px;
}
.ps-narrow p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 14px;
}
.ps-narrow a { color: var(--primary); }

.ps-steps { padding-left: 20px; margin: 0 0 8px; }
.ps-steps li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 12px;
    padding-left: 4px;
}
.ps-steps strong, .ps-list strong { color: var(--text); }

.ps-list { list-style: none; padding: 0; margin: 0 0 8px; }
.ps-list li {
    position: relative;
    padding-left: 20px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 12px;
}
.ps-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.ps-cta-back { margin: 32px 0 22px; }
.ps-related {
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 860px) {
    .ps-editor { grid-template-columns: 1fr; gap: 28px; }
    /* L'aperçu passe AVANT le formulaire sur mobile : on doit voir ce qu'on
       fabrique sans scroller. */
    .ps-preview { order: -1; }
    .ps-preview-sticky { position: static; }
    .ps-canvas { max-width: 320px; margin: 0 auto; }
    .ps-swatches { grid-template-columns: 1fr; }
}
