/* Feuille de core/templates/core/home.html — sortie du gabarit le 2026-10-06 (carnet #36, lot 2).
   Chargée par {% feuille 'core/css/home.css' %} : l'URL porte l'empreinte du fichier, le cache suit. */
/* ── Hero ── */
.home-hero { margin: 0 0 28px; }
.home-hero h2 {
    font-size: 1.65rem; font-weight: 800; color: var(--ink);
    letter-spacing: -0.4px; line-height: 1.2; margin: 0 0 6px;
}
.home-hero p { font-size: 0.97rem; color: var(--ink-2); margin: 0; }

/* ── Search ── */
.search-wrap {
    position: relative; display: flex; align-items: center;
    margin: 0 0 32px;
}
.search-ico {
    position: absolute; left: 14px; font-size: 0.9rem;
    opacity: .45; pointer-events: none;
}
.search-input {
    width: 100%; box-sizing: border-box;
    padding: 11px 38px 11px 38px;
    background: var(--surface-hi); border: 1px solid var(--line);
    border-radius: var(--radius-s); outline: none;
    font: 400 0.92rem/1 inherit; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
    border-color: var(--lfis-blue);
    box-shadow: 0 0 0 3px rgba(0,51,160,.07);
}
.search-input::placeholder { color: var(--ink-3); }
.search-clear {
    position: absolute; right: 12px; background: none; border: none;
    cursor: pointer; font-size: 1.15rem; color: var(--ink-3);
    line-height: 1; padding: 2px 4px; display: none;
}
.search-clear:hover { color: var(--ink); }
.search-clear.visible { display: block; }
.no-results {
    padding: 56px 0; text-align: center;
    color: var(--ink-3); font-size: 0.9rem; display: none;
}

/* ── Catégories en accordéon ── */
.cat-section { margin-bottom: 10px; }

.cat-toggle {
    width: 100%; box-sizing: border-box;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--surface-hi); border: 1px solid var(--line);
    border-radius: var(--radius); cursor: pointer; font: inherit; text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: border-color var(--dur, .15s), box-shadow var(--dur, .15s);
}
.cat-toggle:hover { box-shadow: var(--shadow); }
.cat-toggle-label { flex: 1; font-size: 0.95rem; font-weight: 800; color: var(--ink); }
.cat-toggle-chevron {
    font-size: 0.85rem; color: var(--ink-3); flex-shrink: 0;
    transition: transform var(--dur, .2s) var(--ease, ease), color var(--dur, .2s);
}
.cat-section.open .cat-toggle-chevron,
.cat-section.search-open .cat-toggle-chevron { transform: rotate(90deg); color: var(--ink); }

.cat-section.open .cat-toggle.cat-green,   .cat-section.search-open .cat-toggle.cat-green   { border-color: var(--cat-interactif, var(--ok)); box-shadow: var(--shadow); }
.cat-section.open .cat-toggle.cat-blue,    .cat-section.search-open .cat-toggle.cat-blue    { border-color: var(--cat-supports,   var(--lfis-blue)); box-shadow: var(--shadow); }
.cat-section.open .cat-toggle.cat-purple,  .cat-section.search-open .cat-toggle.cat-purple  { border-color: var(--cat-outils); box-shadow: var(--shadow); }
.cat-section.open .cat-toggle.cat-grey,    .cat-section.search-open .cat-toggle.cat-grey    { border-color: var(--cat-autres,     var(--ink-2)); box-shadow: var(--shadow); }

/* Panneau dépliant : grid-template-rows 0fr→1fr, s'adapte à la hauteur réelle sans JS. */
.tool-list-wrap {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows var(--dur-slow, .28s) var(--ease, ease);
}
.cat-section.open .tool-list-wrap,
.cat-section.search-open .tool-list-wrap { grid-template-rows: 1fr; }
.tool-list-wrap > .tool-list { overflow: hidden; min-height: 0; padding-top: 8px; }

