.header {
    height: 15vh;
    background-color: var(--color-nav);
}
@media (max-width: 768px) {
  .header {
    height: 18vh;
  }
}

.title {
  text-align: center;
}

.tagline::before {
  content: ' ';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--color-black);
  margin-right: 11px;
  line-height: 1;
}

.projects-hero {
  position: relative;
  height: 60vh;
  width: 100%;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subtitle {
  position: relative;
  width: 100%;
  padding: 4rem 2rem;
  overflow: hidden;
}

.subtitle-frame {
  padding-top: 50px;
}

.subtitle-background {
  background-color: var(--color-base2);
}

.subtitle-content {
  display: flex;
  width: 75%;
  margin: 0 auto;
}

/* 画像部分 */
.subtitle-image {
  flex: 1;
  padding: 0 3rem 2rem 4rem;
  transform: translateY(-3rem);
}

.subtitle-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* テキスト部分 */
.subtitle-text {
  flex: 1;
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.subtitle-text h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  font-family: var(--font-mincho);
}

.subtitle hr {
  background-color: var(--color-ceo);
  border:none;
  height: 1px;
  position:relative;
} 

.subtitle hr:before {
  content: '';
  background-color: #000;
  width: 3rem;
  height: 1px;
  position:absolute;
  left:0;
}

.subtitle-text p {
  font-size: 1rem;
  margin-top: 2rem;
  max-width: 45ch; 
}

@media (max-width: 1330px) {
  .subtitle-text h2 {
    font-size: 1.4rem;
    white-space: nowrap;
  }
  .subtitle-text p {
    font-size: 0.7rem;
    max-width: none;
  }
}

@media (max-width: 1024px) {
  .subtitle-image {
    padding: 0;
    flex: auto;
  }
}

@media (max-width: 768px) {
  .subtitle {
    padding: 0 2rem;
  }
  .subtitle-frame {
    padding-top: 0;
  }
  .subtitle-content {
    flex-direction: column;
    transform: none;
  }
  .subtitle-image {
    padding: 20px 0 0 0;
    transform: translateY(0)
  }
  .subtitle-text {
    padding-left: 0;
    text-align: center;
  }
  .subtitle-text h2 {
    font-size: 1.2rem;
  }
  .subtitle-text p {
    text-align: center;
    max-width: none;
    padding-bottom: 1rem;
  }
}

/* セクション全体 */
.l-section {
  padding: 2rem;
  position: relative;
}
.l-section-no-pad-top {
  padding-top: 0;
  margin-bottom: 0;
}
.l-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* 縦書きタイトル */
.vertical-title {
  float: left;
  -webkit-writing-mode: vertical-rl;
  -ms-writing-mode: tb-rl;
  writing-mode: vertical-rl;
  font-size: 30px;
  letter-spacing: .3em;
  line-height: 1;
  font-family: var(--font-mincho);
  font-weight: bold;
}

.vertical-header-tagline {
  -webkit-writing-mode: vertical-rl;
  -ms-writing-mode: tb-rl;
  writing-mode: vertical-rl;
  font-family: var(--font-mincho);
  font-style: italic;
  letter-spacing: .1em;
  vertical-align: baseline;
  margin-left: 7px;
  float: left;
}

.vertical-header-tagline:after {
  margin-top: 10px;
  content: ' ';
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--color-black);
}

/* セクション全体 */
.civil-work-section {
  padding-left: 120px;
  padding-right: 20px;
  margin-bottom: 4rem;
  background-color: var(--color-base);
}

/* 内包コンテナ */
.work-type-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* セクションヘッダー */
.civil-work-header {
  margin-bottom: 2rem;
  text-align: left;
}

.work-title {
  font-size: 1.5rem;
  font-family: var(--font-mincho);
  font-weight: 500;
}

/* 画像スライドショー */
.work-slideshow {
  margin-bottom: 2rem;
}

.slider-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 400px;
}

.slider-container .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* 表示するスライド */
.slider-container .slide.active {
  opacity: 1;
}

.slider-container .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* 縦のアコーディオン（親） */
.vertical-accordion {
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  margin: 1rem auto;
  background-color: var(--color-base);
}

/* 縦アコーディオンのラベル */
.vertical-accordion .accordion-label {
  background: #f0f0f0;
  padding: 1rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.3s ease;
}

