/* ========================================
   お知らせページ
======================================== */

.news-section {
  padding: 80px 0;
}

.news-section .container {
  width: min(100% - 40px, 1100px);
  margin: 0 auto;
}

.news-item {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid #d8d8d8;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.news-date {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: #555;
}

.news-label {
  display: inline-block;
  padding: 4px 10px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 4px;
  color: #fff;
}

.news-label.notice { background: #2a3a46; }
.news-label.works  { background: #8a6f4d; }
.news-label.blog   { background: #6a8f6b; }

.news-text {
  margin-bottom: 24px;
  line-height: 1.9;
}

/* ========================================
   ギャラリー共通
======================================== */

.news-gallery {
  overflow: hidden;
  border-radius: 8px;
}

.gallery-track {
  display: flex;
  transition: transform 0.45s ease;
  will-change: transform;
}

/* ★重要：幅はJS制御前提なので固定しない */
.gallery-track img {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

/* ========================================
   PC：3枚単位スライド
======================================== */

@media (min-width: 769px) {

  .gallery-track {
    gap: 18px; /* ★ここで余白を作る（OK） */
  }

  .gallery-track img {
    flex: 0 0 calc((100% - 36px) / 3);
    width: calc((100% - 36px) / 3);
  }
}

/* ========================================
   SP：1枚固定
======================================== */

@media (max-width: 768px) {

  .news-section {
    padding: 50px 0;
  }

  .news-section .container {
    width: min(100% - 32px, 1100px);
  }

  .news-item {
    padding-bottom: 36px;
    margin-bottom: 36px;
  }

  .news-meta {
    gap: 8px;
  }

  .news-date {
    font-size: 1.3rem;
  }

  .news-label {
    font-size: 1.1rem;
    padding: 4px 8px;
  }

  .news-text {
    margin-bottom: 20px;
  }

  .gallery-track img {
    flex: 0 0 100%;
    width: 100%;
  }

  .gallery-track {
    gap: 0; /* ★SPは絶対に0 */
  }
}

/* ========================================
   カルーセルUI
======================================== */

.news-gallery.is-carousel .gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.news-gallery.is-carousel .gallery-prev,
.news-gallery.is-carousel .gallery-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f2f2f2;
  cursor: pointer;

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

/* ========================================
   ドット（・・・）表示の崩れ修正
======================================== */

/* ドット全体 */
.gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;               /* ドット間の余白 */
  min-width: auto;
  flex-shrink: 0;
  line-height: 1;
}

/* 各ドット */
.gallery-dot {
  display: block;
  width: 8px;
  height: 8px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: #c5c5c5;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 8px;          /* 幅固定 */
}

/* アクティブ時 */
.gallery-dot.active {
  background: #666;
}

/* SP時の微調整 */
@media (max-width: 768px) {
  .gallery-dots {
    gap: 5px;
  }

  .gallery-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
  }
}
/* ========================================
   2～3枚用：PCではコントロール非表示
======================================== */

/* PCではカルーセルUIを非表示 */
@media (min-width: 769px) {
  .news-gallery.is-carousel .gallery-controls {
    display: none;
  }
}

/* SPではカルーセルUIを表示 */
@media (max-width: 768px) {
  .news-gallery.is-carousel .gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
  }
}