/* ============================================================================
   S-Editions — Design System
   ============================================================================ */

/* ---- Variables ---- */
:root {
    --color-primary: #1a4ed8;
    --color-primary-dark: #1238a3;
    --color-accent: #b96900;
    --color-accent-light: #fff5e6;
    /* Or de la marque — repris du hero comme accent décoratif récurrent
       (fil d'identité sous les titres). Le bleu reste la couleur d'action. */
    --color-gold: #d4af37;
    --color-gold-soft: #f0d573;
    --color-text: #1a1f2e;
    --color-text-light: #6b7280;
    --color-text-muted: #9ca3af;
    --color-bg: #ffffff;
    --color-bg-alt: #fafafa;
    --color-bg-tinted: #f6f9ff;
    --color-border: #e5e7eb;
    --color-border-light: #f0f0f0;
    --color-success-bg: #e6f9ed;
    --color-success-text: #0a6b3a;
    --color-success-border: #b7e4c7;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 6px 18px rgba(0,0,0,0.10);

    --container-max: 1100px;
    --container-narrow: 760px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    color: var(--color-text);
}

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ---- Layout ---- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1rem; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 1rem; }

/* ============================================================================
   HEADER
   ============================================================================ */
.site-header {
    background: white;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    height: 64px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-text);
    line-height: 1;
}
.site-logo img {
    display: block;
    height: 44px;
    width: auto;
}
.site-footer .site-logo img { height: 56px; }

.site-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
    color: var(--color-text-light);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--color-bg-tinted); color: var(--color-primary); }
.site-nav a.active { color: var(--color-primary); background: var(--color-bg-tinted); }

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer {
    margin-top: 5rem;
    padding: 2.5rem 0 1.5rem;
    background: #fafafa;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.site-footer__cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 720px) {
    .site-footer__cols { grid-template-columns: 1fr 1fr; }
}

.site-footer h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin: 0 0 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--color-text-light); text-decoration: none; }
.site-footer a:hover { color: var(--color-primary); }
.site-footer__bottom {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    border: 0;
    line-height: 1;
    transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); color: white; }

.btn-outline { background: white; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-bg-tinted); color: var(--color-primary); }

.btn-ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-bg-alt); }

.btn-block { display: flex; width: 100%; justify-content: center; }

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover {
    border-color: #ccd1d9;
    box-shadow: var(--shadow);
}

/* ---- Book card with cover ---- */
/* Flex column pour aligner le bas (prix/date) sur toutes les cartes d'une même
   rangée, quelle que soit la longueur du titre. */
a.book-card { display: flex; flex-direction: column; }
.book-card { padding: 0; overflow: hidden; }
.book-card__cover {
    aspect-ratio: 3 / 4;
    /* Fallback subtil si l'image ne charge pas — bleu marine + texture or */
    background-color: #152647;
    background-image: linear-gradient(135deg, #152647 0%, #0f1d3d 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 0.6rem;
}
.book-card__cover-badges {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 0.4rem;
}

/* ---- Placeholder "Couverture à venir" pour les cartes ---- */
.book-card__cover--missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.7);
    background:
        radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.10) 0%, transparent 60%),
        linear-gradient(135deg, #152647 0%, #0f1d3d 100%);
}
.book-card__cover--missing .book-card__cover-badges {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
}
.book-card__cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}
.book-card__cover-placeholder svg {
    width: 36px;
    height: 36px;
    opacity: 0.45;
}
.book-card__cover-placeholder span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    opacity: 0.85;
}
.book-card__body { padding: 0.85rem 1rem; display: flex; flex-direction: column; flex: 1 1 auto; }
.book-card__collection {
    font-size: 0.7rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.book-card__title {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--color-text);
}
.book-card__subtitle {
    color: var(--color-text-light);
    font-size: 0.84rem;
    margin: 0.4rem 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card__meta {
    margin-top: auto;
    padding-top: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-light);
    font-size: 0.82rem;
}
.book-card__price { font-weight: 600; color: var(--color-text); }

