/* ================================================
   Slider Section Styles
   ================================================ */

/* Gradient Background */
.gradient-background {
  position: relative;
  background: linear-gradient(to bottom, #fff 0%, #DBE2D7 100%);
  padding-bottom: 310px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

@media (max-width: 767px) {
  .gradient-background {
    padding-bottom: 150px;
  }
}

/* Section with Slider */
.section-slider {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-left: 7.32vw;
  gap: 5.86vw;
  margin-bottom: 4rem;
}

@media (max-width: 767px) {
  .section-slider {
    flex-direction: column;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    gap: 2rem;
  }
}

/* Text Content in Slider Section */
.section-slider__text {
  flex: 0 0 auto;
  max-width: 500px;
}

@media (max-width: 767px) {
  .section-slider__text {
    max-width: 100%;
    order: 1;
  }
}

.section-slider__subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #185246;
  font-family: "Noto Sans JP", sans-serif;
  margin-bottom: 1rem;
  line-height: 1.6;
}

@media (max-width: 767px) {
  .section-slider__subtitle {
    font-size: 1.125rem;
  }
}

.section-slider__description {
  font-size: 1rem;
  line-height: 1.8;
  color: #4b5563;
  font-family: "Noto Sans JP", sans-serif;
}

@media (max-width: 767px) {
  .section-slider__description {
    font-size: 0.9375rem;
  }
}

/* Slider Container */
.pAboutSlider {
  display: flex;
  margin-top: 2.4375rem;
  overflow: hidden;
  flex: 1;
  gap: 8px;
}

@media screen and (min-width: 768px) {
  .pAboutSlider {
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .pAboutSlider {
    width: 100%;
    order: 2;
    margin-top: 1.5rem;
  }
}

/* Slider Inner Wrapper - 5 images (updated from 4) */
.pAboutSlider__inner {
  display: flex;
  flex-shrink: 0;
  width: 1142px;
  gap: 8px;
}

@media screen and (min-width: 768px) {
  .pAboutSlider__inner {
    display: flex;
    width: 1639px;
    gap: 7px;
  }
}

/* Animation for both inners (seamless loop) */
.pAboutSlider__inner:first-child {
  animation: 80s linear 0s infinite normal none running loopSlider;
}

@media screen and (min-width: 768px) {
  .pAboutSlider__inner:first-child {
    animation: 120s linear 0s infinite normal none running loopSlider;
  }
}

.pAboutSlider__inner:last-child {
  animation: 80s linear 0s infinite normal none running loopSlider;
}

@media screen and (min-width: 768px) {
  .pAboutSlider__inner:last-child {
    animation: 120s linear 0s infinite normal none running loopSlider;
  }
}

@keyframes loopSlider {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Slider Image Items */
.pAboutSlider__image {
  position: relative;
  flex-shrink: 0;
  width: 226px;
  height: 392px;
  opacity: 0;
  overflow: hidden;
  transition: transform 3.24s cubic-bezier(0.19, 1, 0.22, 1) 0.16s,
              opacity 1.24s cubic-bezier(0.19, 1, 0.22, 1) 0.16s;
  background-color: #e5e7eb;
  border-radius: 8px;
}

@media (max-width: 767px) {
  .pAboutSlider__image {
    height: 100%;
  }
}

@media screen and (min-width: 768px) {
  .pAboutSlider__image {
    width: 323px;
    height: 560px;
  }
}

/* Alternate images offset */
.pAboutSlider__image:nth-child(2n+1) {
  transform: translateY(-10%);
}

/* Active state */
.pAboutSlider.is-active .pAboutSlider__image {
  opacity: 1;
  transform: translateY(0px);
}

.pAboutSlider.is-active .pAboutSlider__image:nth-child(2n+1) {
  transform: translateY(-10%);
}

/* Image styling */
.pAboutSlider__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .pAboutSlider__image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
  }
}

/* Reverse direction slider */
.section-slider--reverse {
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 7.32vw;
}

@media (max-width: 767px) {
  .section-slider--reverse {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }
}

.section-slider--reverse .pAboutSlider__inner:first-child {
  animation: 80s linear 0s infinite reverse none running loopSlider;
}

@media screen and (min-width: 768px) {
  .section-slider--reverse .pAboutSlider__inner:first-child {
    animation: 120s linear 0s infinite reverse none running loopSlider;
  }
}

.section-slider--reverse .pAboutSlider__inner:last-child {
  animation: 80s linear 0s infinite reverse none running loopSlider;
}

@media screen and (min-width: 768px) {
  .section-slider--reverse .pAboutSlider__inner:last-child {
    animation: 120s linear 0s infinite reverse none running loopSlider;
  }
}

/* Wide Image Section */
.section-wide-image {
  position: relative;
  width: 100%;
  margin-top: -340px;
  margin-bottom: 4rem;
  z-index: 10;
}

@media (max-width: 767px) {
  .section-wide-image {
    margin-top: -150px;
    margin-bottom: 2rem;
  }
}

.wide-image-container {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.wide-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

@media (max-width: 767px) {
  .wide-image {
    max-height: 300px;
  }
}

/* Service Cards Section */
.service-cards {
  padding: 7.5rem 0;
  background-color: #fff;
  padding-top: 0;
}

@media (max-width: 767px) {
  .service-cards {
    padding: 4rem 0;
  }
}

.service-cards__container {
  max-width: 1224px;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .service-cards__container {
    max-width: 1224px;
    margin: 0 auto;
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 768px) {
  .service-cards__container {
    display: grid;
    grid-template-columns: repeat(2, calc(50% - 0.75rem));
    gap: 1.5rem;
    padding-bottom: 3rem;
  }
}

.service-card {
  border: 1px solid #185246;
  padding-bottom: 2rem;
  background-color: #ffffff;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (min-width: 768px) {
  .service-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    gap: 1.5rem;
  }
}

.service-card:nth-child(2) {
  transition-delay: 0.4s;
}

@media (max-width: 767px) {
  .service-card:not(:last-child) {
    margin-bottom: 2rem;
  }
}

.service-card__image {
  width: 100%;
  overflow: hidden;
}

.service-card__image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .service-card__image {
    margin-bottom: 1.5rem;
  }
}

/* Service Card Image Slider */
.service-card__image-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.service-card__slider-track {
  display: flex;
  animation: serviceSlide 12s linear infinite;
}

.service-card__slider-track img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .service-card__slider-track img {
    width: 100%;
    height: auto;
    max-height: 270px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
  }
}

