/* =============================================
   NOMAGORA — Éditions (promotion du livre)
   Composants : bloc inline, section accueil,
   sticky bar, popup, page /livre
   Esthétique : éditorial papier crème + serif Fraunces
   ============================================= */

:root {
    --nbk-paper: #FBF7EF;
    --nbk-paper-deep: #F6EFE1;
    --nbk-ink: #1F2937;
    --nbk-line: #EDE3CE;
    --nbk-gold: #A16207;
    --nbk-gold-soft: #FDF3DF;
    --nbk-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* ---------- Objet livre 3D (construit sur la vraie couverture) ---------- */
.nbk-book {
    perspective: 1200px;
    display: inline-block;
    filter: drop-shadow(0 24px 28px rgba(31, 41, 55, 0.22));
}
.nbk-book-inner {
    position: relative;
    transform: rotateY(-24deg) rotateX(2deg);
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
    will-change: transform;
}
.nbk-book:hover .nbk-book-inner {
    transform: rotateY(-10deg) rotateX(1deg) translateY(-6px);
}
.nbk-book-inner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px 8px 8px 3px;
    box-shadow: inset 4px 0 8px rgba(0, 0, 0, 0.08);
}
/* Dos du livre */
.nbk-book-inner::before {
    content: '';
    position: absolute;
    top: 1px;
    bottom: 1px;
    left: 0;
    width: 26px;
    transform: rotateY(-78deg) translateX(-13px);
    transform-origin: left center;
    background: linear-gradient(90deg, #D8DCE4 0%, #F2F4F8 18%, #E4E8EF 55%, #C9CFD9 100%);
    border-radius: 2px 0 0 2px;
}
/* Tranche des pages */
.nbk-book-inner::after {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    right: -7px;
    width: 14px;
    transform: rotateY(70deg) translateX(7px);
    transform-origin: right center;
    background: repeating-linear-gradient(90deg, #FFFFFF 0 1.6px, #E7E2D6 1.6px 3.2px);
    border-radius: 0 2px 2px 0;
}

/* ---------- Micro-composants partagés ---------- */
.nbk-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nbk-gold);
}
.nbk-eyebrow::before {
    content: '';
    width: 22px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
}
.nbk-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nbk-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #FFFFFF;
    border: 1px solid var(--nbk-line);
    border-radius: var(--radius-full, 9999px);
    font-size: 0.78125rem;
    font-weight: 600;
    color: var(--text-secondary, #4A5568);
    white-space: nowrap;
}
.nbk-chip svg { flex-shrink: 0; color: var(--nbk-gold); }
.nbk-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 26px;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.9375rem;
    border-radius: var(--radius-full, 9999px);
    box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s var(--ease, ease), box-shadow 0.2s var(--ease, ease);
}
.nbk-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.45);
    color: #FFFFFF;
}
.nbk-cta svg { flex-shrink: 0; }
.nbk-cta-sub {
    font-size: 0.8125rem;
    color: var(--text-muted, #8E99A8);
}
.nbk-link-more {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blue, #2563EB);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.nbk-serif {
    font-family: var(--nbk-serif);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--nbk-ink);
}

/* ---------- Bloc inline (fiches prénom + articles de blog) ---------- */
.nbk-inline {
    position: relative;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 28px;
    align-items: center;
    margin: 40px 0;
    padding: 28px 32px;
    background:
        radial-gradient(circle at 88% 12%, rgba(161, 98, 7, 0.05), transparent 42%),
        var(--nbk-paper);
    border: 1px solid var(--nbk-line);
    border-radius: var(--radius-xl, 20px);
    overflow: hidden;
}
.nbk-inline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--nbk-gold), #E3B34C 40%, transparent 90%);
}
.nbk-inline .nbk-book { width: 128px; margin: 0 auto; }
.nbk-inline-title {
    font-family: var(--nbk-serif);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--nbk-ink);
    margin: 8px 0 8px;
}
.nbk-inline-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary, #4A5568);
    margin-bottom: 14px;
}
.nbk-inline .nbk-chips { margin-bottom: 18px; }
.nbk-inline-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .nbk-inline {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 26px 20px;
        gap: 20px;
    }
    .nbk-inline .nbk-book { width: 110px; }
    .nbk-inline .nbk-chips { justify-content: center; }
    .nbk-inline-actions { justify-content: center; }
}