/* ── Tool rows ── */
.tool-list { display: flex; flex-direction: column; gap: 1px; }
.tool-row {
    display: flex; align-items: center; gap: 18px;
    padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-s);
    text-decoration: none; color: inherit;
    border-left: 3px solid transparent;
    transition: background var(--dur, .15s), transform var(--dur, .15s),
                border-color var(--dur, .15s), box-shadow var(--dur, .15s);
}
.tool-row:hover {
    background: var(--surface-hi);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}
.tool-row.cat-green:hover  { border-left-color: var(--cat-interactif, var(--ok)); }
.tool-row.cat-blue:hover   { border-left-color: var(--cat-supports,   var(--lfis-blue)); }
.tool-row.cat-purple:hover { border-left-color: var(--cat-outils); }
.tool-row.cat-grey:hover   { border-left-color: var(--cat-autres,     var(--ink-2)); }

.icon-wrap {
    flex-shrink: 0; width: 46px; height: 46px;
    border-radius: var(--radius-s); background: var(--panel);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; line-height: 1;
    transition: transform .15s var(--ease, cubic-bezier(0.22,1,0.36,1));
}
.tool-row:hover .icon-wrap { transform: scale(1.06); }

.tool-row-content { flex: 1; min-width: 0; }
.tool-row-name {
    font-size: 0.93rem; font-weight: 700; color: var(--ink);
    margin: 0 0 2px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.tool-row-desc {
    font-size: 0.78rem; color: var(--ink-3); margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Pastille « nouveau » d'une tuile ── */
.tuile-neuf {
    flex-shrink: 0;
    font: 800 0.64rem/1 'Inter', sans-serif;
    text-transform: uppercase; letter-spacing: .06em;
    color: #fff; background: var(--lfis-red, #e4002b);
    padding: 5px 9px; border-radius: var(--radius-pill);
}
/* ⚠️ `[hidden]` ne masque rien dès qu'un display est posé par ailleurs. */
.tuile-neuf[hidden] { display: none; }

.tool-row-arrow {
    font-size: 1rem; color: var(--line); flex-shrink: 0;
    transition: color var(--dur, .15s), transform var(--dur, .15s);
}
.tool-row:hover .tool-row-arrow {
    color: var(--lfis-red, #e4002b);
    transform: translateX(2px);
}

/* ── Refstat ── */
.refstat {
    margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line);
    font-size: 0.78rem; color: var(--ink-3);
}
.refstat a { color: var(--ink-3); }

/* ── Récents (mobile only) ── */
#mob-recents { display: none; }
.rec-card {
    flex: 1; min-width: 0;
    background: var(--surface-hi);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 10px 6px;
    text-align: center;
    text-decoration: none; color: inherit;
    box-shadow: 0 2px 6px rgba(42,38,32,.05);
    -webkit-tap-highlight-color: transparent;
}
.rec-card-ico  { font-size: 20px; line-height: 1; }
.rec-card-name { font: 700 11px/1.2 'Inter',sans-serif; color: var(--ink); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-card-when { font: 10px 'Inter',sans-serif; color: var(--ink-3); margin-top: 2px; }

/* ── Mobile : page accueil ── */
@media (max-width: 767px) {
    /* Fix 4 — Hero compact */
    .home-hero { margin-bottom: 6px; }
    .home-hero h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.2px; }
    .home-hero p  { display: none; }

    /* Search déplacée dans le header mobile (base.html) */
    .search-wrap { display: none; }
    .no-results { padding: 20px 0; }

    /* Récents : affiché si rempli ou état vide encourageant (Fix 5) */
    #mob-recents.has-recents { display: block; margin-bottom: 22px; }
    #mob-recents:not(.has-recents) {
        display: block;
        margin-bottom: 18px;
    }
    #mob-recents:not(.has-recents) #mob-recents-row::after {
        content: "Tes outils récents apparaîtront ici après ta première utilisation.";
        display: block;
        font: 400 0.82rem/1.45 'Inter', sans-serif;
        color: var(--ink-3);
        background: var(--panel);
        border-radius: var(--radius-s);
        padding: 10px 14px;
    }

    .tool-row:hover { transform: none !important; }
    .tool-row { padding: 13px 10px; }
    .icon-wrap { width: 42px; height: 42px; font-size: 1.2rem; }
    .refstat { display: none; }
}
