/* bh-map3d.css — About hero card: interactive map of the four governorates of Bahrain.
   Markup is generated at build time (bh_about.py); bh-map3d.js adds parallax, lift and labels. Boundary credits: assets/bh/CREDITS.txt */
.visual.m3{--m3-red:#c8102e;--m3-deep:#6d0a1a;--m3-hot:#c8102e;--m3-dim:#ecd2d5;--m3-side:#b9838a;--m3-w:300px;--rx:44deg;--ry:0deg;--rz:-4deg;
  background:radial-gradient(120% 90% at 70% 16%,#a50d26 0,#6d0a1a 46%,#2a0409 100%);min-height:590px;isolation:isolate;color:#fff;contain:layout paint}
.visual.m3::after{content:none}
.visual.m3::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:.5;
  background:repeating-linear-gradient(0deg,#ffffff0a 0 1px,transparent 1px 34px),repeating-linear-gradient(90deg,#ffffff0a 0 1px,transparent 1px 34px);
  -webkit-mask:radial-gradient(70% 60% at 50% 45%,#000,transparent);mask:radial-gradient(70% 60% at 50% 45%,#000,transparent)}
.visual.m3 .visual-stamp{z-index:3;left:auto;right:auto;inset-inline-end:20px;background:#ffffffeb;color:var(--m3-deep)}

.m3-foot{position:absolute;z-index:2;left:0;right:0;bottom:0;padding:46px 24px 20px;pointer-events:none;text-align:start;
  background:linear-gradient(0deg,#1c0307f2 0,#1c0307c4 58%,transparent)}
.m3-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px;pointer-events:auto}
.m3-chip{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:5px 14px;border-radius:999px;background:#ffffff1c;color:#fff;
  box-shadow:inset 0 0 0 1px #ffffff66;font-size:13px;font-weight:800;line-height:1.4;text-decoration:none;transition:background .2s,color .2s,box-shadow .2s}
.m3-chip::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px #ffffff33;transition:background .2s,box-shadow .2s}
.m3-chip:hover,.m3-chip:focus-visible,.m3-chip.on{background:#fff;color:var(--m3-deep);box-shadow:inset 0 0 0 1px #fff}
.m3-chip:hover::before,.m3-chip:focus-visible::before,.m3-chip.on::before{background:var(--m3-red);box-shadow:0 0 0 3px #c8102e33}
.m3-chip:focus-visible{outline:2px solid #fff;outline-offset:2px}
.visual.m3 .visual-logo{position:static;right:auto;bottom:auto;padding:0;pointer-events:none}
.visual.m3 .visual-logo strong{display:block;font-size:clamp(19px,2vw,24px);line-height:1.35}
.visual.m3 .visual-logo span{display:block;margin-top:2px;font-size:13px;color:#f6e9ea;opacity:.92}

.m3-stage{position:absolute;inset:52px 18px 176px;pointer-events:none;perspective:1200px;perspective-origin:50% 0%}
.m3-float{position:absolute;top:50%;left:50%;width:var(--m3-w);margin:calc(var(--m3-w) * -.7588) 0 0 calc(var(--m3-w) * -.5);pointer-events:none;transform-style:preserve-3d}
.m3-tilt{transform:rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));transform-style:preserve-3d;transition:transform .5s cubic-bezier(.2,.7,.2,1)}
.m3-svg{pointer-events:none;display:block;width:100%;height:auto;overflow:visible;direction:ltr}

.m3-shadow{fill:#000;opacity:.42}
.m3-sides use{fill:var(--m3-side)}
.m3-sides use:first-child{fill:#7d4a51}
.m3-inset rect{fill:#ffffff0d;stroke:#ffffffa6;stroke-width:1;stroke-dasharray:4 3}
.m3-inset text{fill:#fff;font:800 12.5px Cairo,Tahoma,sans-serif}
.m3[lang=en] .m3-inset text{font-size:10.5px}
.m3-hit{cursor:pointer;outline:none}
.m3-hit use{fill:none;stroke:transparent;stroke-width:13;stroke-linejoin:round;pointer-events:stroke}
.m3-hit rect{fill:transparent;pointer-events:fill}   /* the whole Hawar inset selects the Southern Governorate */
.m3-em{cursor:pointer;outline:none;pointer-events:visiblePainted}
.m3-em path{fill:url(#m3-top);stroke:#b9838a;stroke-width:.9;stroke-linejoin:round;transition:fill .25s,opacity .25s}
.m3-em:hover path,.m3-em:focus-visible path,.m3-em.on path{fill:var(--m3-hot)}
.m3.has-on .m3-em:not(.on) path{fill:var(--m3-dim)}
.m3.has-on .m3-em.on path{fill:#4a0711}   /* the "socket" left behind under the lifted piece */

.m3-lift{pointer-events:none;transform:translateY(0);transition:transform .32s cubic-bezier(.2,.8,.25,1.25);visibility:hidden}
.m3-lift.up{transform:translateY(-12px);visibility:visible}
.m3-lift-s use{fill:#7d0a1c}
.m3-lift-s use:first-child{fill:#45060f}
.m3-lift-t{fill:var(--m3-hot);stroke:#fff;stroke-width:1.2;stroke-linejoin:round}

.m3-hint{position:absolute;z-index:2;top:22px;inset-inline-start:22px;margin:0;font-size:12px;font-weight:700;line-height:2.1;color:#f6e9ea;opacity:.92;pointer-events:none}
.m3-hint::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px #ffffff33;margin-inline-end:8px;vertical-align:1px}

/* the label docks in the empty south-west corner of the card, beside the map (never over the governorate it names); on touch it carries the two links */
.m3-tip{position:absolute;z-index:4;left:14px;bottom:132px;width:176px;box-sizing:border-box;padding:12px 14px;border-radius:14px;background:#fff;color:var(--m3-deep);
  box-shadow:0 18px 40px #00000059;border-inline-start:4px solid var(--m3-hot);font-size:13px;line-height:1.55;text-align:start;pointer-events:none}
.m3.touch .m3-tip{pointer-events:auto}
.m3-tip[hidden]{display:none}
.m3-tip b{display:block;font-size:17px;font-weight:900;line-height:1.3}
.m3-tip .m3-alt{display:block;font-size:12px;color:#595959;font-weight:700}
.m3-tip .m3-cap-l{margin:6px 0 0;padding-top:6px;border-top:1px solid #e4dfe0;color:#5a2028}
.m3-tip .m3-go{display:none;flex-direction:column;gap:8px;margin-top:8px}
.m3-tip .m3-go a{flex:1;text-align:center;padding:9px 8px;border-radius:9px;background:var(--m3-red);color:#fff;font-weight:800;font-size:12px;text-decoration:none}
.m3-tip .m3-go a+a{background:#fbf9f9;color:var(--m3-deep);box-shadow:inset 0 0 0 1px #e4dfe0}
.m3.touch .m3-tip .m3-go{display:flex}

@media (prefers-reduced-motion:no-preference){.m3.live .m3-float{animation:m3-float 9s ease-in-out infinite alternate}}
@keyframes m3-float{from{transform:translateY(4px) rotateZ(.6deg)}to{transform:translateY(-6px) rotateZ(-.6deg)}}
@media (prefers-reduced-motion:reduce){.m3-tilt,.m3-lift,.m3-em path,.m3-chip{transition:none}}
.m3.has-on .m3-float{animation-play-state:paused}
@media (max-width:1180px){
  /* narrower cards (two-column tablets, phones): header in two rows, the four names share one row, the label is a bar across the top */
  .visual.m3{--m3-w:262px}
  .m3-stage{inset:96px 8px 168px}
  .m3-hint{top:60px;inset-inline-start:20px;font-size:11.5px}
  .m3-chips{flex-wrap:nowrap;gap:6px}
  .m3-chip{flex:1 1 0;justify-content:center;min-width:0;padding:6px 4px;font-size:12.5px}
  .m3-chip::before{content:none}
  .m3-tip{left:10px;right:10px;top:10px;bottom:auto;width:auto;padding:10px 12px;font-size:12px;line-height:1.45}
  .m3-tip b{display:inline-block;font-size:15px;margin-inline-end:8px}
  .m3-tip .m3-alt{display:inline-block}
  .m3-tip .m3-cap-l{margin-top:4px;padding-top:4px}
  .m3-tip .m3-go{flex-direction:row}
  .m3.has-on .m3-hint{visibility:hidden}
}
@media (max-width:800px){
  .visual.m3{min-height:620px;--m3-w:252px}
  .m3-foot{padding:40px 16px 18px}
  .m3-chip{min-height:44px}
}
@media (forced-colors:active){.m3-em path{fill:Canvas;stroke:CanvasText}.m3-em.on path{fill:Highlight}.m3-chip{border:1px solid}}
