/* =====================================================
   導入事例ページ スタイル
   news.css のページヒーロー・パンくず・サイドバー・ページャーを共有
   ===================================================== */

/* ヒーロー背景 - 防草シート画像 */
.page-hero-bg--case {
  background-image: url('../img/hero-msheet.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: var(--color-navy);
}

/* カテゴリバッジ */
.cat-case {
  background: var(--color-green-pale);
  color: var(--color-green-dark);
}


/* ============================================================
   CASE ARCHIVE - カード型一覧
   ============================================================ */
.section-case-archive {
  background: var(--color-bg);
  padding: 56px 0 80px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* カード */
.case-card {
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-gray-100);
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(30, 107, 69, 0.12);
  border-color: var(--color-green-light);
}

.case-card-link {
  display: block;
  color: inherit;
}

/* カード画像 */
.case-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-green-pale) 0%, var(--color-navy-pale) 100%);
}

.case-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.case-card:hover .case-card-img img {
  transform: scale(1.05);
}

/* プレースホルダ（サムネイルなし時） */
.case-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  opacity: 0.3;
}

.case-card-placeholder svg {
  width: 64px;
  height: 64px;
}

/* カテゴリタグ */
.case-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-green);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
}

/* カード本文 */
.case-card-body {
  padding: 20px 24px 24px;
}

.case-card-date {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--color-gray-500);
  display: block;
  margin-bottom: 8px;
}

.case-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card:hover .case-card-title {
  color: var(--color-green-dark);
}

.case-card-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.case-card:hover .case-card-more .arrow {
  transform: translateX(4px);
}


/* ============================================================
   CASE SINGLE - 個別記事
   ============================================================ */
.section-case-single {
  background: var(--color-bg);
  padding: 48px 0 80px;
}

.case-single-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.case-single-article {
  background: var(--color-white);
  border-radius: 12px;
  border: 1px solid var(--color-gray-100);
  padding: 48px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.case-single-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-gray-100);
}

.case-single-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.case-single-meta .news-date {
  font-size: 14px;
}

.case-single-title {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.5;
}

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
.case-gallery {
  margin-bottom: 36px;
}

/* メイン画像 */
.case-gallery-main {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--color-gray-50);
}

.case-gallery-main img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: var(--color-gray-50);
  cursor: zoom-in;
  transition: opacity 0.3s var(--ease);
}

/* サムネイル一覧 */
.case-gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.case-gallery-thumb {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  background: var(--color-gray-50);
}

.case-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-gallery-thumb:hover {
  border-color: var(--color-green-light);
  opacity: 0.85;
}

.case-gallery-thumb.active {
  border-color: var(--color-green);
  box-shadow: 0 0 0 1px var(--color-green);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.case-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-lightbox[hidden] {
  display: none;
}

.case-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.case-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.case-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 48px;
  height: 48px;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}

.case-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.case-lightbox-prev,
.case-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}

.case-lightbox-prev { left: 20px; }
.case-lightbox-next { right: 20px; }

.case-lightbox-prev:hover,
.case-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.case-lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 16px;
  border-radius: 100px;
  z-index: 2;
}


/* 記事本文 - news-single-bodyと同じ */
.case-single-body {
  font-size: 16px;
  line-height: 2;
  color: var(--color-gray-700);
}

.case-single-body p {
  margin-bottom: 1.5em;
}

.case-single-body p:last-child {
  margin-bottom: 0;
}

.case-single-body a {
  color: var(--color-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.case-single-body a:hover {
  color: var(--color-green-dark);
}

.case-single-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-navy);
  margin: 2em 0 0.8em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-green);
}

.case-single-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
  margin: 1.5em 0 0.6em;
  padding-left: 12px;
  border-left: 3px solid var(--color-green);
}

.case-single-body ul,
.case-single-body ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.case-single-body ul { list-style: disc; }
.case-single-body ol { list-style: decimal; }

.case-single-body li {
  margin-bottom: 0.5em;
}

.case-single-body img {
  border-radius: 8px;
  margin: 1.5em 0;
}


/* ============================================================
   SIDEBAR CTA
   ============================================================ */
.sidebar-cta {
  background: linear-gradient(135deg, var(--color-green-dark) 0%, var(--color-navy) 100%);
  border: none;
  text-align: center;
}

.sidebar-cta-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.6;
  margin-bottom: 12px;
}

.sidebar-cta-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 20px;
}

.sidebar-cta .btn {
  width: 100%;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .case-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-single-layout {
    grid-template-columns: 1fr;
  }

  .news-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .sidebar-cta {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .case-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .case-card-img {
    height: 180px;
  }

  .case-single-article {
    padding: 28px 20px;
  }

  .case-gallery-main img {
    height: 260px;
  }

  .case-gallery-thumb {
    width: 64px;
    height: 48px;
  }

  .news-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar-cta {
    grid-column: auto;
  }
}