/* ---------- Section page d'accueil ---------- */
.nbk-home {
    background:
        radial-gradient(circle at 12% 20%, rgba(161, 98, 7, 0.06), transparent 45%),
        radial-gradient(circle at 92% 85%, rgba(124, 58, 237, 0.05), transparent 40%),
        var(--nbk-paper);
    border-top: 1px solid var(--nbk-line);
    border-bottom: 1px solid var(--nbk-line);
    padding: 72px 0;
    margin: 48px 0 0;
}
.nbk-home-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 56px;
    align-items: center;
}
.nbk-home .nbk-book { width: 250px; justify-self: center; }
.nbk-home-title {
    font-family: var(--nbk-serif);
    font-size: clamp(1.75rem, 3.4vw, 2.375rem);
    font-weight: 600;
    line-height: 1.18;
    color: var(--nbk-ink);
    margin: 14px 0 14px;
}
.nbk-home-title em {
    font-style: italic;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nbk-home-text {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-secondary, #4A5568);
    max-width: 56ch;
    margin-bottom: 20px;
}
.nbk-home .nbk-chips { margin-bottom: 26px; }
.nbk-home-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
@media (max-width: 820px) {
    .nbk-home { padding: 52px 0; }
    .nbk-home-grid {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }
    .nbk-home .nbk-book { width: 190px; }
    .nbk-home-text { margin-inline: auto; }
    .nbk-home .nbk-chips, .nbk-home-actions { justify-content: center; }
}

/* ---------- Sticky bar (pilule flottante, discrète et fermable) ---------- */
.nbk-sticky {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 900; /* sous le bandeau cookies tarteaucitron */
    transform: translate(-50%, 120%);
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(680px, calc(100vw - 24px));
    padding: 10px 12px 10px 14px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--nbk-line);
    border-radius: var(--radius-full, 9999px);
    box-shadow: 0 16px 40px -8px rgba(31, 41, 55, 0.25);
    transition: transform 0.45s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}
.nbk-sticky.nbk-visible { transform: translate(-50%, 0); }
.nbk-sticky-cover {
    width: 34px;
    height: 44px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}
