@charset "utf-8";
/* CSS Document */
.h-main-ttl h1 {
  font-size: 3rem;
}
.h-main-ttl .aisatsu-lead {
  max-width: 880px;
  width: calc(100% - 80px);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 2.4;
}
.h-main-ttl .aisatsu-lead rt {
  font-size: 1rem;
}
.lang-menu-wrap h2 {
  font-size: 2.4rem;
  font-weight: 600;
  padding-bottom: 1rem;
}

.top-box-wrap ul {
  justify-content: center;
  gap: 8rem;
}
.top-box-wrap ul::after {
  display: none;
}
.solo-balloon {
  padding: 8px 40px 6px
}

/* フレーズ（ローマ字・各国語）基本：M PLUS優先＋Notoをフォールバック */
.wg-phrase{
  font-family:
    "M PLUS Rounded 1c",
    "Noto Sans",
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

/* 中国語（簡体） */
.wg-phrase:lang(zh),
.wg-phrase:lang(zh-Hans){
  font-family:
    "Noto Sans SC",
    "Noto Sans",
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 中国語（繁体） */
.wg-phrase:lang(zh-Hant){
  font-family:
    "Noto Sans TC",
    "Noto Sans",
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* アラビア語（右から左） */
.wg-phrase:lang(ar){
  font-family:
    "Noto Sans Arabic",
    "Noto Sans",
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  direction: rtl;
  unicode-bidi: isolate;
  text-align: center;
  margin-right: 0;
}

/* ヒンディー語（デーヴァナーガリー） */
.wg-phrase:lang(hi){
  font-family:
    "Noto Sans Devanagari",
    "Noto Sans",
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ルビ */
ruby,
ruby rb,
ruby rt {
  line-height: 1;
}

/* ===== ツールバー ===== */

/* ===== 言語チップ（ボタン複数選択） ===== */
.wg-langchips,
.wg-tabs,
.intro-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 280px));
  gap: 8px;
  justify-content: center;
  align-content: start;
  margin: 1rem auto 2rem;
  width: min(calc(100% - 16px), calc((280px + 8px) * 5 - 8px));
}
.intro-wrap {
  justify-content: flex-start;
}
@media (max-width: 1028px) {
  .intro-wrap {
    justify-content: center;
  }
  
}
.wg-chip,
.wg-chip-clear,
.wg-tabs button {
  padding:5px 10px;
  border:1px solid #0066DA;
  color: #0066DA;
  background:#fff;
  border-radius:999px;
  cursor:pointer;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  user-select:none;
  align-items: center;
  border-radius: 40px;
  font-weight: 600;
  padding: 4px 8px;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 100%;
  min-block-size: 44px;
}
.wg-chip.is-on,
.wg-chip-clear.is-on,
.wg-tabs button.is-active {
  background:#0066DA;
  border-color:#0066DA;
  color:#fff
}

#wg-root {
  margin-top: clamp(100px, 10vw, 200px);
}

/* ===== セクション ===== */
.wg-section {
  margin: 28px 0 40px
}
.wg-lang {
  margin: 0 0 10px;
  font-size: 1.8rem;
  font-weight: 700;
}

