/**
 * Vitrine publique — téléphone, tablette, petits écrans.
 * Chargé après style.css / public-vitrine.css / vitrine-hero.css.
 */

/* ——— Base : pas de débordement horizontal ——— */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

main.home-page,
main[class$="-page"],
main:has(.page-wrapper) {
  overflow-x: hidden;
  max-width: 100%;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* ——— En-tête vitrine : logo + titre + menu (plus large que le contenu 900px) ——— */
.header.container {
  text-align: center;
  max-width: min(1180px, 100%);
  width: 100%;
  box-sizing: border-box;
  padding-left: 16px;
  padding-right: 16px;
  overflow: visible;
  position: relative;
  z-index: 40;
}

.header .header-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  position: relative;
  margin: 0 auto;
}

.header .logo {
  display: block;
  order: 1;
  width: min(380px, 100%);
  max-width: 380px;
  height: auto;
  margin: 0 auto !important;
  flex-shrink: 0;
}

/* Intitulé de page sous le logo */
.header-site-title {
  order: 2;
  margin: 0;
  padding: 0;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  color: #1f3c88;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  width: 100%;
}

.mobile-menu-toggle {
  order: 3;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  margin: 0;
  border: 1px solid #d0e8f7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  z-index: 50;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1f4e79;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop / grand écran : menu horizontal (retour à la ligne si besoin) */
@media (min-width: 1025px) {
  .mobile-menu-toggle {
    display: none !important;
  }

  .header .logo {
    width: min(420px, 92%);
    max-width: 420px;
  }

  .header .header-top {
    padding-bottom: 4px;
  }

  .header .main-nav {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 100%;
    white-space: normal;
    margin-top: 18px;
  }

  .header .main-nav a {
    white-space: nowrap;
  }
}

/* Tablette / mobile : liens toujours visibles en colonne (pas de menu caché) */
@media (max-width: 1024px) {
  .header.container {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .header .header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 0;
    padding: 8px 0 0;
    box-sizing: border-box;
  }

  .header .logo {
    order: 1;
    width: min(200px, 72%);
    max-width: 200px;
    margin: 0 auto !important;
  }

  .header-site-title {
    order: 2;
    width: 100%;
    margin: 0;
    padding: 0 12px;
    font-size: clamp(16px, 4vw, 22px);
  }

  /* Bouton hamburger inutile : les liens restent affichés */
  .mobile-menu-toggle {
    display: none !important;
  }

  .header .main-nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 0 4px;
    border-top: 1px solid #e8eef4;
    white-space: normal;
    background: #fff;
    position: relative;
    z-index: 45;
  }

  .header .main-nav a {
    width: 100%;
    text-align: center;
    padding: 12px 14px;
    font-size: 14px;
    border-right: none !important;
    border-radius: 8px;
    min-height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
  }

  .header .main-nav a.active::after {
    left: 14px;
    right: 14px;
    bottom: 6px;
  }
}

/* ——— Conteneurs & sections ——— */
@media (max-width: 1024px) {
  .about-section,
  .expertise-section,
  .dg-preview,
  .cta-section,
  .intro-section,
  .compliance-page .compliance-grid,
  .news-page .compliance-grid,
  .clients-page .info-section,
  .clients-page .features-section,
  .contact-page .contacts-section,
  .services-page .services-section,
  .dg-page .values-section,
  .dg-page .message-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .section-header {
    margin-bottom: 32px;
  }
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: 20px 16px !important;
    margin-bottom: 24px;
  }

  .container.page-wrapper {
    margin-left: auto;
    margin-right: auto;
  }

  /* Actualités : une colonne dès la tablette */
  .news-page .compliance-grid .compliance-cards {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .hero-btn-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-btn-primary,
  .hero-btn-secondary {
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-slide-content {
    padding: 16px 12px 48px;
  }
}

/* ——— Téléphone ——— */
@media (max-width: 640px) {
  .vitrine-hero {
    padding: 44px 16px 40px !important;
  }

  .vitrine-hero--compact {
    padding: 36px 16px 32px !important;
  }

  .vitrine-hero .hero-badge {
    font-size: 12px;
    padding: 5px 14px;
    margin-bottom: 12px;
  }

  .intro-card,
  .about-card,
  .dg-card,
  .cta-card,
  .compliance-card,
  .news-page .compliance-card,
  .contact-card,
  .service-card,
  .message-card {
    border-radius: 16px;
  }

  .cta-btn,
  .compliance-page .cta-btn,
  .clients-page .portal-link,
  .contact-page .contact-card a.cta-btn {
    display: flex;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    box-sizing: border-box;
    min-height: 48px;
  }

  .service-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .clients-page .info-card {
    text-align: center;
  }

  .clients-page .info-card .cta-btn {
    margin-left: auto;
    margin-right: auto;
  }

  /* Médiathèque */
  .page-wrapper .media-tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .page-wrapper .media-tab {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .page-wrapper .media-viewer {
    grid-template-columns: 40px 1fr 40px;
    gap: 8px;
  }

  .page-wrapper .nav-arrow,
  .page-wrapper .nav-arrow.left,
  .page-wrapper .nav-arrow.right {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 22px;
  }

  .page-wrapper .media-placeholder {
    padding: 24px 10px;
    min-height: 120px;
  }

  .page-wrapper .media-placeholder video,
  .page-wrapper .media-placeholder img {
    max-height: 55vh;
    object-fit: contain;
  }

  .page-wrapper .contact-card {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .header .logo {
    width: min(160px, 48vw);
    max-width: 160px;
  }

  .stats-bar {
    margin-left: 12px !important;
    margin-right: 12px !important;
    border-radius: 12px;
  }

  .expertise-card,
  .compliance-card-body {
    padding: 22px 18px;
  }

  .footer-container {
    padding: 16px 12px;
  }

  .footer-logo {
    width: 110px;
  }
}

/* ——— Tablette paysage : cartes actualités encore en 2 col entre 641–900 si souhaité ——— */
@media (min-width: 769px) and (max-width: 900px) {
  .news-page .compliance-grid .compliance-cards {
    grid-template-columns: 1fr;
  }
}

/* ——— Conformité PDF (complément) ——— */
@media (max-width: 768px) {
  .compliance-docs-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .compliance-docs-tab {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
}

/* ——— Zones tactiles ——— */
@media (hover: none) and (pointer: coarse) {
  .header .main-nav a,
  .media-tab,
  .hero-dot,
  .hero-arrow,
  .nav-arrow,
  .cta-btn,
  .expertise-card {
    -webkit-tap-highlight-color: rgba(42, 168, 74, 0.15);
  }

  .expertise-card:hover,
  .cta-btn:hover {
    transform: none;
  }
}