/* ---- Collection card ---- */
.collection-card { padding: 1.25rem; }
.collection-card__logo {
    aspect-ratio: 3 / 2;
    background:
        radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, #e8edff 0%, #f0eee5 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--radius-sm);
    margin: -1.25rem -1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c4a8c;
    overflow: hidden;
}
.collection-card__logo svg {
    width: 48px;
    height: 48px;
    opacity: 0.6;
}
.collection-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================================
   BADGES
   ============================================================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.badge-blue { background: var(--color-bg-tinted); color: var(--color-primary); }
.badge-orange { background: var(--color-accent-light); color: var(--color-accent); }
.badge-gray { background: var(--color-bg-alt); color: var(--color-text-light); }

/* ============================================================================
   GRIDS
   ============================================================================ */
.grid-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}
.grid-collections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */
.pagination { margin-top: 2rem; display: flex; gap: 0.4rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination strong {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}
.pagination a { border: 1px solid var(--color-border); color: var(--color-text); background: white; }
.pagination a:hover { background: var(--color-bg-alt); border-color: #ccd1d9; }
.pagination strong { background: var(--color-primary); color: white; }
.pagination__info { margin-left: 0.75rem; color: var(--color-text-light); font-size: 0.85rem; }

/* ============================================================================
   FORMS
   ============================================================================ */
/* Styles de formulaire — appliqués UNIQUEMENT sur les pages publiques
   identifiées par la classe `.container` ou `.container-narrow` sur le <main>.
   EasyAdmin utilise <main class="content"> et n'est donc pas affecté. */
:is(main.container, main.container-narrow) :is(input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], textarea, select) {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    background: white;
}
:is(main.container, main.container-narrow) :is(input, textarea, select):focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
    border-color: var(--color-primary);
}
:is(main.container, main.container-narrow) label {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--color-text);
    display: block;
    margin-bottom: 0.3rem;
}

/* ============================================================================
   HERO (page d'accueil)
   ============================================================================ */
