/**
 * Iwakis exhibition QR stories.
 *
 * This canvas intentionally remains independent from the institutional shell.
 */

html {
  background: #050505;
}

body.iwakis-qr-template {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: #fff;
  background-color: #050505;
  background-image:
    linear-gradient(rgba(0, 0, 0, .08), rgba(0, 0, 0, .08)),
    url("../images/iwakis/language-selector2-vert.jpg");
  background-position: center top;
  background-repeat: repeat;
  background-size: 1080px auto;
  font-family: var(--eurisca-sans), "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.iwakis-qr-template.admin-bar {
  min-height: calc(100vh - 32px);
}

.iwakis-qr-template * {
  box-sizing: border-box;
}

.iwakis-qr-template .iwakis-qr-skip-link {
  position: fixed;
  z-index: 100000;
  top: .75rem;
  left: .75rem;
  padding: .75rem 1rem;
  color: #050505;
  background: #f4d238;
  font-weight: 800;
  transform: translateY(-180%);
}

.iwakis-qr-template .iwakis-qr-skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.iwakis-qr-page {
  width: min(100% - 2rem, 1180px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(4rem, 9vw, 7rem);
}

.iwakis-qr-story {
  width: 100%;
  margin: 0;
}

.iwakis-qr-language {
  width: max-content;
  margin: 0 auto clamp(1.5rem, 3vw, 2.5rem);
}

.iwakis-qr-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
}

.iwakis-qr-language a {
  display: grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(0, 0, 0, .65);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.iwakis-qr-language a:hover {
  border-color: #f4d238;
  background: #111;
}

.iwakis-qr-language a:focus-visible {
  outline: 3px solid #f4d238;
  outline-offset: 4px;
}

.iwakis-qr-language a[aria-current="page"] {
  border-color: #f4d238;
  box-shadow: inset 0 -3px #f4d238;
}

.iwakis-qr-language img {
  width: 28px;
  height: 20px;
  object-fit: cover;
}

.iwakis-qr-story > nav:first-child {
  display: none;
}

.iwakis-qr-story > p:first-of-type {
  width: min(100%, 760px);
  margin: 0 auto clamp(1.75rem, 4vw, 3.25rem);
  padding: 0;
  text-align: center;
}

.iwakis-qr-story > p:first-of-type img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .36);
}

.iwakis-qr-story > h2 {
  margin: 0 0 1.5rem;
  color: #f4d238;
  font-family: var(--eurisca-sans), "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: .01em;
  text-align: center;
  text-wrap: balance;
}

.iwakis-qr-story > h2:first-of-type {
  display: block;
  width: min(100%, 920px);
  margin-inline: auto;
}

.iwakis-qr-story > h2:nth-of-type(n + 2):nth-of-type(-n + 4) {
  display: inline-block;
  width: 32.9%;
  padding-inline: .75rem;
  vertical-align: top;
}

.iwakis-qr-story > p:not(:first-of-type) {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 0 clamp(.75rem, 2vw, 1.5rem) 1.25rem;
  color: #fff;
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  font-weight: 400;
  line-height: 1.7;
  text-wrap: pretty;
}

.iwakis-qr-story > p:empty {
  display: none;
}

.iwakis-qr-story a {
  color: inherit;
}

.iwakis-qr-story a {
  text-decoration-color: #f4d238;
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}

.iwakis-qr-story a:focus-visible {
  outline: 3px solid #f4d238;
  outline-offset: 4px;
}

@media (max-width: 700px) {
  body.iwakis-qr-template {
    background-size: 760px auto;
  }

  body.iwakis-qr-template.admin-bar {
    min-height: calc(100vh - 46px);
  }

  .iwakis-qr-page {
    width: min(100% - 1.25rem, 1180px);
    padding-top: 1rem;
  }

  .iwakis-qr-language {
    margin-bottom: 1.25rem;
  }

  .iwakis-qr-story > p:first-of-type {
    margin-bottom: 1.75rem;
  }

  .iwakis-qr-story > h2,
  .iwakis-qr-story > h2:nth-of-type(n + 2):nth-of-type(-n + 4) {
    display: block;
    width: min(100%, 35rem);
    margin: 0 auto .85rem;
    padding-inline: .5rem;
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .iwakis-qr-story > p:not(:first-of-type) {
    padding-inline: .5rem;
    font-size: 1rem;
    line-height: 1.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iwakis-qr-template *,
  .iwakis-qr-template *::before,
  .iwakis-qr-template *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
