/* ==========================================================================
   VDM Header Block
   Reproduit le design de mairie-marseille15-16.fr
   ========================================================================== */

/* ==========================================================================
   1. Conteneur principal — header
   ========================================================================== */
.vdm-header-block {
  top: 0;
  left: 0;
  pointer-events: none;
  width: 1052px;
  text-align: center;
  margin: 0 auto;
}

#block-vdm-entetemobilelogorecherchemenu {
  position: absolute;
  left: 0;
  top: 35px;
}

/* Compensation barre d'administration Drupal */
.toolbar-fixed .vdm-header-block {
  top: calc(40px + 39px);
}
.toolbar-fixed.toolbar-horizontal.toolbar-tray-open .vdm-header-block {
  top: calc(40px + 79px);
}

/* Mobile : header colle aux bords, fond blanc, 70px de hauteur */
@media (max-width: 768px) {
  .vdm-header-block {
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: #fff;
    height: 70px;
    pointer-events: auto;
    display: flex;
    align-items: center;
  }
  .toolbar-fixed .vdm-header-block {
    top: 46px;
  }
  .toolbar-fixed.toolbar-horizontal .vdm-header-block {
    top: 46px;
  }
}

/* ==========================================================================
   2. Groupe gauche : logo + bouton hamburger
   ========================================================================== */
.vdm-burger-logo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 40;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

/* Sur mobile : on inverse l'ordre → hamburger à gauche, logo à droite */
@media (max-width: 768px) {
  .vdm-burger-logo {
    flex-direction: row-reverse;
    position: static;
    align-items: center;
  }
}

/* -- Logo (carré bleu) ---------------------------------------------------- */
.vdm-burger-logo__logo {
  background-color: rgba(0, 153, 204, 0.74);
  position: relative;
  padding: 18px;
  margin-bottom: 5px; /* descend légèrement sous le header pour former un carré */
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .vdm-burger-logo__logo {
    padding: 8px 0;
    margin-bottom: 0;
    width: 50px;
  }
}

.vdm-burger-logo__logo a {
  display: block;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  height: 87px;
  width: 114px;
  font-size: 0;
}

.vdm-burger-logo__logo a img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  .vdm-burger-logo__logo a {
    height: 34px;
    width: 40px;
    margin: 0 auto;
  }
}

.vdm-burger-logo__name {
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
}

/* -- Bouton hamburger (carré bleu) --------------------------------------- */
.vdm-burger-logo__burger {
  display: flex !important;
  height: 60px;
  padding: 18px;
  width: auto;
  background: #0099cc;
  transition: 200ms linear background;
  align-items: center;
  cursor: pointer;
  border: none;
  outline: none;
  gap: 10px;
  pointer-events: auto;
}

.vdm-burger-logo__burger:hover {
  background: #2977a7;
}

@media (max-width: 768px) {
  .vdm-burger-logo__burger {
    height: 50px;
    padding: 10px;
    margin-right: 10px;
    justify-content: center;
  }
}

/* Les 3 barres du hamburger */
.vdm-burger-logo__burger-lines {
  position: relative;
  width: 26px;
  height: 20px;
  flex-shrink: 0;
}

.vdm-burger-logo__burger-lines span {
  display: block;
  position: absolute;
  background: #fff;
  height: 3px;
  width: 26px;
  border-radius: 99px;
  left: 3px;
  transition: 200ms ease-in-out;
}

.vdm-burger-logo__burger-lines span:nth-child(1) { top: calc(50% - 7px); }
.vdm-burger-logo__burger-lines span:nth-child(2) { top: calc(50% - 1px); }
.vdm-burger-logo__burger-lines span:nth-child(3) { top: calc(50% + 5px); }

/* État ouvert : animation croix */
.vdm-burger-logo__burger.open .vdm-burger-logo__burger-lines span:nth-child(1) {
  top: calc(50% - 1px);
  transform: rotate(45deg);
}
.vdm-burger-logo__burger.open .vdm-burger-logo__burger-lines span:nth-child(2) {
  opacity: 0;
}
.vdm-burger-logo__burger.open .vdm-burger-logo__burger-lines span:nth-child(3) {
  top: calc(50% - 1px);
  transform: rotate(-45deg);
}

/* Texte "MENU" à côté du hamburger */
.vdm-burger-logo__burger-text {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  font-family: "Montserrat", "Orkney Bold", sans-serif;
  line-height: 20px;
  position: relative;
  top: 2px;
  left: 5px;
}

/* Masquer le texte sur mobile */
@media (max-width: 768px) {
  .vdm-burger-logo__burger-text {
    display: none;
  }
}

/* ==========================================================================
   3. Icône recherche (droite) — carré bleu
   ========================================================================== */
.vdm-header-search-icon {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 40;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0099cc;
  color: #fff;
  cursor: pointer;
  transition: 200ms linear background;
  pointer-events: auto;
}