.vertical-accordion .accordion-label:hover {
  background: e0e0e0;
}

/* 縦アコーディオンのコンテンツ */
.vertical-accordion .accordion-content {
  transition: max-height 0.5s ease-out;
  max-height: 0;
  overflow: hidden;
}

/* 開いたとき */
.vertical-accordion .accordion-toggle:checked ~ .accordion-content {
  max-height: 500px; /* コンテンツの高さに合わせて調整 */
}

/* アコーディオンの開閉アイコン */
.accordion-icon {
  transition: transform 0.3s ease;
}

/* 縦のアコーディオンが開いたとき */
.vertical-accordion .accordion-toggle:checked + .accordion-label .accordion-icon {
  transform: rotate(90deg);
}

/* 横のアコーディオン（子） */
.horizontal-accordion {
  display: flex;
  align-items: center;
  border-radius: 4px;
  overflow: hidden;
  width: 90%;
  margin: 0.5rem auto;
  background-color: var(--color-base);
}

/* 横のアコーディオンのコンテンツ */
.horizontal-accordion .accordion-content {
  transition: transform 0.5s ease;
  padding-left: 1rem;
  transform-origin: left;
  transform: scaleX(0);
  overflow: hidden;
}

.horizontal-accordion .accordion-toggle:checked ~ .accordion-content {
  transform: scaleX(1);
}

.horizontal-accordion .accordion-toggle:checked + .accordion-label .accordion-icon {
  transform: rotate(0deg);
}

.horizontal-accordion .accordion-toggle:not(:checked) + .accordion-label .accordion-icon {
  transform: rotate(-90deg);
}
/* ----- レスポンシブ対応 ----- */

/* 大画面向け：1300px以下の場合 */
@media (max-width: 1300px) {
  .vertical-title {
    font-size: 1.5rem;
  }

  .accordion-label {
    font-size: 0.8rem;
  }

  .animated-text {
    font-size: 0.7rem;
  }

  .horizontal-accordion .accordion-content {
    padding-left: 0.5rem;
  }

  .work-title {
    font-size: 1.3rem;
  }
}

