/**
 * Bras-sur-Meuse — optimisations mobile (≤ 900px)
 */

@media (max-width: 900px) {
  :root {
    --bras-mobile-gutter: 1rem;
    --bras-safe-top: env(safe-area-inset-top, 0px);
    --bras-tabbar-height: 4.1rem;
  }

  body.bras-site {
    overflow-x: clip;
  }

  /* ——— Shell application ——— */
  body.bras-site .bras-header {
    position: sticky;
    top: 0;
    z-index: 130;
    background: rgba(243, 242, 239, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(16, 16, 15, 0.06);
    box-shadow: none;
  }

  body.bras-site .bras-header-wave-slot {
    display: none !important;
  }

  body.bras-site .bras-menu-toggle {
    display: none !important;
  }

  body.bras-site .bras-nav {
    display: none !important;
  }

  body.bras-site .bras-home-header-actions {
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
  }

  body.bras-site .bras-home-citizen {
    display: none !important;
  }

  body.bras-site .bras-home-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 999px;
    color: var(--bras-ink, #10100f);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(16, 16, 15, 0.08);
  }

  /* Orbes de couleur : même présence qu’au desktop */
  body.bras-site .bras-bg-decor {
    opacity: 1;
  }

  body.bras-site .bras-bg-decor__orb {
    opacity: 0.95;
    filter: blur(1.5px);
  }

  /* ——— Bandeau contact ——— */
  body.bras-site:not(.home) .bras-topbar {
    font-size: 0.74rem;
  }

  .bras-topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding-block: 0.45rem;
  }

  .bras-topbar__contact {
    min-width: 0;
    line-height: 1.35;
  }

  .bras-topbar__contact:last-child {
    flex-wrap: wrap;
    row-gap: 0.15rem;
  }

  .bras-header__inner {
    min-height: 3.4rem;
    padding-block: 0.35rem;
    gap: 0.55rem;
  }

  .bras-brand__logo,
  .bras-brand .custom-logo {
    max-height: 42px;
    max-width: min(190px, 52vw);
  }

  /* ——— Accueil : blocs besoins / rubriques ——— */
  body.home .bras-home-topics {
    padding: 2rem 0 2.25rem;
  }

  body.home .bras-home-topics__head,
  body.home .bras-home-topics__inner {
    width: min(100% - 1.25rem, var(--bras-max, 1240px));
    margin-inline: auto;
  }

  body.home .bras-home-topic {
    min-height: 3.35rem;
    padding: 0.85rem 0.95rem;
  }

  body.home .bras-home-topic__label {
    font-size: 0.92rem;
  }

  body.home .bras-home-topic__desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  /* ——— Pages internes ——— */
  body.bras-site:not(.home) .bras-page-hero {
    padding: calc(1.35rem + var(--bras-safe-top)) 0 1.35rem;
  }

  body.bras-site:not(.home) .bras-page-hero .bras-container,
  body.bras-site:not(.home) .bras-content,
  body.bras-site:not(.home) .bras-section .bras-container,
  .bras-archive-grid {
    width: min(100% - 1.25rem, var(--bras-inner-max, 1080px));
    margin-inline: auto;
  }

  body.bras-site:not(.home) .bras-page-title {
    font-size: clamp(1.65rem, 7vw, 2.15rem);
  }

  body.bras-site:not(.home) .bras-lead,
  body.bras-site:not(.home) .bras-page-hero__lead {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .bras-archive-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding-block: 1.75rem 2.25rem;
    width: min(100% - 1.25rem, var(--bras-inner-max, 1080px));
    margin-inline: auto;
    max-width: 100%;
  }

  .bras-archive-grid .bras-news-card {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .bras-archive-grid .bras-news-card__media {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
  }

  .bras-archive-grid .bras-news-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  body.bras-site:not(.home) .bras-container.bras-archive-grid {
    width: min(100% - 1.25rem, var(--bras-inner-max, 1080px));
    padding-inline: 0;
  }

  .bras-contact-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* ——— Pied de page ——— */
  .bras-footer--minimal .bras-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.15rem 1rem calc(0.35rem + var(--bras-safe-bottom, 0px));
  }

  .bras-footer--minimal .bras-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.65rem;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .bras-footer--minimal .bras-footer__sep {
    display: none;
  }

  .bras-footer--minimal .bras-footer__links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    padding: 0.15rem 0;
  }

  .bras-footer-home__inner > .bras-footer-home__grid,
  .bras-footer-home__inner > .bras-footer-home__labels,
  .bras-footer-home__inner > .bras-footer-home__main,
  .bras-footer-home__inner > .bras-footer-home__bottom {
    width: min(100% - 1.25rem, var(--bras-max, 1240px));
    margin-inline: auto;
  }

  .bras-footer-home__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .bras-footer-home__legal {
    gap: 0.15rem 0.65rem;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .bras-footer-home__legal .bras-footer__sep {
    display: none;
  }

  .bras-footer-home__legal a {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    padding: 0.15rem 0;
  }

  /* ——— Tabbar flottante ancrée au premier plan ——— */
  body.bras-site .bras-mobile-tabbar,
  .bras-mobile-tabbar {
    display: flex;
    position: fixed !important;
    left: 0.7rem;
    right: 0.7rem;
    bottom: calc(0.45rem + var(--bras-safe-bottom, 0px));
    z-index: 200;
    min-height: var(--bras-tabbar-height);
    padding: 0.4rem 0.35rem;
    border: 1px solid rgba(16, 16, 15, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(30, 20, 12, 0.16);
  }

  .has-mobile-tabbar {
    padding-bottom: calc(var(--bras-tabbar-height) + 1.1rem + var(--bras-safe-bottom, 0px));
  }

  .bras-mobile-tabbar__item {
    min-height: 2.7rem;
    padding: 0.25rem 0.1rem;
    font-size: 0.62rem;
    border-radius: 12px;
  }

  .bras-mobile-tabbar__item.is-active {
    background: rgba(139, 35, 50, 0.08);
  }

  .bras-mobile-tabbar__icon {
    width: 1.45rem;
    height: 1.45rem;
  }

}


@media (max-width: 380px) {
  .bras-topbar__contact span[aria-hidden="true"] {
    display: none;
  }

  .bras-mobile-tabbar__label {
    font-size: 0.58rem;
  }
}
