.page-template-page-works .voice-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  margin-bottom: 0 !important;
}
/* ========================================
   Works Page Specific Styles
   Scope: body.page-template-page-works
======================================== */

/* ========================================
   Works Section
======================================== */
.page-template-page-works .works-section {
  margin: 0 auto 120px;
}

.page-template-page-works .works-content {
  padding: 80px 120px;
  background: #ffffff;
  border-radius: 40px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
  margin-top: 80px;
}

.page-template-page-works .works-content:first-of-type {
  margin-top: 0;
}

.page-template-page-works .works-header {
  margin-bottom: 60px;
}

.page-template-page-works .section-heading {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 30px;
  text-align: left;
}

.page-template-page-works .section-subtitle {
  font-size: 24px;
  font-weight: 600;
}

/* Works Category */
.page-template-page-works .works-category {
  margin-bottom: 80px;
}

/* h3 titles in works rely on common subpages h3 styles */

/* Case block layout */
.page-template-page-works .works-case {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 80px;
}

.page-template-page-works .works-case:last-child {
  margin-bottom: 0;
}

.page-template-page-works .works-text {
  flex: 1;
}

.page-template-page-works .works-media {
  flex: 0 0 360px;
}

.page-template-page-works .works-image,
.page-template-page-works .works-image-placeholder {
  width: 360px;
  height: 240px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

.page-template-page-works .works-text p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-dark);
}