/* ===== Layout: 3カラム（PC）===== */
.wg-row {
  margin-left: clamp(80px, 8vw, 120px);
  margin-right: clamp(12px, 2vw, 20px);
  --col-label: 20%;
  --col-phrase: 40%;
  --col-pron: 40%;
  display:grid;
  grid-template-columns:var(--col-label) var(--col-phrase) var(--col-pron);
  column-gap:0;
  row-gap: clamp(10px, 1vw, 16px);
  padding: clamp(6px, 1vw, 10px) 0;
}
/* 先頭の可視フレーズ行にキャラクターを出す */
.wg-row.is-first-visible {
  position: relative;
}
.wg-row.is-first-visible::before {
  content: "";
  position: absolute;
  left: calc(clamp(80px, 8vw, 120px) * -1);
  top: clamp(32px, 4vw, 48px);
  transform: translateY(-50%);
  width: clamp(60px, 6vw, 90px);
  height: clamp(60px, 6vw, 90px);
  border-radius: 50%;
  background-color: #ffeb3b;
  background-image: url("../img/rabbit_aisatsu_icon.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* 左：ラベル（左向き三角そのまま） */
.wg-label {
  position:relative;
  grid-column:1;
  color:#333;
  background:#ffeb3b;
  padding:10px 15px;
  border-radius:12px;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  font-weight:500;
  line-height:2;
  text-align: center;
  align-self: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.wg-label::before { content: none; }
.wg-row:not([data-label="言語紹介"]) .wg-label::before {
  content:"";
  position:absolute;
  left: -30px;
  top:50%;
  transform:translateY(-50%);
  border:10px solid transparent;
  border-right: 20px solid #ffeb3b;
}

.wg-intro {
  margin-top: 20px;
  position: relative;

}
#wg-showintro {
  appearance: none;
  position: absolute;
  top: 20px;
  left: 12px;
  width: 24px;
  height: 24px;
  border: 2px solid #e51f1a;
  background-color: #fff;
  vertical-align: 0;
}
#wg-showintro:checked:before {
  position: absolute;
  top: 2px;
  left: 8px;
  transform: rotate(50deg);
  width: 6px;
  height: 12px;
  border-right: 2px solid #e51f1a;
  border-bottom: 2px solid #e51f1a;
  content: '';
}
.wg-intro label {
  max-width: 360px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  font-weight: 700;
  color: #e51f1a;
  white-space: nowrap;
  border: 1px solid #e51f1a;
  border-radius: 20px;
  background-color: #fff;
  padding-left: 16px;
  line-height: 2;
}

.wg-intro label:has(input:checked) {
  background-color: #e51f1a;
  color: #fff;
}
/* 中：フレーズ（外周左だけ角丸）＋中央セパレータ */
.wg-phrase {
  position:relative;
  grid-column:2;
  word-break: break-word;
  background:#7bffc9;
  padding: 10px 15px;
  border-radius: 12px 0 0 12px;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  font-weight: 600;
  line-height: 2;
  align-content: center;
  margin-left:16px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
}
.wg-phrase::after {
  content:"";
  position:absolute;
  top:8px;
  bottom:8px;
  right: 0;
  width:1px;
  background:rgba(0,0,0,.25);
}

/* 右：発音（外周右だけ角丸）＋右向き三角 */
.wg-pron {
  position:relative;
  grid-column:3;
  word-break:break-word;
  background:#7bffc9;
  padding:10px 15px;
  margin: 0;
  border-radius:0 12px 12px 0;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  font-weight: 600;
  line-height:2;
  align-content: center;
  text-align: center;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
}
.wg-pron::after{
  content:"";
  position:absolute;
  right: -30px;
  top:50%;
  transform:translateY(-50%);
  border:10px solid transparent;
  border-left: 20px solid #7bffc9;
}

/* 意味（右2カラム横断） */
.wg-row.wg-meaning .wg-note {
  grid-column:2 / span 2;
  line-height:1.8;
}

/* 番外＝意味のみ を「言語紹介」と同じ見た目に */
.wg-row[data-group="extra"].wg-extra-meaning-only {
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  column-gap: 0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  border-bottom: none;
}

/* 左カラム（ラベル） */
.wg-row[data-group="extra"].wg-extra-meaning-only .wg-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 8px 8px;
  border-radius: 10px 0 0 10px;
  background: transparent;
  font-weight: 700;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  line-height: 1.2;
  color: #0f1732;
  text-align: center;
  box-shadow: none;
}

/* ラベルの吹き出し三角は不要 */
.wg-row[data-group="extra"].wg-extra-meaning-only .wg-label::before{
  display: none !important;
}

/* 右カラム（本文） */
.wg-row[data-group="extra"].wg-extra-meaning-only .wg-note{
  grid-column: 2;
  padding: 12px 16px 12px 20px;
  border-radius: 0 10px 10px 0;
  line-height: 1.9;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  background-color: #fff;
  box-shadow: none;
  border-left: 2px solid #1a1a1a
}

.wg-row[data-group="extra"].wg-extra-meaning-only .wg-note::before {
  background: none;
}
.wg-row[data-group="extra"].wg-extra-meaning-only .wg-note::after {
  border: none;
}

/* 念のため：番外で誤って入っていたら非表示 */
.wg-row[data-group="extra"].wg-extra-meaning-only .wg-phrase,
.wg-row[data-group="extra"].wg-extra-meaning-only .wg-pron{
  display: none !important;
}

