/* ============================================
   PAGE D'ACCUEIL PUBLIQUE (refonte)
   HTML : templates/public/lovanime-public.php
   JS   : assets/js/home-carousel.js, assets/js/public-chrome.js
   Les variables de couleur viennent de public-chrome.css.
   ============================================ */

.home {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------- Bandeau d'invitation ---------- */
.home-hero {
    display: block;
    padding: 18px 20px;
    border-radius: 7px;
    background: linear-gradient(90deg, #697bec 0%, #754ca6 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
}

.home-hero p {
    margin: 0;
    font-size: 14px;
    line-height: 21px;
}

/* ---------- Carrousel des membres ---------- */
.home-members {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--lv-line);
    border-radius: 10px;
}

.home-members__head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.home-members__head h2 {
    margin: 0;
    color: var(--lv-ink);
    font-size: 14px;
    font-weight: 600;
}

.home-members__count {
    color: var(--lv-muted);
    font-size: 12px;
}

.home-members__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-members__nav {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--lv-line);
    border-radius: 50%;
    background: #fff;
    color: var(--lv-muted);
    cursor: pointer;
}

.home-members__nav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-members__nav:hover:not(:disabled) {
    color: var(--lv-blue);
    border-color: var(--lv-blue);
}

.home-members__nav:disabled {
    opacity: .35;
    cursor: default;
}

.home-members__nav[hidden] {
    display: none;
}

.home-members__track {
    flex: 1;
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.home-members__track::-webkit-scrollbar {
    display: none;
}

.home-members__item {
    flex: 0 0 calc((100% - 7 * 12px) / 8);
    min-width: 88px;
    scroll-snap-align: start;
}

.home-members__item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--lv-ink);
    text-decoration: none;
}

.home-members__item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--lv-line);
}

.home-members__item a:hover img {
    border-color: var(--lv-red);
}

.home-members__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 500;
}

/* ---------- Mise en page : contenu + colonne de droite ---------- */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 24px;
    align-items: start;
}

.home-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.home-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.home-section__head h2 {
    margin: 0;
    color: var(--lv-blue);
    font-size: 19px;
    font-weight: 600;
}

.home-section__head a {
    color: var(--lv-blue);
    font-size: 12px;
    text-decoration: none;
}

.home-section__head a:hover {
    text-decoration: underline;
}

/* ---------- Cartes (critiques et news) ---------- */
.card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--lv-line);
    border-radius: 10px;
}

.card--news {
    background: #eff8f2;
    border-color: #d9ebdd;
}

.card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card__tag {
    color: var(--lv-blue);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.card--news .card__tag {
    color: #397654;
}

.card__score {
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--lv-blue-soft);
    color: var(--lv-muted);
    font-size: 10px;
    white-space: nowrap;
}

.card__score strong {
    color: var(--lv-blue);
    font-size: 16px;
    font-weight: 700;
}

.card__main {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.card__cover {
    flex: 0 0 124px;
    display: block;
    height: 154px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--lv-line);
}

.card__cover--tall {
    flex-basis: 150px;
    height: 208px;
}

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

.card__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card__title {
    margin: 0;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.35;
}

.card__title a {
    color: var(--lv-blue);
    text-decoration: none;
}

.card__title a:hover {
    text-decoration: underline;
}

.card__excerpt {
    margin: 0;
    color: var(--lv-ink);
    font-size: 14px;
    line-height: 1.6;
}

.card__source {
    margin: 0;
    color: var(--lv-muted);
    font-size: 12px;
    line-height: 1.5;
}

.card__author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lv-muted);
    font-size: 12px;
}

.card__author img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 50%;
}

.card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 0 24px;
    border-top: 1px solid var(--lv-line);
}

.card--news .card__actions {
    border-top-color: #d9ebdd;
}

.card__votes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vote {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--lv-muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.vote svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vote:hover {
    color: var(--lv-blue);
    background: rgba(53, 123, 169, .08);
}

.card__more {
    color: var(--lv-blue);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.card__more:hover {
    text-decoration: underline;
}

/* ---------- Annonces ---------- */
.home-ads {
    display: flex;
    gap: 16px;
}

.ad {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border-radius: 10px;
}

.ad--cool { background: #f2effc; }
.ad--warm { background: #fff3e9; }

.ad__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--lv-muted);
    font-size: 10px;
}

.ad__tag {
    font-weight: 600;
}

.ad__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ad__photo {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
}

.ad__title {
    margin: 0;
    color: var(--lv-ink);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}

.ad__text {
    flex: 1;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--lv-ink);
    font-size: 13px;
    line-height: 1.6;
}

.ad__foot {
    display: flex;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid #d9d6e3;
}

.ad--warm .ad__foot {
    border-top-color: #ecd9c8;
}

.ad__reply {
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: var(--lv-blue);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ad__reply:hover {
    text-decoration: underline;
}

/* ---------- Colonne de droite ---------- */
.home-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
}

.side-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    border-radius: 10px;
    background: var(--lv-blue-soft);
}

.side-stats h2 {
    margin: 0 0 6px;
    color: var(--lv-blue);
    font-size: 14px;
    font-weight: 600;
}

.side-stats__line {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    color: var(--lv-muted);
    font-size: 12px;
}

.side-stats__line strong {
    color: var(--lv-blue);
    font-size: 26px;
    font-weight: 600;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--lv-line);
    border-radius: 10px;
}

.side-panel h2 {
    margin: 0;
    color: var(--lv-blue);
    font-size: 12px;
    font-weight: 600;
}

.side-member {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.side-member img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
}

.side-member__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.side-member__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--lv-ink);
    font-size: 12px;
    font-weight: 600;
}

.side-member__status {
    color: var(--lv-muted);
    font-size: 10px;
}

.side-member__status.is-online {
    color: var(--lv-green);
}

.side-member__detail {
    color: var(--lv-muted);
    font-size: 11px;
    line-height: 1.4;
}

.side-member:hover .side-member__name {
    color: var(--lv-blue);
}

/* ---------- Tablette et mobile : une seule colonne ---------- */
@media (max-width: 1023px) {
    .home-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-side {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .side-stats {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: baseline;
        gap: 24px;
    }

    .side-stats h2 {
        margin: 0 auto 0 0;
    }
}

@media (max-width: 767px) {
    .home {
        padding: 20px 16px 32px;
        gap: 20px;
    }

    .home-members {
        padding: 18px 12px;
    }

    .home-members__item {
        flex-basis: calc((100% - 2 * 12px) / 3);
    }

    .home-section__head h2 {
        font-size: 18px;
    }

    .card__body {
        padding: 18px;
    }

    .card__main {
        flex-direction: column;
        gap: 16px;
    }

    .card__cover,
    .card__cover--tall {
        flex-basis: auto;
        width: 100%;
        height: 200px;
    }

    .card__title {
        font-size: 20px;
    }

    .card__actions {
        padding: 0 12px 0 18px;
    }

    .home-ads {
        flex-direction: column;
    }

    .home-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-stats {
        flex-wrap: wrap;
    }
}

/* Carrousel infini : coupe l'aimantation le temps du saut de repositionnement */
.home-members__track.is-jumping {
    scroll-snap-type: none;
    scroll-behavior: auto;
}