@keyframes serviceSlide {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(-100%);
  }
  55% {
    transform: translateX(-200%);
  }
  75% {
    transform: translateX(-200%);
  }
  80% {
    transform: translateX(-300%);
  }
  95% {
    transform: translateX(-300%);
  }
  100% {
    transform: translateX(0);
  }
}

/* 2枚用スライダー */
.service-card__slider-track--2 {
  animation: serviceSlide2 8s ease-in-out infinite;
}

@keyframes serviceSlide2 {
  0% {
    transform: translateX(0);
  }
  45% {
    transform: translateX(0);
  }
  55% {
    transform: translateX(-100%);
  }
  95% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

/* 3枚用スライダー */
.service-card__slider-track--3 {
  animation: serviceSlide3 12s ease-in-out infinite;
}

@keyframes serviceSlide3 {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(-100%);
  }
  65% {
    transform: translateX(-200%);
  }
  95% {
    transform: translateX(-200%);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 767px) {
  .service-card__image-slider {
    margin-bottom: 1.5rem;
  }
}

.service-card__content {
  padding: 0 2.5rem;
}

@media (max-width: 767px) {
  .service-card__content {
    padding: 0 1.5rem;
  }
}

.service-card__label {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: #185246;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
}

.service-card__title {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  font-family: "Noto Serif JP", serif;
  margin-bottom: 1rem;
}

@media (max-width: 767px) {
  .service-card__title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
}

.service-card__subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #185246;
  font-family: "Noto Sans JP", sans-serif;
  margin-bottom: 1rem;
}

