@import url('blog-blocks.css');

/* Pages blog : neutralise les styles globaux agressifs (uppercase, marges, section padding) */
body.blog-page h1,
body.blog-page h2,
body.blog-page h3,
body.blog-page h4 {
    text-transform: none;
    letter-spacing: normal;
}

body.blog-page .section_blog,
body.blog-page .section_blog-article {
    padding: calc(80px + 2rem) 0 3rem;
}

.section_blog {
    background: linear-gradient(180deg, var(--color-secondary) 0%, #fff 280px);
}

.section_blog-article {
    background: #fff;
}

.blog-wrap {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.blog-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.blog-hero h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.blog-hero p {
    max-width: 42rem;
    margin: 0 auto;
    color: #555;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(54, 54, 54, 0.08);
    border: 1px solid #ececf8;
    transition: box-shadow 0.25s ease;
    height: 100%;
}

.blog-card:hover {
    box-shadow: 0 16px 34px rgba(115, 115, 252, 0.15);
}

.blog-card-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--color-secondary);
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card-media--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 2rem;
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.15rem 1.25rem 1.3rem;
    gap: 0;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.4rem;
}

.blog-card-date {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
}

.blog-card-likes {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #e84a6f;
    font-weight: 700;
    white-space: nowrap;
}

.blog-card-likes::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.blog-card-title {
    margin: 0 0 0.65rem;
    padding: 0;
    font-size: 1.12rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--color-dark);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    overflow-wrap: anywhere;
}

.blog-card-title a:hover {
    color: var(--color-primary);
}

.blog-card-excerpt {
    margin: 0 0 0.9rem;
    padding: 0;
    color: #555;
    flex: 1;
    line-height: 1.55;
}

.blog-card-more {
    align-self: flex-start;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.blog-card-more:hover {
    text-decoration: underline;
}

.blog-empty {
    text-align: center;
    background: #fff;
    border: 2px dashed #d8d8f8;
    border-radius: 14px;
    padding: 2.5rem 1.5rem;
    color: #666;
}

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid #e0e0f5;
    background: #fff;
    color: var(--color-dark);
}

.blog-pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.blog-pagination .is-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.blog-article-back {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.blog-article-back:hover {
    text-decoration: underline;
}

.blog-article-panel {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #ececf8;
    box-shadow: 0 8px 24px rgba(54, 54, 54, 0.05);
}

.blog-article-header {
    position: static;
    width: auto;
    height: auto;
    z-index: auto;
    box-shadow: none;
    background: transparent;
    padding: clamp(1.35rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2rem) 1rem;
    border-bottom: 1px solid #f0f0fa;
}

.blog-article-title {
    font-size: clamp(1.45rem, 4vw, 2rem) !important;
    margin: 0 0 0.65rem !important;
    line-height: 1.25 !important;
    font-weight: 700;
    color: var(--color-dark);
    overflow-wrap: anywhere;
}

.blog-article-meta {
    color: #777;
    font-size: 0.95rem;
    margin: 0;
}

.blog-article-cover {
    margin: 0;
    overflow: hidden;
}

.blog-article-cover img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

.blog-article-content {
    padding: 1.35rem clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2rem);
}

.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
    color: var(--color-dark);
    line-height: 1.3;
    text-transform: none;
}

.blog-article-content h2 {
    font-size: 1.35rem;
}

.blog-article-content h3 {
    font-size: 1.15rem;
}

.blog-article-content p,
.blog-article-content ul,
.blog-article-content ol {
    margin-bottom: 1rem;
    line-height: 1.65;
}

.blog-article-content ul,
.blog-article-content ol {
    margin-left: 1.5rem;
}