/* タブレット・スマホ向け */
@media (max-width: 768px) {
  /* 内包コンテナの左右パディングを縮小 */
  .l-inner {
    padding: 0 1rem;
  }

  /* 縦書きタイトル・タグラインのフォントサイズを縮小 */
  .vertical-title {
    font-size: 1.8rem;
  }
  .vertical-header-tagline {
    font-size: 1rem;
  }
  
  /* 画像スライドショー高さの調整 */
  .slider-container {
    height: 250px; /* 小さい画面用に高さ縮小 */
  }
  
  /* 横のアコーディオン（子）を縦型に切替 */
  .horizontal-accordion {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0.5rem auto;
  }
  .horizontal-accordion .accordion-label {
    width: 90%;
    padding: 0.5rem;
  }
  .vertical-accordion .accordion-label {
    padding: 0.5rem;
  }
  /* 横アコーディオンの内容は、横展開ではなく縦に展開 */
  .horizontal-accordion .accordion-content {
    transition: transform 0.5s ease;
    transform-origin: top;
    /* 初期状態は開いている（scaleY(1)） */
    transform: scaleY(1);
    padding-left: 0;
    padding-top: 0.5rem;
  }
  /* チェックが外れたときに縦に閉じる */
  .horizontal-accordion .accordion-toggle:not(:checked) ~ .accordion-content {
    transform: scaleY(0);
  }
  
  /* もし必要なら、フォントサイズ調整 */
  .work-title {
    font-size: 1.2rem;
  }
  .civil-work-header {
    margin-bottom: 1.5rem;
  }

  .modal-right .modal-thumbs img {
    width: 4rem;
  }

  .modal-right h2 {
    text-align: center;
    font-size: 1.3rem;
  }

  .modal-info-table {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .l-section {
    padding: 0;
  }
  .vertical-title {
    font-size: 1rem;
  }
  .vertical-header-tagline {
    font-size: 0.6rem;
  }
  .civil-work-section {
    padding-left: 3rem;
  }
}

.works-page {
  margin-bottom: 2rem;
}

.works-page h2 {
  text-align: center;
  font-family: var(--font-mincho);
  font-weight: bold;
}

.works-page .tagline {
  text-align: center;
  padding-bottom: 2rem;
}

.work-info {
  padding-top: 1rem;
}

.work-info hr {
  background-color: var(--color-base);
  border:none;
  height: 1px;
  position:relative;
  padding: 8px 0 15px 0;
}

.work-info hr:before {
  content: '';
  background-color: #000;
  width: 1.5rem;
  height: 1px;
  position:absolute;
  left:0;
}

@media (max-width: 768px) {
  .works-page h2 {
    font-size: 1.5rem;
  }
}

/* モーダル全体（オーバーレイ） */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  display: none; /* 初期状態は非表示 */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.active {
  display: flex;
}

/* 固定サイズのモーダルコンテンツ（PCサイズ） */
.modal-content {
  background-color: var(--color-white);
  width: 1200px;       /* 固定幅 */
  height: 700px;       /* 固定高さ */
  border-radius: 8px;
  position: relative;
  overflow: hidden;    /* 内容があふれる場合は隠す */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  padding: 5rem 4.5rem;
  display: flex;
}

.modal-body {
  display: flex;
  width: 100%;
  height: 100%;
}

/* 左側：大きい画像 */
.modal-left {
  flex: 1.5;
  padding-right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-left img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 右側：詳細情報 */
.modal-right {
  flex: 1;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-info-table {
  border-collapse: collapse;
  border-spacing: 0;
  margin-top: 20px;
}

.modal-info-table th {
  width: 6em;
  padding: 0.5em;
  font-weight: 600;
  font-size: 0.875em;
  vertical-align: top;
  text-align: left;
}

.modal-info-table td {
  padding: 0.5em;
  font-size: 0.875em;
  vertical-align: top;
  text-align: left;
}

/* サムネイル群を下端に配置 */
.modal-thumbs {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.modal-thumbs img {
  width: 6rem;
  height: auto;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.modal-thumbs img:hover {
  transform: scale(1.1);
}

/* モーダル閉じるボタン */
.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  background: none;
  border: none;
  color: #000;
  cursor: pointer;
  z-index: 10;
}

@media (max-width: 1024px) {
  .modal-content {
    width: 95%;
  }
}

/* スマホ向けレスポンシブ */
@media (max-width: 768px) {
  .modal-content {
    width: 90%;
    height: auto;
    flex-direction: column;
    padding: 3rem;
  }
  .modal-body {
    flex-direction: column;
    height: 100%;
  }
  /* 左側：画像部分を縦並びで上部に固定（60%の高さ） */
  .modal-left {
    width: 100%;
    height: 50%;
    padding-right: 0;
    margin-bottom: 20px;
  }
  .modal-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* 右側：詳細情報部分を縦並びで下部に配置（40%の高さ） */
  .modal-right {
    width: 100%;
    height: 40%;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  /* モーダル閉じるボタンを調整 */
  .modal-close {
    top: 10px;
    right: 10px;
    font-size: 2rem;
  }
}


/* 施工事例一覧のレイアウト調整 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* PCデフォルト */
  gap: 20px;
  padding: 0 20px;
  list-style: none;
}

/* タブレット対応 */
@media (max-width: 1024px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr); /* タブレット */
  }
}

/* スマホ対応 */
@media (max-width: 768px) {
  .works-grid {
    grid-template-columns: repeat(1, 1fr); /* スマホ */
  }
}

/* 施工事例カード */
.work-card {
  background-color: var(--color-base);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding-bottom: 2.5rem;
}

/* 画像の外枠 */
.work-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

/* 画像の調整 */
.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* オーバーレイ（ホバー時に左から右へアニメーション） */
.work-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* 黒の半透明 */
  transition: left 0.4s ease-in-out;
  z-index: 1;
}

/* 「詳しく見る」テキスト */
.work-image::after {
  content: "詳しく見る";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-white);
  font-size: 1.2rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 2;
}

/* ホバー時のアニメーション */
.work-image:hover::before {
  left: 0; /* 左から右へ表示 */
}

.work-image:hover::after {
  opacity: 1; /* 「詳しく見る」を表示 */
}

#work-modal {
  display: none; /* 初期状態では非表示 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

#work-modal.active {
  display: flex;
  opacity: 1;
}
