/* ========================================
   ENTITY PROFILE PAGE
   Design éditorial premium — Bloomberg meets Wikipedia
   ======================================== */

/* ---------- CSS Variables ---------- */
.entity-page {
    --ep-blue: #0046b5;
    --ep-blue-soft: #e8f0fe;
    --ep-dark: #0f1724;
    --ep-text: #1f2937;
    --ep-muted: #667085;
    --ep-border: #e5e7eb;
    --ep-bg-warm: #fafaf8;
    --ep-accent: #d97706;
    --ep-radius: 12px;
    --ep-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
    --ep-shadow-lg: 0 4px 24px rgba(16, 24, 40, 0.08);
}

/* ---------- Page layout override ---------- */
.entity-page .main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0;
    margin-top: 0;
}

body.menu-scrolled .entity-page .main {
    margin-top: 0;
}

/* ---------- Scroll-triggered fade-in ---------- */
@keyframes ep-fade-up {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ep-animate {
    opacity: 0;
    animation: ep-fade-up .7s cubic-bezier(.22, 1, .36, 1) forwards;
}

.ep-delay-1 { animation-delay: .12s; }
.ep-delay-2 { animation-delay: .24s; }
.ep-delay-3 { animation-delay: .36s; }
.ep-delay-4 { animation-delay: .48s; }

/* ---------- HERO ---------- */
.ep-hero {
    position: relative;
    background: var(--ep-dark);
    color: #fff;
    padding: 160px 24px 80px;
    overflow: hidden;
    text-align: center;
}

.ep-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(0, 70, 181, .25) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(217, 119, 6, .15) 0%, transparent 70%);
    pointer-events: none;
}

/* Animated subtle grid pattern */
.ep-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.ep-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
}

.ep-entity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 24px;
    padding: 6px 16px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    margin-bottom: 24px;
}

.ep-entity-badge .badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ep-accent);
    animation: ep-pulse 2s ease-in-out infinite;
}

@keyframes ep-pulse {
    0%, 100% { opacity: .6; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.3); }
}

.ep-hero h1 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    margin: 0 0 20px;
    background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ep-hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.65;
    color: rgba(255,255,255,.72);
    max-width: 600px;
    margin: 0 auto 32px;
    font-weight: 400;
}

.ep-hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.ep-hero-stat {
    text-align: center;
}

.ep-hero-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ep-hero-stat-label {
    font-size: .74rem;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 500;
}

/* ---------- CONTENT WRAPPER ---------- */
.ep-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- SECTION SPACING ---------- */
.ep-section {
    padding: 64px 0;
}

.ep-section + .ep-section {
    border-top: 1px solid var(--ep-border);
}

.ep-section-label {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ep-blue);
    margin-bottom: 12px;
}

.ep-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ep-dark);
    letter-spacing: -.02em;
    margin: 0 0 24px;
    line-height: 1.2;
}

/* ---------- FICHE D'IDENTITE ---------- */
.ep-identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--ep-border);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    overflow: hidden;
    box-shadow: var(--ep-shadow);
}

.ep-identity-cell {
    background: #fff;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ep-identity-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ep-muted);
}

.ep-identity-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ep-text);
    line-height: 1.4;
}

.ep-identity-value a {
    color: var(--ep-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}

.ep-identity-value a:hover {
    border-bottom-color: var(--ep-blue);
}

/* ---------- KNOWLEDGE GRAPH ---------- */
.ep-kg-container {
    background: var(--ep-bg-warm);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    padding: 40px;
    overflow-x: auto;
}

.ep-kg-svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Nodes */
.ep-kg-node-primary {
    fill: var(--ep-blue);
}

.ep-kg-node-secondary {
    fill: #6366f1;
}

.ep-kg-node-tertiary {
    fill: #10b981;
}

.ep-kg-node-text {
    fill: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: central;
}

.ep-kg-edge {
    stroke: #cbd5e1;
    stroke-width: 1.5;
    fill: none;
}

.ep-kg-edge-label {
    fill: var(--ep-muted);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Animated node hover via CSS */
.ep-kg-node:hover .ep-kg-node-primary,
.ep-kg-node:hover .ep-kg-node-secondary,
.ep-kg-node:hover .ep-kg-node-tertiary {
    filter: brightness(1.15);
    cursor: pointer;
}

/* ---------- EDITORIAL SECTION ---------- */
.ep-editorial {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ep-text);
}

.ep-editorial p {
    margin: 0 0 1.25em;
}

.ep-editorial strong {
    font-weight: 600;
    color: var(--ep-dark);
}

.ep-pull-quote {
    position: relative;
    margin: 40px 0;
    padding: 28px 32px 28px 36px;
    border-left: 3px solid var(--ep-accent);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 0 var(--ep-radius) var(--ep-radius) 0;
    font-size: 1.1rem;
    font-weight: 500;
    font-style: italic;
    color: #92400e;
    line-height: 1.6;
}

/* ---------- TIMELINE ---------- */
.ep-timeline {
    position: relative;
    padding-left: 36px;
}

.ep-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--ep-blue) 0%, var(--ep-border) 100%);
    border-radius: 1px;
}

