/* Lot 5.3 ter : deux références définitives ; photographies originales intactes.
   Styles du bandeau regroupés ici. Les règles de navigation restent distinctes. */
:root { --header-height: 144px; }
[hidden] { display: none !important; }
.garden-header {
  --brand-size: 52px;
  --halo-width: min(1000px, 84vw);
  --header-illustration: url('../../ressources/illustrations/bandeaux/bandeau-jardin.webp');
  position: relative;
  isolation: isolate;
  height: var(--header-height);
  min-height: var(--header-height);
  overflow: clip;
  border: 0;
  background: var(--forest) var(--header-illustration) center 54% / cover no-repeat;
}
.garden-header.administration-header { --header-illustration: url('../../ressources/v3/illustrations/bandeau-administration.webp'); }
.garden-header::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: -42px; translate: -50% 0;
  width: var(--halo-width); height: 190px;
  background: rgba(255,253,245,.88);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  --fade-x: linear-gradient(to right, transparent, rgba(0,0,0,.16) 5%, rgba(0,0,0,.6) 12%, #000 20%, #000 80%, rgba(0,0,0,.6) 88%, rgba(0,0,0,.16) 95%, transparent);
  --fade-y: linear-gradient(to bottom, transparent, #000 30%, #000 66%, rgba(0,0,0,.75) 80%, rgba(0,0,0,.25) 93%, transparent);
  mask-image: var(--fade-x), var(--fade-y); mask-composite: intersect;
  -webkit-mask-image: var(--fade-x), var(--fade-y); -webkit-mask-composite: source-in;
  mask-repeat: no-repeat;
}
@supports not ((mask-composite: intersect) or (-webkit-mask-composite: source-in)) {
  .garden-header::before { background: radial-gradient(ellipse closest-side, #fffdf5e0 25%, #fffdf599 58%, transparent); }
}
.garden-header .header-identity-band { position: relative; z-index: 1; isolation: isolate; height: 100%; display: grid; place-items: center; }
.garden-header .brand {
  display: flex; flex-direction: column; align-items: center;
  position: relative; translate: 0 -7px;
  gap: 3px; max-width: 100%; padding: 0 20px;
  border: 0; background: transparent; box-shadow: none;
  color: #173b22;
}
.garden-header .brand-wordmark { display: inline-flex; align-items: center; justify-content: center; gap: 0; min-width: 0; font-size: var(--brand-size); white-space: nowrap; }
.garden-header .brand-name { font-family: 'Birds of Hell', cursive; font-size: 1em; font-weight: 400; line-height: 1.15; letter-spacing: normal; transform: none; }
.garden-header .brand-wordmark > .brand-leaf { --icon-size: 52px; margin-right: 4px; translate: 0 0; }
.garden-header .brand .brand-subtitle { margin: 0; text-align: center; font-size: 23px; line-height: 1.35; white-space: nowrap; }
.garden-header .header-photograph-band { position: absolute; z-index: 2; top: 19px; right: 24px; }
.garden-header .garden-date {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 9px; margin: 0; padding: 7px 12px;
  border: 1px solid #d4cfb18c; border-radius: 11px;
  background: rgba(255,253,245,.94); color: #355a43;
  box-shadow: 0 2px 9px #24392520;
  font-size: 16.5px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.garden-header .garden-date > .v3-picture { --icon-size: 27px; }
.header-menu-divider,.date-divider,.date-short { display: none; }
.app-layout { min-height: calc(100dvh - var(--header-height)); }
@media (min-width:701px) {
  .app-layout:not(.guest-layout) { background: linear-gradient(to right, var(--forest), #274d32 210px, transparent 210px); }
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  overflow-y: auto;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 10px;
  background: linear-gradient(to right, var(--forest), #274d32);
  box-shadow: inset -1px 0 #142f2820;
}
.sidebar::before {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  left: 0;
  bottom: 80px;
  width: 180px;
  height: 270px;
  max-height: max(0px, calc(100% - 650px));
  background: url('../../ressources/v3/ornements/branche-menu-pc-validee.webp') left bottom / contain no-repeat;
}
.sidebar > a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #fffdf5;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.sidebar > a[aria-current] {
  color: var(--ink);
  background: linear-gradient(110deg, #c4d799, #dce6b9);
  border-color: #d5e4b5;
  box-shadow: inset 0 1px #fffdf566, 0 1px 3px #18362320;
}
.sidebar > a:not([aria-current]):hover { background: #ffffff12; border-color: #a5b99c66; color: #fffdf5; }
.sidebar img {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.sidebar form { margin-top: auto; padding-top: 2rem; }
.logout {
  background: #244a2ed9;
  border: 1px solid var(--sage);
  color: #fffdf5;
  width: 100%;
  min-height: 44px;
  padding: .65rem;
  border-radius: var(--radius-control);
  font-weight: 700;
}
.logout:hover { background: var(--forest); }
.mobile-nav { display: none; }
.menu-toggle { display: none; }
.menu-toggle, .menu-close {
  width: 44px;
  height: 44px;
  padding: 9px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: rgba(245, 242, 232, .9);
  color: var(--green);
}
.menu-toggle img, .menu-close img { width: 26px; height: 26px; object-fit: contain; }
.navigation-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  width: min(320px, calc(100vw - 44px));
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0 20px 20px 0;
  background: var(--forest);
  color: white;
  box-shadow: 8px 0 28px #102d2b40;
  overscroll-behavior: contain;
}
.navigation-drawer[open] { display: flex; flex-direction: column; }
.navigation-drawer::backdrop { background: #132b2080; backdrop-filter: blur(2px); }
.drawer-heading { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.drawer-heading h2 { margin: 0; font-size: 1.15rem; color: #fffdf5; }
.menu-close { display: grid; }
.navigation-drawer .sidebar { flex: 1; background: transparent; position: relative; top: auto; height: auto; align-self: stretch; }
body.menu-open { position: fixed; width: 100%; overflow: hidden; }
body.menu-open .mobile-nav { display: none; }
@media (max-width: 1050px) {
  .garden-date .date-full { display: none; }
  .garden-date .date-short { display: inline; }
}
@media (max-width: 700px) {
  :root {
    --identity-height: clamp(64px, 19.34vw, 84px);
    --photograph-height: clamp(56px, 17vw, 74px);
    --header-height: calc(var(--identity-height) + var(--photograph-height));
    --header-overlap: clamp(14px, 4.15vw, 18px);
  }
  .garden-header { height: var(--header-height); background: var(--forest); }
  .garden-header::before { display: none; }
  .garden-header .header-identity-band {
    height: var(--identity-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-inline: clamp(11px, 3.4vw, 16px);
    /* Médiane du fond de la référence Android approuvée ; menu inchangé. */
    background: #0e5720;
    --brand-size: clamp(28px, 8.81vw, 38px);
  }
  .garden-header .header-identity-band::after {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    right: 0; top: 0; width: clamp(105px, 33vw, 145px); height: 100%;
    background: url('../../ressources/ornements/guirlande-lierre.webp') 70% center / auto 115px no-repeat;
    opacity: .35; filter: blur(1.5px);
    mask-image: linear-gradient(to right, transparent, #000 70%);
  }
  .garden-header.guest-header .header-identity-band::after { display: none; }
  .garden-header .menu-toggle {
    position: relative; z-index: 2;
    width: clamp(44px, 12vw, 52px); height: 48px;
    padding: 8px; border: 0; background: transparent;
  }
  .garden-header .menu-toggle .v3-picture { --icon-size: 32px; }
  .garden-header .header-menu-divider {
    display: block; position: absolute;
    left: calc(clamp(11px, 3.4vw, 16px) + clamp(44px, 12vw, 52px) + clamp(3px, 11.3vw - 33.16px, 12px));
    top: 50%; translate: 0 -50%;
    width: 1px; height: clamp(28px, 8.7vw, 38px);
    background: #fffdf599;
  }
  .garden-header .brand {
    /* Centrage selon les contours visibles : la référence est légèrement
       à gauche du centre, et la calligraphie déborde sa largeur d'avance. */
    position: absolute; left: calc(50% - 1.8vw); top: 50%; translate: -50% -50%;
    padding: 0; gap: 0; color: #fffdf5;
    width: max-content; max-width: calc(100% - 108px);
  }
  .garden-header .brand-wordmark { font-size: var(--brand-size); }
  .garden-header .brand-name { line-height: 1.2; }
  .garden-header .brand .brand-subtitle { display: none; }
  .garden-header .brand-wordmark > .brand-leaf {
    --icon-size: clamp(32px, 9.35vw, 41px); margin-right: 3px; translate: 0 1px;
  }
  /* Seule la présentation devient blanche : dessin, alpha et fichier intacts. */
  .garden-header .brand-leaf > img { filter: brightness(0) invert(1); }
  .garden-header .header-photograph-band {
    position: relative; top: auto; right: auto;
    height: var(--photograph-height);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: clamp(7px, 5.3vw - 9px, 13px);
    background: var(--forest) var(--header-illustration) center bottom / max(100%, 336px) auto no-repeat;
    border-radius: 0;
  }
  .garden-header .garden-date {
    margin: 0; padding: 3px 8px; gap: 7px;
    border-radius: 999px; font-size: .875rem; line-height: 1.4;
    color: #0e5720;
    max-width: calc(100% - 20px);
  }
  .garden-header .garden-date > .v3-picture { --icon-size: 24px; }
  .garden-header .date-divider { display: block; width: 1px; height: 23px; background: #0e572077; }
  .garden-header .garden-date .date-full { display: inline; }
  .garden-header .garden-date .date-short { display: none; }
  .js-ready .menu-toggle { display: grid; }
  .js-ready .sidebar:not(.is-open) { display: none; }
  .navigation-drawer .sidebar { padding: 4px 10px 14px; }
  .sidebar > a { min-height: 54px; }
  .sidebar img { width: 34px; height: 34px; }
  .sidebar::before { display: none; }
  .app-layout { position: relative; z-index: 1; margin-top: calc(-1 * var(--header-overlap)); border-radius: clamp(14px, 4.35vw, 20px) clamp(14px, 4.35vw, 20px) 0 0; background: var(--ivory); }
  .navigation-drawer .logout { min-height: 44px; }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: linear-gradient(var(--panel), var(--ivory));
    box-shadow: 0 -2px 6px #263b2510;
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #173b22;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
  }
  .mobile-nav a[aria-current] {
    background: linear-gradient(#c4d799, #e0e8c4);
    border-color: #b8cc96;
  }
  .mobile-nav img { width: 32px; height: 32px; object-fit: contain; background: transparent; }
}
