/* Spoločný prepínač denného a nočného režimu */
.theme-toggle {
  width: 76px;
  height: 42px;
  padding: 3px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: #74787d;
  background: #f3f1ed;
  border: 1px solid #cbc8c2;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.theme-toggle:hover {
  border-color: #ed1c24;
}

.theme-toggle:focus-visible {
  outline: 3px solid #ed1c24;
  outline-offset: 3px;
}

.theme-icon {
  height: 34px;
  display: grid;
  place-items: center;
  color: inherit;
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

html[data-theme="light"] .theme-icon-sun,
html[data-theme="dark"] .theme-icon-moon {
  color: #fff;
  background: #ed1c24;
  transform: scale(1);
}

html[data-theme="light"] .theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  transform: scale(0.9);
}

html[data-theme="dark"] .theme-toggle {
  color: #b9bdc2;
  background: #202226;
  border-color: #45484e;
}

.theme-toggle--floating {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 50;
  box-shadow: 8px 8px 0 rgba(9, 10, 11, 0.24);
}

@media (max-width: 560px) {
  .theme-toggle {
    width: 68px;
    height: 38px;
  }

  .theme-icon {
    height: 30px;
    font-size: 16px;
  }

  .theme-toggle--floating {
    top: 14px;
    right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-icon {
    transition: none;
  }
}
