/* ========================================
   HOMEPAGE - diploma.africa v2
   Mobile-first responsive
   ======================================== */

.page-front .page-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: white;
}

/* ========================================
   HEADER
   ======================================== */

.page-front .site-header {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid #f3f4f6;
  z-index: 50;
}

.page-front .header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .page-front .header-inner {
    padding: 1rem 1.5rem;
    max-width: 64rem;
    margin: 0 auto;
  }
}

/* Logo */
.page-front .site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.page-front .logo-image {
  width: 180px;
  height: auto;
}

@media (min-width: 640px) {
  .page-front .logo-image {
    width: 250px;
  }
}

.page-front .logo-fallback {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
}

.page-front .logo-diploma {
  color: #2563eb;
}

.page-front .logo-dot {
  color: #06b6d4;
}

.page-front .logo-africa {
  color: #1f2937;
}

/* ========================================
   COUNTRY SWITCHER
   ======================================== */

.country-switcher {
  position: relative;
}

.country-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.country-trigger:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.country-trigger .chevron {
  transition: transform 0.2s;
}

.country-switcher.open .chevron {
  transform: rotate(180deg);
}

.country-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 14rem;
  max-height: 60vh;
  overflow-y: auto;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0;
  z-index: 100;
}

.country-switcher.open .country-dropdown {
  display: block;
}

.country-dropdown .dropdown-label {
  padding: 0.5rem 1rem;
  font-size: 0.65rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: white;
}

.country-dropdown .country-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  text-decoration: none;
  color: #374151;
  transition: background 0.15s;
}

.country-dropdown .country-option:hover {
  background: #f9fafb;
}

.country-dropdown .country-option.active {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.country-dropdown .country-code {
  font-weight: 700;
  font-size: 0.875rem;
  width: 1.75rem;
}

.country-dropdown .country-name {
  font-size: 0.875rem;
}

/* ========================================
   HERO
   ======================================== */

.homepage-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 7rem;
  text-align: center;
}

@media (min-width: 640px) {
  .homepage-hero {
    padding: 2rem 1.5rem 6rem;
  }
}

@media (min-width: 1280px) {
  .homepage-hero {
    padding: 3rem 2rem 4rem;
  }
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
  margin: 0 0 0.75rem 0;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }
}

@media (min-width: 1280px) {
  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
}

.hero-subtitle {
  /*color: #6b7280;*/
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
  max-width: 22rem;
}

@media (min-width: 640px) {
  .hero-subtitle {
    font-size: 0.9rem;
    max-width: 28rem;
    margin-bottom: 2rem;
  }
}

.hero-subtitle strong {
  color: #374151;
}

.hero-subtitle .highlight {
  display: block;
  margin-top: 0.5rem;
  color: #06b6d4;
  font-weight: 900;
}

/* ========================================
   SEARCH FORM
   ======================================== */

.homepage-search-form {
  width: 100%;
  max-width: 100%;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .homepage-search-form {
    max-width: 26rem;
    padding: 0;
  }
}

.homepage-search-form > div,
.homepage-search-form .views-exposed-form,
.homepage-search-form .bef-exposed-form {
  background: #f9fafb;
  border-radius: 1.25rem;
  padding: 1.25rem;
  margin: 0;
}

@media (min-width: 640px) {
  .homepage-search-form > div,
  .homepage-search-form .views-exposed-form,
  .homepage-search-form .bef-exposed-form {
    padding: 1.5rem;
    border-radius: 1.5rem;
  }
}

.homepage-search-form form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

@media (min-width: 640px) {
  .homepage-search-form form {
    gap: 0.75rem;
  }
}

.homepage-search-form label,
.homepage-search-form .form-item > label,
.homepage-search-form .description,
.homepage-search-form .bef-secondary-options {
  display: none !important;
}

.homepage-search-form .form-item {
  margin: 0 !important;
  padding: 0 !important;
}