/* SP：1カラム（言語紹介と同じ振る舞い） */
@media (max-width: 768px){
  .wg-row[data-group="extra"].wg-extra-meaning-only{
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .wg-row[data-group="extra"].wg-extra-meaning-only .wg-label {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid #1a1a1a;
    border-radius: 0;
    padding: 8px 0 10px;
  }
  .wg-row[data-group="extra"].wg-extra-meaning-only .wg-note {
    grid-column: 1;
    padding: 12px 0 0;
    border-left: none;
  }
}


/* 空要素は非表示 */
.wg-row>dd:empty{display:none}


/* SP: 2段構成 */
@media (max-width: 768px){
  .wg-row {
    grid-template-columns: 1fr 0.4fr;
  }
  .wg-label {
    grid-column: 1;
    margin-right: 0.5rem;
  }
  .wg-phrase {
    grid-column: 1 / -1;
    margin-left: 0;
    border-radius: 12px;
  }
  .wg-phrase::after {
    display: none; /* 狭い画面では縦線を消す */
  }
  .wg-pron {
    grid-column: 1 / -1;
    border-radius: 12px;
  }

  /* 意味・番外編は2カラムまたぎ */
  .wg-row.wg-meaning .wg-note,
  .wg-row.wg-extra-meaning-only .wg-note {
    grid-column: 1 / -1;
  }
}


/* ==== 言語紹介レイアウト ==== */
.wg-row[data-label="言語紹介"]{
  grid-template-columns: clamp(100px, 10vw, 160px) 1fr;
  column-gap: 0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  margin: 12px 0;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
}
/* 既定の下線などを無効化 */
.wg-row[data-label="言語紹介"]{ border-bottom: none; }

/* 左カラム：縦の仕切りつきラベル */
.wg-row[data-label="言語紹介"] .wg-label {
  margin: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px 8px 8px;
  border-right: 2px solid #1a1a1a;
  border-radius: 10px 0 0 10px;
  position:relative;
  background-image:url("../img/intro_txt.png");
  background-size: cover;
  background-repeat: no-repeat;
  color: transparent;
  width: clamp(60px, 8vw, 120px);
  height: clamp(60px, 8vw, 120px);
  box-shadow: none;
}
/* 吹き出し消す */
.wg-row[data-label="言語紹介"] .wg-label::before{ display:none !important; }

/* ==== 言語紹介（背景アイコン対応） ==== */
.wg-row[data-label="言語紹介"] .wg-note{
  margin: 0;
  position: relative;
  padding: 20px 20px 20px clamp(100px, 14vw, 200px);
  border-radius: 0 10px 10px 0;
  line-height: 1.9;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  background-color: #fff;
  box-shadow: none;
}

/* 丸アイコン背景（画像を背景に設定） */
.wg-row[data-label="言語紹介"] .wg-note::before{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(80px, 11vw, 160px);
  height: clamp(80px, 11vw, 160px);
  border-radius: 50%;
  background-image: url("../img/kamome_syoukai.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}


/* SP対応（1カラムで上に出す） */
@media (max-width: 768px){

  .wg-row[data-label="言語紹介"]{
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .wg-row[data-label="言語紹介"] .wg-label{
    justify-content:flex-start;
    border-right: 0;
    border-bottom: 1px solid #1a1a1a;
    border-radius: 10px 10px 0 0;
    padding: 8px 0 10px;
  }
  .wg-row[data-label="言語紹介"] .wg-note{
    padding:0 16px 16px;
  }
  .wg-row[data-label="言語紹介"] .wg-note::before{
    left: 50%;
    top: -80px;
    transform: translateX(-50%);
  }
}

.wg-section  {
  padding: 20px;
  border-top: 4px solid #c8ebff;
  background-color: #eee;
  position: relative;
  margin-bottom: 120px;
  position: relative;
}
.wg-section h2 {
  position: absolute;
  top: -5.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  text-align: center;
  line-height: 2;
  font-size: 2rem;
  font-weight: 500;
  padding: 0.5rem 4rem;
  border: 4px solid #c8ebff;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  color: #111;
  background-color: #eee;
  white-space: nowrap;
}

@media(max-width: 1028px) {
  .wg-section h2 {
    top: -5.6rem;
  }
}
@media(max-width: 768px) {
  .wg-section h2 {
    font-size: 1.6rem;
    top: -4.8rem;
  }
}
/* ==== 9色ループ（1〜9 → 繰り返し） ==== */

/* 1 */
.wg-section:nth-child(9n + 1) {
  border-top: 4px solid #FFD500;
  background: rgba(255, 213, 0, 0.2);
}
.wg-section:nth-child(9n + 1) h2 {
  border: 4px solid #FFD500;
  border-bottom: none;
  background: #FFD500;
}

/* 2 */
.wg-section:nth-child(9n + 2) {
  border-top: 4px solid #00ADE6;
  background: rgba(0, 153, 255, 0.2);
}
.wg-section:nth-child(9n + 2) h2 {
  border: 4px solid #00ADE6;
  border-bottom: none;
  background: #00ADE6;
}

/* 3 */
.wg-section:nth-child(9n + 3) {
  border-top: 4px solid #70D500;
  background: rgba(102, 204, 0, 0.2);
}
.wg-section:nth-child(9n + 3) h2 {
  border: 4px solid #70D500;
  border-bottom: none;
  background: #70D500;
}

/* 4 */
.wg-section:nth-child(9n + 4) {
  border-top: 4px solid #FF8800;
  background: rgba(255, 153, 0, 0.2);
}
.wg-section:nth-child(9n + 4) h2 {
  border: 4px solid #FF8800;
  border-bottom: none;
  background: #FF8800;
}

/* 5 */
.wg-section:nth-child(9n + 5) {
  border-top: 4px solid #00BB98;
  background: rgba(0, 204, 153, 0.2);
}
.wg-section:nth-child(9n + 5) h2 {
  border: 4px solid #00BB98;
  border-bottom: none;
  background: #00BB98;
}

/* 6 */
.wg-section:nth-child(9n + 6) {
  border-top: 4px solid #D2E000;
  background: rgba(204, 204, 0, 0.2);
}
.wg-section:nth-child(9n + 6) h2 {
  border: 4px solid #D2E000;
  border-bottom: none;
  background: #D2E000;
}

/* 7 */
.wg-section:nth-child(9n + 7) {
  border-top: 4px solid #7596FF;
  background: rgba(117, 150, 255, 0.2);
}
.wg-section:nth-child(9n + 7) h2 {
  border: 4px solid #7596FF;
  border-bottom: none;
  background: #7596FF;
}

/* 8 */
.wg-section:nth-child(9n + 8) {
  border-top: 4px solid #FF6C59;
  background: rgba(255, 108, 89, 0.2);
}
.wg-section:nth-child(9n + 8) h2 {
  border: 4px solid #FF6C59;
  border-bottom: none;
  background: #FF6C59;
}

/* 9 */
.wg-section:nth-child(9n + 9) {
  border-top: 4px solid #7BF02F;
  background: rgba(102, 255, 51, 0.2);
}
.wg-section:nth-child(9n + 9) h2 {
  border: 4px solid #7BF02F;
  border-bottom: none;
  background: #7BF02F;
}


/* ハイライト */
mark{background:linear-gradient(transparent 60%, #ffec8b 60%)}

.wg-note {
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  background-color: #fff;
  padding: clamp(8px, 1vw, 12px) clamp(16px, 2vw, 24px);
  border-radius: 20px;
  position: relative;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
}
.wg-note::after {
  content:"";
  position:absolute;
  left: clamp(-20px, -3vw, -30px);
  top:50%;
  transform:translateY(-50%);
  border: 10px solid transparent;
  border-right: 20px solid #fff;
}
.wg-note::before{
  content: "";
  position: absolute;
  left: clamp(-200px, -14vw, -80px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(60px, 11vw, 160px);
  height: clamp(60px, 11vw, 160px);
  border-radius: 50%;
  background-image: url("../img/kamome.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* スクリーンリーダー専用 */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.nav-wrap { display: block; }
.lang-menu-wrap .search-h {
  font-size: clamp(2rem, 2.2vw, 2.4rem);
  font-weight: 600;
  padding-bottom: 1rem;
  display: block;
  width: 100%;
  text-align: center;
  color: #0066DA;
  border-bottom: dashed 3px #0066DA;
}
.search-h:has(+ .nav-wrap) {
  color: #1D8301;
  border-bottom: 3px dashed #1D8301;
}
.search-h span {
  font-size: clamp(1.6rem, 2vw, 1.8rem);
}

.nav-wrap .wg-tabs button {
  border:1px solid #1D8301;
  color: #1D8301;
}
.nav-wrap .wg-tabs button.is-active {
  background:#1D8301;
  border-color:#1D8301;
  color:#fff
}

.all-wrap {
  margin: 0 auto;
  width: calc(100% - 72px);
}
@media (max-width: 1028px){
  .all-wrap {
    margin: 0 auto;
    width: 100%;
  }
}
/* 1028px以下で一段階小さく */
@media (max-width: 1028px){
  .wg-chip, .wg-chip-clear, .wg-tabs button{ min-height: 44px; }
}

/* 768px以下でさらに小さく・余白圧縮 */
@media (max-width: 768px){
  .wg-langchips, .wg-tabs{
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}