/* =========================================
   LAYOUT GLOBAL
   ========================================= */

.layout-page {
  min-height: 100vh;
}

.region-content {
  padding: 0;
}

/* =========================================
   APP SHELL (sidebar + contenu)
   ========================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-body {
  margin-left: 280px;
  flex: 1 1 auto;
  min-width: 0; /* évite les overflows dans les contenus longs */
  display: flex;
  flex-direction: column;
}

.app-sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  flex: 0 0 280px;
  position: fixed;
  left: 0;
  z-index: 1030;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  background: #ffffff;
  border-right: 1px solid var(--color-border);
}

.toolbar-tray-open .app-sidebar {
  top: 79px;
  height: calc(100vh - 79px);
}

/* Branding dans la sidebar */
.app-sidebar .site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-sidebar .site-branding-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-sidebar .block-system-branding-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.25rem 0.25rem 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.app-sidebar .site-logo img {
  height: 44px;
  width: auto;
  border-radius: 14px;
}

.app-sidebar .site-title {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
}

@media (max-width: 767.98px) {
  .app-shell {
    flex-direction: column;
  }
  .app-sidebar {
    display: none;
  }
  .app-body {
    margin-left: 0;
  }
}

/* Sidebar “rail” sur tablette / fenêtre moyenne */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .app-sidebar {
    width: 88px;
    flex-basis: 88px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  
  .app-body {
    margin-left: 88px;
  }

  .app-sidebar .block-system-branding-block {
    justify-content: center;
  }

  /* Rail tablette : branding centré, texte masqué */
  .app-sidebar .site-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
  }

  .app-sidebar .site-title,
  .app-sidebar .site-slogan {
    display: none;
  }

  .app-sidebar .site-logo {
    margin: 0 auto;
  }

}

.main-content {
  flex: 1;
  padding: var(--content-pad-top) var(--layout-pad-x) calc(var(--layout-pad-y) * 2);
}

.site-footer {
  padding: var(--space-3) var(--layout-pad-x) calc(var(--layout-pad-y) * 1.5);
}

/* Si bottom-nav présente : éviter que le contenu soit caché */
.has-bottom-nav .main-content {
  padding-bottom: 90px;
}

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

.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header-inner {
  padding: var(--header-pad-y) var(--header-pad-x) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.region-content-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.site-logo img {
  height: 48px;
  width: auto;
  display: block;
}

.region-content-header .form-control {
  height: 48px;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 999px;
}

/* =========================
   HEADER LAYOUT (logo | search | account)
   ========================= */

.region-content-header {
  display: flex;
  align-items: center;
  gap: 12px;              /* espace entre logo et search */
  width: 100%;
}

.region-content-header > .block-system-branding-block {
  flex: 0 0 auto;
}

.region-content-header > .views-exposed-form {
  flex: 1 1 auto;         /* la search prend la place */
  min-width: 0;           /* important pour éviter overflow */
}
