/* ==========================================================
   GRENOBLE POKER PONTOIS
   COMPOSANT : CARTES D'ARTICLES DU FORUM

   Utilisé sur :
   - La page d'accueil
   - Les pages du forum

   SOMMAIRE
   --------
   1. Liste des discussions
   2. Cartes de discussion
   3. Avatars
   4. Titres des discussions
   5. Contenu des discussions
   6. Catégories
   7. Descriptions des discussions
   8. Métadonnées
   9. Compteur de commentaires
   10. Responsive tablette
   11. Responsive mobile
   12. Accessibilité

   Les styles spécifiques aux pages du forum sont dans :
   assets/css/pages/forum.css

   ========================================================== */

/* ==========================================================
   1. LISTE DES DISCUSSIONS
   ========================================================== */

.gp-forum-list {
    display: flex;
    flex-direction: column;
}


/* ==========================================================
   2. CARTES DE DISCUSSION

   Structure :
   - Avatar à gauche
   - Contenu à droite
   ========================================================== */

.gp-forum-item {
    display: flex;
    align-items: flex-start;

    gap: 12px;
    padding: 14px 0;

    border-bottom: 1px solid var(--gp-border);
}

.gp-forum-item:first-child {
    padding-top: 0;
}

.gp-forum-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}


/* ==========================================================
   3. AVATARS
   ========================================================== */

/* 3.1. Conteneur */

.gp-forum-avatar {
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    margin-top: 0;
}


/* 3.2. Lien vers le profil */

.gp-forum-avatar-link {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;
    overflow: hidden;

    background-color: #f1f5f9;

    border: 1px solid var(--gp-border);
    border-radius: 50%;

    color: #94a3b8;
    text-decoration: none;
}

.gp-forum-avatar-link:hover,
.gp-forum-avatar-link:focus {
    color: var(--gp-red);
    text-decoration: none;
}


/* 3.3. Avatar par défaut */

.gp-forum-avatar-placeholder {
    position: static;
    display: block;

    width: auto;
    height: auto;

    margin: 0;
    padding: 0;

    font-size: 19px;
    line-height: 1;
    text-align: center;
}

.gp-forum-avatar-placeholder.glyphicon {
    top: 0;
}


/* 3.4. Image */

.gp-forum-avatar-link img {
    position: absolute;
    top: 0;
    left: 0;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 50%;
}


/* ==========================================================
   4. TITRES DES DISCUSSIONS
   ========================================================== */

.gp-forum-item-title {
    margin: 0 0 5px;

    color: var(--gp-text);

    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;

    overflow-wrap: anywhere;
}

.gp-forum-item-title a,
.gp-forum-item-title a:visited {
    color: var(--gp-text);
    text-decoration: none;
}

.gp-forum-item-title a:hover,
.gp-forum-item-title a:focus {
    color: var(--gp-red);
    text-decoration: none;
}


/* ==========================================================
   5. CONTENU DES DISCUSSIONS
   ========================================================== */

.gp-forum-item-content {
    flex: 1;
    min-width: 0;
}


/* ----------------------------------------------------------
   5.1. EN-TÊTE : TITRE ET BOUTON DE SUIVI
   ---------------------------------------------------------- */

.gp-forum-item .entry-item-ctn-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}


/* ----------------------------------------------------------
   5.2. TITRE DES CARTES MODERNES
   ---------------------------------------------------------- */

.gp-forum-item .gp-forum-item-title {
    flex: 1;
    min-width: 0;

    margin: 0;

    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}


/* ==========================================================
   6. CATÉGORIES
   ========================================================== */

.gp-forum-item-category {
    display: inline-block;
    align-self: flex-start;

    padding: 3px 8px;

    background-color: #e9eef4;

    border-radius: 4px;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.gp-forum-item-category a {
    color: var(--gp-text);
    text-decoration: none;
}

.gp-forum-item-category a:hover,
.gp-forum-item-category a:focus {
    color: var(--gp-red);
    text-decoration: none;
}


/* ==========================================================
   7. DESCRIPTIONS DES DISCUSSIONS
   ========================================================== */

/*
 * Le conteneur n'est pas limité en hauteur,
 * afin de conserver le lien "lire la suite".
 */

.gp-forum-item-description {
    margin-top: 8px;
    margin-bottom: 10px;

    color: var(--gp-text);

    font-size: 13px;
    line-height: 1.6;
}


/* ----------------------------------------------------------
   7.1. EXTRAIT LIMITÉ À DEUX LIGNES
   ---------------------------------------------------------- */

.gp-forum-item-excerpt {
    display: -webkit-box;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;

    overflow: hidden;
}


/* ==========================================================
   8. MÉTADONNÉES
   ========================================================== */

/* Pied de la discussion */

.gp-forum-item-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 6px 16px;

    margin-top: 8px;

    color: var(--gp-text-muted, #777);
    font-size: 12px;
}


/* Informations secondaires */

.gp-forum-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 4px 12px;

    margin-top: 10px;

    color: var(--gp-text-muted, #777);
    font-size: 12px;
}


/* ==========================================================
   9. COMPTEUR DE COMMENTAIRES
   ========================================================== */

/* Présentation commune */

.gp-forum-item .gp-forum-comments {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    font-size: 12px;
    line-height: 1.5;

    white-space: nowrap;
}


/* ----------------------------------------------------------
   9.1. DISCUSSION AVEC COMMENTAIRES
   ---------------------------------------------------------- */

.gp-forum-item .gp-forum-comments-link {
    color: var(--gp-text-muted, #777);
    text-decoration: none;

    cursor: pointer;

    transition: color 0.15s ease;
}

.gp-forum-item .gp-forum-comments-link:hover,
.gp-forum-item .gp-forum-comments-link:focus {
    color: var(--gp-red, #c62828);
    text-decoration: underline;
}


/* ----------------------------------------------------------
   9.2. DISCUSSION SANS COMMENTAIRE
   ---------------------------------------------------------- */

.gp-forum-item .gp-forum-comments-empty {
    color: #999;
    cursor: default;
}


/* ==========================================================
   10. RESPONSIVE — TABLETTE

   Largeur : 768px à 1199px
   ========================================================== */

@media (min-width: 768px) and (max-width: 1199px) {

    .gp-forum-avatar,
    .gp-forum-avatar-link {
        width: 38px;
        height: 38px;
    }

    .gp-forum-avatar {
        flex-basis: 38px;
    }
}


/* ==========================================================
   11. RESPONSIVE — MOBILE

   Largeur : jusqu'à 767px
   ========================================================== */

@media (max-width: 767px) {

    /* Avatars */

    .gp-forum-avatar,
    .gp-forum-avatar-link {
        width: 35px;
        height: 35px;
    }

    .gp-forum-avatar {
        flex-basis: 35px;
    }

    .gp-forum-avatar-placeholder {
        font-size: 17px;
    }

    /* Cartes */

    .gp-forum-item {
        gap: 10px;
    }

    .gp-forum-item .entry-item-ctn-title {
        flex-wrap: wrap;
    }
}


/* ==========================================================
   12. ACCESSIBILITÉ
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .gp-forum-item .gp-forum-comments-link {
        transition: none;
    }
}
