/* fixed arrangement: row 1 video (left) and welcome (right), row 2 the map over the full width. The tiles of row 1 are as high as the
   highest one: the row is as high as the tallest content (full welcome text, video with its fixed 16:9 box and caption) and the other tile stretches to it */
.dm-hero-box {
  background: var(--backgroundcolor, rgba(0,0,0,0.55));
  border-radius: 20px;
  padding: 30px;
  color: white;
}
.dm-hero-box.dm-video-box { padding: 16px 16px 6px; display: flex; flex-direction: column; }
/* the video box is 16:9 before the video has loaded, so the row does not change its height when the video arrives; a video of
   another shape is letterboxed, never stretched */
.dm-video-box video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.dm-video-box p { margin-top: auto; padding-top: 1rem; }

/* the map block holds the map of the module servers-map; it fills the full width of the page at the 2:1 proportion of the world view and
   keeps its size until the map is loaded */
.dm-map-box {
  position: relative; aspect-ratio: 2 / 1; width: 100%;
  background: #0f2a3d;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
@media (min-width: 576px) {
  /* the heading of the welcome box (one word) shrinks with the narrow column instead of reaching out of the box (40 px from about 1330 px) */
  .dm-hero-box h1 { font-size: clamp(1.4rem, 3vw, 2.5rem); }
  /* the columns of a row stretch (Bootstrap) and hand their height to the tile inside */
  .maintest > .row > [class*="col-"] { display: flex; }
  .maintest > .row > [class*="col-"] > .dm-hero-box,
  .maintest > .row > [class*="col-"] > .dm-map-box { flex: 1 1 auto; width: 100%; }
}
/* the map sits inside the box without making it taller: its size never feeds back into the row */
.dm-map-box > div { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.dm-map-box:hover { box-shadow: 0 0 0 3px rgba(255,0,0,0.6), 0 0 14px rgba(255,0,0,0.25); }
/* a visitor with saved favourites sees them in this block as cards instead of the map (servers-map sets sf-favorites-on on <html>
   before the block is drawn): the block takes the height of the cards, in the box of the other tiles instead of the frame of the map */
html.sf-favorites-on .dm-map-box { aspect-ratio: auto; background: var(--backgroundcolor, rgba(0,0,0,0.55)); border: 0; border-radius: 20px; overflow: visible; padding: 20px; }
html.sf-favorites-on .dm-map-box:hover { box-shadow: none; }
html.sf-favorites-on .dm-map-box > div { position: static; }

@media (max-width: 575px) {
  .dm-map-box { aspect-ratio: 4 / 3; margin-bottom: 16px; }
  html.sf-favorites-on .dm-map-box { aspect-ratio: auto; }
  .dm-hero-box { margin-bottom: 16px; }
  /* the rows of the start page keep the full width of the phone without reaching past it */
  .maintest > .row { margin-left: 0; margin-right: 0; }
  .maintest > .row > [class*="col-"] { padding-left: 0; padding-right: 0; }
}