.vdm-header-search-icon:hover,
.vdm-header-search-icon:focus {
  background: #0086b3;
  outline: none;
}

.vdm-header-search-icon svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 768px) {
  .vdm-header-search-icon {
    height: 50px;
    width: 50px;
    position: static;
    margin-left: auto;
  }
}

/* ==========================================================================
   4. Formulaire de recherche déroulant (depuis la droite)
   ========================================================================== */
.vdm-header-search-form {
  position: absolute;
  top: 0;
  right: 60px; /* juste à gauche de l'icône loupe */
  z-index: 40;
  height: 60px;
  width: 0;
  background: #fff;
  overflow: hidden;
  transition: 200ms linear width;
  pointer-events: auto;
}

.vdm-header-search-form.open {
  width: calc(100% - 250px);
}

.vdm-header-search-form form {
  display: block;
  font-size: 0;
  height: 100%;
}

.vdm-header-search-form form input[type="search"],
.vdm-header-search-form form input[type="text"] {
  display: inline-block;
  vertical-align: top;
  width: calc(100% - 60px);
  line-height: 40px;
  font-size: 20px;
  border: 0;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  padding: 10px 20px;
  height: 60px;
  outline: none;
  color: #0d1948;
}

.vdm-header-search-form form input[type="submit"],
.vdm-header-search-form form button[type="submit"] {
  display: inline-block;
  vertical-align: top;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  height: 60px;
  color: #0d1948;
  border: 0;
  width: 60px;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  text-align: center;
  line-height: 60px;
  font-size: 20px;
}

@media (max-width: 768px) {
  .vdm-header-search-form {
    right: 50px;
    background: #fff;
    height: 50px;
    position: static;
    width: 0;
    flex-shrink: 0;
  }
  .vdm-header-search-form.open {
    width: calc(100% - 50px) !important;
  }
  .vdm-header-search-form form input[type="search"],
  .vdm-header-search-form form input[type="text"] {
    height: 50px;
    font-size: 17px;
    width: calc(100% - 50px);
  }
  .vdm-header-search-form form input[type="submit"],
  .vdm-header-search-form form button[type="submit"] {
    width: 50px;
    line-height: 50px;
    height: 50px;
  }
}

/* ==========================================================================
   5. Menu plein écran (#menu_principal via .menu-main)
      Ces styles complètent ceux existants dans style.css / style_responsive.css
   ========================================================================== */

/* Quand le menu est ouvert, bloquer le scroll de body */
body.vdm-menu-open {
  overflow: hidden;
}

/* Ajustements scroll : padding top pour compenser le header fixe */
body.vdm-is-scrolled .vdm-header-block > .container,
body.vdm-is-scrolled #vdm-header-block > .container {
  width: 100%;
  max-width: 1580px;
}


/* Conteneur principal
   -------------------------------------------------------------------------- */
.vdm-header-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  position: relative;
  z-index: 200;
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

/* État scrollé : le bloc devient fixé en haut et compacté
   -------------------------------------------------------------------------- */
.vdm-header-block.is-scrolled {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0.4rem 1rem;
}

/* Ajustement quand la barre d'administration Drupal est visible */
.toolbar-fixed .vdm-header-block.is-scrolled {
  top: 39px;
}
.toolbar-fixed.toolbar-horizontal.toolbar-tray-open .vdm-header-block.is-scrolled {
  top: 79px;
}

/* ==========================================================================
   Logo
   ========================================================================== */
.vdm-header-logo {
  flex: 0 0 auto;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.vdm-header-logo__link {
  display: block;
  line-height: 0;
}

.vdm-header-logo__img {
  max-height: 60px;
  width: auto;
  transition: max-height 0.3s ease;
}

.vdm-header-logo__name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
}

/* Logo compacté au scroll */
.vdm-header-block.is-scrolled .vdm-header-logo__img {
  max-height: 36px;
}

/* Animation : logo glisse vers la gauche au scroll */
.vdm-header-block.is-scrolled .vdm-header-logo {
  transform: translateX(-0.5rem);
}

/* ==========================================================================
   Zone de recherche
   ========================================================================== */
.vdm-header-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Formulaire de recherche (visible en état normal) */
.vdm-header-search__form {
  width: 100%;
  max-width: 400px;
  transition: opacity 0.25s ease, max-width 0.35s ease;
}

.vdm-header-search__form form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.vdm-header-search__form input[type="search"],
.vdm-header-search__form input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 0.9rem;
}

.vdm-header-search__form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.vdm-header-search__form button[type="submit"] {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: #fff;
}

