  <style>
    .gallery {
      column-count: 1;
      column-gap: 4px;
      max-width: 1000px;
      margin: 0 auto;
    }

  @media (min-width: 1024px) {
    .gallery {
      column-count: 1;
      text-align:center;
    }
}

    .gallery-item {
      max-width: 90%;
      position: relative;
      display: block;
      margin: 0 auto 8px;
      overflow: hidden;
    }

    .gallery-item img {
      display: block;
      width: 100%; /* max-widthではなくwidthを100%に */
      aspect-ratio: 4/3;
      object-fit: cover;
    }

    .gallery-item:hover img {
      transform: scale(1.01);
    }

    .overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.35);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      opacity: 0;
      font-size: 16px;
      transition: opacity 0.3s ease;
      z-index: 2;
      pointer-events: none;
    }

    .gallery-item:hover .overlay {
      opacity: 1;
    }

    .gallery-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.35);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      opacity: 0;
      font-size: 16px;
      transition: opacity 0.3s ease;
      z-index: 2;
      pointer-events: none;
    }

    .gallery-item:hover .gallery-overlay {
      opacity: 1;
    }


    /* モーダル */
    .modal {
      display: none;
      position: fixed;
      top: 0; left: 0;
      width: 100%;
      height: 100%;
      justify-content: center;
      align-items: center;
      background: rgba(0,0,0,0.7);
      z-index: 9999;
    }

   .modal-content {
     max-width: 90%;
     max-height: 90%;
     display: block;
     margin: 0 auto; /* 念のため中央寄せ */
     border-radius: 4px;
   }

    .modal-content img {
      max-width: 90vw;
      max-height: 80vh;
      display: block;
      margin: 0 auto;
    }

    .modal-close {
      position: absolute;
      top: 20px;
      right: 20px;
      font-size: 32px;
      color: white;
      cursor: pointer;
    }

/* デフォルトでは非表示（PC版） */
    .modal-title {
      display: none;
    }

/* SP版だけ表示 & 画像下に配置 */
@media (max-width: 768px) {
  .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
  }

  .modal-content img {
    margin-bottom: 10px;
  }

  .modal-title {
    display: block;
    font-size: 14px;
    color: #fff;
    text-align: center;
    line-height: 1.4;
  }
}

    .allworks-link a {
      font-size: 1.2rem;
      display: inline-block; 
      text-align: center;
    }

  </style>
