.modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  overflow: hidden;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background-color: #000;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.modal-backdrop.show {
  opacity: 0.5;
}
.modal-open {
  overflow: hidden;
}
.modal.fade .modal-dialog {
  transform: translate(0, -0.625rem);
  opacity: 0;
  transition: 
    transform 0.2s ease-out,
    opacity 0.2s ease-out;
}
.modal.show .modal-dialog {
  transform: none;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog {
    transition: none;
  }
}
.modal .modal-dialog {
  position: relative;
  width: auto;
  margin: 0 auto;
  max-width: min(90vw,60rem);
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  min-height: calc(100% - 1rem);
}
.modal .modal-dialog-centered {
  min-height: calc(100% - 1rem);
  align-items: center;
}
.modal .modal-dialog-scrollable {
  height: calc(100% - 1rem);
}
.modal .modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}
.modal .modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

/* 大画面の余白調整 */
@media (min-width: 576px) {
  .modal .modal-dialog {
    margin: 1.75rem auto;
    min-height: calc(100% - 3.5rem);
  }
  .modal .modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
  }
  .modal .modal-dialog-scrollable {
    height: calc(100% - 3.5rem);
  }
}
.modal .modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: .5rem;
  outline: 0;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
  max-height: calc(100vh - 3.5rem);
  overflow: hidden;
}
.modal .modal-header,
.modal .modal-footer {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-color: rgba(0, 0, 0, .1);
  background-color: #fff;
  z-index: 100;
  box-shadow: 0 0 7px 3px rgba(128, 128, 128, 0.5);
}
.modal .modal-header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}
.modal .modal-footer {
  justify-content: flex-end;
  border-top: 1px solid rgba(0, 0, 0, .1);
}

.modal .modal-header .modal-title {
  display: inline;
  font-size: 1.25rem;
  margin: 0;
  padding: 0;
}

.modal .modal-body .modal-title {
  font-size: 1.25rem;
}

.modal .modal-body {
  position: relative;
  padding: 1rem;
  overflow: auto;
}

/* 閉じるボタン */
.modal .btn-close {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  width: 1em;
  height: 1em;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 1;
  opacity: .7;
  cursor: pointer;
  font-size: 1.25rem;
}
.modal .btn-close:hover,
.modal .btn-close:focus {
  opacity: 1;
}
.modal .btn-close::before {
  content: "×";
  display: inline-block;
  font-weight: 600;
}

/* --- ボタン--- */
.modal .modal-footer > button,
.btn-open-modal {
  font-size: 0.75rem;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(0,0,0,.2);
  background: #f8f9fa;
  color: inherit;
  padding: .375rem .75rem;
  border-radius: .25rem;
  cursor: pointer;
}
.modal .modal-footer > button + button {
  margin-left: .5rem;
}
.modal .modal-footer > button:hover,
.btn-open-modal:hover {
  background: #f1f3f5;
}
.text-right {
  text-align: right !important;
}
.not-date {
  color: rgba(0,0,0,.6);
  font-size: .9em;
}

.modal.show { display: block; }

/* 画像拡大表示img-shrunk関連 */
/* 画像拡大表示のモーダルにおける画像サイズ調整 */
#modal-image {
  height: 70vh;
  width: auto;
  display: block;
  margin: 0 auto;
}
/* 画像拡大ボタン */
.img-shrunk-button {
  height: 1.5rem;
  width: 7rem;
  margin: 0 auto;
  background-image: url(../img/img-shurunk-button.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
/* 画像拡大ボタン */
.img-shrunk-button:hover {
  cursor: pointer;
  opacity: 0.5;
}

/* 記事中のモーダル：金山測候所と活火山の写真ボタン */
#open-kaneyama-modal, #open-volcano-modal {
    margin: 0.5rem auto;
    padding: 0;
    min-height: 3rem;

    text-decoration: none;
    print-color-adjust: exact;

    overflow: hidden;
    border:  none;
    background-color: rgb(250, 250, 250);
    box-shadow: 0 0 5px rgba(128, 128, 128, 0.75);
    transition: all ease-out 0.25s;
    border-radius: 0.75rem;

    display: flex;
    cursor: pointer;
}
#open-kaneyama-modal:hover, #open-volcano-modal:hover {
    box-shadow: 0 0 10px rgba(128, 128, 128);
}
#open-kaneyama-modal > .btn-thumbnail-img, #open-volcano-modal > .btn-thumbnail-img {
    width: 5rem;
    overflow: hidden;
    position: relative;
}
#open-kaneyama-modal > .btn-thumbnail-img > img, #open-volcano-modal > .btn-thumbnail-img > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex: none;
    background-size: cover;
    background-position: center;

    transition: all 0.25s ease-out;
}
#open-kaneyama-modal:hover > .btn-thumbnail-img > img, #open-volcano-modal:hover > .btn-thumbnail-img > img {
    transform-origin: center center;
    transform: scale(1.2);
}
#open-kaneyama-modal .btn-text, #open-volcano-modal .btn-text {
    flex-grow: 1;
    color: black;

    padding: 0.5rem;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    font-size: 1rem;
    white-space: nowrap;
}