/* ==========================================================================
 *  STYLE POUR LA PAGE INDEX DES FICHES TECHNIQUES (Autonome)
 *  ========================================================================== */

/* Variables et Typographie de base */
.fiche-page {
    --fiche-brand: #ff6233;
    --fiche-bg: var(--v3-bg, #fbfaf9);
    --fiche-surface: var(--v3-surface, #ffffff);
    --fiche-surface-soft: #f7f4f1;
    --fiche-text: var(--v3-text, #262c2c);
    --fiche-muted: var(--v3-text-mut, #69727c);
    --fiche-border: var(--v3-border, #ece4dd);

    font-family: var(--v3-font-text, 'Lora', Georgia, serif);
    line-height: 1.7;
    background: var(--fiche-bg);
    color: var(--fiche-text);
}

.fiche-page *, .fiche-page *::before, .fiche-page *::after {
    box-sizing: border-box;
}

/* LE FAMEUX CONTAINER QUI MANQUAIT ! */
.fiche-shell {
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
}
.fiche-shell--wide {
    width: min(1180px, calc(100% - 2rem));
}

/* --- HERO INDEX --- */
.fiche-index-hero {
    position: relative;
    min-height: clamp(300px, 35vw, 450px);
    display: flex;
    align-items: center; /* Centré verticalement */
    justify-content: center;
    overflow: hidden;
    /* Un beau dégradé de secours si pas d'image */
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    text-align: center;
    padding-top: 4rem; /* Pour éviter le chevauchement de la navbar */
}

.fiche-index-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.fiche-index-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.4) 0%, rgba(17, 24, 39, 0.8) 100%);
    z-index: 2;
}

.fiche-index-hero__inner {
    position: relative;
    z-index: 3;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Fil d'ariane */
.fiche-breadcrumb {
    font-family: var(--v3-font-ui, sans-serif);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}
.fiche-breadcrumb a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}
.fiche-breadcrumb a:hover {
    color: var(--fiche-brand);
}
.fiche-breadcrumb__sep {
    margin: 0 0.5rem;
    opacity: 0.5;
}

/* Textes du Hero */
.fiche-index-hero__kicker {
    display: inline-block;
    background: var(--fiche-brand);
    color: #fff;
    font-family: var(--v3-font-ui, sans-serif);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    margin-bottom: 1.5rem;
}

.fiche-index-hero__title {
    color: #fff;
    font-family: var(--v3-font-ui, sans-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.1;
    margin: 0 0 1rem 0;
}

.fiche-index-hero__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
}

/* --- ESPACEMENT DU CORPS --- */
.fiche-index-main {
    padding: 4rem 0 5rem;
}

/* État vide */
.fiche-index-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--fiche-surface);
    border: 1px dashed var(--fiche-border);
    border-radius: 16px;
    color: var(--fiche-muted);
}
.fiche-index-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--fiche-border);
}

/* --- GRILLE DES CARTES --- */
.fiche-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

/* --- CARTE INDIVIDUELLE --- */
.fiche-index-card {
    display: flex;
    flex-direction: column;
    background: var(--fiche-surface);
    border: 1px solid var(--fiche-border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--fiche-text);
    box-shadow: 0 4px 15px rgba(25, 30, 38, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.fiche-index-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(25, 30, 38, 0.08);
    border-color: rgba(255, 98, 51, 0.3);
}

.fiche-index-card__img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--fiche-surface-soft);
}

.fiche-index-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.fiche-index-card:hover .fiche-index-card__img-wrap img {
    transform: scale(1.05);
}

.fiche-index-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--fiche-border);
}

.fiche-index-card__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--fiche-brand);
    color: #ffffff;
    font-family: var(--v3-font-ui, sans-serif);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.fiche-index-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.fiche-index-card__title {
    font-family: var(--v3-font-ui, sans-serif);
    font-size: 1.25rem;
    margin: 0 0 0.8rem 0;
    line-height: 1.35;
    color: var(--fiche-text);
    transition: color 0.2s;
}

.fiche-index-card:hover .fiche-index-card__title {
    color: var(--fiche-brand);
}

.fiche-index-card__desc {
    font-size: 0.95rem;
    color: var(--fiche-muted);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fiche-index-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--fiche-surface-soft);
    font-family: var(--v3-font-ui, sans-serif);
    font-size: 0.85rem;
}

.fiche-index-card__author {
    color: var(--fiche-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fiche-index-card__readmore {
    color: var(--fiche-brand);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.2s;
}

.fiche-index-card:hover .fiche-index-card__readmore {
    gap: 0.6rem;
}

/* Dark mode si applicable */
html[data-theme="dark"] .fiche-page,
html.theme-dark .fiche-page {
    --fiche-bg: #11161c;
    --fiche-surface: #141b22;
    --fiche-surface-soft: #1a232d;
    --fiche-text: #f2f5f7;
    --fiche-muted: #9aa7b4;
    --fiche-border: #263240;
}
