/* Les panneaux reprennent le papier, l'emblème et le feuillage de la ferme. */
.rucher-body {
  --rucher-kit-paper: url('../monde-3d/assets/ui/carnet-ouvert/papier.webp');
  --rucher-kit-leaf: url('../monde-3d/assets/ui/carnet-ouvert/branche.webp');
  padding: clamp(12px, 2.3vw, 40px) clamp(10px, 2.4vw, 40px) 28px;
}

.rucher-body::after { display: none; }
.rucher-body .rucher-hud {
  position: relative;
  inset: auto;
  transform: none;
  width: min(100%, 1580px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 auto 12px;
}
.rucher-hud .rucher-hud-brand { min-height: 42px; padding: 4px 10px; }
.rucher-hud .rucher-hud-brand span { width: 30px; height: 30px; padding: 2px; }
.rucher-hud-brand img, .rucher-mast-emblem img { width: 100%; height: 100%; object-fit: contain; }
.rucher-hud .rucher-hud-line, .rucher-hud .rucher-hud-level { margin: 0; min-height: 32px; }
.rucher-hud .rucher-hud-level i { min-width: 54px; }
.rucher-hud-level [data-rucher-hud-fill] { width: 0; }
.rucher-body.rucher-embed { padding: 9px clamp(7px, 1.25vw, 18px) 16px; }
.rucher-embed .rucher-hud { margin-bottom: 8px; }
.rucher-embed .rucher-posts { border-radius: 23px 23px 0 0; }
.rucher-hud-return {
  margin-left: auto;
  padding: .52em .8em;
  border: 1px solid #ddb76b;
  border-radius: 10px;
  color: #fff5da;
  background: #17492f;
  font: 700 .88rem Georgia, serif;
  cursor: pointer;
}
.rucher-hud-return:hover { background: #286140; }
.rucher-hud-return:focus-visible { outline: 3px solid #f5d27c; outline-offset: 2px; }

.rucher-body .rucher-sheet { width: min(100%, 1580px); }
.rucher-sheet .rucher-mast { min-height: 112px; padding-block: 14px; }
.rucher-mast .rucher-mast-emblem { width: 67px; height: 67px; padding: 6px; }
.rucher-mast::before, .rucher-mast::after {
  content: '';
  width: clamp(48px, 8vw, 105px);
  height: 52px;
  background: var(--rucher-kit-leaf) center / contain no-repeat;
  opacity: .8;
  pointer-events: none;
}

.rucher-sheet .rucher-posts {
  gap: 8px;
  padding: 12px clamp(10px, 2.3vw, 32px) 15px;
  background: var(--rucher-kit-paper), #f6e4bd;
}
.rucher-sheet .rucher-posts button {
  min-height: 65px;
  gap: .24rem;
  font-size: .88rem;
  line-height: 1.15;
  color: #684817;
  box-shadow: inset 0 0 0 2px #ffefcb, 0 2px 4px #4c371a29;
}
.rucher-sheet .rucher-posts button span { font-size: .87rem; color: #244630; }
.rucher-sheet .rucher-posts button[aria-current] {
  border-color: #c99535;
  color: #ffe2a1;
  box-shadow: inset 0 0 0 1px #d4aa585c, 0 3px 5px #34281354;
}
.rucher-sheet .rucher-posts button[aria-current] span { color: #fff5d8; }
.rucher-direction {
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
  gap:8px 16px;padding:12px clamp(12px,2.2vw,31px);
  background:#244b33;color:#fff4d7;border-block:1px solid #c99b59;
}
.rucher-embed .rucher-direction {border-radius:19px 19px 0 0}
.rucher-direction > div {display:grid;gap:3px}
.rucher-direction span {color:#f1d19a;font:600 .73rem/1.25 system-ui}
.rucher-direction strong {font:700 clamp(.99rem,1.4vw,1.22rem)/1.2 Georgia,serif}
.rucher-sheet .rucher-direction button {
  min-height:42px;padding:7px 11px;border:1px solid #d2a45f;border-radius:8px;
  color:#20452f;background:#fcdf9c;font:700 .88rem/1.25 Georgia,serif;cursor:pointer;
}
.rucher-sheet .rucher-direction button:hover {background:#fff0c4}
.rucher-posts-panel {background:#f7e0ac;border-bottom:1px solid #bd995b}
.rucher-posts-panel > summary {
  min-height:40px;padding:11px clamp(12px,2.2vw,31px);box-sizing:border-box;
  font:700 .88rem/1.25 Georgia,serif;color:#2b4c35;cursor:pointer;
}
.rucher-posts-panel[open] > summary {border-bottom:1px solid #d1b477}
.rucher-embed .rucher-posts-panel .rucher-posts {border-radius:0}
.rucher-direction button:focus-visible,.rucher-posts-panel summary:focus-visible {
  outline:3px solid #cc8c37;outline-offset:-3px;
}
.rucher-hud .rucher-hud-return + .rucher-hud-return {margin-left:0;background:#f8e4ad;color:#244530}

.rucher-sheet .rucher-grid {
  grid-template-columns: minmax(0, 1fr) clamp(225px, 20vw, 290px);
  gap: clamp(12px, 1.7vw, 25px);
  padding: clamp(12px, 1.8vw, 26px);
  background: linear-gradient(150deg, #fff4d966, #fff7e133), var(--rucher-kit-paper), #f1dfb8;
}
.rucher-sheet .rucher-work {
  position: relative;
  scroll-margin-top: 12px;
  padding: clamp(12px, 1.4vw, 22px);
  border: 1px solid #b98b4a;
  border-radius: 18px;
  background: #fff7df70;
  box-shadow: inset 0 0 0 3px #fffaf085, 0 3px 9px #57391820;
}
.rucher-work h2::before, .rucher-work h2::after {
  content: '';
  width: clamp(21px, 4vw, 46px);
  height: 22px;
  background: var(--rucher-kit-leaf) center / contain no-repeat;
  pointer-events: none;
}
.rucher-sheet .rucher-inline-guide { position: relative; z-index: 2; }
.rucher-work h2 { clear: both; }
.rucher-orientation-task {display:grid;grid-template-columns:minmax(0,1.65fr) minmax(180px,1fr);gap:12px;align-items:start}
.rucher-orientation-choices {min-width:0;padding:8px;border:1px solid #d4a763;border-radius:12px;background:#fcf0cd}
.rucher-orientation-plan-link {display:none}
.rucher-orientation-task .rucher-choices {margin:0 0 6px;grid-template-columns:1fr;gap:5px}
.rucher-sheet .rucher-work .rucher-orientation-task .rucher-choices button {min-height:43px;padding:.34rem .5rem;font-size:.95rem}
.rucher-orientation-choices .rucher-primary {width:100%;margin:0;min-height:44px}
.rucher-sheet[data-rucher-screen^="A"] .rucher-guide .rucher-quote {display:none}
.rucher-work .rucher-gallery {
  margin-top: 12px;
  border-color: #956330;
  background: #2d3026;
  box-shadow: 0 0 0 2px #ead1a0, 0 5px 18px #43291f35;
  isolation: isolate;
}
.rucher-gallery .rucher-gallery-photo { width: 100%; height: 100%; display: block; object-fit: cover; }
.rucher-gallery > canvas { border-radius: 0; }
.rucher-gallery .rucher-gallery-miniature {
  position: absolute;
  z-index: 2;
  bottom: 3%;
  right: 2%;
  width: 16%;
  height: auto;
  border: 1px solid #daad65;
  border-radius: 9px;
  box-shadow: 0 2px 10px #29180b58;
}
.rucher-gallery-sign, .rucher-gallery-note {
  position: absolute;
  z-index: 2;
  border: 1px solid #e1b465;
  border-radius: 8px;
  padding: .35em .65em;
  color: #fff2d1;
  background: #173628ec;
  font-weight: 700;
  pointer-events: none;
}
.rucher-gallery .rucher-gallery-sign {
  left: 48.4%;
  top: 60%;
  transform: translate(-50%, -50%);
  font-size: clamp(.55rem, 1.15vw, 1rem);
  width: 19%;
  padding: 0;
  text-align: center;
  text-shadow: 0 1px 2px #17160e;
  background: transparent;
  border: 0;
}
.rucher-gallery-note { top: 4%; left: 3%; font-size: clamp(.75rem, 1.35vw, .98rem); }
.rucher-gallery-bee {
  position: absolute;
  z-index: 2;
  width: 15%;
  transform: translate(-50%, -50%) scaleX(var(--bee-orientation, 1)) rotate(var(--bee-angle, 0deg));
  filter: drop-shadow(0 3px 3px #241b185c);
  pointer-events: none;
}

/* La translation sert à centrer le bouton sur le point, y compris au survol. */
.rucher-sheet .rucher-work button.rucher-marker,
.rucher-sheet .rucher-work button.rucher-marker:hover:not(:disabled),
.rucher-sheet .rucher-work button.rucher-marker:active:not(:disabled) {
  z-index: 3;
  transform: translate(-50%, -50%);
  filter: none;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.rucher-sheet .rucher-work button.rucher-marker {
  border: 2px solid #f8dda2;
  color: #fff2d2;
  background: #173d2def;
  box-shadow: 0 0 0 1px #65441c, 0 3px 10px #1a1a146e;
}
.rucher-sheet .rucher-work button.rucher-marker:is(:hover,[aria-pressed=true]) {
  background: #f7d88e;
  color: #234936;
  box-shadow: 0 0 0 3px #fff3c75c, 0 3px 10px #1a1a1492;
}
.rucher-sheet .rucher-choices button { min-height: 63px; font-size: 1.02rem; }
.rucher-sheet .rucher-choices button span { font-size: .82rem; }

.rucher-grid:has(.rucher-frame-task) { grid-template-columns: minmax(0, 1fr); }
.rucher-grid:has(.rucher-frame-task) > .rucher-guide { display: none; }
.rucher-frame-task {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(230px, 1fr);
  gap: clamp(10px, 2vw, 24px);
  align-items: start;
}
.rucher-frame-sight .rucher-gallery { margin-top: 0; }
.rucher-frame-answers {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid #bf9853;
  border-radius: 13px;
  color: #19412b;
  background: linear-gradient(140deg, #fff5d9, #f6e3b1);
  box-shadow: 0 2px 4px #61461838, inset 0 0 0 2px #fff4d5;
}
.rucher-frame-answers h3 { margin: 0; padding: .44rem; color: #fff1cc; background: #1e4d33; border-radius: 8px; text-align: center; }
.rucher-frame-answers .rucher-choices { grid-template-columns: 1fr; margin: 0; }
.rucher-frame-answers .rucher-choices button { min-height: 46px; text-align: start; }
.rucher-frame-answers .rucher-primary { margin: 0; width: 100%; }
.rucher-frame-guide { padding: .65rem .72rem; border: 1px solid #d2b477; border-radius: 9px; background: #fbf0cf; }
.rucher-frame-guide > p { margin: .3rem 0 .55rem; }
.rucher-frame-guide details { margin: 0; }
.rucher-frame-answers .rucher-reaction { margin: 0; }
@media (max-width: 680px) { .rucher-frame-task { grid-template-columns: minmax(0, 1fr); } }

.rucher-guide-dialog .rucher-guide-dialog-panel {
  width: min(1220px, 100%);
  max-height: calc(100dvh - 36px);
  padding: clamp(19px, 2.4vw, 36px);
  border: 1px solid #a67135;
  background: var(--rucher-kit-paper), #f4e0b3;
  box-shadow: 0 0 0 3px #e9bf71, 0 0 0 5px #6d431f, 0 16px 65px #06160dac;
  scrollbar-width: thin;
  scrollbar-color: #a5793f #f4e2bc;
}
.rucher-guide-content { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(12px, 2vw, 26px); align-items: start; }
.rucher-guide-dialog .rucher-guide-dialog-visual { margin: 11px 0 0; }
.rucher-guide-dialog .rucher-guide-dialog-visual img { aspect-ratio: auto; filter: none; }
.rucher-guide-dialog .rucher-guide-dialog-visual::after { content: none; }
.rucher-guide-visual > .rucher-guide-motion::before,
.rucher-guide-visual > .rucher-guide-motion::after { content: none; }
.rucher-guide-notes .rucher-guide-dialog-points { font-size: clamp(.92rem, 1.2vw, 1.08rem); }
.rucher-guide-notes .rucher-primary {
  font: 700 1rem Georgia, serif;
  min-height: 43px;
  padding: .58rem .9rem;
  border: 1px solid #b8843a;
  border-radius: 10px;
  background: linear-gradient(#235d40, #103f28);
  color: #fff4d2;
  cursor: pointer;
}
.rucher-guide-notes .rucher-primary:hover { background: #276445; }
.rucher-guide-notes .rucher-primary:focus-visible { outline: 3px solid #bc822d; outline-offset: 3px; }

html:has([data-rucher-guide-dialog]) { overflow: hidden; }
@media (min-width: 761px) and (max-height: 700px) {
  .rucher-guide-dialog .rucher-guide-dialog-panel { padding: 20px; }
  .rucher-guide-dialog .rucher-guide-dialog-visual {
    justify-self: center;
    width: 100%;
    max-width: min(100%, calc((100dvh - 158px) * 1.6));
  }
}

@media (max-width: 980px) {
  .rucher-sheet .rucher-posts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rucher-sheet .rucher-grid { grid-template-columns: minmax(0,1fr) 205px; }
}
@media (max-width: 760px) {
  .rucher-sheet .rucher-grid, .rucher-guide-content { grid-template-columns: minmax(0, 1fr); }
  .rucher-mast .rucher-mast-emblem { width: 49px; height: 49px; }
  .rucher-orientation-task {grid-template-columns:minmax(0,1fr)}
  .rucher-orientation-choices {grid-row:1}
  .rucher-orientation-task .rucher-choices button span {display:none}
  .rucher-orientation-plan-link {display:inline-block;padding:4px 3px 6px;color:#284d31;font-weight:700}
}
@media (max-width: 520px) {
  .rucher-sheet .rucher-posts { gap: 5px; }
  .rucher-sheet .rucher-posts button { min-height: 51px; }
  .rucher-sheet .rucher-posts button span { font-size: .66rem; }
  .rucher-hud-return { margin-left: 0; }
}
.rucher-entree-cadre {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  padding: .75rem 0;
}
.rucher-entree-cadre span { color: #354d34; flex: 1 1 14rem; }
dialog.rucher-dialog-cadre {
  box-sizing: border-box;
  width: min(1120px, calc(100% - 1rem));
  max-width: none;
  max-height: calc(100dvh - 1rem);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 2px solid #82633d;
  border-radius: 14px;
  color: #263b2c;
  background: #fbf3de;
  box-shadow: 0 14px 48px #172c24aa;
}
dialog.rucher-dialog-cadre::backdrop { background: #11231d99; }
.rucher-cadre-attente { padding: 1.5rem; }
.rucher-cadre-attente button { margin: .25rem .5rem .25rem 0; }
.rucher-cadre-sync { margin: .5rem 1rem; color: #773c15; }
.rucher-embed dialog.rucher-dialog-cadre[open] {
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  background: linear-gradient(112deg,#fcf8eb,#f6eed7);
}
.rucher-embed .rucher-dialog-cadre .a5-cadre {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
