/* ================================================
   BLOG MOBILE — blog-mobile.css
   Projet : E-KOULIBA
   Auteur : Axelle
   ================================================ */

/* -----------------------------------------------
   ANIMATIONS GLOBALES
----------------------------------------------- */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes floatCircle {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes lineGrow {
  from { width: 0; }
  to   { width: 20px; }
}


/* -----------------------------------------------
   SECTION 1 — HERO BLOG
----------------------------------------------- */
@media (max-width: 768px) {

  /* ---- Wrapper principal ---- */
  .blog-hero {
    padding: 16px 16px 8px;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg-primary);
  }

  /* Cercle décoratif teal — haut droite */
  .blog-hero::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27,74,71,0.18) 0%, transparent 70%);
    animation: floatCircle 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
  }

  /* Cercle décoratif or — bas gauche */
  .blog-hero::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,168,67,0.18) 0%, transparent 70%);
    animation: floatCircle 6s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
  }

  /* ---- Conteneur : 1 colonne sur mobile ---- */
  .blog-hero__container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0;
    position: relative;
    z-index: 1;
  }

  /* ---- Label animé ---- */
  .blog-hero__label {
    animation: fadeSlideUp 0.5s ease forwards;
  }

  .label-line {
    animation: lineGrow 0.6s ease forwards;
  }

  /* ---- Titre ---- */
  .blog-hero__title {
    font-size: 1.6rem;
    animation: fadeSlideUp 0.6s ease 0.1s both;
  }

  /* Shimmer doré sur "Technique" */
  .blog-hero__title .text-or {
    background: linear-gradient(
      90deg,
      var(--color-or) 0%,
      var(--color-or-clair) 50%,
      var(--color-or) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
  }

  /* ---- Description ---- */
  .blog-hero__desc {
    font-size: 0.85rem;
    max-width: 100%;
    animation: fadeSlideUp 0.6s ease 0.2s both;
  }

  /* ---- Tags catégories : flex wrap mobile ---- */
  .blog-hero__tags {
    grid-template-columns: unset !important;
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    animation: fadeSlideUp 0.6s ease 0.3s both;
  }

  /* Tous les tags visibles — spécificité haute */
  .blog-hero__tags .blog-tag {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Tags or — impairs */
  .blog-hero__tags .blog-tag:nth-child(odd) {
    color: var(--color-or);
    border-color: var(--color-or);
    background: rgba(212, 168, 67, 0.06);
  }

  /* Tags teal — pairs */
  .blog-hero__tags .blog-tag:nth-child(even) {
    color: var(--color-teal);
    border-color: var(--color-teal);
    background: rgba(27, 74, 71, 0.06);
  }

  /* Max 4 tags sur mobile — cache le 5ème et au-delà */
  .blog-hero__tags .blog-tag:nth-child(n+5) {
    display: none !important;
  }

  /* Désactive l'effet fill hover desktop */
  .blog-tag::before {
    display: none;
  }

  /* ---- Éléments cachés sur mobile ---- */
  .blog-hero__stats  { display: none; }
  .blog-hero__right  { display: none; }
  .blog-preview-card { display: none; }

}


/* -----------------------------------------------
   SECTION 2 — RECHERCHE
----------------------------------------------- */
@media (max-width: 768px) {

  /* ---- Wrapper section ---- */
  .blog-search {
    padding: 24px 16px 20px;
    border: none;
    animation: fadeSlideUp 0.5s ease forwards;
  }

  .blog-search__container {
    padding: 0;
    gap: 12px;
  }

  /* ---- Barre de recherche ---- */
  .blog-search__bar {
    position: relative;
  }

  .blog-search__input {
    font-size: 0.82rem;
    padding: 13px 44px 13px 16px;
    box-sizing: border-box;
    animation: fadeSlideUp 0.6s ease 0.1s both;
  }

  /* Bouton loupe repositionné mobile */
  .blog-search__icon-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px;
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Supprime le rotate au toucher */
  .blog-search__icon-btn:hover {
    transform: translateY(-50%);
  }

  .blog-search__icon {
    width: 16px;
    height: 16px;
  }

  /* ---- Message résultats actifs ---- */
  .blog-search__active {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
    padding-left: 0;
    animation: fadeSlideUp 0.4s ease both;
  }

  .blog-search__clear {
    font-size: 0.70rem;
    padding: 2px 10px;
  }

  /* ---- Tendances : scroll horizontal ---- */
  .blog-search__trends {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    animation: fadeSlideUp 0.6s ease 0.2s both;
  }

  .blog-search__trends::-webkit-scrollbar {
    display: none;
  }

  /* Label "Tendances :" */
  .blog-search__trends-label {
    padding-left: 0;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--color-text-primary);
  }

  /* Conteneur tags tendances */
  .blog-search__trends-tags {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    min-height: 28px;
  }

  .blog-search__trends-tags::-webkit-scrollbar {
    display: none;
  }

  /* Tous les tags tendances visibles */
  .blog-search__trends-tags .blog-trend-tag {
    display: inline-flex !important;
    align-items: center;
    font-size: 0.65rem;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 20px;
    transition: border-color 0.25s ease,
                color 0.25s ease,
                background-color 0.25s ease;
  }

  /* Tags tendances — même style exact que les boutons catégories */
.blog-search__trends-tags .blog-trend-tag {
  font-size: 0.65rem;
  padding: 5px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.25s ease,
              color 0.25s ease,
              background-color 0.25s ease;
}

.blog-search__trends-tags .blog-trend-tag:hover {
  transform: none;
  border-color: var(--color-or);
  color: var(--color-or);
  background-color: rgba(212, 168, 67, 0.08);
  box-shadow: none;
}

.blog-search__trends-tags .blog-trend-tag.trend-active {
  background-color: var(--color-or);
  color: var(--color-text-primary);
  border-color: var(--color-or);
}

.blog-search__trends-tags .blog-trend-tag.trend-active:hover {
  transform: none;
  color: var(--color-text-primary);
  background-color: var(--color-or);
}
}

