/* THE DAILY PIXEL NEWS - language buttons (pixel squares with flags, on the left) + language blocks */

/* info pages: only the blocks of the chosen language are visible */
html:not([lang="en"]) [data-l="en"],
html:not([lang="it"]) [data-l="it"],
html:not([lang="de"]) [data-l="de"],
html:not([lang="es"]) [data-l="es"] { display: none !important; }

.langbar {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lang-sq {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: none;
  cursor: pointer;
  background: #3b3466;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  line-height: 1;
  box-shadow: inset -3px -3px 0 #0000004d, inset 3px 3px 0 #ffffff26, 0 0 0 3px #1b1b2f;
  transition: transform .08s steps(2);
}
.lang-sq img {
  width: 24px;
  height: 17px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 0 2px #1b1b2f;
}
.lang-sq:hover { transform: translate(-1px, -2px); filter: brightness(1.15); }
.lang-sq:active { transform: translate(1px, 1px); box-shadow: inset 3px 3px 0 #0000004d, 0 0 0 3px #1b1b2f; }
.lang-sq:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* the chosen language: yellow square with a blinking pixel arrow */
.lang-sq.on { background: #eab308; color: #1b1b2f; }
.lang-sq.on::after {
  content: '';
  position: absolute;
  margin-left: 66px;
  border: 5px solid transparent;
  border-right: 6px solid #eab308;
  animation: lang-blink 1s steps(1) infinite;
}
@keyframes lang-blink { 50% { opacity: 0; } }

/* HIDE button (under the flags) and the little TAB that brings them back (html.langs-off = hidden) */
.lang-hide, .lang-tab {
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; cursor: pointer;
  background: #3b3466; color: #fff;
  box-shadow: inset -3px -3px 0 #0000004d, inset 3px 3px 0 #ffffff26, 0 0 0 3px #1b1b2f;
}
.lang-hide { width: 44px; height: 22px; }
.lang-hide:hover, .lang-tab:hover { filter: brightness(1.25); }
.lang-hide:focus-visible, .lang-tab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* pixel arrows made of borders: hide = pointing left, tab = pointing right */
.lang-hide i, .lang-tab i { width: 0; height: 0; border: 5px solid transparent; }
.lang-hide i { border-right: 7px solid #eab308; margin-right: 6px; }
.lang-tab i { border-left: 7px solid #eab308; margin-left: 5px; animation: lang-blink 1.2s steps(1) infinite; }
.lang-tab {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 50;
  width: 24px; height: 56px; flex-direction: column; gap: 7px;
  box-shadow: inset -3px -3px 0 #0000004d, 3px 0 0 #1b1b2f, 0 3px 0 #1b1b2f, 0 -3px 0 #1b1b2f;
}
.lang-tab img { width: 16px; height: 11px; image-rendering: pixelated; box-shadow: 0 0 0 1px #1b1b2f; }
.lang-tab:hover { width: 28px; }
html:not(.langs-off) .lang-tab, html.langs-off .langbar { display: none; }

/* phone / narrow screens: the squares sit in a row at the top left */
@media (max-width: 899px), (max-height: 559px) {
  .langbar { position: absolute; top: 8px; left: 8px; transform: none; flex-direction: row; gap: 9px; }
  .lang-sq { width: 38px; height: 38px; font-size: 6px; }
  .lang-sq img { width: 21px; height: 15px; }
  .lang-sq.on::after { display: none; }
  .lang-hide { width: 30px; height: 38px; }
  .lang-hide i { transform: rotate(90deg); margin: 0 0 6px; }  /* pointing up */
  .lang-tab { position: absolute; top: 0; left: 10px; transform: none; width: 52px; height: 22px; flex-direction: row; gap: 8px;
    box-shadow: inset -3px -3px 0 #0000004d, 0 3px 0 #1b1b2f, 3px 0 0 #1b1b2f, -3px 0 0 #1b1b2f; }
  .lang-tab:hover { width: 52px; height: 26px; }
  .lang-tab i { transform: rotate(90deg); margin: 4px 0 0; }   /* pointing down */
}
@media (max-width: 899px), (max-height: 559px) {
  html:not(.langs-off) body { padding-top: 58px !important; }
  html.langs-off body { padding-top: 28px !important; }
}