.blog-article-content u {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.blog-article-content s,
.blog-article-content strike {
    text-decoration: line-through;
}

.blog-article-content a[href] {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.blog-article-content a[href]:hover {
    color: #5a5ae0;
}

.blog-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(54, 54, 54, 0.08);
}

.blog-article-content img.blog-img-full {
    display: block;
    width: 100%;
    margin: 1.25rem 0;
}

.blog-article-content img.blog-img-center {
    display: block;
    margin: 1.25rem auto;
}

.blog-article-content img.blog-img-left {
    float: left;
    max-width: min(46%, 360px);
    margin: 0.35rem 1.25rem 1rem 0;
}

.blog-article-content img.blog-img-right {
    float: right;
    max-width: min(46%, 360px);
    margin: 0.35rem 0 1rem 1.25rem;
}

.blog-article-content figure {
    margin: 1.25rem 0;
}

.blog-article-content figure img {
    margin: 0;
}

.blog-article-content figcaption {
    margin-top: 0.55rem;
    font-size: 0.9rem;
    color: #777;
    text-align: center;
}

.blog-article-content blockquote:not(.blog-quote-card) {
    margin: 1.25rem 0;
    padding: 0.9rem 1.1rem;
    border-left: 4px solid var(--color-primary);
    background: var(--color-secondary);
    border-radius: 0 10px 10px 0;
    color: #444;
}

/* Blocs éditoriaux (Attention, Citation, FAQ, Tableau, Quiz) → css/blog-blocks.css */

.blog-article-content::after {
    content: "";
    display: table;
    clear: both;
}

.blog-article-actions {
    position: relative;
    padding: 1rem clamp(1.25rem, 3vw, 2rem) clamp(1.35rem, 3vw, 2rem);
    border-top: 1px solid #f0f0fa;
    background: linear-gradient(180deg, #fafaff 0%, #fff 100%);
}

.blog-actions-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ebebf8;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(54, 54, 54, 0.06);
}

.blog-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8a8aa8;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.blog-action-btn:hover:not(:disabled) {
    background: var(--color-secondary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.blog-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.blog-actions-divider {
    width: 1px;
    height: 1.4rem;
    background: #ececf8;
}

.blog-icon {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
    flex-shrink: 0;
}

.blog-icon-heart {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.blog-like-btn.is-liked {
    color: #e84a6f;
}

.blog-like-btn.is-liked .blog-icon-heart {
    fill: #e84a6f;
    stroke: #e84a6f;
    animation: blog-heart-pop 0.35s ease;
}

.blog-like-btn.is-liked:hover:not(:disabled) {
    background: #fff0f4;
    color: #e84a6f;
}

.blog-like-count {
    min-width: 0.65rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    color: inherit;
}

.blog-share-wrap {
    position: relative;
}

.blog-share-toggle[aria-expanded="true"] {
    background: var(--color-secondary);
    color: var(--color-primary);
}

.blog-share-menu {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.65rem);
    z-index: 20;
    min-width: 16.5rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid #ececf8;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(54, 54, 54, 0.14);
    transform: translateX(-50%) translateY(6px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.blog-share-menu::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 14px;
    height: 14px;
    border-right: 1px solid #ececf8;
    border-bottom: 1px solid #ececf8;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
}

.blog-share-menu.is-open {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

.blog-share-networks {
    display: grid;
    grid-template-columns: repeat(4, 2.75rem);
    justify-content: center;
    gap: 0.55rem;
}

.blog-share-network {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 4px 12px rgba(54, 54, 54, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-share-network svg {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
    flex-shrink: 0;
}

.blog-share-network:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 18px rgba(54, 54, 54, 0.18);
}

.blog-share-network.is-facebook { background: #1877f2; }
.blog-share-network.is-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.blog-share-network.is-linkedin { background: #0a66c2; }
.blog-share-network.is-whatsapp { background: #25d366; }
.blog-share-network.is-tiktok { background: #010101; }
.blog-share-network.is-snapchat {
    background: transparent;
    box-shadow: 0 4px 12px rgba(54, 54, 54, 0.1);
    overflow: hidden;
}

.blog-share-network.is-snapchat .blog-share-icon-snapchat {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.blog-share-network.is-email { background: #7373fc; }
.blog-share-network.is-copy { background: #363636; }
.blog-share-network.is-native { background: #6b7280; }

.blog-share-toast {
    position: absolute;
    left: 50%;
    bottom: 0.85rem;
    z-index: 25;
    margin: 0;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(54, 54, 54, 0.92);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transform: translateX(-50%);
    box-shadow: 0 8px 20px rgba(54, 54, 54, 0.2);
    animation: blog-toast-in 0.25s ease;
}

@keyframes blog-heart-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.28); }
    100% { transform: scale(1); }
}

@keyframes blog-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.blog-article-cta {
    max-width: 760px;
    margin: 2rem auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.blog-article-cta a {
    text-decoration: none;
    padding: 0.85rem 1.4rem;
    border-radius: 5px;
    font-weight: 700;
}

.blog-article-footer {
    max-width: 960px;
    margin: 3rem auto 0;
    padding-top: 0.5rem;
    background: none;
}

body.blog-page .blog-article-footer section {
    background: none;
    padding: 0;
}

.blog-section-heading {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0 0 1.75rem;
    color: #a8a8bc;
    font-family: var(--font-headings);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.blog-section-heading::before,
.blog-section-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dddde8 15%, #dddde8 85%, transparent);
}

.blog-about {
    margin-bottom: 3rem;
}

.blog-about-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
}

.blog-about-photo-wrap {
    width: clamp(120px, 18vw, 180px);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 10px 28px rgba(54, 54, 54, 0.12);
    flex-shrink: 0;
}

.blog-about-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-about-content {
    min-width: 0;
}

.blog-about-name {
    margin: 0 0 0.75rem !important;
    font-size: clamp(1.35rem, 3vw, 1.75rem) !important;
    font-weight: 700;
    color: var(--color-dark);
    text-transform: none;
    letter-spacing: normal;
}

.blog-about-content p {
    margin: 0 0 1rem;
    color: #555;
    line-height: 1.7;
}

.blog-about-link {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.blog-about-link:hover {
    text-decoration: underline;
}

.blog-related {
    margin-bottom: 1rem;
    background: none !important;
    padding: 0 !important;
}

.blog-about {
    background: none !important;
    padding: 0 !important;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
}

.blog-related-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease;
}

.blog-related-card:hover {
    transform: translateY(-4px);
}

.blog-related-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: none;
    margin-bottom: 0.75rem;
}

.blog-related-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.blog-related-card:hover .blog-related-media img {
    transform: scale(1.04);
}

.blog-related-media--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8c8d8;
    font-size: 2rem;
    font-weight: 700;
    border: 1px solid #e8e8ee;
}

.blog-related-title {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #666;
    text-align: center;
}

.blog-related-card:hover .blog-related-title {
    color: var(--color-primary);
}

@media (max-width: 900px) {
    .blog-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.blog-page .section_blog,
    body.blog-page .section_blog-article {
        padding-top: calc(60px + 1.25rem);
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-title {
        font-size: 1.05rem;
    }

    .blog-share-menu {
        left: auto;
        right: -0.25rem;
        bottom: calc(100% + 0.55rem);
        min-width: 14.5rem;
        transform: translateY(6px) scale(0.98);
    }

    .blog-share-menu.is-open {
        transform: translateY(0) scale(1);
    }

    .blog-share-menu::after {
        left: auto;
        right: 1.15rem;
        transform: rotate(45deg);
    }

    .blog-about-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .blog-about-photo-wrap {
        margin: 0 auto;
    }

    .blog-related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}