/*
 * Journal Plugin — archive des journaux
 * Repris du thème Newspaper (fichier archive-journal.php) le 2026-11-13 : les mises à jour du thème ne l'effacent plus.
 * Seule différence : remise à zéro et police limitées à .jm-archive-container (elles touchaient aussi l'en-tête et le pied du thème).
 */

:root {
    --jm-primary: #bf2828;
    --jm-primary-dark: #9a2020;
    --jm-primary-light: #d63a3a;
    --jm-black: #000000;
    --jm-white: #ffffff;
    --jm-gray-light: #f8f9fa;
    --jm-gray: #e9ecef;
    --jm-gray-dark: #333333;
    --jm-shadow: 0 2px 15px rgba(0,0,0,0.08);
    --jm-shadow-hover: 0 8px 30px rgba(191, 40, 40, 0.25);
}

:where(.jm-archive-container, .jm-archive-container *) { /* :where() = même priorité nulle que l'ancien « * » */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.jm-archive-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.jm-archive-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: #fff;
}

.jm-latest-hero {
    background: linear-gradient(135deg, var(--jm-black) 0%, #2d2d2d 50%, var(--jm-primary-dark) 100%);
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.jm-latest-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/kairos-journal-155794_1280.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.jm-latest-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1068px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: center;
}

.jm-latest-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--jm-primary);
    color: var(--jm-white);
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(191, 40, 40, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.jm-latest-title {
    font-size: 3em;
    font-weight: 800;
    color: var(--jm-white);
    margin: 0 0 20px 0;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.jm-latest-subtitle {
    font-size: 1em;
    color: rgba(255,255,255,0.9);
    margin-bottom: 25px;
    line-height: 1.6;
}

.jm-latest-meta-info {
    display: flex;
    gap: 30px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.jm-meta-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--jm-white);
    font-size: 1em;
}

.jm-meta-info-item strong {
    color: var(--jm-primary-light);
}

.jm-latest-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.jm-btn-buy-now {
    background: var(--jm-primary);
    color: var(--jm-white);
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(191, 40, 40, 0.4);
}

.jm-btn-buy-now:hover {
    background: var(--jm-white);
    color: var(--jm-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.3);
}

.jm-btn-discover {
    background: transparent;
    color: var(--jm-white);
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    border: 2px solid rgba(255,255,255,0.5);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.jm-btn-discover:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--jm-white);
}

.jm-latest-image {
    position: relative;
    border-radius: 0px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: transform 0.4s;
    background: var(--jm-gray);
    aspect-ratio: 3/4;
}

.jm-latest-image:hover {
    transform: rotate(0deg) scale(1.02);
}

.jm-latest-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.jm-latest-image-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--jm-primary);
    color: var(--jm-white);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* === BADGE HORS-SÉRIE IMAGE === */
.jm-card-badge-hs-image {
    position: absolute;
    top: 5px;
    left: 15px;
    width: 60px;
    height: 60px;
    object-fit: contain;
    z-index: 3;
    animation: jm-fade-in 0.3s ease-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ← Zoom 100% au survol (60px → 120px) */
.jm-journal-card:hover .jm-card-badge-hs-image {
    transform: scale(2); /* ← Grandit de 100% */
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

/* Ajustement pour la hero section (plus grand) */
.jm-latest-image .jm-card-badge-hs-image {
    width: 150px;
    height: 150px;
    top: 20px;
    left: 20px;
}

/* Zoom hero au survol */
.jm-latest-image:hover .jm-card-badge-hs-image {
    transform: scale(1.5);
}

/* Ajustement si les deux badges sont présents */
.jm-card-ribbon + .jm-card-badge-hs-image,
.jm-card-badge-hs-image + .jm-card-ribbon {
    top: 65px;
}

.jm-latest-image .jm-card-ribbon + .jm-card-badge-hs-image,
.jm-latest-image .jm-card-badge-hs-image + .jm-card-ribbon {
    top: 130px;
}

@keyframes jm-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajustement si les deux badges sont présents */
.jm-card-ribbon + .jm-card-badge-hs,
.jm-card-badge-hs + .jm-card-ribbon {
    top: 45px;
}

.jm-journals-section {
    max-width: 1068px;
    margin: 0 auto;
    padding: 60px 40px;
}

.jm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--jm-gray);
}

