/* MaPêcheSession : mêmes fonds et commandes que MaPêcheConnect. */
:root { color-scheme: dark; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { isolation: isolate; min-height: 100svh; background: transparent; }
body::before { z-index: -2; pointer-events: none; filter: none; background: linear-gradient(rgba(3,4,10,.12),rgba(3,4,10,.12)), url('/assets/img/bg-desktop.jpg') right center / cover no-repeat; }
body::after { display: none; }
html[data-theme="light"] body { background: transparent !important; }
html[data-theme="light"] body::before { display: block !important; background: url('/assets/img/bg-light-desktop-v2.webp') right center / cover no-repeat; }
#app, .card, .post, .sheet, .two-col > *, .grid2 > *, .grid3 > *, .row > * { min-width: 0; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { flex-wrap: wrap; }
input, select, textarea { min-width: 0; max-width: 100%; scroll-margin-block: 110px; }
input[type="checkbox"], input[type="radio"] { flex-shrink: 0; }
.card, .post-body, .hero-text, .comment, .sheet, .footer-links { overflow-wrap: anywhere; }
.tabsbar { max-width: 100%; padding-bottom: 4px; }
.tabsbar > * { flex-shrink: 0; }
.hero-actions > .btn, .hero-actions > button { white-space: normal; overflow: visible; line-height: 1.3; padding-block: 10px; }
.site-header .brand { flex-shrink: 0; }
.nav-user { min-width: 0; }
.nav-user .btn-nav { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
button.small, .choices .chip, .footer-links a { min-height: 44px; }
.footer-links a { display: inline-flex; align-items: center; }
:is(a, button, .chip):focus-visible { outline: 3px solid var(--purple2); outline-offset: 3px; }
.sheet-back { z-index: 2000; padding-top: env(safe-area-inset-top); }
.sheet { max-height: 92dvh; overscroll-behavior: contain; }
#map { height: clamp(300px, 60dvh, 680px); }
.layer-panel { max-width: calc(100% - 20px); max-height: calc(100% - 20px); overflow-y: auto; }
#toast { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px); }
html[data-theme="light"] .sheet { background: linear-gradient(#fff, #f5f9f6); }
html[data-theme="light"] .chip.on, html[data-theme="light"] :is(button,.btn).primary,
html[data-theme="light"] .pwa-header-btn, html[data-theme="light"] nav.tabs a.fab span.bubble { color: #fff !important; }
html[data-theme="light"] .mobile-menu-btn span { background: #162f31; }
@media (max-width: 1599px) {
  :root { --header-h: 76px; }
  .site-header { height: calc(var(--header-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); gap: 12px; }
  .site-header .brand { margin-right: auto; max-width: calc(100% - 108px); }
  .mobile-menu-btn { display: flex !important; flex: 0 0 46px; }
  .site-nav { display: none !important; position: absolute; top: 100%; right: max(14px, env(safe-area-inset-right)); width: min(320px, calc(100vw - 28px)); flex-direction: column; align-items: stretch; gap: 6px; padding: 12px; max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top) - 16px); overflow-y: auto; overscroll-behavior: contain; background: var(--mpc-canvas-0_97-value-ed32ea3fa1, rgba(5,3,10,.97)); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
  .site-nav.open { display: flex !important; }
  .site-nav a, .site-nav button { width: 100%; justify-content: flex-start; padding-inline: 18px; min-height: 46px; }
  .site-nav .nav-user { width: 100%; }
  .site-nav .nav-user .btn-nav { width: auto; max-width: none; flex: 1; }
  .site-nav .nav-user .icon-btn { flex: 0 0 46px; justify-content: center; }
}
@media (max-width: 1100px) {
  body::before { background-image: linear-gradient(rgba(3,4,10,.12),rgba(3,4,10,.12)), url('/assets/img/bg-mobile.jpg'); background-position: center top; }
  html[data-theme="light"] body::before { background-image: url('/assets/img/bg-light-mobile-v2.webp'); background-position: center top; }
}
@media (min-width: 600px) and (max-width: 899px) {
  #app, #app.wide { max-width: 840px; padding-inline: 28px; }
  .species-grid, .events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
  .sheet-back { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; padding: 24px; max-height: calc(100dvh - 48px); }
}
@media (min-width: 900px) { #toast { bottom: 24px; } }
@media (max-width: 599px) {
  :root { --header-h: 72px; }
  .site-header .brand { gap: 6px; font-size: clamp(16px, 4.6vw, 24px); letter-spacing: -.7px; }
  .site-header .brand .logo-img { width: 34px; height: 34px; flex-shrink: 0; }
  #app { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .card { padding: 16px; border-radius: 20px; }
  .post-head { flex-wrap: wrap; }
  .post-body { flex-wrap: wrap; }
  .post-actions { margin-left: auto; }
  .species-grid, .events-grid { grid-template-columns: minmax(0, 1fr); }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar h1 { flex-basis: 100%; }
  .page-hero h1 { font-size: clamp(34px, 10vw, 56px); }
  .site-footer { margin-top: 24px; }
  .footer-inner { width: 100%; }
  body.no-nav .site-footer { padding-bottom: 24px; }
  .footer-links { gap: 4px 14px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  body::before, html[data-theme="light"] body::before { inset: 0 0 auto; height: 100svh; background-size: 100% auto; background-position: center top; background-color: var(--bg); }
}
@media (max-width: 380px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