.page-template-page-works .works-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-template-page-works .works-item {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-template-page-works .works-image {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: #999;
  font-size: 16px;
}

.page-template-page-works .works-item-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.page-template-page-works .works-item-desc {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.8;
}

/* ========================================
   Voice Section
======================================== */
.page-template-page-works .voice-section {
  margin: 0 auto 120px;
  padding: 20px 0;
  background: #FCFCFC;
  overflow-x: hidden;
}

.page-template-page-works .voice-header {
  margin-bottom: 0 !important;
}

.page-template-page-works .voice-section .section-title {
  text-align: left;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 30px;
  line-height: 1.5;
}

.page-template-page-works .voice-carousel {
  position: relative;
  max-width: 1200px;
  margin: 0 auto 30px;
  box-sizing: border-box;
  width: 100%;
}

.page-template-page-works .voice-item {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  outline: none;
}

.page-template-page-works .voice-avatar {
  width: 60px;
  height: 60px;
  background: #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.page-template-page-works .voice-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
  margin: 16px 0 0 0;
  /* align-self: flex-start; */
}


/* Slick Carousel Styles - Minimal overrides */
.page-template-page-works .slick-slide {
  margin: 0 20px;
  min-width: 0;
}

.page-template-page-works .slick-list {
  margin: 0 -20px;
  overflow: visible;
  padding: 16px 0;
}

.page-template-page-works .slick-track {
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
}

.page-template-page-works .slick-slide {
  display: flex;
  height: auto;
  box-sizing: border-box;
  min-width: 0;
}

.page-template-page-works .slick-slide > div {
  display: flex;
  height: 100%;
  width: 100%;
  min-width: 0;
}

.page-template-page-works .voice-item {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 260px;
  max-width: 100%;
}

@media (max-width: 1024px) {
  .page-template-page-works .slick-slide {
    margin: 0 12px;
  }


  .page-template-page-works .slick-list {
    margin: 0 -12px;
  }
}

@media (max-width: 768px) {
  .page-template-page-works .slick-slide {
    margin: 0 10px;
  }

  .page-template-page-works .slick-list {
    margin: 0 -10px;
  }
}

.page-template-page-works .slick-prev,
.page-template-page-works .slick-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px !important;
  height: 30px !important;
  z-index: 10 !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

.page-template-page-works .slick-prev { left: 8px; }
.page-template-page-works .slick-next { right: 8px; }

.page-template-page-works .slick-prev::before,
.page-template-page-works .slick-next::before {
  display: none !important;
}

.page-template-page-works .slick-prev.slick-disabled,
.page-template-page-works .slick-next.slick-disabled {
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
}

.page-template-page-works .slick-prev:focus,
.page-template-page-works .slick-next:focus,
.page-template-page-works .slick-prev:active {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  outline: none;
  gap: 8px;
  background: var(--text-dark) !important;
  color: #fff !important;
  margin-bottom: 0 !important;
  display: flex;
  align-items: flex-start;
  min-width: 200px;
  max-width: 240px;
  flex-shrink: 0;
  cursor: pointer !important;
  font-size: 18px !important;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
  margin: 0;
  align-self: flex-start;
  flex: 1;
  margin: 0 !important;
  visibility: visible !important;
  .page-template-page-works .voice-item {
    flex-direction: column;
    padding: 24px 32px;
    gap: 20px;
  }
  .page-template-page-works .voice-header {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 8px;
  }
  .page-template-page-works .voice-text {
    margin: 0;
  }
}
.page-template-page-works .carousel-btn:disabled:hover,
.page-template-page-works .carousel-btn:focus,
  .page-template-page-works .voice-item {
    flex-direction: column;
    padding: 20px 16px;
    gap: 16px;
  }
  .page-template-page-works .voice-header {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 8px;
  }
  .page-template-page-works .voice-text {
    margin: 0;
  }
/*    Responsive Design */
/* ======================================== */

@media (min-width: 769px) {
  .page-template-page-works .voice-avatar {
    width: 80px;
    height: 80px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
  }
}

/* タブレット: 769px～1024px */
@media (max-width: 1024px) {
  .page-template-page-works .section-heading {
    font-size: 28px;
    margin-bottom: 40px;
  }

  .page-template-page-works .works-content {
    padding: 60px 80px;
  }

  .page-template-page-works .works-case { gap: 30px; }
  .page-template-page-works .works-media { flex: 0 0 320px; }
  .page-template-page-works .works-image,
  .page-template-page-works .works-image-placeholder { width: 320px; height: 213px; }


  .page-template-page-works .works-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .page-template-page-works .voice-carousel {
    max-width: calc(100vw - 32px);
    padding: 0 8px;
  }

  .page-template-page-works .slick-slide {
    margin: 0 6px;
  }

  .page-template-page-works .slick-list {
    margin: 0 -6px;
  }

  .page-template-page-works .voice-item {
    padding: 30px;
  }

  .page-template-page-works .slick-prev { left: 4px; }
  .page-template-page-works .slick-next { right: 4px; }

  .page-template-page-works .voice-section .section-title {
    font-size: 28px;
    margin-bottom: 40px;
  }
}

/* タブレット縦: 481px～768px */
@media (min-width: 481px) and (max-width: 768px) {
  .page-template-page-works .works-section {
    padding: 60px 20px 80px;
  }

  .page-template-page-works .section-heading {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .page-template-page-works .works-category {
    margin-bottom: 60px;
  }

  .page-template-page-works .works-content {
    padding: 60px 40px;
    margin-top: 60px;
  }

  .page-template-page-works .works-case { flex-direction: column; }
  .page-template-page-works .works-media { width: 100%; max-width: none; }
  .page-template-page-works .works-image,
  .page-template-page-works .works-image-placeholder { width: 100%; height: auto; aspect-ratio: 3/2; display: block; border-radius: 34px; }


  .page-template-page-works .works-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .page-template-page-works .works-item-title {
    font-size: 16px;
  }

  .page-template-page-works .works-item-desc {
    font-size: 13px;
  }

  .page-template-page-works .voice-section {
    padding: 60px 20px 80px;
  }

  .page-template-page-works .voice-section .container {
    overflow-x: hidden;
  }

  .page-template-page-works .voice-carousel {
     width: 100%;
     max-width: 100vw;
     box-sizing: border-box;
     padding: 0 8px;
     margin: 0 auto 30px;
  }

  .page-template-page-works .slick-slide {
     margin: 0 2vw;
     min-width: 0;
  }

  .page-template-page-works .slick-list {
     margin: 0 -2vw;
     padding: 12px 0;
     box-sizing: border-box;
     overflow: hidden;
  }

  .page-template-page-works .voice-item {
     flex: 1 1 0%;
     min-width: 0;
     max-width: 100%;
     width: 100%;
     box-sizing: border-box;
     padding: 24px 32px;
  }

  .page-template-page-works .slick-prev { left: 4px; }
  .page-template-page-works .slick-next { right: 4px; }

  .page-template-page-works .voice-section .section-title {
    font-size: 24px;
    margin-bottom: 30px;
  }
}

/* スマホ: 480px以下 */
@media (max-width: 480px) {
  .page-template-page-works .works-section { padding: 0 20px 0; }

  .page-template-page-works .section-heading {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .page-template-page-works .works-category {
    margin-bottom: 50px;
  }

  .page-template-page-works .works-content {
    padding: 60px 20px;
    margin-top: 40px;
  }

  .page-template-page-works .works-case { flex-direction: column; gap: 20px; margin-bottom: 60px; }
  .page-template-page-works .works-case:last-child { margin-bottom: 0; }
  .page-template-page-works .works-media {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
  }
  .page-template-page-works .works-image,
  .page-template-page-works .works-image-placeholder { width: 100%; height: auto; aspect-ratio: 3/2; display: block; }


  .page-template-page-works .works-items {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-template-page-works .works-item-title {
    font-size: 16px;
  }

  .page-template-page-works .works-item-desc {
    font-size: 13px;
  }

  .page-template-page-works .voice-section { padding: 20px; }

  .page-template-page-works .voice-section .container {
    overflow-x: hidden;
  }

  .page-template-page-works .voice-carousel {
     width: 100%;
     max-width: 100vw;
     box-sizing: border-box;
     padding: 0;
     margin: 0 auto 30px;
  }

  .page-template-page-works .slick-slide {
     margin: 0 4px;
     min-width: 0;
     width: 85vw !important; /* スマホでカード1枚が画面幅の大部分を占めるように強制 */
  }

  .page-template-page-works .slick-list {
     margin: 0 -4px;
     padding: 8px 0;
     box-sizing: border-box;
     overflow: hidden;
  }

  .page-template-page-works .voice-item {
     flex: 1 1 0%;
     min-width: 0;
     max-width: 100%;
     width: 100%;
     box-sizing: border-box;
     padding: 20px 16px;
    /* 新レイアウト用 */
  }


  .page-template-page-works .voice-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    line-height: 1.3;
    flex-shrink: 0;
    min-width: 180px;
    text-align: left;
  }

  .page-template-page-works .voice-avatar {
    width: 80px;
    height: 80px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
    margin-left: auto;
  }

  .page-template-page-works .voice-text {
     font-size: 14px;
     font-weight: 400;
     margin: 16px 0 0 0;
     line-height: 2;
     text-align: left;
     align-self: flex-start;
  }

  .page-template-page-works .slick-prev { left: 4px; }
  .page-template-page-works .slick-next { right: 4px; }

  .page-template-page-works .voice-avatar {
    width: 50px;
    height: 50px;
    font-size: 10px;
  }

  .page-template-page-works .voice-text {
    font-size: 13px;
  }

  .page-template-page-works .voice-section .section-title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .voice-carousel-wrapper {
    padding: 0;
  }
}

/* --- Voiceセクション レイアウト上書き --- */
.page-template-page-works .voice-carousel {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.page-template-page-works .voice-item {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
}
.page-template-page-works .voice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  width: 100%;
}
.page-template-page-works .voice-title {
  flex: 1 1 0;
  min-width: 0;
  word-break: break-word;
  text-align: left;
}
.page-template-page-works .voice-avatar {
  flex-shrink: 0;
  margin-left: 16px;
}
.page-template-page-works .voice-text {
  width: 100%;
  flex: 1 1 auto;
  text-align: left;
  margin: 0;
}

/* --- Voiceセクション カルーセル矢印常時表示・カード幅制限・崩れ防止 --- */
@media (min-width: 769px) {
  .page-template-page-works .voice-item {
    max-width: 400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .page-template-page-works .voice-item {
    max-width: 320px;
  }
}
.page-template-page-works .slick-prev,
.page-template-page-works .slick-next {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 10 !important;
  width: 30px !important;
  height: 30px !important;
}

/* --- slick構造を壊さずカルーセル・矢印を必ず表示・カード幅制限 --- */
@media (min-width: 769px) {
  .page-template-page-works .slick-slide {
    max-width: 400px;
    min-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .page-template-page-works .slick-slide {
    max-width: 320px; /* カードの最大幅を制限 */
  }
}
.page-template-page-works .slick-prev,
.page-template-page-works .slick-next {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 10 !important;
  width: 30px !important;
  height: 30px !important;
}

/* --- slick本来の動作を復元し、他コンテンツに影響しないvoice専用リセット --- */
.page-template-page-works .voice-carousel,
.page-template-page-works .voice-item,
.page-template-page-works .slick-slide,
.page-template-page-works .slick-track,
.page-template-page-works .slick-list {
  display: initial !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: initial !important;
  gap: 0 !important;
  box-sizing: border-box;
}

/* カードの見た目はpaddingで調整 */
.page-template-page-works .voice-item {
  padding: 40px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 0 8px;
}

/* 矢印を常時表示・サイズ固定 */
.page-template-page-works .slick-prev,
.page-template-page-works .slick-next {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 10 !important;
  width: 30px !important;
  height: 30px !important;
  background: #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  color: #333 !important;
}

/* slickの矢印アイコンが消えている場合の対策 */
.page-template-page-works .slick-prev:before,
.page-template-page-works .slick-next:before {
  color: #333 !important;
  font-size: 24px !important;
  opacity: 1 !important;
}