.hero {
    position: relative;
    overflow: hidden;
    /* Bleu marine sobre, dégradé très subtil pour donner de la profondeur */
    background:
        radial-gradient(circle at 20% 0%, rgba(212, 175, 55, 0.10) 0%, transparent 50%),
        linear-gradient(180deg, #0f1d3d 0%, #152647 100%);
    color: white;
    padding: 4.5rem 1rem 4rem;
}

.hero__orbs { position: absolute; inset: 0; pointer-events: none; }
.hero__orb {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
}
/* Or chaud en haut à gauche, bleu profond en bas à droite — très discret */
.hero__orb--accent { background: #d4af37; top: -150px; left: -100px; }
.hero__orb--pink   { background: #4a6fb5; bottom: -150px; right: -120px; opacity: 0.25; }

.hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    z-index: 1;
}
.hero__text { max-width: 540px; }

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
    margin-bottom: 1.5rem;
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem;
    color: white;
}
.hero__title-accent {
    background: linear-gradient(90deg, #f0d573 0%, #d4af37 60%, #b8941f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 1.15rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.92);
    margin: 0 0 2rem;
}
.hero__subtitle strong { color: white; }

.hero__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.hero__btn {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.hero__btn--primary {
    background: linear-gradient(135deg, #f0d573 0%, #d4af37 100%);
    color: #0f1d3d;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.30);
}
.hero__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.40);
    color: #0f1d3d;
}
.hero__btn--ghost {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    backdrop-filter: blur(10px);
}
.hero__btn--ghost:hover {
    background: rgba(255,255,255,0.20);
    color: white;
}

.hero__stats {
    display: flex;
    gap: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.hero__stats > div { display: flex; flex-direction: column; }
.hero__stats strong {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    color: white;
    letter-spacing: -0.01em;
}
.hero__stats-plus { color: #d4af37; margin-left: 0.1rem; font-weight: 700; }
.hero__stats small {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    margin-top: 0.15rem;
}

/* ---- Pile de 3 livres en perspective ---- */
.hero__books {
    position: relative;
    height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero__book {
    position: absolute;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    background-color: rgba(255,255,255,0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow:
        0 30px 60px rgba(0,0,0,0.35),
        0 10px 20px rgba(0,0,0,0.25);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}
.hero__book--center {
    width: 230px;
    z-index: 3;
    transform: rotate(2deg) translateY(-10px);
}
.hero__book--center:hover { transform: rotate(0deg) translateY(-25px) scale(1.04); }

.hero__book--left {
    width: 195px;
    z-index: 2;
    transform: rotate(-10deg) translateX(-110px) translateY(20px);
    opacity: 0.92;
}
.hero__book--left:hover { transform: rotate(-6deg) translateX(-110px) translateY(0); opacity: 1; }

.hero__book--right {
    width: 195px;
    z-index: 2;
    transform: rotate(10deg) translateX(110px) translateY(20px);
    opacity: 0.92;
}
.hero__book--right:hover { transform: rotate(6deg) translateX(110px) translateY(0); opacity: 1; }

@media (max-width: 900px) {
    .hero { padding: 3rem 1rem 3.5rem; }
    .hero__inner { grid-template-columns: 1fr; gap: 2rem; }
    .hero__title { font-size: 2.3rem; }
    .hero__books { height: 320px; }
    .hero__book--center { width: 175px; }
    .hero__book--left { width: 145px; transform: rotate(-10deg) translateX(-80px) translateY(15px); }
    .hero__book--right { width: 145px; transform: rotate(10deg) translateX(80px) translateY(15px); }
    .hero__stats { gap: 1.25rem; flex-wrap: wrap; }
    .hero__stats strong { font-size: 1.35rem; }
}

/* ============================================================================
   ANIMATIONS — entrée discrète, pas envahissant
   ============================================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hero : cascade subtile à l'arrivée */
.hero__badge,
.hero__title,
.hero__subtitle,
.hero__cta,
.hero__stats {
    animation: fadeInUp 0.65s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.hero__badge    { animation-delay: 0.05s; }
.hero__title    { animation-delay: 0.15s; }
.hero__subtitle { animation-delay: 0.25s; }
.hero__cta      { animation-delay: 0.35s; }
.hero__stats    { animation-delay: 0.45s; }

.hero__book {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.hero__book--center { animation-delay: 0.30s; }
.hero__book--left   { animation-delay: 0.50s; }
.hero__book--right  { animation-delay: 0.70s; }

/* Sections : fade-in à l'arrivée (toutes en même temps, pas trop chargé) */
.section {
    animation: fadeIn 0.5s ease-out backwards;
    animation-delay: 0.1s;
}

/* Respect des préférences accessibilité (reduce motion) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   PAGE-LEVEL HELPERS
   ============================================================================ */
.page-header { margin: 2rem 0 1.5rem; }
.page-header h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.page-header p { margin: 0; color: var(--color-text-light); }

.section { margin-top: 3rem; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.25rem; }
.section__head h2 { margin: 0; font-size: 1.5rem; }
.section__head a { color: var(--color-primary); text-decoration: none; font-size: 0.9rem; }

/* ---- Fil d'accent doré : reprend l'or du hero sous les grands titres, pour
   que l'identité ne se dilue pas après le premier écran. Purement décoratif —
   le bleu (--color-primary) reste la couleur des actions/CTA. ---- */
.section__head h2,
.page-header h1 { position: relative; }
.section__head h2::after,
.page-header h1::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 0.5rem;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--color-gold-soft) 0%, var(--color-gold) 100%);
}

/* ============================================================================
   NEWSLETTER — choix radio (page contact)
   ============================================================================ */
.newsletter-choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.newsletter-choices .radio-line {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.newsletter-choices .radio-line input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--color-primary);
}
.newsletter-choices .radio-line label {
    margin: 0;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
}

.alert {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-success-border);
    background: var(--color-success-bg);
    color: var(--color-success-text);
}
