/* ============================================
   Saxho.net — Blog (listing + article + comments)
   ============================================ */

/* --- Badge accent (ecosysteme category) --- */
.badge--accent {
    background-color: rgba(166, 61, 107, 0.1);
    color: var(--c-accent);
}

/* --- Category Filters --- */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-sm);
    justify-content: center;
    margin-bottom: var(--sp-3xl);
}

.blog-filter {
    cursor: pointer;
    transition: all var(--transition-fast);
    background-color: var(--c-surface);
    color: var(--c-medium);
    text-decoration: none;
}

.blog-filter:hover {
    background-color: var(--c-dark);
    color: var(--c-white);
}

.blog-filter--active {
    background-color: var(--c-primary);
    color: var(--c-white);
}

.blog-filter--active:hover {
    background-color: var(--c-primary-light);
    color: var(--c-white);
}

/* --- Article Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-xl);
    margin-bottom: var(--sp-3xl);
}

/* ============================================
   Blog Cards — Enhanced
   ============================================ */

.blog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    transition: transform var(--transition-normal),
                box-shadow var(--transition-normal),
                border-color var(--transition-normal);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

/* --- Category hover glow --- */
.blog-card[data-category="innovation"]:hover {
    border-color: rgba(27, 58, 158, 0.3);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(27, 58, 158, 0.12);
}

.blog-card[data-category="methodes"]:hover {
    border-color: rgba(255, 107, 74, 0.3);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(255, 107, 74, 0.12);
}

.blog-card[data-category="retours-experience"]:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(16, 185, 129, 0.12);
}

.blog-card[data-category="ecosysteme"]:hover {
    border-color: rgba(166, 61, 107, 0.3);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(166, 61, 107, 0.12);
}

/* --- Cover image --- */
.blog-card__image {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

/* --- Placeholder with category illustration --- */
.blog-card__placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    position: relative;
    overflow: hidden;
    /* Default gradient (fallback) */
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
}

/* Category-specific gradients */
.blog-card[data-category="innovation"] .blog-card__placeholder {
    background: linear-gradient(135deg, #1B3A9E 0%, #3A7DFF 40%, #D94F70 100%);
}

.blog-card[data-category="methodes"] .blog-card__placeholder {
    background: linear-gradient(135deg, #D94F70 0%, #F5A623 100%);
}

.blog-card[data-category="retours-experience"] .blog-card__placeholder {
    background: linear-gradient(135deg, #10B981 0%, #0EA5E9 100%);
}

.blog-card[data-category="ecosysteme"] .blog-card__placeholder {
    background: linear-gradient(135deg, #D94F70 0%, #6366F1 100%);
}

/* --- Geometric shapes per category --- */

/* Innovation: concentric circles */
.blog-card[data-category="innovation"] .blog-card__placeholder::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.blog-card[data-category="innovation"] .blog-card__placeholder::after {
    content: '';
    position: absolute;
    width: 170px;
    height: 170px;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* Methodes: rotated squares */
.blog-card[data-category="methodes"] .blog-card__placeholder::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%) rotate(15deg);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.blog-card[data-category="methodes"] .blog-card__placeholder::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    top: 38%;
    left: 68%;
    transform: rotate(30deg);
    border: 1.5px solid rgba(255, 255, 255, 0.10);
}

/* Retours experience: chevron + path */
.blog-card[data-category="retours-experience"] .blog-card__placeholder::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    top: 45%;
    left: 60%;
    transform: translate(-50%, -50%) rotate(-45deg);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.blog-card[data-category="retours-experience"] .blog-card__placeholder::after {
    content: '';
    position: absolute;
    width: 90px;
    height: 2px;
    top: 55%;
    left: 35%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(-25deg);
}

/* Ecosysteme: constellation dots */
.blog-card[data-category="ecosysteme"] .blog-card__placeholder::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    top: 40%;
    left: 55%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow:
        30px -20px 0 rgba(255, 255, 255, 0.15),
        -25px 15px 0 rgba(255, 255, 255, 0.12),
        40px 25px 0 rgba(255, 255, 255, 0.10),
        -10px -30px 0 rgba(255, 255, 255, 0.08);
}

.blog-card[data-category="ecosysteme"] .blog-card__placeholder::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 55%;
    width: 70px;
    height: 50px;
    background:
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.06) 49%, rgba(255, 255, 255, 0.06) 51%, transparent 52%),
        linear-gradient(-30deg, transparent 48%, rgba(255, 255, 255, 0.04) 49%, rgba(255, 255, 255, 0.04) 51%, transparent 52%);
    transform: translate(-10px, -15px);
}

