/*
Theme Name: Bata
Theme URI: https://batasthlm.se
Author: Bata
Description: Single page theme for BATA, a tavern and bar of sorts on Hornsgatan in Stockholm.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: bata
*/

@font-face {
    font-family: 'BL Pylon Mono';
    src: url('BLPylonMono-ExtraLightMono.woff2') format('woff2'),
        url('BLPylonMono-ExtraLightMono.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

body.admin-bar .wrapper {
  min-height: calc(100svh - 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .wrapper {
    min-height: calc(100svh - 46px);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --text-color: #fffefb;
  --background-color: #BF3501;
}

html {
  /* Stops mobile Safari enlarging text in wide blocks such as the marquee track. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  margin: 0;
  overflow-x: clip;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'BL Pylon Mono', monospace;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1.33;
}

a {
  color: var(--text-color);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
    text-decoration-thickness: 0.5px;
    text-underline-offset: 0.25ch;
  }
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100svh;
  padding: 25px;

  @media (min-width: 768px) {
    padding: 50px 50px 45px 50px;
  }
}

.header {
  width: 100%;
}

.wordmark {
  display: block;
  width: 100%;
}

.content {
  margin-top: 20px;
  text-align: center;

  @media (min-width: 768px) {
    margin-top: 40px;
    margin-bottom: 45px;
  }
}

.content p {
  margin: 0;
}

.address {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-style: normal;
}

.address-row {
  display: flex;
  flex-direction: column;
  align-items: center;

  @media (min-width: 768px) {
    flex-direction: row;
    gap: 2ch;
  }
}

.footer {
  width: 100%;
  margin-top: auto;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;

  @media (min-width: 768px) {
    flex-direction: row;
    justify-content: space-between;
    gap: 2ch;
    line-height: 1;
  }
}

/* Widget links need a button, so it is stripped back to look like the links beside it. */
.footer-link--widget {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;

  &:hover {
    text-decoration: underline;
    text-decoration-thickness: 0.5px;
    text-underline-offset: 0.25ch;
  }
}

.marquee {
  width: 100vw;
  overflow: hidden;
}

.marquee-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding-inline: 25px;
  text-align: center;
}

.marquee-item::after {
  content: '·' / '';
  padding-inline: 1ch;
}

.marquee-item:last-child::after {
  content: none;
}

.marquee.is-running {
  .marquee-track {
    display: flex;
    width: max-content;
    animation: marquee var(--marquee-duration, 30s) linear infinite;
  }

  /* Hover sticks after a tap on touch screens, so touch devices pause while pressed instead. */
  @media (hover: hover) {
    &:hover .marquee-track {
      animation-play-state: paused;
    }
  }

  /* A long press would otherwise select the text or open the callout menu. */
  @media (hover: none) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  &.is-paused .marquee-track {
    animation-play-state: paused;
  }

  .marquee-group {
    flex: none;
    flex-wrap: nowrap;
    padding-inline: 0;
    white-space: nowrap;
  }

  .marquee-item:last-child::after {
    content: '·' / '';
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
