/*
 * Ex-libris typographique (Phase 6.E)
 * 4 presets générés entièrement en CSS — pas d'image serveur.
 * Rapport 3:4 (portrait, comme un vrai livre).
 */

:root {
    --ex-ratio: 75%; /* largeur/hauteur = 3/4 => paddingTop 133%, ou juste aspect-ratio */
}

.ex-libris {
    aspect-ratio: 3 / 4;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18),
                0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    font-family: 'Cormorant Garamond', 'Garamond', serif;
    container-type: inline-size;
}

.ex-libris.ex-libris-grande {
    width: 100%;
    max-width: 360px;
}
.ex-libris.ex-libris-petite {
    width: 140px;
}

.ex-libris-cadre {
    width: 86%;
    height: 86%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3cqw;
    box-sizing: border-box;
}

.ex-libris-ornement-haut,
.ex-libris-ornement-bas {
    font-size: 7.5cqw;
    line-height: 1;
    margin: 1.5cqw 0;
    opacity: 0.85;
}

.ex-libris-titre {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    margin: 3cqw 0;
    line-height: 1.15;
    letter-spacing: 0.02em;
    word-wrap: break-word;
    font-size: 8.5cqw;
}
.ex-libris-titre.titre-sm { font-size: 6.5cqw; }
.ex-libris-titre.titre-xs { font-size: 5cqw; }

.ex-libris-sous-titre {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    margin-top: -1cqw;
    margin-bottom: 2cqw;
    opacity: 0.85;
    font-size: 4.5cqw;
}

.ex-libris-separateur {
    margin: 2cqw 0;
    opacity: 0.55;
    letter-spacing: 0.25em;
    font-size: 4cqw;
}

.ex-libris-auteur {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2cqw;
    font-size: 4.5cqw;
}
.ex-libris-auteur.auteur-sm { font-size: 3.5cqw; }

/* ----------------------------------------------------------------------
 * Preset : PARCHEMIN
 *   Fond beige vieilli, encre brune, ornements dorés, bordure fine.
 * ---------------------------------------------------------------------- */
.ex-libris-parchemin {
    background:
        radial-gradient(circle at 30% 20%, rgba(214, 180, 110, 0.18), transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(140, 95, 40, 0.12), transparent 55%),
        linear-gradient(135deg, #f5e6c4 0%, #ead4a0 100%);
    color: #3d2e1a;
}
.ex-libris-parchemin .ex-libris-cadre {
    border: 1px solid rgba(155, 122, 43, 0.6);
    outline: 1px solid rgba(155, 122, 43, 0.3);
    outline-offset: 3px;
}
.ex-libris-parchemin .ex-libris-ornement-haut,
.ex-libris-parchemin .ex-libris-ornement-bas,
.ex-libris-parchemin .ex-libris-separateur {
    color: #9b7a2b;
}
.ex-libris-parchemin .ex-libris-sous-titre { color: #5a4426; }
.ex-libris-parchemin .ex-libris-auteur { color: #6b4f1a; }

/* ----------------------------------------------------------------------
 * Preset : CUIR
 *   Fond cuir bordeaux foncé, or gravé, croix templière.
 * ---------------------------------------------------------------------- */
.ex-libris-cuir {
    background:
        radial-gradient(circle at 25% 30%, rgba(155, 40, 40, 0.25), transparent 55%),
        radial-gradient(circle at 75% 70%, rgba(40, 15, 15, 0.35), transparent 55%),
        linear-gradient(145deg, #4a1a1a 0%, #2a0e0e 100%);
    color: #d8b668;
}
.ex-libris-cuir .ex-libris-cadre {
    border: 2px double rgba(216, 182, 104, 0.5);
}
.ex-libris-cuir .ex-libris-ornement-haut,
.ex-libris-cuir .ex-libris-ornement-bas {
    color: #c9a254;
    text-shadow: 0 0 8px rgba(201, 162, 84, 0.4);
}
.ex-libris-cuir .ex-libris-titre {
    color: #e7c880;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.ex-libris-cuir .ex-libris-sous-titre { color: #a68a4e; }
.ex-libris-cuir .ex-libris-separateur { color: #8a6c2e; }
.ex-libris-cuir .ex-libris-auteur {
    color: #d8b668;
    /* pas de letter-spacing accru : risque de wrap sur les petites vignettes */
}

/* ----------------------------------------------------------------------
 * Preset : MARBRE
 *   Fond marbre blanc/gris, encre noire gravée, ornements méandre grec.
 * ---------------------------------------------------------------------- */
.ex-libris-marbre {
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 120, 120, 0.08), transparent 55%),
        radial-gradient(circle at 80% 30%, rgba(100, 100, 100, 0.1), transparent 55%),
        linear-gradient(120deg, #f5f2ec 0%, #e5e0d4 45%, #f0ebde 80%);
    color: #1a1a1a;
}
.ex-libris-marbre .ex-libris-cadre {
    border: 1px solid #2a2a2a;
    outline: 1px solid rgba(42, 42, 42, 0.25);
    outline-offset: 5px;
}
.ex-libris-marbre .ex-libris-ornement-haut,
.ex-libris-marbre .ex-libris-ornement-bas {
    color: #2a2a2a;
}
.ex-libris-marbre .ex-libris-titre {
    color: #0d0d0d;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
}
.ex-libris-marbre .ex-libris-sous-titre { color: #555; }
.ex-libris-marbre .ex-libris-separateur { color: #666; }
.ex-libris-marbre .ex-libris-auteur { color: #2a2a2a; }

/* ----------------------------------------------------------------------
 * Preset : JARDIN
 *   Fond papier verdâtre, ornements floraux, ton mousse/sauge.
 * ---------------------------------------------------------------------- */
.ex-libris-jardin {
    background:
        radial-gradient(circle at 20% 20%, rgba(140, 180, 130, 0.22), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(90, 130, 85, 0.15), transparent 55%),
        linear-gradient(140deg, #e8eedc 0%, #d2dfb8 100%);
    color: #2e3d22;
}
.ex-libris-jardin .ex-libris-cadre {
    border: 1px solid rgba(90, 130, 85, 0.7);
    outline: 1px dashed rgba(90, 130, 85, 0.35);
    outline-offset: 4px;
}
.ex-libris-jardin .ex-libris-ornement-haut,
.ex-libris-jardin .ex-libris-ornement-bas {
    color: #4a7a3a;
}
.ex-libris-jardin .ex-libris-titre { color: #1f2e17; }
.ex-libris-jardin .ex-libris-sous-titre { color: #4a6535; }
.ex-libris-jardin .ex-libris-separateur { color: #5a824a; }
.ex-libris-jardin .ex-libris-auteur { color: #345226; }

/* ----------------------------------------------------------------------
 * Vignette de selection dans la modale de publication (Phase 6.E)
 * ---------------------------------------------------------------------- */
.pub-cov-preset-vignette {
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 150ms ease, transform 150ms ease;
}
.pub-cov-preset-vignette:hover {
    border-color: rgba(155, 122, 43, 0.35);
    transform: translateY(-2px);
}
.pub-cov-preset-vignette.actif {
    border-color: #9b7a2b;
    background: rgba(155, 122, 43, 0.08);
}
.pub-cov-preset-vignette.actif::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 8px;
    color: #9b7a2b;
    font-size: 1.2rem;
    font-weight: 600;
    background: #fdfbf5;
    border-radius: 50%;
    width: 1.4em;
    height: 1.4em;
    line-height: 1.4em;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