/* -----------------------------------------------
   SECTION 3 — GRILLE ARTICLES
----------------------------------------------- */
@media (max-width: 768px) {

  /* ---- Wrapper section ---- */
  .blog-articles {
    padding: 24px 0 0;
    animation: fadeSlideUp 0.5s ease forwards;
  }

  .blog-articles__container {
    padding: 0 12px;
    gap: 20px;
  }

  /* ---- Filtres catégories : scroll horizontal ---- */
  .blog-articles__filters {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding-left: 0;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .blog-articles__filters::-webkit-scrollbar {
    display: none;
  }

  /* Label "Catégories :" */
  .blog-articles__filters-label {
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .blog-articles__filters-btns {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
  }

  /* Boutons catégorie — taille réduite */
  .blog-cat-btn {
    font-size: 0.65rem;
    padding: 5px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.25s ease,
                color 0.25s ease,
                background-color 0.25s ease;
  }

  /* Hover — couleur sans montée */
  .blog-cat-btn:hover {
    transform: none;
    border-color: var(--color-or);
    color: var(--color-or);
    background-color: rgba(212, 168, 67, 0.08);
    box-shadow: none;
  }

  /* Bouton actif */
  .blog-cat-btn--active {
    background-color: var(--color-or);
    color: var(--color-text-primary);
    border-color: var(--color-or);
  }

  .blog-cat-btn--active:hover {
    transform: none;
    color: var(--color-text-primary);
    background-color: var(--color-or);
  }


  

  /* ---- Grille : 2 colonnes sur mobile ---- */
  .blog-articles__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
  }

  /* ---- Cards articles — animation décalée ---- */
  .blog-card {
    border-radius: 12px;
    animation: fadeSlideUp 0.6s ease both;
  }

  .blog-card:nth-child(1) { animation-delay: 0.05s; }
  .blog-card:nth-child(2) { animation-delay: 0.15s; }
  .blog-card:nth-child(3) { animation-delay: 0.25s; }
  .blog-card:nth-child(4) { animation-delay: 0.35s; }

  /* Image réduite */
  .blog-card__img-wrapper    { height: 110px; }
  .blog-card__img-placeholder { height: 110px; }
  .blog-card__img-placeholder svg { width: 28px; height: 28px; }

  /* Corps card */
  .blog-card__body  { padding: 10px 12px 14px; gap: 6px; }
  .blog-card__cat   { font-size: 0.72rem; }
  .blog-card__title { font-size: 0.78rem; line-height: 1.35; }
  .blog-card__meta  { flex-direction: column; gap: 3px; font-size: 0.68rem; }
  .blog-card__btn   { font-size: 0.75rem; padding: 7px 0; }

  /* Overlay extrait au hover — désactivé sur mobile */
  .blog-card__hover-overlay { display: none; }

  /* ---- Supprime les effets hover tactiles ---- */
  @media (hover: none) {

    .blog-card:hover {
      transform: none !important;
      box-shadow: none !important;
      border-color: var(--color-separator) !important;
    }

    .blog-card:hover .blog-card__img   { transform: none !important; }
    .blog-card:hover .blog-card__title { color: var(--color-text-primary) !important; }

    .blog-trend-tag:hover,
    .blog-tag:hover,
    .blog-cat-btn:hover          { transform: none !important; }

    .blog-pagination__prev:hover,
    .blog-pagination__next:hover { transform: none !important; }

  }

}


/* -----------------------------------------------
   SECTION 4 — PAGINATION
----------------------------------------------- */
@media (max-width: 768px) {

  .blog-pagination        { padding: 16px 0 28px; }
  .blog-pagination__container { padding: 0 16px; }

  /* Bouton Précédente */
  .blog-pagination__prev  { font-size: 0.72rem; padding: 7px 14px; }

  /* Info centrale */
  .blog-pagination__current { font-size: 0.82rem; }
  .blog-pagination__total   { font-size: 0.68rem; }

  /* Bouton Suivante */
  .blog-pagination__next  { font-size: 0.72rem; padding: 7px 14px; }

  /* Supprime le glissement au toucher */
  .blog-pagination__prev:hover,
  .blog-pagination__next:hover { transform: none; }

}


/* ============================================
     7. NEWSLETTER — popup adaptée mobile
     ============================================ */
  .nl-modal {
    padding: 38px 24px 28px;
    border-radius: 22px;
    max-width: 100%;
  }

  .nl-close {
    width: 32px;
    height: 32px;
    top: 12px;
    right: 12px;
  }
  .nl-close svg { width: 14px; height: 14px; }

  .nl-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }
  .nl-icon svg { width: 24px; height: 24px; }

  .nl-pretitle { font-size: 9.5px; }

  .nl-title {
    font-size: 22px;
    line-height: 1.15;
    margin-bottom: 12px;
  }

  .nl-desc {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 22px;
  }

  .nl-input {
    padding: 12px 12px 12px 38px;
    font-size: 13px;
  }
  .nl-input-wrap svg { width: 14px; height: 14px; left: 12px; }

  .nl-submit {
    padding: 13px 18px;
    font-size: 10.5px;
    letter-spacing: 0.12em;
  }

  .nl-success {
    padding: 12px;
    font-size: 13px;
  }

  .nl-legal {
    font-size: 10px;
    margin-top: 14px;
  }

  /* FAB plus petit */
  .nl-fab {
    bottom: 22px;
    right: 22px;
    padding: 11px 16px;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    gap: 8px;
  }

  .nl-fab svg { width: 14px; height: 14px; }