/* --- Card body --- */
.blog-card__category {
    margin-bottom: var(--sp-sm);
    display: inline-block;
}

.blog-card__title {
    font-size: var(--fs-h4);
    margin-bottom: var(--sp-sm);
}

.blog-card__title a {
    color: var(--c-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.blog-card__title a:hover {
    color: var(--c-primary);
}

/* Category-specific title hover */
.blog-card[data-category="methodes"] .blog-card__title a:hover {
    color: var(--c-secondary);
}

.blog-card[data-category="retours-experience"] .blog-card__title a:hover {
    color: var(--c-success);
}

.blog-card[data-category="ecosysteme"] .blog-card__title a:hover {
    color: var(--c-accent);
}

.blog-card .card__body {
    flex: 1;
}

.blog-card__excerpt {
    font-size: var(--fs-small);
    color: var(--c-medium);
    line-height: var(--lh-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__footer {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    border-top: 1px solid var(--c-surface);
    transition: border-color var(--transition-normal);
}

/* Category-specific footer border on hover */
.blog-card[data-category="innovation"]:hover .blog-card__footer {
    border-top-color: rgba(27, 58, 158, 0.2);
}

.blog-card[data-category="methodes"]:hover .blog-card__footer {
    border-top-color: rgba(255, 107, 74, 0.2);
}

.blog-card[data-category="retours-experience"]:hover .blog-card__footer {
    border-top-color: rgba(16, 185, 129, 0.2);
}

.blog-card[data-category="ecosysteme"]:hover .blog-card__footer {
    border-top-color: rgba(166, 61, 107, 0.2);
}

/* --- Empty state --- */
.blog-empty {
    padding: var(--sp-3xl) 0;
    font-size: var(--fs-body-lg);
}

/* --- Pagination --- */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-lg);
}

.blog-pagination__info {
    font-size: var(--fs-small);
    color: var(--c-muted);
}

/* ============================================
   Article Detail
   ============================================ */

/* --- Article Hero --- */
.page-hero--blog-article {
    min-height: auto;
    padding: var(--sp-3xl) 0 var(--sp-2xl);
    position: relative;
    overflow: hidden;
}

/* Category-specific hero gradients (no cover image) */
.page-hero--blog-article[data-category="innovation"] {
    background: linear-gradient(135deg, #0D0D1A 0%, #1B3A9E 60%, #D94F70 100%);
}

.page-hero--blog-article[data-category="methodes"] {
    background: linear-gradient(135deg, #0D0D1A 0%, #D94F70 60%, #F5A623 100%);
}

.page-hero--blog-article[data-category="retours-experience"] {
    background: linear-gradient(135deg, #0D0D1A 0%, #10B981 60%, #0EA5E9 100%);
}

.page-hero--blog-article[data-category="ecosysteme"] {
    background: linear-gradient(135deg, #0D0D1A 0%, #D94F70 60%, #6366F1 100%);
}

/* Cover image as hero background */
.blog-article__hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* When cover image present: bigger hero + dark overlay */
.page-hero--blog-article.page-hero--has-cover {
    min-height: 50vh;
}

.page-hero--blog-article.page-hero--has-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13, 13, 26, 0.3) 0%,
        rgba(13, 13, 26, 0.7) 100%
    );
    z-index: 1;
}

.page-hero--blog-article .container {
    position: relative;
    z-index: 2;
}

/* --- Back link --- */
.blog-article__back {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-small);
    margin-bottom: var(--sp-lg);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.blog-article__back:hover {
    color: var(--c-white);
}

/* --- Category in hero --- */
.blog-article__category {
    margin-bottom: var(--sp-md);
}

/* --- Meta line --- */
.blog-article__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    flex-wrap: wrap;
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.6);
    margin-top: var(--sp-md);
}

.blog-article__meta-sep {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Article Content (Prose) — Enhanced
   ============================================ */

.blog-article__content {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-relaxed);
    color: var(--c-dark);
}

/* Drop cap on first paragraph */
.blog-article__content > p:first-child::first-letter {
    float: left;
    font-family: var(--ff-display);
    font-size: 3.5em;
    font-weight: var(--fw-bold);
    line-height: 0.8;
    padding-right: 0.08em;
    padding-top: 0.05em;
    color: var(--c-primary);
}

/* Category-specific drop cap color */
.blog-article-section[data-category="methodes"] .blog-article__content > p:first-child::first-letter {
    color: var(--c-secondary);
}

.blog-article-section[data-category="retours-experience"] .blog-article__content > p:first-child::first-letter {
    color: var(--c-success);
}

.blog-article-section[data-category="ecosysteme"] .blog-article__content > p:first-child::first-letter {
    color: var(--c-accent);
}

.blog-article__content p {
    margin-bottom: var(--sp-lg);
}

/* h2 with top separator for visual rhythm */
.blog-article__content h2 {
    font-family: var(--ff-display);
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    margin-top: var(--sp-3xl);
    margin-bottom: var(--sp-md);
    padding-top: var(--sp-xl);
    border-top: 1px solid var(--c-surface);
    color: var(--c-dark);
}

.blog-article__content h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.blog-article__content h3 {
    font-family: var(--ff-display);
    font-size: var(--fs-h4);
    font-weight: var(--fw-semibold);
    margin-top: var(--sp-2xl);
    margin-bottom: var(--sp-sm);
    color: var(--c-dark);
}

.blog-article__content ul,
.blog-article__content ol {
    margin-bottom: var(--sp-lg);
    padding-left: var(--sp-xl);
}

.blog-article__content li {
    margin-bottom: var(--sp-sm);
    line-height: var(--lh-relaxed);
}

/* Enhanced blockquote */
.blog-article__content blockquote {
    border-left: 4px solid var(--c-primary-light);
    padding: var(--sp-lg) var(--sp-xl);
    margin: var(--sp-2xl) 0;
    background: linear-gradient(135deg, rgba(27, 58, 158, 0.04) 0%, rgba(166, 61, 107, 0.04) 100%);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--c-medium);
    font-size: var(--fs-body-lg);
    line-height: var(--lh-relaxed);
    position: relative;
}