@media (max-width: 767px) {
  .service-card__subtitle {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }
}

.service-card__text {
  font-size: 1rem;
  line-height: 1.8;
  color: #4b5563;
  font-family: "Noto Sans JP", sans-serif;
}

@media (max-width: 767px) {
  .service-card__text {
    font-size: 0.9375rem;
  }
}

/* Split Sections Group (Greetings & Company) */
.split-sections-group {
  margin: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.split-sections-group + .history-section {
  margin-top: -3rem;
}

.split-section__row {
  display: flex;
  flex-direction: row;
  min-height: 50vh;
}

@media (max-width: 1023px) {
  .split-section__row {
    flex-direction: column-reverse;
  }
}

.split-section__row--reverse {
  flex-direction: row-reverse;
}

@media (max-width: 1023px) {
  .split-section__row--reverse {
    flex-direction: column-reverse;
  }
}

.split-section__content {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

@media (min-width: 768px) {
  .split-section__content {
    padding: 3rem;
  }
}

@media (min-width: 1024px) {
  .split-section__content {
    padding: 4rem;
  }
}

@media (max-width: 1023px) {
  .split-section__content {
    width: 100%;
  }
}

.split-section__content--bg {
  background-color: #eef2f0;
}

.split-section__inner {
  max-width: 42rem;
  width: 100%;
}

.split-section__label {
  color: #6b9999;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

.split-section__title {
  font-size: 2.5rem;
  font-weight: 300;
  color: #1f2937;
  margin-top: 0.5rem;
  font-family: "Noto Serif JP", serif;
}

@media (min-width: 768px) {
  .split-section__title {
    font-size: 3rem;
  }
}

@media (max-width: 767px) {
  .split-section__title {
    font-size: 2rem;
  }
}

.split-section__text {
  color: #374151;
  line-height: 2;
  margin-top: 2rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .split-section__text {
    font-size: 1rem;
  }
}

.split-section__signature {
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 500;
  text-align: right;
  margin-top: 2rem;
  font-family: "Noto Serif JP", serif;
}

.split-section__image {
  width: 50%;
  background-color: #d1d5db;
  min-height: 300px;
}

@media (max-width: 767px) {
  .split-section__image {
    width: 50%;
    background-color: #d1d5db;
    min-height: 200px;
  }
}

@media (max-width: 1023px) {
  .split-section__image {
    width: 100%;
  }
}

.split-section__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Company Details */
.company-details {
  color: #374151;
  margin-top: 2rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .company-details {
    font-size: 1rem;
  }
}

.company-details__row {
  display: flex;
  padding: 1rem 0;
  border-bottom: 1px solid #d3d9d6;
}

@media (max-width: 767px) {
  .company-details__row {
    display: block;
    padding: 0.75rem 0;
  }
}

.company-details__row--no-border {
  border-bottom: none;
}

.company-details__label {
  width: 7rem;
  flex-shrink: 0;
  font-weight: 700;
}

@media (min-width: 768px) {
  .company-details__label {
    width: 8rem;
  }
}

@media (max-width: 767px) {
  .company-details__label {
    width: 100%;
    margin-bottom: 0.25rem;
    display: block;
  }
}

.company-details__value {
  flex: 1;
}

@media (max-width: 767px) {
  .company-details__value {
    width: 100%;
    display: block;
  }
}

/* History Section */
.history-section {
  position: relative;
  background-color: #1f2937;
  color: #ffffff;
  padding: 5rem 2rem;
  background-image: url('../img/history-background.webp');
  background-size: cover;
  background-position: center;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

@media (max-width: 767px) {
  .history-section {
    padding: 3rem 1rem;
  }
}

.history-section__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.history-section__container {
  position: relative;
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .history-section__container {
    flex-direction: column;
  }
}

/* 縦書きタイトル（デスクトップ） */
.history-section__vertical-title {
  display: none;
  flex-direction: row;
  justify-content: center;
  margin-right: 4rem;
  gap: 0rem;
}

@media (min-width: 768px) {
  .history-section__vertical-title {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .history-section__vertical-title {
    margin-left: 5rem;
  }
}

.history-section__vertical-heading {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  font-family: "Noto Serif JP", serif;
}

.history-section__vertical-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 1.125rem;
  color: #9ca3af;
  letter-spacing: 0.3em;
}

/* 横書きタイトル（モバイル） */
.history-section__mobile-title {
  display: block;
  text-align: center;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .history-section__mobile-title {
    display: none;
  }
}

.history-section__mobile-label {
  color: #9ca3af;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

.history-section__mobile-heading {
  font-size: 2.5rem;
  font-weight: 300;
  color: #ffffff;
  margin-top: 0.5rem;
  font-family: "Noto Serif JP", serif;
}

@media (max-width: 767px) {
  .history-section__mobile-heading {
    font-size: 1.5rem;
    font-weight: 300;
    color: #ffffff;
    margin-top: 0.5rem;
    font-family: "Noto Serif JP", serif;
  }
}

/* タイムライン */
.history-timeline {
  position: relative;
  width: 100%;
  max-width: 42rem;
}

.history-timeline__line {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: #fff;
}

@media (max-width: 767px) {
  .history-timeline__line {
    left: 11px;
    top: 120px;
    height: 90%;
  }
}

@media (min-width: 640px) {
  .history-timeline__line {
    left: 1rem;
  }
}

.history-timeline__items {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.history-timeline__item {
  position: relative;
  padding-left: 2rem;
}

@media (max-width: 767px) {
  .history-timeline__item {
    padding-left: 3rem;
  }
}

@media (min-width: 640px) {
  .history-timeline__item {
    padding-left: 4rem;
  }
}

.history-timeline__dot {
  position: absolute;
  left: 0;
  top: 0.25rem;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 1.25rem;
  background-color: #ffffff;
  border-radius: 50%;
}

@media (max-width: 767px) {
  .history-timeline__dot {
    left: 12px;
    top: 0.25rem;
    transform: translateX(-50%);
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (min-width: 640px) {
  .history-timeline__dot {
    left: 1rem;
  }
}

.history-timeline__year {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: "Noto Serif JP", serif;
}

.history-timeline__text {
  margin-top: 0.5rem;
  color: #d1d5db;
  line-height: 1.75;
}

/* Equipment Section Header */
.section-equipment__header {
  text-align: right;
  margin-bottom: 3rem;
  align-self: flex-start;
}

@media (max-width: 767px) {
  .section-equipment__header {
    margin-bottom: 2rem;
  }
}

/* Section Header Left */
.section-header-left {
  text-align: left;
  margin-bottom: 3rem;
}

@media (max-width: 767px) {
  .section-header-left {
    margin-bottom: 2rem;
  }
}

/* News View More Button */
.news-view-more-link {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 320px;
  height: 64px;
  padding: 8px 64px 8px 8px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 16px;
  color: #185246;
  text-align: center;
  overflow-wrap: anywhere;
  background-color: #185246;
  border-radius: 32px;
  text-decoration: none;
  flex-direction: row-reverse;
  padding: 8px 8px 8px 64px;
  transition: background-color 0.2s;
  align-self: flex-end;
  margin-left: auto;
}

.news-view-more-link:hover {
  background-color: rgba(24, 82, 70, 0.9);
}

.news-view-more__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 48px;
  aspect-ratio: 1;
  overflow: hidden;
  transition: transform 0.2s;
}

.news-view-more-link:hover .news-view-more__icon {
  transform: translateX(4px);
}

.news-view-more__text {
  flex-shrink: 1;
  width: 100%;
  color: #fff;
}