.nbk-sticky-text {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}
.nbk-sticky-text strong {
    display: block;
    font-family: var(--nbk-serif);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--nbk-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nbk-sticky-text span {
    font-size: 0.75rem;
    color: var(--text-muted, #8E99A8);
}
.nbk-sticky .nbk-cta {
    padding: 9px 18px;
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.nbk-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-muted, #8E99A8);
    cursor: pointer;
    transition: background 0.2s var(--ease, ease), color 0.2s var(--ease, ease);
}
.nbk-close:hover { background: var(--nbk-paper-deep); color: var(--nbk-ink); }
@media (max-width: 560px) {
    .nbk-sticky { gap: 10px; }
    .nbk-sticky-text span { display: none; }
    .nbk-sticky .nbk-cta { padding: 9px 14px; }
}

/* ---------- Popup (déclenchée à l'engagement, jamais à l'arrivée) ---------- */
.nbk-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s var(--ease, ease);
}
.nbk-popup {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 960;
    transform: translate(-50%, -46%) scale(0.96);
    width: min(430px, calc(100vw - 32px));
    background:
        radial-gradient(circle at 85% 8%, rgba(161, 98, 7, 0.06), transparent 45%),
        #FFFFFF;
    border: 1px solid var(--nbk-line);
    border-radius: var(--radius-2xl, 28px);
    box-shadow: 0 40px 90px -18px rgba(15, 23, 42, 0.45);
    padding: 0 30px 28px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s var(--ease, ease), transform 0.35s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}
.nbk-popup-backdrop.nbk-visible, .nbk-popup.nbk-visible { opacity: 1; }
.nbk-popup.nbk-visible { transform: translate(-50%, -50%) scale(1); }
.nbk-popup .nbk-book {
    width: 132px;
    margin: -56px auto 14px;
}
.nbk-popup .nbk-close {
    position: absolute;
    top: 12px;
    right: 12px;
}
.nbk-popup-title {
    font-family: var(--nbk-serif);
    font-size: 1.4375rem;
    font-weight: 600;
    line-height: 1.22;
    color: var(--nbk-ink);
    margin: 10px 0 10px;
}
.nbk-popup-text {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-secondary, #4A5568);
    margin-bottom: 18px;
}
.nbk-popup .nbk-chips {
    justify-content: center;
    margin-bottom: 20px;
}
.nbk-popup .nbk-cta { width: 100%; }
.nbk-popup-no {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.8125rem;
    color: var(--text-muted, #8E99A8);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.nbk-popup-no:hover { color: var(--text-secondary, #4A5568); }
body.nbk-popup-open { overflow: hidden; }

/* ---------- Page /livre ---------- */
.nbk-page-hero {
    background:
        radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.05), transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(161, 98, 7, 0.07), transparent 45%),
        var(--nbk-paper);
    border-bottom: 1px solid var(--nbk-line);
    padding: 64px 0 72px;
}
.nbk-page-hero-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 64px;
    align-items: center;
}
.nbk-page-hero .nbk-book { width: 290px; justify-self: center; }
.nbk-page-hero h1 {
    font-family: var(--nbk-serif);
    font-size: clamp(2rem, 4.2vw, 2.875rem);
    font-weight: 600;
    line-height: 1.12;
    color: var(--nbk-ink);
    margin: 16px 0 12px;
}
.nbk-page-hero .subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary, #4A5568);
    max-width: 58ch;
    margin-bottom: 22px;
}
.nbk-page-hero .nbk-chips { margin-bottom: 30px; }
.nbk-hero-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.nbk-hero-actions .nbk-cta {
    padding: 16px 32px;
    font-size: 1.0625rem;
}
@media (max-width: 880px) {
    .nbk-page-hero { padding: 40px 0 52px; }
    .nbk-page-hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .nbk-page-hero .nbk-book { width: 210px; }
    .nbk-page-hero .subtitle { margin-inline: auto; }
    .nbk-page-hero .nbk-chips, .nbk-hero-actions { justify-content: center; }
}