/* Icône recherche compacte (masquée par défaut, visible au scroll) */
.vdm-header-search__icon {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 0.4rem;
  line-height: 0;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.vdm-header-search__icon svg {
  width: 22px;
  height: 22px;
}

/* Au scroll : masquer le formulaire, afficher l'icône,
   et décaler l'ensemble vers la gauche                 */
.vdm-header-block.is-scrolled .vdm-header-search {
  flex: 0 0 auto;
  justify-content: flex-start;
  transform: translateX(-0.5rem);
  padding: 0 0.5rem;
}

.vdm-header-block.is-scrolled .vdm-header-search__form {
  display: none;
}

.vdm-header-block.is-scrolled .vdm-header-search__icon {
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Bouton menu hamburger
   ========================================================================== */
.vdm-header-burger {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: relative;
  z-index: 300;
}

.vdm-header-burger__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.vdm-header-burger__label {
  font-size: 0.65rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
  font-family: 'Orkney Bold', sans-serif;
}

/* État ouvert : animation croix */
.vdm-header-burger.open .vdm-header-burger__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.vdm-header-burger.open .vdm-header-burger__bar:nth-child(2) {
  opacity: 0;
}

.vdm-header-burger.open .vdm-header-burger__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.vdm-header-burger.open .vdm-header-burger__label {
  display: none;
}

/* ==========================================================================
   Panneau de recherche — ouvert via l'icône en état scrollé
   ========================================================================== */
.vdm-search-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--vdm-header-top-color, #002454);
  padding: 1rem;
  z-index: 250;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vdm-search-panel.is-open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: opacity-menu 0.3s ease;
}

.vdm-search-panel form {
  display: flex;
  flex: 1;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.vdm-search-panel input[type="search"],
.vdm-search-panel input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.6rem 1rem;
  color: #fff;
  font-size: 1rem;
}

.vdm-search-panel button[type="submit"] {
  background: transparent;
  border: none;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  color: #fff;
}

.vdm-search-panel__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

/* ==========================================================================
   6. Panneau de menu plein écran
   ========================================================================== */

/* Overlay couvrant toute la page */
.vdm-fullmenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 35; /* sous .vdm-burger-logo et .vdm-header-search-icon (z-index: 40) */
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.vdm-fullmenu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow-y: auto;
}

/* Conteneur intérieur : positionné à droite du groupe logo+burger
   (flex-direction: column → ~188px de hauteur, ~155px de largeur) */
.vdm-fullmenu__inner {
  display: flex;
  min-height: 100%;
  position: relative;
  left: 35%;
  top: 25%;
}

/* --------------------------------------------------------------------------
   Colonne gauche — items du menu "main" (niveau 1)
   -------------------------------------------------------------------------- */
.vdm-fullmenu__col-main {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid #dde3ea;
  padding-right: 50px;
}

.vdm-fullmenu__main-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vdm-fullmenu__main-item {
  border-bottom: 1px solid #dde3ea;
}

.vdm-fullmenu__main-item:first-child {
  border-top: 1px solid #dde3ea;
}

.vdm-fullmenu__main-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1948;
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  transition: color 0.15s ease;
}

.vdm-fullmenu__main-link:hover,
.vdm-fullmenu__main-link:focus {
  color: #0099cc;
  outline: none;
}

.vdm-fullmenu__main-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.vdm-fullmenu__main-link-text {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Colonne droite — navigation secondaire niveaux 1 et 2
   -------------------------------------------------------------------------- */
.vdm-fullmenu__col-nav {
  flex: 1;
  padding-left: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 50px;
  align-content: flex-start;
}

.vdm-fullmenu__nav-section {
  width: 220px;
  margin-bottom: 30px;
}

.vdm-fullmenu__nav-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #0d1948;
  text-decoration: none;
  margin-bottom: 10px;
  font-family: "Montserrat", sans-serif;
  transition: color 0.15s ease;
}

.vdm-fullmenu__nav-title:hover,
.vdm-fullmenu__nav-title:focus {
  color: #0099cc;
  outline: none;
}

.vdm-fullmenu__nav-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vdm-fullmenu__nav-child-item {
  margin-bottom: 5px;
}

.vdm-fullmenu__nav-child-link {
  font-size: 0.9rem;
  color: #0099cc;
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  line-height: 1.4;
  transition: text-decoration 0.1s ease;
}

.vdm-fullmenu__nav-child-link:hover,
.vdm-fullmenu__nav-child-link:focus {
  text-decoration: underline;
  outline: none;
}

/* --------------------------------------------------------------------------
   Responsive mobile
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .vdm-fullmenu__inner {
    flex-direction: column;
    padding-top: 80px;   /* le header mobile fait ~70px */
    padding-left: 20px;
    padding-right: 20px;
  }

  .vdm-fullmenu__col-main {
    width: 100%;
    border-right: 0;
    border-bottom: 2px solid #dde3ea;
    padding-right: 0;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  .vdm-fullmenu__col-nav {
    padding-left: 0;
    gap: 0 20px;
  }

  .vdm-fullmenu__nav-section {
    width: calc(50% - 10px);
  }
}
