/* Language switcher (inc/i18n.php, common/js/i18n.js). */

/* While a translation loads, keep the page behind #loading instead of flashing the Japanese text.
   !important beats the inline styles style.js sets on both. */
html.tcm-i18n-pending #container { visibility: hidden !important; }
html.tcm-i18n-pending #loading { display: block !important; opacity: 1 !important; }

.tcm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

.tcm-lang {
  position: absolute;
  z-index: 20;
  top: 20px;
  right: 20px;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, "Apple SD Gothic Neo", "Malgun Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1;
}
/* LPs show the hamburger MENU (72px at 28px from the corner) on PC too: sit to its left. Below 1101px the LP titles
   reach that corner, so there the languages are only in the menu. */
.tcm-lang--lp { top: 47px; right: 112px; }
@media (max-width: 1100px) {
  .tcm-lang--lp { display: none; }
}

.tcm-lang__toggle {
  display: inline-block;
  margin: 0;
  padding: 9px 14px 9px 12px;
  border: 1px solid #c8a54c;
  border-radius: 999px;
  background: rgba(0, 9, 40, .82);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.tcm-lang__toggle:hover,
.tcm-lang__toggle[aria-expanded="true"] { background: rgba(0, 9, 40, .95); border-color: #e9c77f; }
.tcm-lang__toggle:focus-visible,
.tcm-lang button:focus-visible,
.tcm-lang-menu button:focus-visible { outline: 2px solid #e9c77f; outline-offset: 2px; }
.tcm-lang__icon {
  display: inline-block;
  margin-right: 6px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.tcm-lang__toggle::after {
  content: "";
  display: inline-block;
  margin-left: 7px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 3px;
}

@media (max-width: 678px) {
  /* A globe button left of the fixed MENU button (54px at 15px from the corner); the menu lists the languages too. */
  .tcm-lang { top: 22px; right: 77px; }
  .tcm-lang__toggle { width: 40px; height: 40px; padding: 0; border-radius: 50%; text-align: center; }
  .tcm-lang__toggle::after,
  .tcm-lang__current { display: none; }
  .tcm-lang__icon { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
}

.tcm-lang__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  margin: 0;
  padding: 6px 0;
  border: 1px solid #c8a54c;
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  list-style: none;
}
.tcm-lang__list[hidden] { display: none; }
.tcm-lang__list button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 11px 16px;
  border: 0;
  background: none;
  color: #07172f;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.tcm-lang__list button:hover { background: #f3ead2; }
.tcm-lang__list button[aria-current="true"] { font-weight: bold; }
.tcm-lang__list button[aria-current="true"]::after { content: " \2713"; color: #8c211f; }

/* The row in the hamburger menu (SP, and LPs on PC). */
.tcm-lang-menu {
  margin: 0 5.3333vw 24px;
  padding: 0;
  list-style: none;
  text-align: center;
}
.tcm-lang-menu li { display: inline-block; margin: 0 4px 8px; }
.tcm-lang-menu button {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #ddc45d;
  border-radius: 999px;
  background: none;
  color: #fff;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, "Apple SD Gothic Neo", "Malgun Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.tcm-lang-menu button[aria-current="true"] { background: #ddc45d; color: #015830; font-weight: bold; }

/* Shown only while the page is translated (its text comes from the dictionary). */
.tcm-lang-note { display: none; }
html.tcm-i18n-on .tcm-lang-note {
  display: block;
  margin: 0 auto 10px;
  padding: 0 20px;
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* Text the theme draws as images of Japanese, redrawn from the translated text. */
/* The PC menu buttons (sprites in header.css and topheader.css, one fixed width per item). */
@media (min-width: 679px) {
  html.tcm-i18n-on header nav li { width: auto !important; }
  html.tcm-i18n-on header nav li a {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 calc(10 / 1440 * 100vw);
    border: 2px solid #c2ad57;
    border-radius: 6px;
    background: #fff !important;
    box-shadow: inset 0 0 0 1px #a9a6a8;
    color: #234737;
    font-size: max(10px, calc(15 / 1440 * 100vw));
    font-weight: bold;
    line-height: 1.1;
    text-indent: 0;
    text-decoration: none;
    white-space: nowrap;
  }
  html.tcm-i18n-on header nav li a:hover { color: #c71b1c; }
}
/* The venue pages' green circles (名称, 日時...): tcm_i18n_label() in inc/i18n.php. Sizes follow outline.css. */
html.tcm-i18n-on section#outline .mainTxt li { position: relative; background-image: none; }
html.tcm-i18n-on section#outline .mainTxt .tcm-i18n-label {
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  margin: 0;
  clip: auto;
  border-radius: 50%;
  background: #20681a;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  -webkit-hyphens: auto;
  hyphens: auto;
}
@media (max-width: 678px) {
  html.tcm-i18n-on section#outline .mainTxt .tcm-i18n-label { width: 55px; height: 55px; font-size: 10px; }
}
@media (max-width: 480px) {
  /* outline.css shrinks the circle to 40px here, too small for a translated word: a little larger, text moved over. */
  html.tcm-i18n-on section#outline .mainTxt li { padding-left: 56px; }
  html.tcm-i18n-on section#outline .mainTxt .tcm-i18n-label { width: 48px; height: 48px; font-size: 9px; }
}
/* The top page's 今年は２つの会場で開催 ribbon (avenue__title.png): the NEWS label's plain ribbon (topnews__label.png)
   with the translated text on it. */
html.tcm-i18n-on .avenue__title img { display: none; }
html.tcm-i18n-on .avenue__title .tcm-i18n-label {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 350px;
  height: 48px;
  margin: 0 auto;
  padding: 0 46px;
  clip: auto;
  background: url(../../images/topnews__label.png) 0 0 / 100% 100% no-repeat;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
}
@media (max-width: 678px) {
  html.tcm-i18n-on .avenue__title .tcm-i18n-label {
    width: 80%;
    height: auto;
    aspect-ratio: 700 / 96;
    padding: 0 12%;
    font-size: min(15px, 3.6vw);
  }
}
/* A translated venue name can take more lines on one card than on the other: the venue link fills its card, so both
   ticket buttons sit at the bottom and both red arrows (top: 50% of the link) at one height, as in Japanese. */
html.tcm-i18n-on .avenue__content {
  display: flex;
  flex-direction: column;
}
html.tcm-i18n-on .avenue__content > a { flex-grow: 1; }
/* Subpage titles (common.css #contents.second .title h2): one image per page, one of them set inline
   (page-comingsoon.php) and one with !important (contact-form.css), hence !important here. Sizes follow common.css. */
html.tcm-i18n-on #contents.second .title { height: auto; min-height: 68px; }
html.tcm-i18n-on #contents.second .title h2 {
  height: auto;
  min-height: 49px;
  padding-bottom: 12px;
  background-image: none !important;
  color: #c71b1c;
  font-size: 32px;
  font-weight: bold;
  line-height: 1.2;
  text-indent: 0;
  display: flex;
  align-items: flex-end;
}
@media (max-width: 980px) {
  html.tcm-i18n-on #contents.second .title { min-height: 53px; }
  html.tcm-i18n-on #contents.second .title h2 { min-height: 32px; padding-bottom: 14px; font-size: 22px; }
}
@media (max-width: 480px) {
  html.tcm-i18n-on #contents.second .title { min-height: 40px; }
  html.tcm-i18n-on #contents.second .title h2 { min-height: 23px; padding-bottom: 12px; font-size: 16px; }
}
/* LP mastheads: a translated title runs longer than the Japanese one; keep it clear of the language and MENU buttons
   (PC: both within 240px of the right edge; SP: the MENU within 80px). (100vw - 100%) / 2 is the space already right
   of it. The Japanese title keeps the client's layout. */
html.tcm-i18n-on .founder-masthead h1 { padding-right: max(0px, calc(240px - (100vw - 100%) / 2)); }
@media (max-width: 678px) {
  html.tcm-i18n-on .founder-masthead h1 { padding-right: max(0px, calc(80px - (100vw - 100%) / 2)); }
}
/* outline.css keeps the Japanese dates on one line; a translation wraps where it fits. */
html.tcm-i18n-on section#outline .mainTxt .txt02 span { white-space: normal; }
/* The Japanese date lines keep their halves whole with *nobreak spans, which a translation does not carry: balance
   the lines instead, and in Chinese keep the parts whole, so a date breaks at its brackets, not inside 12月 or （周五）. */
html.tcm-i18n-on .avenue__date,
html.tcm-i18n-on section#outline .mainTxt .txt02 h4 { text-wrap: balance; }
html[lang|="zh"] .avenue__date,
html[lang|="zh"] section#outline .mainTxt .txt02 h4 { word-break: keep-all; }

/* Browsers break Hangul between any two syllables; Korean text breaks between words. */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: break-word; }
/* Chinese breaks between any two characters, and the *nobreak spans that keep Japanese headings in phrases are gone:
   balance the lines, so a heading does not end in one character (德国圣诞市集的传 / 统). */
html[lang|="zh"] h1,
html[lang|="zh"] h2,
html[lang|="zh"] h3,
html[lang|="zh"] h4 { text-wrap: balance; }

/* The theme's stacks start with Japanese fonts, which would draw the Han characters Chinese shares with Japanese
   in Japanese shapes, mid-line with the rest. Each language gets its own stack; the serif blocks (LPs, 今年の見どころ,
   the LP cards) a serif one. English keeps the theme's fonts, except in the serif blocks, whose subset fonts
   carry almost no Latin letters. */
html[lang="ko"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
html[lang="zh-Hans"] body { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html[lang="zh-Hant"] body { font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
html[lang="en"] .founder-page,
html[lang="en"] #contents .tophighlights,
html[lang="en"] #contents .tcm-lp-entry { font-family: Georgia, "Times New Roman", serif; }
html[lang="ko"] .founder-page,
html[lang="ko"] #contents .tophighlights,
html[lang="ko"] #contents .tcm-lp-entry { font-family: "AppleMyungjo", "Batang", "Noto Serif KR", serif; }
html[lang="zh-Hans"] .founder-page,
html[lang="zh-Hans"] #contents .tophighlights,
html[lang="zh-Hans"] #contents .tcm-lp-entry { font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif; }
html[lang="zh-Hant"] .founder-page,
html[lang="zh-Hant"] #contents .tophighlights,
html[lang="zh-Hant"] #contents .tcm-lp-entry { font-family: "Songti TC", "PMingLiU", "MingLiU", "Noto Serif TC", serif; }
