/*
 * Bootstrap 5 の上で、Bootstrap 3.4.1（同梱していたカスタムビルド）の見た目を保つための上書き。
 * bootstrap.min.css の直後、site.css より前に読み込む。
 * 見た目を刷新するときは、このファイルごと見直す。 see LF-17
 */

/* ---------- 基本の文字・色 ---------- */
:root {
    --bs-body-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --bs-body-font-size: 14px;
    --bs-body-line-height: 1.42857143;
    --bs-body-color: #333;
    --bs-body-color-rgb: 51, 51, 51;
    --bs-link-color: #337ab7;
    --bs-link-color-rgb: 51, 122, 183;
    --bs-link-hover-color: #23527c;
    --bs-link-hover-color-rgb: 35, 82, 124;
    scroll-behavior: auto;
}

a {
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

a:focus {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
}

h1, h2, h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

h4, h5, h6 {
    margin-top: 10px;
    margin-bottom: 10px;
}

h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

p {
    margin: 0 0 10px;
}

ul,
ol {
    padding-left: 40px;
    margin-top: 0;
    margin-bottom: 10px;
}

b,
strong {
    font-weight: bold;
}

small {
    font-size: 85%;
}

hr {
    margin-top: 20px;
    margin-bottom: 20px;
    color: revert;
    border: 0;
    border-top: 1px solid #eee;
    opacity: 1;
}

img {
    border: 0;
}

canvas {
    display: inline-block;
    vertical-align: baseline;
}

code,
pre {
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

code {
    padding: 2px 4px;
    font-size: 90%;
    color: #c7254e;
    background-color: #f9f2f4;
    border-radius: 4px;
}

pre {
    display: block;
    padding: 9.5px;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.42857143;
    color: #333;
    word-break: break-all;
    word-wrap: break-word;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ---------- 表 ---------- */
th {
    text-align: left;
}

td,
th {
    padding: 0;
}

thead,
tbody,
tfoot,
tr,
td,
th {
    border-color: revert;
    border-style: revert;
    border-width: revert;
}

/* ---------- フォーム ---------- */
label {
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 700;
}

button,
input,
optgroup,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    border-radius: revert;
}

textarea {
    resize: both;
}

input[type="radio"],
input[type="checkbox"] {
    padding: 0;
    margin: 4px 0 0;
    line-height: normal;
}

input[type="radio"]:focus,
input[type="checkbox"]:focus {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}

input[type="search"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline-offset: 0;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute-field,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
    padding: revert;
}

/* ---------- グリッド ---------- */
/* Bootstrap 3 は幅を width で決め、上限を持たなかった（site.css の width 指定がそのまま効く） */
.container {
    --bs-gutter-x: 30px;
    max-width: none;
}

@media (min-width: 992px) {
    .container {
        width: 970px;
    }
}

@media (min-width: 1200px) {
    .container {
        width: 1170px;
    }
}

.container::before,
.container::after {
    display: table;
    content: " ";
}

.container::after {
    clear: both;
}

.row {
    --bs-gutter-x: 30px;
}

.row > * {
    position: relative;
    min-height: 1px;
}

/*
 * Bootstrap 3 の列は、横に並ばない幅では float しないただのブロックだった（幅は auto、上下のマージンは相殺される）。
 * その幅では行を flex からブロックに戻す。col-12 と col-xl-4 は旧 col-lg-*、col-lg-5 と col-lg-7 は旧 col-md-*。
 */
@media (max-width: 1199.98px) {
    .row:has(> .col-12, > .col-xl-4) {
        display: flow-root;
    }

    .row:has(> .col-12, > .col-xl-4) > * {
        width: auto;
    }
}

@media (max-width: 991.98px) {
    .row:has(> .col-lg-5, > .col-lg-7) {
        display: flow-root;
    }

    .row:has(> .col-lg-5, > .col-lg-7) > * {
        width: auto;
    }
}

/* ---------- ボタン ---------- */
/* Bootstrap 3 の .btn は背景色を持たず、色の class が無いボタンはブラウザ標準のボタン色だった */
.btn {
    --bs-btn-padding-x: 12px;
    --bs-btn-padding-y: 6px;
    --bs-btn-font-size: 14px;
    --bs-btn-line-height: 1.42857143;
    --bs-btn-border-radius: 4px;
    --bs-btn-focus-box-shadow: none;
    --bs-btn-bg: buttonface;
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: buttonface;
    --bs-btn-active-color: #333;
    --bs-btn-active-bg: buttonface;
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: buttonface;
    --bs-btn-disabled-border-color: transparent;
    transition: none;
}

.btn:hover,
.btn:focus {
    text-decoration: none;
}

.btn:focus,
.btn:focus-visible {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}

.btn:active {
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #337ab7;
    --bs-btn-border-color: #2e6da4;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #286090;
    --bs-btn-hover-border-color: #204d74;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #204d74;
    --bs-btn-active-border-color: #122b40;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #337ab7;
    --bs-btn-disabled-border-color: #2e6da4;
}

.btn-primary:focus {
    color: #fff;
    background-color: #286090;
    border-color: #122b40;
}

/* Bootstrap 5 で廃止された btn-default */
.btn-default {
    --bs-btn-color: #333;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #ccc;
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: #e6e6e6;
    --bs-btn-hover-border-color: #adadad;
    --bs-btn-active-color: #333;
    --bs-btn-active-bg: #d4d4d4;
    --bs-btn-active-border-color: #8c8c8c;
    --bs-btn-disabled-color: #333;
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #ccc;
}

.btn-default:focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #8c8c8c;
}

.btn-link {
    --bs-btn-bg: transparent;
    --bs-btn-hover-bg: transparent;
    --bs-btn-active-bg: transparent;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-color: #777;
    text-decoration: none;
    border-radius: 0;
}

.btn-link:hover,
.btn-link:focus {
    color: #23527c;
    text-decoration: underline;
    background-color: transparent;
}

.btn-link:active {
    box-shadow: none;
}

/* ---------- モーダル ---------- */
.modal {
    --bs-modal-margin: 10px;
    --bs-modal-padding: 15px;
    --bs-modal-header-padding: 15px;
    --bs-modal-border-color: rgba(0, 0, 0, 0.2);
    --bs-modal-border-radius: 6px;
    --bs-modal-inner-border-radius: 0px;
    --bs-modal-header-border-color: #e5e5e5;
    --bs-modal-footer-border-color: #e5e5e5;
    --bs-modal-title-line-height: 1.42857143;
    --bs-modal-footer-gap: 0px;
}

.modal-dialog {
    max-width: none;
    margin: var(--bs-modal-margin);
}

.modal-content {
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
}

.modal-header,
.modal-footer {
    display: block;
}

.modal-title {
    margin: 0;
}

.modal-footer {
    text-align: right;
}

.modal.fade .modal-dialog {
    transform: translate(0, -25%);
}

.modal.show .modal-dialog,
.modal.modal-static .modal-dialog {
    transform: none;
}

@media (min-width: 1336px) {
    .modal-dialog {
        max-width: 600px;
        margin: 30px auto;
    }

    .modal-content {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }
}

/* Bootstrap 5 で廃止された close（btn-close は見た目が違うため使わない） */
.close {
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.2;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.5;
}

button.close {
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.modal-header .close {
    margin-top: -2px;
}
