/* ================================================
   SEARCH & FILTERS - diploma.africa v2
   Mobile-first, nettoyé
   ================================================ */

/* ========================================
   BASE - FORMULAIRES EXPOSÉS
   ======================================== */

.views-exposed-form {
  padding: 1rem;
}

.views-exposed-form .form--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.views-exposed-form .form-item {
  margin: 0;
  flex: 1;
  min-width: 150px;
}

.views-exposed-form .form-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.views-exposed-form select,
.views-exposed-form input[type="text"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-200, #e5e7eb);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: var(--gray-700, #374151);
  background: white;
  transition: border-color 0.2s;
}

.views-exposed-form select:focus,
.views-exposed-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}

.views-exposed-form .form-actions {
  display: flex;
  gap: 0.5rem;
}

/* Mobile */
@media (max-width: 767px) {
  .views-exposed-form .form--inline {
    flex-direction: column;
  }
  
  .views-exposed-form .form-item {
    width: 100%;
  }
  
  .views-exposed-form .form-actions {
    width: 100%;
  }
}

/* ========================================
   PAGINATION & INFINITE SCROLL
   ======================================== */

.pager {
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.pager__items {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pager__item a,
.pager__item span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
}

.pager__item--active span {
  background: var(--primary, #2563eb);
  color: white;
}

/* ========================================
   PAGE /FORMATIONS - HEADER
   ======================================== */

.formations-page-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 1rem;
  margin-bottom: 1rem;
}

.formations-page-header__inner {
  max-width: 1320px;
  margin: 0 auto;
}

/* Breadcrumb */
.formations-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.formations-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}

.formations-breadcrumb a:hover {
  color: #2563eb;
}

.formations-breadcrumb svg {
  width: 0.875rem;
  height: 0.875rem;
  color: #cbd5e1;
}

/* Titre H1 */
.formations-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.formations-page-title .title-prefix {
  color: #1e293b;
}

.formations-page-title .title-country {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sous-titre */
.formations-page-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
}

.formations-page-subtitle .count {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 2rem;
  font-weight: 600;
  color: #475569;
}

.formations-page-subtitle .count-number {
  color: #2563eb;
  font-weight: 700;
}

.formations-page-subtitle .divider {
  width: 4px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 50%;
}

/* ========================================
   PAGE /FORMATIONS - LAYOUT MOBILE
   ======================================== */

.view-formations-wrapper {
  padding-bottom: 5rem;
}

.formations-layout {
  display: flex;
  flex-direction: column;
}

.formations-sidebar {
  padding: 0 1rem 1rem;
}

.filters-card {
  background: #f9fafb;
  border-radius: 1rem;
  padding: 1.25rem;
}

.filters-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.formations-content {
  padding: 0 1rem;
}

.formations-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.formations-pager {
  margin-top: 1.5rem;
}

/* ========================================
   PAGE /FORMATIONS - DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {

  /* Header */
  .formations-page-header {
    padding: 2rem 2rem 1.75rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0fdfa 100%);
  }

  .formations-page-title {
    font-size: 2rem;
  }

  .formations-page-subtitle {
    font-size: 0.9375rem;
  }

  /* Container */
  .view-formations-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem;
  }

  /* Layout 2 colonnes */
  .formations-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
  }

  /* Sidebar sticky */
  .formations-sidebar {
    position: sticky;
    top: 80px;
    padding: 0;
    align-self: start;
  }

  .filters-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-top: 0.9rem;
  }

  .filters-title {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  /* Formulaire filtres */
  .filters-card .views-exposed-form {
    padding: 0;
  }

  .filters-card .views-exposed-form .form--inline,
  .filters-card .views-exposed-form > div {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .filters-card .views-exposed-form .form-item {
    width: 100%;
    min-width: 0;
    flex: none;
    margin: 0 0 0.5rem 0;
  }

  .filters-card .views-exposed-form select {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
  }

  .filters-card .views-exposed-form select:hover {
    border-color: #d1d5db;
  }

  .filters-card .views-exposed-form select:focus {
    outline: none;
    background-color: white;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }

  /* Options avancées */
  .filters-card details {
    margin: 0.75rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
  }

  .filters-card details summary {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem 0;
    list-style: none;
  }

  .filters-card details summary::-webkit-details-marker {
    display: none;
  }

  /* Bouton "Affiche tes résultats" dans filtres */
  .filters-card .views-exposed-form .form-actions {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
  }

  .filters-card .form-actions .form-submit,
  .filters-card .form-actions input[type="submit"],
  .filters-card .form-actions button[type="submit"],
  .filters-card .form-actions .button {
    display: block !important;
    width: 100% !important;
    padding: 0.875rem 1.25rem !important;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 0.75rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  }

  .filters-card .form-actions .form-submit:hover,
  .filters-card .form-actions input[type="submit"]:hover,
  .filters-card .form-actions button[type="submit"]:hover,
  .filters-card .form-actions .button:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-2px) !important;
  }

  /* Contenu résultats */
  .formations-content {
    padding: 0;
    min-width: 0;
  }

  .formations-pager {
    margin-top: 2rem;
  }
}