.blog-article__content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 16px;
    font-family: var(--ff-display);
    font-size: 4rem;
    color: var(--c-primary-light);
    opacity: 0.2;
    line-height: 1;
}

.blog-article__content a {
    color: var(--c-primary);
    text-decoration: underline;
}

.blog-article__content a:hover {
    color: var(--c-primary-light);
}

.blog-article__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--sp-xl) 0;
}

.blog-article__content strong {
    font-weight: var(--fw-semibold);
    color: var(--c-dark);
}

/* Inline code */
.blog-article__content code {
    font-family: var(--ff-mono);
    font-size: 0.9em;
    background: var(--c-surface);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--c-accent);
}

/* Code block */
.blog-article__content pre {
    background: var(--c-dark);
    color: var(--c-white);
    padding: var(--sp-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--sp-xl) 0;
}

.blog-article__content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* ============================================
   Article CTA Zone (share + newsletter + contact)
   ============================================ */

.blog-cta {
    margin-top: var(--sp-3xl);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--c-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--c-white);
}

.blog-cta__block {
    padding: var(--sp-xl) var(--sp-2xl);
    position: relative;
}

.blog-cta__block + .blog-cta__block {
    border-top: 1px solid var(--c-surface);
}

.blog-cta__heading {
    font-family: var(--ff-display);
    font-size: var(--fs-h4);
    font-weight: var(--fw-bold);
    margin-bottom: var(--sp-xs);
    color: var(--c-dark);
}

.blog-cta__text {
    font-size: var(--fs-body);
    color: var(--c-medium);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--sp-md);
}

