/**
 * Bootstrap 3 → Bootstrap 5 ブリッジCSS
 *
 * 目的: BS3クラスをBS5環境でも動作させる互換レイヤー
 * BS5のCSSと併用して読み込むことで、段階的な移行を可能にする
 *
 * 使い方:
 * 1. BS3の bootstrap.css を BS5の bootstrap.css に差し替え
 * 2. BS5の bootstrap.css の直後にこのファイルを読み込む
 * 3. ページ単位でBS3クラスをBS5クラスに書き換え
 * 4. 完全移行後、このファイルを削除
 *
 * 作成日: 2026-02-14
 */

/* ========================================
 * 1. Grid System: col-xs-* → col-*
 * BS3の col-xs-* は BS5 の col-* に相当
 * ======================================== */
.col-xs-1 { flex: 0 0 auto; width: 8.333333%; }
.col-xs-2 { flex: 0 0 auto; width: 16.666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; }
.col-xs-4 { flex: 0 0 auto; width: 33.333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.666667%; }
.col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.333333%; }
.col-xs-8 { flex: 0 0 auto; width: 66.666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

/* col-xs-offset-* → offset-* */
.col-xs-offset-1 { margin-left: 8.333333%; }
.col-xs-offset-2 { margin-left: 16.666667%; }
.col-xs-offset-3 { margin-left: 25%; }
.col-xs-offset-4 { margin-left: 33.333333%; }
.col-xs-offset-6 { margin-left: 50%; }

/* col-xs-push/pull → order-* (近似) */
.col-xs-push-1 { order: 1; }
.col-xs-push-2 { order: 2; }
.col-xs-push-6 { order: 6; }
.col-xs-pull-6 { order: -6; }

/* col-sm-push/pull */
@media (min-width: 576px) {
  .col-sm-push-1 { order: 1; }
  .col-sm-push-2 { order: 2; }
  .col-sm-push-3 { order: 3; }
  .col-sm-push-6 { order: 6; }
  .col-sm-push-9 { order: 9; }
  .col-sm-pull-3 { order: -3; }
  .col-sm-pull-6 { order: -6; }
  .col-sm-pull-9 { order: -9; }
}

/* col-md-push/pull (サイドメニュー等で使用) */
@media (min-width: 768px) {
  .col-md-push-1 { order: 1; }
  .col-md-push-2 { order: 2; }
  .col-md-push-3 { order: 3; }
  .col-md-push-4 { order: 4; }
  .col-md-push-6 { order: 6; }
  .col-md-push-9 { order: 9; }
  .col-md-pull-3 { order: -3; }
  .col-md-pull-4 { order: -4; }
  .col-md-pull-6 { order: -6; }
  .col-md-pull-9 { order: -9; }
}

/* col-lg-push/pull */
@media (min-width: 992px) {
  .col-lg-push-3 { order: 3; }
  .col-lg-push-6 { order: 6; }
  .col-lg-push-9 { order: 9; }
  .col-lg-pull-3 { order: -3; }
  .col-lg-pull-6 { order: -6; }
  .col-lg-pull-9 { order: -9; }
}

/* col-sm-offset-* */
@media (min-width: 576px) {
  .col-sm-offset-0 { margin-left: 0; }
  .col-sm-offset-1 { margin-left: 8.333333%; }
  .col-sm-offset-2 { margin-left: 16.666667%; }
  .col-sm-offset-3 { margin-left: 25%; }
}

/* col-md-offset-* */
@media (min-width: 768px) {
  .col-md-offset-0 { margin-left: 0; }
  .col-md-offset-1 { margin-left: 8.333333%; }
  .col-md-offset-2 { margin-left: 16.666667%; }
  .col-md-offset-3 { margin-left: 25%; }
  .col-md-offset-4 { margin-left: 33.333333%; }
}

/* col-lg-offset-* */
@media (min-width: 992px) {
  .col-lg-offset-0 { margin-left: 0; }
  .col-lg-offset-1 { margin-left: 8.333333%; }
  .col-lg-offset-2 { margin-left: 16.666667%; }
  .col-lg-offset-3 { margin-left: 25%; }
}

/* ========================================
 * 1b. BS3互換: .listnon内のul>liにcol-*がある場合のfloat互換
 * BS3ではfloatベースだったため、rowなしでもcol-*が使われていた
 * ======================================== */
.listnon ul > li[class*="col-"] {
  float: left;
}
.listnon ul::after {
  content: "";
  display: table;
  clear: both;
}

/* ========================================
 * 2. Responsive Visibility: hidden-* / visible-*
 * BS3の hidden-xs は BS5 の d-none d-sm-block に相当
 * ======================================== */

/* hidden-* classes */
.hidden-xs {
  display: none !important;
}
@media (min-width: 576px) {
  .hidden-xs { display: block !important; }
}

.hidden-sm {
  display: block !important;
}
@media (min-width: 576px) and (max-width: 767.98px) {
  .hidden-sm { display: none !important; }
}

.hidden-md {
  display: block !important;
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .hidden-md { display: none !important; }
}

.hidden-lg {
  display: block !important;
}
@media (min-width: 992px) {
  .hidden-lg { display: none !important; }
}

/* visible-* classes (display: block on specified, hidden on others) */
.visible-xs,
.visible-xs-block {
  display: none !important;
}
@media (max-width: 575.98px) {
  .visible-xs,
  .visible-xs-block { display: block !important; }
}

.visible-sm,
.visible-sm-block {
  display: none !important;
}
@media (min-width: 576px) and (max-width: 767.98px) {
  .visible-sm,
  .visible-sm-block { display: block !important; }
}

.visible-md,
.visible-md-block {
  display: none !important;
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .visible-md,
  .visible-md-block { display: block !important; }
}

.visible-lg,
.visible-lg-block {
  display: none !important;
}
@media (min-width: 992px) {
  .visible-lg,
  .visible-lg-block { display: block !important; }
}

/* visible-*-inline */
.visible-xs-inline { display: none !important; }
@media (max-width: 575.98px) {
  .visible-xs-inline { display: inline !important; }
}

.visible-sm-inline { display: none !important; }
@media (min-width: 576px) and (max-width: 767.98px) {
  .visible-sm-inline { display: inline !important; }
}

.visible-md-inline { display: none !important; }
@media (min-width: 768px) and (max-width: 991.98px) {
  .visible-md-inline { display: inline !important; }
}

.visible-lg-inline { display: none !important; }
@media (min-width: 992px) {
  .visible-lg-inline { display: inline !important; }
}

/* ========================================
 * 3. Image: img-responsive → img-fluid
 * ======================================== */
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========================================
 * 4. Panels → Cards
 * BS3の panel は BS5 の card に相当
 * ======================================== */
.panel {
  margin-bottom: 1rem;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
}

.panel-default {
  border-color: #dee2e6;
}

.panel-heading {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
}

.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1rem;
  color: inherit;
}

