/*
 * ジョルダンモバイルチケット 販売メニュー（ticket_top）
 * 旧 css/ress.min.css + css/style.css を ticket_top.php 専用に1ファイルへ統合
 * ress.css は使わず、このページに必要なリセットだけを「1. ベース」に記述
 *
 * 旧 style.css から外したもの（未使用）:
 *   .notice / .notice .box-title / a.SubMenu
 *   ※ 旧 style.css は他ページ（index_coming.html 等）が読んでいる可能性があるため、サーバーからは削除しないこと
 *
 * 主な色:
 *   #F76F49 選択中タブ / #323239 文字・見出し背景 / #86858a サブ文字 / #EFEFF4 タブ背景
 *   #e60663 注意書き / #5f9ea0 フッターリンク
 */

/* ========== 1. ベース（ress.css から、このページに必要な指定だけを抜き出したもの） ========== */
/* 幅指定に padding・border を含める（.Menu2 の max-width などがこれを前提にしている） */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;   /* iOS で横向き時に文字が勝手に拡大されるのを防ぐ */
}

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

/* ブラウザ既定の余白をなくす（このページで使っている要素のみ） */
body,
h1,
h2,
h3,
p,
hr,
ul,
ol,
li,
figure {
  margin: 0;
  padding: 0;
}

/* ========== 2. ページ共通 ========== */
html,
body {
  font-family: 'Noto Sans JP', sans-serif;
}

main {
  overflow: hidden;
}

h2 {
  background-color: #323239;
  padding-top: 5px;
  text-align: center;
  width: 100%;
}

/* ========== 3. 上部タブ（固定表示） ========== */
.Menu {
  position: fixed;
  top: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 45px;               /* 本文側は #Menuber の margin-top でこの高さ分ずらしている */
  text-align: center;
  background-color: #EFEFF4;
}

.Menu a.is-active span {
  color: #F76F49;
  border-bottom: 2px solid #F76F49;
  padding-bottom: 2px;
}

/* 「New」などのバッジ（タブ内2つ目の span） */
.Menu a span:nth-child(2) {
  position: relative;
  top: -18px;
  left: -6px;
  font-size: 12px;
  color: #F76F49;
  border: none;
  padding-bottom: 0;
}

/* ログインしていないときの「再購入」タブ（リンク無効） */
.Menu a.not-active {
  pointer-events: none;
  padding: 4px 16px;
  color: #86858a;
}

.Menu a.not-active span:nth-child(2) {
  display: none;
}

.TopMenu {
  position: relative;
  padding: 4px 20px;
  font-size: 16px;
  color: #323239;
  text-decoration: none;
}

.TopMenu:last-of-type {
  border-left: 1px dashed #86858a;
}

@media only screen and (max-width: 374px) {
  .TopMenu {
    padding: 4px 12px;
  }
}

/* ========== 4. サブメニュー（種別・都道府県） ========== */
.Menu2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: 450px;
  margin: 0 auto;
  padding: 2px 8px 6px;
  text-align: center;
}

.Menu2 a.is-active span {
  color: #F76F49;
  border-bottom: 2px solid #F76F49;
  padding-bottom: 2px;
}

a.SubMenu2 {
  min-width: 64px;
  padding: 4px 8px;
  color: #86858a;
  text-decoration: none;
}

/*
 * ホバー表示はマウス操作の端末だけ。タッチ端末では、タップ後（「戻る」で戻ったとき）に
 * 押したタブがホバー色のまま残り、選択中が2つあるように見えるのを防ぐ
 */
@media (hover: hover) {
  .Menu a:hover span,
  .Menu2 a:hover span {
    color: #F76F49;
    border-bottom: 2px solid #F76F49;
    padding-bottom: 2px;
  }
}

/* ========== 5. チケット一覧（2列） ========== */
.sales-ticket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 10px;
}

.ticket-img {
  width: 48%;
}

/*
 * HTML の width/height 属性（170x198）から縦横比だけを使い、高さは表示幅に合わせる。
 * height: auto がないと高さ 198px 固定になり、画面幅によって縦に伸び縮みする
 * （ticket_top.php の TICKET_IMG_W / TICKET_IMG_H と対になっている）
 *
 * 画像はあえてインライン表示のままにしている。画像の下に文字の下がり分（約4px）の
 * すき間ができ、これが上下のバナーの間隔になっているため（display: block にすると詰まる）
 */
.ticket-img img {
  width: 100%;
  height: auto;
}

/*
 * タブレット・横向き（幅600px以上）は列を増やし、バナー1枚の幅を約170〜230pxに保つ。
 * 2列のまま広げると画像が大きく引き伸ばされて粗くなるため。
 * 列数は画面幅に応じて自動（600px→3列、768px→4列、1024px→5列 など）。
 * 最終行が埋まらないときも左から詰めて並べるため、ここだけ grid を使う。
 * ※ バナーの最大幅（約230px）は ticket_top.php の TICKET_IMG_SIZES と対になっている
 */
@media (min-width: 600px) {
  .sales-ticket {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    column-gap: 16px;
  }

  .ticket-img {
    width: auto;
  }
}

/* ========== 6. 注意書き・フッター ========== */
.attention {
  width: 96%;
  margin: 0 auto;
  line-height: 2;
  font-size: 0.8em;
  color: #e60663;
}

.GreyTxt {
  margin: 10px;
  font-size: 13px;
  color: #666;
}

.FooterLink {
  margin: 10px;
  color: #999;
}

.FooterLink a {
  color: #5f9ea0;
  text-decoration: none;
}

/* ========== 7. 事業者向け専用ページ（ticket_coming.php） ========== */
.Menu-title {
  color: #333;
}

/* 見出しを固定タブの高さ分下げる */
#pass {
  margin-top: 45px;
}

/*
 * 事業者コードの入力画面（画面全体を覆う）
 * inset は古い WebView（Android Chrome 86 以前・iOS 14.4 以前）で効かず、
 * 入力画面がページの最下部に出てしまうため、top/right/bottom/left で指定する
 */
.AccessCode {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.AccessCode-box {
  width: 80%;
  max-width: 450px;
  margin: 40vh auto 0;
  padding: 10px;
  border-radius: 10px;
  background-color: #fff;
  text-align: left;
}

.AccessCode-row {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

.AccessCode-input {
  flex: 1;
  min-width: 0;
  margin-right: 5px;        /* flex の gap は古い WebView で効かないため margin で間隔をとる */
  padding: 2px 4px;
  font: inherit;
  font-size: 16px;          /* 16px 未満だと iOS が入力時に画面を拡大する */
  border: 1px solid gray;
  border-radius: 0;
}

.AccessCode-button {
  width: 20%;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  text-align: center;
  background-color: #F76F49;
  border: 2px solid #F76F49;
  border-radius: 5px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.AccessCode-error {
  color: red;
}