.jm-section-heading {
    font-size: 2em;
    font-weight: 800;
    color: var(--jm-black);
    margin: 0;
    position: relative;
    padding-left: 20px;
}

.jm-section-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 40px;
    background: var(--jm-primary);
    border-radius: 3px;
}

.jm-results-count {
    color: #666;
    font-size: 1em;
    font-weight: 500;
}

.jm-journals-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 60px;
}

.jm-journal-card {
    background: var(--jm-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--jm-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.jm-journal-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--jm-shadow-hover);
}

.jm-card-ribbon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--jm-primary);
    color: var(--jm-white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.jm-card-image-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    padding: 20px;
    overflow: hidden;
}

.jm-card-image-wrapper img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    border: 1px solid #ddd;
}

.jm-journal-card:hover .jm-card-image-wrapper img {
    transform: scale(1);
}

.jm-card-overlay {
    display: none;
}

.jm-card-body {
    padding: 2px 25px 25px 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.jm-card-date {
    font-size: 0.6em;
    color: var(--jm-primary);
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.jm-card-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 5px 0;
    line-height: 1.3;
    text-transform: uppercase;
    text-align: center;
}

.jm-card-title a {
    color: var(--jm-black);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

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

.jm-card-subtitle {
    font-size: 0.9em;
    color: #555;
    margin: 8px 0 15px 0;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
}

.jm-card-excerpt {
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.jm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid var(--jm-gray-light);
    margin-top: auto;
}

.jm-card-price {
    font-size: 1em;
    font-weight: 800;
    color: var(--jm-primary);
}

.jm-card-price span {
    font-size: 0.5em;
    vertical-align: super;
}

.jm-card-link {
    background: var(--jm-primary);
    color: var(--jm-white);
    padding: 8px 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jm-card-link:hover {
    background: var(--jm-black);
    transform: translateX(3px);
}

.jm-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--jm-gray);
}

.jm-pagination-wrapper a,
.jm-pagination-wrapper span {
    padding: 12px 18px;
    border: 2px solid var(--jm-gray);
    border-radius: 8px;
    text-decoration: none;
    color: var(--jm-gray-dark);
    font-weight: 600;
    transition: all 0.3s;
    min-width: 45px;
    text-align: center;
}

.jm-pagination-wrapper a:hover,
.jm-pagination-wrapper .current {
    border-color: var(--jm-primary);
    background: var(--jm-primary);
    color: var(--jm-white);
    transform: translateY(-2px);
}

.jm-no-results {
    text-align: center;
    padding: 80px 20px;
    background: var(--jm-white);
    border-radius: 12px;
    box-shadow: var(--jm-shadow);
}

.jm-no-results h2 {
    font-size: 2em;
    color: var(--jm-black);
    margin-bottom: 15px;
}

.jm-no-results p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .jm-journals-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .jm-latest-hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .jm-latest-title {
        font-size: 2.2em;
    }
    .jm-latest-image {
        order: -1; /* Place l'image AVANT le texte sur mobile */
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
    }
    
    .jm-journals-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jm-latest-image {
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
    }
    .jm-latest-hero-content, .jm-latest-subtitle{
        text-align: center;
    }
}

@media (max-width: 768px) {
    .jm-latest-hero {
        padding: 40px 20px;
    }
    
    .jm-latest-title {
        font-size: 1.8em;
    }
    
    .jm-filters-bar {
        padding: 20px;
    }
    
    .jm-filters-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .jm-filter-controls {
        flex-direction: column;
    }
    
    .jm-search-input {
        min-width: 100%;
    }
    
    .jm-journals-section {
        padding: 40px 20px;
    }
    
    .jm-journals-grid-4 {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .jm-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .jm-latest-actions {
        flex-direction: column;
    }
    
    .jm-btn-buy-now,
    .jm-btn-discover {
        width: 100%;
        justify-content: center;
    }
    .jm-latest-hero-content, .jm-latest-subtitle{
        text-align: center;
    }
}

@media (max-width: 480px) {
    .jm-latest-title {
        font-size: 1.5em;
    }
    
    .jm-latest-meta-info {
        flex-direction: column;
        gap: 15px;
    }
    .jm-latest-hero-content, .jm-latest-subtitle{
        text-align: center;
    }
}