/* --- Share block --- */
.blog-cta__share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-sm);
}

.blog-cta__share-buttons .blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
}

.blog-cta__share-buttons .blog-share-btn .icon {
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.blog-cta__share-buttons .blog-share-btn:hover .icon {
    opacity: 1;
}

/* --- Newsletter block --- */
.blog-cta__newsletter {
    background: linear-gradient(135deg, rgba(27, 58, 158, 0.03) 0%, rgba(166, 61, 107, 0.03) 100%);
}

.blog-cta__newsletter-row {
    display: flex;
    gap: var(--sp-sm);
    max-width: 480px;
}

.blog-cta__newsletter-input {
    flex: 1;
    min-width: 0;
}

.blog-cta__newsletter-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.blog-cta__newsletter-feedback {
    margin-top: var(--sp-sm);
    font-size: var(--fs-small);
    min-height: 1.4em;
}

.blog-cta__newsletter-feedback--success {
    color: var(--c-success, #10B981);
}

.blog-cta__newsletter-feedback--info {
    color: var(--c-primary);
}

.blog-cta__newsletter-feedback--error {
    color: var(--c-error, #EF4444);
}

/* --- Contact block --- */
.blog-cta__contact {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    color: var(--c-white);
}

.blog-cta__contact .blog-cta__heading {
    color: var(--c-white);
}

.blog-cta__contact .blog-cta__text {
    color: rgba(255, 255, 255, 0.8);
}

.blog-cta__contact .btn--primary {
    background: var(--c-white);
    color: var(--c-primary);
    border-color: var(--c-white);
}

.blog-cta__contact .btn--primary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--c-primary-dark);
}

/* ============================================
   Comments
   ============================================ */

.blog-comments {
    margin-top: var(--sp-xl);
}

.blog-comments__title {
    font-family: var(--ff-display);
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    margin-bottom: var(--sp-xl);
}

.blog-comments__count {
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
    color: var(--c-muted);
}

.blog-comments__form {
    margin-bottom: var(--sp-2xl);
}

.blog-comments__textarea {
    min-height: 100px;
    resize: vertical;
}

.blog-comments__login-prompt {
    background-color: var(--c-surface);
    padding: var(--sp-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-2xl);
    font-size: var(--fs-body);
    color: var(--c-medium);
    text-align: center;
}

.blog-comments__login-prompt a {
    color: var(--c-primary);
    font-weight: var(--fw-semibold);
}

.blog-comments__empty {
    font-style: italic;
    color: var(--c-muted);
}

/* --- Individual Comment --- */
.blog-comment {
    padding: var(--sp-lg) 0;
    border-bottom: 1px solid var(--c-surface);
}

.blog-comment:last-child {
    border-bottom: none;
}

.blog-comment__header {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-sm);
}

.blog-comment__author {
    font-size: var(--fs-body);
    color: var(--c-dark);
}

.blog-comment__date {
    font-size: var(--fs-xs);
    color: var(--c-muted);
}

.blog-comment__text {
    font-size: var(--fs-body);
    color: var(--c-medium);
    line-height: var(--lh-relaxed);
}

/* ============================================
   Blog Responsive Overrides
   (CRITICAL: placed here, not in responsive.css,
   because blog.css loads AFTER responsive.css)
   ============================================ */

@media (max-width: 767px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-md);
    }

    .blog-article__meta {
        flex-direction: column;
        gap: var(--sp-xs);
    }

    .blog-article__meta-sep {
        display: none;
    }

    .blog-cta__block {
        padding: var(--sp-lg);
    }

    .blog-cta__newsletter-row {
        flex-direction: column;
    }

    .blog-article__content {
        font-size: var(--fs-body);
    }

    .blog-article__content h2 {
        font-size: var(--fs-h4);
    }

    .blog-comments__title {
        font-size: var(--fs-h4);
    }

    /* Drop cap smaller on mobile */
    .blog-article__content > p:first-child::first-letter {
        font-size: 2.5em;
    }

    /* Cover image hero reduced */
    .page-hero--blog-article.page-hero--has-cover {
        min-height: 35vh;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