.homepage-search-form select {
  width: 100%;
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  font-size: 0.9rem;
  color: #374151;
  background-color: white;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.125rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

@media (min-width: 640px) {
  .homepage-search-form select {
    padding: 1rem 3rem 1rem 1rem;
    border-radius: 1rem;
    font-size: 1rem;
    background-position: right 1rem center;
    background-size: 1.25rem;
  }
}

.homepage-search-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.homepage-search-form select:hover {
  border-color: #d1d5db;
}

.homepage-search-form .form-actions {
  margin: 0.5rem 0 0 0 !important;
  padding: 0 !important;
}

.homepage-search-form input[type="submit"],
.homepage-search-form button[type="submit"],
.homepage-search-form .form-submit {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 0.875rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 640px) {
  .homepage-search-form input[type="submit"],
  .homepage-search-form button[type="submit"],
  .homepage-search-form .form-submit {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    font-size: 1rem;
  }
}

.homepage-search-form input[type="submit"]:hover,
.homepage-search-form button[type="submit"]:hover {
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.homepage-search-form input[type="submit"]:active,
.homepage-search-form button[type="submit"]:active {
  transform: translateY(0);
}

/* Hide reset button */
.homepage-search-form input[value="Réinitialiser"],
.homepage-search-form .bef-reset-button,
.homepage-search-form .form-reset {
  display: none !important;
}

/* ========================================
   STATS
   ======================================== */

.homepage-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .homepage-stats {
    gap: 2rem;
    margin-top: 2.5rem;
  }
}

.homepage-stats .stat {
  text-align: center;
}

.homepage-stats .stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

@media (min-width: 640px) {
  .homepage-stats .stat-number {
    font-size: 2.25rem;
  }
}

.homepage-stats .stat-number.primary {
  color: #2563eb;
}

.homepage-stats .stat-number.secondary {
  color: #06b6d4;
}

.homepage-stats .stat-label {
  font-size: 0.65rem;
  color: #6b7280;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

@media (min-width: 640px) {
  .homepage-stats .stat-label {
    font-size: 0.7rem;
    margin-top: 0.375rem;
  }
}

.homepage-stats .stat-divider {
  width: 1px;
  height: 2.5rem;
  background-color: #e5e7eb;
}

@media (min-width: 640px) {
  .homepage-stats .stat-divider {
    height: 3rem;
  }
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */

.page-front .bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #f3f4f6;
  padding: 0.5rem 1rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}

.page-front .bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  padding: 0.5rem 0.25rem;
  text-decoration: none;
  color: #9ca3af;
  transition: color 0.2s;
}

.page-front .bottom-nav-item:hover {
  color: #6b7280;
}

.page-front .bottom-nav-item.active {
  color: #2563eb;
}

.page-front .bottom-nav-item .nav-icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.page-front .bottom-nav-item span {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
}

@media (min-width: 640px) {
  .page-front .bottom-nav-item span {
    font-size: 0.7rem;
  }
}

/* Hide bottom nav on desktop */
@media (min-width: 1280px) {
  .page-front .bottom-nav {
    display: none;
  }
  
  .homepage-hero {
    padding-bottom: 3rem;
  }
}

/* ========================================
   DESKTOP NAVIGATION & FOOTER
   Breakpoint: 1024px+
   ======================================== */

/* === NAVIGATION DESKTOP (cachée par défaut) === */
.desktop-nav {
  display: none;
}

/* === BOUTON ESPACE ÉTABLISSEMENT (caché par défaut) === */
.btn-etablissement {
  display: none;
}

/* === FOOTER (caché sur mobile) === */
.site-footer {
  display: none;
}

/* ========================================
   DESKTOP STYLES (1024px+)
   ======================================== */
@media (min-width: 1024px) {
  
  /* --- Header Desktop --- */
  .site-header .header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
  }
  
  /* Navigation desktop visible */
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  
  .desktop-nav__link {
    color: #6b7280;
    font-size: 0.9375rem;
    font-weight: 900;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
  }
  
  .desktop-nav__link:hover {
    color: #2563eb;
  }
  
  .desktop-nav__link.is-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
  }

  /* Actions header (bouton + sélecteur) */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  /* Bouton Espace Établissement */
  .btn-etablissement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: #2563eb;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  
  .btn-etablissement:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
  }
  
  .btn-etablissement svg {
    width: 1rem;
    height: 1rem;
  }

  /* --- Bottom Nav cachée --- */
  .bottom-nav {
    display: none !important;
  }
  
  .page-front .bottom-nav {
    display: none !important;
  }

  /* --- Hero ajusté --- */
  .homepage-hero {
    padding: 3rem 2rem 2rem;
    min-height: calc(100vh - 180px);
  }
  
  .hero-title {
    font-size: 2.75rem;
    margin-bottom: 1.25rem;
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
    max-width: 36rem;
    margin-bottom: 0.75rem;
  }
  
  .hero-subtitle .highlight {
    margin-top: 0.75rem;
    font-size: 1.125rem;
  }

  /* Search form plus large */
  .homepage-search-form {
    max-width: 32rem;
  }
  
  .homepage-search-form > div,
  .homepage-search-form .views-exposed-form,
  .homepage-search-form .bef-exposed-form {
    padding: 1.75rem;
  }

  /* Stats */
  .homepage-stats {
    gap: 3rem;
    margin-top: 2.5rem;
  }
  
  .homepage-stats .stat-number {
    font-size: 2.75rem;
  }
  
  .homepage-stats .stat-label {
    font-size: 0.75rem;
  }

  /* --- Footer visible --- */
  .site-footer {
    display: block;
    border-top: 1px solid #f3f4f6;
    padding: 1.25rem 2rem;
    background: white;
  }
  
  .page-front .site-footer {
    margin-top: auto;
  }
  
  .footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .footer-copyright {
    color: #9ca3af;
    font-size: 0.8125rem;
  }
  
  .footer-copyright a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
  }
  
  .footer-copyright a:hover {
    color: #2563eb;
  }
  
  .footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  
  .footer-links__link {
    color: #9ca3af;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  
  .footer-links__link:hover {
    color: #2563eb;
  }
}

/* ========================================
   LARGE DESKTOP (1280px+)
   ======================================== */
@media (min-width: 1280px) {
  .hero-title {
    font-size: 3rem;
  }
  
  .homepage-search-form {
    max-width: 36rem;
  }
  
  .desktop-nav {
    gap: 2.5rem;
  }
  
  .desktop-nav__link {
    font-size: 1rem;
  }
}
