/**
 * Company Page Styles (page-company.php)
 *
 * セクション構成:
 * - section5: メインコンテナ（会社概要ページ全体）
 * - company-title: セクションタイトル
 * - company-gallery-scroll: オートスクロールギャラリー
 * - company-info: 会社情報テーブル
 * - company-btn: お問合わせボタン
 */

/* =====================================
   Section5: メインコンテナ
===================================== */
.section5 {
  position: relative;
  margin-bottom: 0;
  background-color: #f7f7f7;
}

.section5--company {
  margin-top: 50px;
}

.section5 .section5-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 120px;
  font-size: 20px;
  text-align: center;
  color: #000;
  padding: 0 14px;
  margin-bottom: 0;
}

.section5 .section5-title h2 {
  margin: 0;
  letter-spacing: 0.5em;
}

.section5 .section5-title .section5-title-p {
  margin: 0;
  margin-top: 10px;
  font-size: 14px;
}

/* =====================================
   Company Title
===================================== */
.section5 .container .company-title {
  text-align: center;
  color: #000;
  margin-bottom: 16px;
}

.section5 .container .company-title h3 {
  position: relative;
  display: inline-block;
  padding: 0 80px;
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 0;
}

.section5 .container .company-title h3::before,
.section5 .container .company-title h3::after {
  content: "";
  position: absolute;
  top: 50%;
  display: inline-block;
  width: 70px;
  height: 1px;
  background-color: #000;
  transform: translateY(-50%);
}

.section5 .container .company-title h3::before {
  left: 0;
}

.section5 .container .company-title h3::after {
  right: 0;
}

/* =====================================
   Gallery Scroll (Auto-scroll Gallery)
===================================== */
.company-gallery-scroll {
  margin: 40px 0 60px;
  position: relative;
  overflow: hidden;
}

.gallery-scroll-container {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.gallery-scroll-track {
  display: flex;
  align-items: center;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  animation: autoScroll 30s infinite linear;
}

.gallery-card {
  flex: 0 0 400px;
  height: 280px;
  margin-right: 24px;
  overflow: hidden;
  pointer-events: none;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* 無限スクロールのキーフレーム */
@keyframes autoScroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-400px * 4 - 24px * 4));
  }
}

/* =====================================
   Company Info Table
===================================== */
.section5 .container .company-info {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background-color: #fff;
  color: #000;
}

.section5 .container .company-info td {
  border: 1px solid #B9B9B8;
  padding: 8px;
  text-align: left;
  font-size: 16px;
}

.section5 .container .company-info td:first-child {
  width: 30%;
  background-color: #f6f7f9;
  color: #000;
  font-weight: 600;
}

.section5 .container .company-info td:last-child {
  width: 70%;
}

/* =====================================
   Company Button (お問合わせ)
===================================== */
.company-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.company-btn {
  display: inline-block;
  background-color: #CF0D37;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  padding: 10px 30px;
  border: none;
  border-radius: 5px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
  margin: 28px auto;
}

.company-btn:hover {
  background-color: #A30A2C;
}

/* =====================================
   Responsive Design
===================================== */

/* PC - 600px以下 */
@media (width <= 600px) {
  .section5 .container .company-title h3 {
    font-size: 20px;
  }
}

/* モバイル - 768px以下 */
@media screen and (width <= 768px) {
  .section5 {
    padding: 40px 0;
    margin-top: 20px;
  }

  .section5-title {
    margin-bottom: 25px;
  }

  .company-title {
    margin-bottom: 20px;
  }

  .company-gallery-scroll {
    margin: 30px 0 40px;
  }

  .gallery-scroll-container {
    height: 200px;
  }

  .gallery-card {
    flex: 0 0 280px;
    height: 180px;
    margin-right: 16px;
  }

  @keyframes autoScroll {
    0% {
      transform: translateX(0);
    }

    100% {
      transform: translateX(calc(-280px * 4 - 16px * 4));
    }
  }
}

/* 小型モバイル - 480px以下 */
@media screen and (width <= 480px) {
  .section5 {
    padding: 30px 0;
    margin-top: 15px;
  }

  .section5-title {
    margin-bottom: 20px;
  }

  .company-title {
    margin-bottom: 15px;
  }
}

/* タブレット - 880px以下 */
@media (width <= 880px) {
  /* Company Info テーブルをブロック表示に変更 */
  .section5 .container .company-info {
    display: block;
    border-collapse: initial;
    width: 100%;
    overflow: hidden;
  }

  .section5 .container .company-info tr {
    display: block;
  }

  .section5 .container .company-info td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    background-color: #fff;
    border: 1px solid #dfdfdf;
  }

  .section5 .container .company-info td:first-child {
    width: 100% !important;
    background-color: #dfdfdf;
    border: none;
  }

  .section5 .container .company-info td:last-child {
    width: 100% !important;
  }
}

/* タブレット - 1024px以下 */
@media (width <= 1024px) {
  .gallery-scroll-container {
    height: 250px;
  }

  .gallery-card {
    flex: 0 0 320px;
    height: 220px;
    margin-right: 20px;
  }

  @keyframes autoScroll {
    0% {
      transform: translateX(0);
    }

    100% {
      transform: translateX(calc(-320px * 4 - 20px * 4));
    }
  }
}