.panel-body {
  padding: 1.25rem;
}

.panel-footer {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);
}

.panel-primary {
  border-color: #0d6efd;
}
.panel-primary > .panel-heading {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.panel-success {
  border-color: #198754;
}
.panel-success > .panel-heading {
  color: #fff;
  background-color: #198754;
  border-color: #198754;
}

.panel-info {
  border-color: #0dcaf0;
}
.panel-info > .panel-heading {
  color: #000;
  background-color: #0dcaf0;
  border-color: #0dcaf0;
}

.panel-warning {
  border-color: #ffc107;
}
.panel-warning > .panel-heading {
  color: #000;
  background-color: #ffc107;
  border-color: #ffc107;
}

.panel-danger {
  border-color: #dc3545;
}
.panel-danger > .panel-heading {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

/* ========================================
 * 5. Float: pull-left / pull-right
 * ======================================== */
.pull-left {
  float: left !important;
}

.pull-right {
  float: right !important;
}

/* ========================================
 * 6. Navbar: BS3 navbar互換
 * BS5にはnavbar-inverse/navbar-toggle/navbar-collapseが無いため再現
 * ======================================== */
.navbar-inverse {
  background-color: #343a40;
  border-color: transparent;
}

.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
  color: rgba(255, 255, 255, 0.85);
}

.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-nav > li > a:hover {
  color: #fff;
}

/* navbar基本構造 */
.navbar {
  position: relative;
  min-height: 50px;
}

.navbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* navbar-toggle (ハンバーガーメニュー) */
.navbar-toggle {
  display: none;
  position: relative;
  float: right;
  padding: 9px 10px;
  margin-right: 15px;
  margin-top: 8px;
  margin-bottom: 8px;
  background-color: transparent;
  background-image: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  cursor: pointer;
}

.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #fff;
  border-radius: 1px;
  margin-top: 4px;
}

.navbar-toggle .icon-bar:first-child {
  margin-top: 0;
}

/* navbar-collapse */
.navbar-collapse {
  overflow: hidden;
}

.navbar-collapse.collapse {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

/* モバイル表示 */
@media (max-width: 767.98px) {
  .navbar-toggle {
    display: block;
  }

  .navbar-collapse.collapse {
    display: none !important;
  }

  .navbar-collapse.collapse.in,
  .navbar-collapse.collapse.show {
    display: block !important;
  }

  .navbar-nav {
    float: none !important;
    margin: 0;
  }

  .navbar-nav > li {
    float: none;
  }

  .navbar-nav > li > a {
    padding: 10px 15px;
  }
}

/* dropdown menu within navbar */
.navbar-nav .dropdown-menu {
  position: static;
  float: none;
  width: auto;
  border: 0;
  box-shadow: none;
}

@media (min-width: 768px) {
  .navbar-nav .dropdown-menu {
    position: absolute;
  }

  .navbar-nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
  }

  .navbar-nav > li {
    float: left;
  }

  .navbar-nav > li > a {
    padding: 15px;
  }
}

/* ========================================
 * 7. Buttons: btn-default
 * ======================================== */
.btn-default {
  color: #212529;
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.btn-default:hover {
  color: #212529;
  background-color: #e2e6ea;
  border-color: #dae0e5;
}

/* ========================================
 * 8. Labels → Badges
 * ======================================== */
.label {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.label-default { background-color: #6c757d; }
.label-primary { background-color: #0d6efd; }
.label-success { background-color: #198754; }
.label-info { background-color: #0dcaf0; color: #000; }
.label-warning { background-color: #ffc107; color: #000; }
.label-danger { background-color: #dc3545; }

/* ========================================
 * 9. Well → Card
 * ======================================== */
.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

.well-sm {
  padding: 9px;
  border-radius: 0.2rem;
}

.well-lg {
  padding: 24px;
  border-radius: 0.3rem;
}

/* ========================================
 * 10. Miscellaneous BS3 Utilities
 * ======================================== */

/* center-block → mx-auto d-block */
.center-block {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* input-group-addon → input-group-text */
.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  white-space: nowrap;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}

/* BS3 divider in dropdown */
.divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

/* BS3 media object */
.media {
  display: flex;
  align-items: flex-start;
}

.media-left {
  padding-right: 10px;
}

.media-body {
  flex: 1;
}

/* BS3 caret */
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px dashed;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* sr-only (BS3と同じだがBS5ではvisually-hidden) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