/* Large desktop */
@media (min-width: 1280px) {
  .formations-layout {
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
  }

  .formations-page-title {
    font-size: 2.25rem;
  }
}

/* ========================================
   BOUTON "AFFICHER PLUS" - PAGINATION
   Override diploma.css
   ======================================== */

.view-formations-wrapper .pager,
.view-formations-wrapper .js-pager__items {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem;
  margin-top: 1rem;
}

.view-formations-wrapper .pager__item {
  list-style: none;
}

.view-formations-wrapper .pager__item a.button,
.view-formations-wrapper .pager .button,
.formations-content .pager__item a.button,
.formations-pager .pager__item a.button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem !important;
  background: white !important;
  color: #2563eb !important;
  border: 2px solid #2563eb !important;
  border-radius: 0.75rem !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-formations-wrapper .pager__item a.button:hover,
.view-formations-wrapper .pager .button:hover,
.formations-content .pager__item a.button:hover,
.formations-pager .pager__item a.button:hover {
  background: #2563eb !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ========================================
   PAGE /ETABLISSEMENTS - HEADER
   ======================================== */

.etablissements-page-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 1rem;
  margin-bottom: 1rem;
}

.etablissements-page-header__inner {
  max-width: 1320px;
  margin: 0 auto;
}

/* Breadcrumb - FIX SVG GÉANT */
.etablissements-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.etablissements-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}

.etablissements-breadcrumb a:hover {
  color: #2563eb;
}

/* FIX CRITIQUE : Forcer les dimensions du 
SVG breadcrumb */
.etablissements-breadcrumb svg {
  width: 0.875rem !important;
  height: 0.875rem !important;
  min-width: 0.875rem;
  max-width: 0.875rem;
  flex-shrink: 0;
  color: #cbd5e1;
}

/* Titre H1 */
.etablissements-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.etablissements-page-title .title-prefix {
  color: #1e293b;
}

.etablissements-page-title .title-country {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sous-titre */
.etablissements-page-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
}

.etablissements-page-subtitle .count {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 2rem;
  font-weight: 600;
  color: #475569;
}

.etablissements-page-subtitle .count-number {
  color: #2563eb;
  font-weight: 700;
}

.etablissements-page-subtitle .divider {
  width: 4px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 50%;
}

/* ========================================
   PAGE /ETABLISSEMENTS - LAYOUT & FILTRES
   ======================================== */

.etablissements-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem;
}

/* Barre de recherche/filtres */
.etablissements-filters {
  margin-bottom: 1.5rem;
}

.etablissements-filters .views-exposed-form {
  padding: 0;
}

/* Champ de recherche principal */
.etablissements-filters input[type="text"],
.etablissements-filters input[type="search"] {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  background-color: #f9fafb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.875rem center;
  transition: all 0.2s;
}

.etablissements-filters input[type="text"]:focus,
.etablissements-filters input[type="search"]:focus {
  outline: none;
  border-color: #2563eb;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================
   PAGE /ETABLISSEMENTS - BOUTONS BEF
   Sélecteurs corrigés pour cibler le bon HTML
   ======================================== */

/* Forcer l'affichage des actions (override filters.css) */
.etablissements-filters .form-actions,
.etablissements-filters__inner .form-actions,
.view-etablissements-wrapper .form-actions,
#edit-actions {
  display: flex !important;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Bouton Appliquer (principal) */
.etablissements-filters input[type="submit"].form-submit,
.etablissements-filters__inner input[type="submit"],
.view-etablissements-wrapper input[type="submit"].form-submit,
#edit-submit-etablissements {
  padding: 0.75rem 1.5rem !important;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 0.5rem !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.etablissements-filters input[type="submit"].form-submit:hover,
.etablissements-filters__inner input[type="submit"]:hover,
#edit-submit-etablissements:hover {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px);
}

/* Bouton Réinitialiser (secondaire) - quand il sera activé */
.etablissements-filters input[value="Réinitialiser"],
.etablissements-filters input[value="Reset"],
.etablissements-filters__inner input[value="Réinitialiser"],
.view-etablissements-wrapper input[value="Réinitialiser"],
#edit-reset {
  padding: 0.75rem 1.25rem !important;
  background: transparent !important;
  color: #6b7280 !important;
  border: 1.5px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.etablissements-filters input[value="Réinitialiser"]:hover,
.etablissements-filters input[value="Reset"]:hover,
#edit-reset:hover {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
  color: #374151 !important;
}

/* ========================================
   PAGE /ETABLISSEMENTS - GRILLE RÉSULTATS
   FIX : Cibler le bon conteneur
   ======================================== */

