/* ==========================================================
   GRENOBLE POKER PONTOIS
   COMPOSANT GLOBAL : TITRE DE SECTION
   ==========================================================

   Utilisation :
   - Événements à venir
   - À la une
   - Derniers articles
   - Forum Winamax
   - Nos derniers inscrits
   - Autres pages du site

   Structure HTML :

   <h2 class="gp-section-title">
       <span
           class="glyphicon glyphicon-calendar gp-section-title-icon"
           aria-hidden="true">
       </span>

       <span class="gp-section-title-text">
           Titre de la section
       </span>
   </h2>

   Organisation :
   1. Conteneur du titre
   2. Icône
   3. Texte
   4. Variantes
   5. Responsive : tablette
   6. Responsive : mobile
   7. Responsive : petits mobiles

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


/* ==========================================================
   1. CONTENEUR DU TITRE
   ========================================================== */

/*
 * Composant générique pour les titres de section.
 *
 * Flexbox permet :
 * - L'alignement vertical de l'icône et du texte
 * - Un espacement constant
 * - Une présentation cohérente sur tout le site
 *
 * min-width: 0 permet au texte de se réduire
 * correctement dans un conteneur flex.
 */

.gp-section-title {
    display: flex;
    align-items: center;

    gap: 10px;

    min-width: 0;
    margin: 0;

    color: var(--gp-text);

    font-family: var(--gp-font-primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}


/* ==========================================================
   2. ICÔNE DU TITRE
   ========================================================== */

/*
 * Icône affichée avant le texte.
 *
 * Compatible avec les Glyphicons de Bootstrap 3.
 *
 * Bootstrap applique normalement :
 *
 * position: relative;
 * top: 1px;
 *
 * Nous neutralisons ce décalage pour obtenir
 * un alignement vertical cohérent.
 *
 * flex-shrink: 0 empêche la réduction de l'icône
 * lorsque le texte devient trop long.
 */

.gp-section-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    position: relative;
    top: 0;

    margin: 0;
    padding: 0;

    color: var(--gp-red);

    font-size: 23px;
    line-height: 1;
}


/* ==========================================================
   3. TEXTE DU TITRE
   ========================================================== */

/*
 * Partie textuelle du titre.
 *
 * Permet :
 * - Un alignement correct avec l'icône
 * - Le retour à la ligne si nécessaire
 * - La prévention des débordements horizontaux
 *
 * line-height: inherit conserve l'interligne
 * défini sur le titre parent.
 */

.gp-section-title-text {
    display: block;

    min-width: 0;

    line-height: inherit;
    overflow-wrap: break-word;
}


/* ==========================================================
   4. VARIANTES
   ========================================================== */

/*
 * Variantes de taille réutilisables.
 *
 * Elles permettent d'adapter les titres
 * à différents contextes sans créer
 * de nouveaux composants CSS.
 */


/* ----------------------------------------------------------
   4.1. TITRE PLUS GRAND
   ---------------------------------------------------------- */

/*
 * Exemple :
 *
 * <h2 class="gp-section-title gp-section-title--large">
 */

.gp-section-title--large {
    font-size: 26px;
}

.gp-section-title--large .gp-section-title-icon {
    font-size: 27px;
}


/* ----------------------------------------------------------
   4.2. TITRE PLUS PETIT
   ---------------------------------------------------------- */

/*
 * Exemple :
 *
 * <h2 class="gp-section-title gp-section-title--small">
 */

.gp-section-title--small {
    font-size: 18px;
}

.gp-section-title--small .gp-section-title-icon {
    font-size: 19px;
}


/* ==========================================================
   5. RESPONSIVE — TABLETTE
   ========================================================== */

/*
 * Largeur : 768px à 1199px.
 *
 * Réduction de la taille du titre et de l'icône.
 */

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

    .gp-section-title {
        font-size: 20px;
    }

    .gp-section-title-icon {
        font-size: 21px;
    }
}


/* ==========================================================
   6. RESPONSIVE — MOBILE
   ========================================================== */

/*
 * Largeur : jusqu'à 767px.
 *
 * Réduction des espacements pour les smartphones.
 */

@media (max-width: 767px) {

    .gp-section-title {
        gap: 8px;
        font-size: 17px;
    }

    .gp-section-title-icon {
        font-size: 19px;
    }
}


/* ==========================================================
   7. RESPONSIVE — PETITS MOBILES
   ========================================================== */

/*
 * Largeur : jusqu'à 380px.
 *
 * Adaptation supplémentaire pour les petits écrans.
 */

@media (max-width: 380px) {

    .gp-section-title {
        gap: 7px;
        font-size: 15px;
    }

    .gp-section-title-icon {
        font-size: 17px;
    }
}