.nbk-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 28px;
}
.nbk-feature {
    background: #FFFFFF;
    border: 1px solid var(--border, #E5E9F0);
    border-radius: var(--radius-lg, 16px);
    padding: 24px 26px;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0, 0, 0, 0.04));
}
.nbk-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--nbk-gold-soft);
    color: var(--nbk-gold);
    margin-bottom: 14px;
}
.nbk-feature h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text, #1A202C);
}
.nbk-feature p {
    font-size: 0.9063rem;
    line-height: 1.65;
    color: var(--text-secondary, #4A5568);
}

/* Extrait « page du livre » */
.nbk-sample {
    max-width: 620px;
    margin: 28px auto 0;
    background: #FFFDF8;
    border: 1px solid var(--nbk-line);
    border-radius: 6px;
    box-shadow: 0 18px 44px -14px rgba(31, 41, 55, 0.18), inset 0 0 60px rgba(161, 98, 7, 0.03);
    padding: 44px 52px;
    font-family: var(--nbk-serif);
    color: var(--nbk-ink);
    position: relative;
}
.nbk-sample-foot {
    display: block;
    text-align: center;
    margin-top: 30px;
    font-size: 0.75rem;
    color: var(--text-muted, #8E99A8);
    letter-spacing: 0.08em;
}
.nbk-sample-badge {
    font-family: var(--font);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nbk-gold);
    background: var(--nbk-gold-soft);
    border: 1px solid var(--nbk-line);
    border-radius: 9999px;
    padding: 3px 10px;
    vertical-align: middle;
}
.nbk-sample h3 {
    font-size: 1.625rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.nbk-sample .nbk-sample-meta {
    font-size: 0.875rem;
    font-style: italic;
    color: var(--nbk-gold);
    margin-bottom: 14px;
}
.nbk-sample p {
    font-size: 0.9688rem;
    line-height: 1.85;
    margin-bottom: 12px;
}
.nbk-sample p strong { font-weight: 600; }
@media (max-width: 560px) {
    .nbk-sample { padding: 32px 26px; }
}

.nbk-final-cta {
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(161, 98, 7, 0.07), transparent 55%),
        var(--nbk-paper);
    border: 1px solid var(--nbk-line);
    border-radius: var(--radius-2xl, 28px);
    padding: 52px 30px;
    margin: 56px 0 64px;
}
.nbk-final-cta .nbk-book { width: 150px; margin-bottom: 20px; }
.nbk-final-cta h2 {
    font-family: var(--nbk-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--nbk-ink);
    margin-bottom: 10px;
}
.nbk-final-cta p {
    color: var(--text-secondary, #4A5568);
    max-width: 52ch;
    margin: 0 auto 26px;
}

/* ---------- Bouton navbar « Le livre » ---------- */
.nbk-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    margin-right: 10px;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.8125rem;
    line-height: 1;
    border-radius: var(--radius-full, 9999px);
    box-shadow: 0 4px 14px -3px rgba(37, 99, 235, 0.35);
    white-space: nowrap;
    transition: transform 0.2s var(--ease, ease), box-shadow 0.2s var(--ease, ease);
}
.nbk-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px -3px rgba(37, 99, 235, 0.45);
    color: #FFFFFF;
}
.nbk-nav-btn svg { flex-shrink: 0; }
@media (max-width: 560px) {
    .nbk-nav-btn { padding: 8px 11px; }
    .nbk-nav-btn span { display: none; }
}

/* ---------- Page livre : prose, figures, tableau ---------- */
.nbk-prose {
    max-width: 74ch;
    font-size: 1.0313rem;
    line-height: 1.8;
    color: var(--text-secondary, #4A5568);
}
.nbk-prose p { margin-bottom: 14px; }
.nbk-prose strong { color: var(--text, #1A202C); }
.nbk-prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.nbk-figure {
    margin: 28px 0 8px;
    border-radius: var(--radius-xl, 20px);
    overflow: hidden;
    border: 1px solid var(--nbk-line);
    box-shadow: 0 18px 44px -16px rgba(31, 41, 55, 0.22);
}
.nbk-figure img { display: block; width: 100%; height: auto; }

.nbk-table-wrap { overflow-x: auto; margin-top: 22px; }
.nbk-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #FFFFFF;
    border: 1px solid var(--nbk-line);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    font-size: 0.9375rem;
}
.nbk-table th, .nbk-table td {
    padding: 13px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-light, #F0F3F8);
}
.nbk-table thead th {
    background: var(--nbk-paper);
    font-family: var(--nbk-serif);
    font-size: 1rem;
    color: var(--nbk-ink);
}
.nbk-table tbody tr:last-child td { border-bottom: none; }
.nbk-table td:first-child { font-weight: 600; color: var(--text, #1A202C); white-space: nowrap; }

.nbk-h2 {
    font-family: var(--nbk-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--nbk-ink);
    margin-bottom: 14px;
}

/* ---------- Accessibilité mouvement ---------- */
@media (prefers-reduced-motion: reduce) {
    .nbk-book-inner, .nbk-sticky, .nbk-popup, .nbk-popup-backdrop, .nbk-cta {
        transition: none !important;
    }
}