.etablissements-results {
  width: 100%;
}

/* Le vrai conteneur de grille (Views Infinite Scroll) */
.etablissements-results .views-infinite-scroll-content-wrapper {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  /* Override clearfix qui casse le grid */
  float: none !important;
}

.etablissements-results .views-infinite-scroll-content-wrapper.clearfix::before,
.etablissements-results .views-infinite-scroll-content-wrapper.clearfix::after {
  display: none !important;
}

/* Chaque carte prend sa cellule */
.etablissements-results .views-infinite-scroll-content-wrapper > .views-row,
.etablissements-results .views-infinite-scroll-content-wrapper > .colonne {
  width: 100%;
  float: none !important;
}

/* Tablette : 2 colonnes */
@media (min-width: 640px) {
  .etablissements-results .views-infinite-scroll-content-wrapper {
    gap: 1.25rem;
  }
}

/* Desktop : 3 colonnes */
@media (min-width: 1024px) {
  .etablissements-results .views-infinite-scroll-content-wrapper {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem;
  }
}

/* Large desktop : toujours 3 colonnes mais plus espacées */
@media (min-width: 1280px) {
  .etablissements-results .views-infinite-scroll-content-wrapper {
    gap: 2rem;
  }
}

/* ========================================
   PAGE /ETABLISSEMENTS - DESKTOP LAYOUT
   ======================================== */

@media (min-width: 1024px) {
  .etablissements-page-header {
    padding: 2rem 2rem 1.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0fdfa 100%);
  }

  .etablissements-page-title {
    font-size: 2rem;
  }

  .etablissements-page-subtitle {
    font-size: 0.9375rem;
  }

  .etablissements-content {
    padding: 1.5rem 2rem 4rem;
  }

  /* Filtres en ligne sur desktop */
  .etablissements-filters .views-exposed-form .form--inline {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
  }

  .etablissements-filters .views-exposed-form .form-item {
    flex: 1;
    /* max-width: 400px; */
  }

  .etablissements-filters .form-actions {
    flex: 0 0 auto;
    margin-top: 0;
  }
}

@media (min-width: 1280px) {
  .etablissements-page-title {
    font-size: 2.25rem;
  }
}

/* ========================================
   PAGE /ETABLISSEMENTS - PAGINATION
   ======================================== */

.etablissements-pager {
  margin-top: 2rem;
  padding: 1.5rem 0;
  display: flex;
  justify-content: center;
}

.etablissements-pager .pager__item a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: white;
  color: #2563eb;
  border: 2px solid #2563eb;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.etablissements-pager .pager__item a.button:hover {
  background: #2563eb;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}


/**
 * Orientation Page Header & Form Styles
 * Harmonisé avec /formations et /etablissements
 */

/* ===== PAGE HEADER SEO ===== */
.orientation-page-header {
  padding: 1.5rem 1rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.orientation-page-header__inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Breadcrumb */
.orientation-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.orientation-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}

.orientation-breadcrumb a:hover {
  color: #2563eb;
}

.orientation-breadcrumb svg {
  width: 14px;
  height: 14px;
  stroke: #94a3b8;
}

.orientation-breadcrumb span:last-child {
  color: #334155;
}

/* Titre H1 */
.orientation-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
}

.orientation-page-title .title-prefix {
  color: #1e293b;
}

.orientation-page-title .title-country {
  color: #2563eb;
}

/* Sous-titre */
.orientation-page-subtitle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0;
}

.orientation-page-subtitle .count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
}

.orientation-page-subtitle .divider {
  width: 4px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 50%;
}

/* ===== FORM WRAPPER ===== */
.orientation-form-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Hero introduction du webform - ajuster le style existant */
.orientation-form-wrapper .form-introduction-wrapper {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  border-radius: 1rem;
  margin: 1.5rem 0;
  padding: 2rem;
  color: white;
}

.orientation-form-wrapper .form-introduction-wrapper p {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  line-height: 1.6;
}

.orientation-form-wrapper .form-introduction-wrapper p:last-child {
  margin-bottom: 0;
}

.orientation-form-wrapper .form-introduction-wrapper strong {
  color: white;
  font-weight: 600;
}

/* ===== DESKTOP ===== */
@media (min-width: 1024px) {
  .orientation-page-header {
    padding: 2rem 2rem 1.5rem;
  }
  
  .orientation-page-title {
    font-size: 2.25rem;
  }
  
  .orientation-form-wrapper {
    padding: 0 2rem 3rem;
  }
  
  .orientation-form-wrapper .form-introduction-wrapper {
    padding: 2.5rem 3rem;
    margin: 2rem 0;
  }
}

/* Fix SVG breadcrumb orientation */
.orientation-breadcrumb svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px;
  max-width: 14px;
  flex-shrink: 0;
}