.ep-timeline-item {
    position: relative;
    padding-bottom: 32px;
}

.ep-timeline-item:last-child {
    padding-bottom: 0;
}

.ep-timeline-dot {
    position: absolute;
    left: -36px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--ep-blue);
    z-index: 1;
    transition: transform .2s, background .2s;
}

.ep-timeline-item:hover .ep-timeline-dot {
    background: var(--ep-blue);
    transform: scale(1.25);
}

.ep-timeline-date {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ep-blue);
    margin-bottom: 4px;
}

.ep-timeline-text {
    font-size: .95rem;
    line-height: 1.55;
    color: var(--ep-text);
}

.ep-timeline-text strong {
    font-weight: 600;
    color: var(--ep-dark);
}

/* ---------- ARTICLES GRID ---------- */
.ep-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

.ep-article-card {
    background: #fff;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    overflow: hidden;
    box-shadow: var(--ep-shadow);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.ep-article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ep-shadow-lg);
}

.ep-article-card-img {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f3f4f6;
}

.ep-article-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.ep-article-card:hover .ep-article-card-img img {
    transform: scale(1.04);
}

.ep-article-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-article-card-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    width: fit-content;
}

.ep-type-article {
    background: #e3f2fd;
    color: #1565c0;
}

.ep-type-lexique {
    background: #e8f5e9;
    color: #2e7d32;
}

.ep-type-podcast {
    background: #fff3e0;
    color: #e65100;
}

.ep-article-card-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--ep-dark);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-article-card-meta {
    margin-top: auto;
    font-size: .78rem;
    color: var(--ep-muted);
    padding-top: 8px;
}

/* ---------- CONCEPTS TAGS ---------- */
.ep-concepts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ep-concept-tag {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--ep-border);
    border-radius: 24px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--ep-text);
    text-decoration: none;
    background: #fff;
    transition: all .2s ease;
}

.ep-concept-tag:hover {
    background: var(--ep-blue-soft);
    border-color: var(--ep-blue);
    color: var(--ep-blue);
    transform: translateY(-2px);
}

/* ---------- CTA BLOCK ---------- */
.ep-cta-block {
    background: linear-gradient(135deg, var(--ep-dark) 0%, #1e293b 100%);
    border-radius: var(--ep-radius);
    padding: 40px;
    text-align: center;
    color: #fff;
    margin-top: 48px;
}

.ep-cta-block h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.ep-cta-block p {
    color: rgba(255,255,255,.65);
    margin: 0 0 24px;
    font-size: .95rem;
}

.ep-cta-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--ep-accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    transition: background .2s, transform .2s;
}

.ep-cta-btn:hover {
    background: #b45309;
    transform: translateY(-2px);
}

/* ---------- BREADCRUMB override ---------- */
.ep-breadcrumb {
    padding: 120px 24px 0;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ---------- STRUCTURED DATA HIDDEN ---------- */
.ep-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .ep-hero {
        padding: 130px 20px 56px;
    }

    .ep-hero h1 {
        font-size: 2.2rem;
    }

    .ep-hero-stats {
        gap: 24px;
    }

    .ep-section {
        padding: 40px 0;
    }

    .ep-section-title {
        font-size: 1.4rem;
    }

    .ep-identity-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ep-kg-container {
        padding: 24px 16px;
    }

    .ep-articles-grid {
        grid-template-columns: 1fr;
    }

    .ep-content {
        padding: 0 16px;
    }

    .ep-pull-quote {
        padding: 20px 20px 20px 24px;
        font-size: 1rem;
    }

    .ep-cta-block {
        padding: 28px 20px;
    }

    .ep-timeline {
        padding-left: 30px;
    }

    .ep-timeline-dot {
        left: -30px;
        width: 14px;
        height: 14px;
    }

    .ep-timeline::before {
        left: 6px;
    }
}

@media (max-width: 480px) {
    .ep-identity-grid {
        grid-template-columns: 1fr;
    }

    .ep-hero-stats {
        flex-direction: column;
        gap: 16px;
    }
}
