details:not([open]) .close-text {
  display: none;
}

details[open] .open-text {
  display: none;
}

.about-main .mv-container {
  grid-template:
    '. header .' 0
    '. breadcrumb .' auto
    '. main .' 1fr
    / 40px auto 8.4%;
  aspect-ratio: unset;
  margin-bottom: 0;
  color: inherit;

  @media (width <= 767px) {
    grid-template:
      '. header .' 0
      '. breadcrumb .' 0
      '. main .' 1fr
      / 16px auto 16px;
    margin-bottom: 0;
  }
}

.about-main .mv-main {
  align-self: start;
  max-width: 1360px;
  margin: auto;
}

.profile-section {
  padding-bottom: 5rem;

  @media (width <= 767px) {
    padding-bottom: 3rem;
  }
}

.profile-section-subtitle {
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.profile-list {
  display: grid;
  grid-template-columns: 280px 1fr;
  border-top: 1px solid var(--color-light-gray);

  @media (width <= 767px) {
    grid-template-columns: 1fr;
  }
}

.profile-list dt,
.profile-list dd {
  padding: 1.5rem 1rem;
  font-size: 1rem;
  line-height: 1.7;
  border-bottom: 1px solid var(--color-light-gray);
}

.profile-list dt {
  display: flex;
  align-items: flex-start;
  font-weight: 700;
  color: var(--color-gray);

  @media (width <= 767px) {
    padding-bottom: 0.25rem;
    border-bottom: none;
  }
}

.profile-list dd {
  margin: 0;

  @media (width <= 767px) {
    padding-top: 0;
  }
}

.executives-list {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1rem 0.5rem;

  @media (width <= 767px) {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.executives-list span:nth-child(odd) {
  color: var(--color-gray);

  @media (width <= 767px) {
    font-weight: 700;
  }
}

.gallery-section {
  padding-bottom: 5rem;

  @media (width <= 767px) {
    padding-bottom: 3rem;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;

  @media (width <= 767px) {
    grid-template-columns: 1fr;
  }
}

.gallery-item-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: grayscale(100%);
}

.director-section {
  padding: 5rem 0;
  background-color: var(--color-gray-bg);

  @media (width <= 767px) {
    padding: 3rem 0;
  }
}

.director-section-title {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.director-section-card {
  overflow: hidden;
  background-color: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 5%);
}

.director-list {
  display: grid;
  grid-template-columns: 280px 1fr;

  @media (width <= 767px) {
    grid-template-columns: 1fr;
  }
}

.director-list dt,
.director-list dd {
  padding: 1.5rem 2rem;
  margin: 0;
  line-height: 1.7;
  border-bottom: 1px solid var(--color-light-gray);
}

.director-list dt {
  display: flex;
  align-items: flex-start;
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-gray);

  @media (width <= 767px) {
    padding-bottom: 0.25rem;
    font-weight: 700;
    border-bottom: none;
  }
}

.director-list dd {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-black);

  @media (width <= 767px) {
    padding-top: 0;
    font-weight: 400;
  }
}

.director-list dt:last-of-type,
.director-list dd:last-of-type {
  border-bottom: none;
}

.officer-section {
  padding-bottom: 5rem;

  @media (width <= 767px) {
    padding-bottom: 3rem;
  }
}

.officer-list {
  display: grid;
  gap: 2rem;
}

.officer-card-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
  pointer-events: none;
  list-style: none;

  @media (width <= 767px) {
    grid-template-columns: 1fr;
    gap: 1rem;
    justify-items: center;
    padding: 1.5rem;
    text-align: center;
  }
}

.officer-card-summary::-webkit-details-marker {
  display: none;
}

.officer-card-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;

  @media (width <= 767px) {
    width: 100px;
    height: 100px;
  }
}

.officer-card-title {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-black);
}

.officer-card-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-black);

  @media (width <= 767px) {
    font-size: 1.25rem;
  }
}

.officer-card-note {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-black);
}

.officer-card-toggle {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  align-self: end;
  justify-content: center;
  min-width: 137px;
  min-height: 38px;
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
  pointer-events: auto;
  cursor: pointer;
  background-color: var(--color-white);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  transition: all 0.3s ease;

  @media (width <= 767px) {
    margin: 0 auto;
  }
}

.officer-card-toggle .officer-toggle-icon {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.officer-card-toggle .officer-toggle-icon::after {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 2.5px;
  height: 2.5px;
  content: '';
  border-right: 1px solid var(--color-white);
  border-bottom: 1px solid var(--color-white);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform 0.3s ease;

  @media (width <= 767px) {
    top: 35%;
  }
}

.officer-card-summary:hover .officer-card-toggle {
  color: var(--color-white);
  background-color: var(--color-accent);
}

.officer-card-summary:hover .officer-toggle-icon {
  background-color: var(--color-white);
}

.officer-card-summary:hover .officer-toggle-icon::after {
  border-color: var(--color-accent);
}

.officer-card-details {
  padding: 2rem;
  padding-top: 0;

  @media (width <= 767px) {
    display: block;
    padding: 1.5rem;
    padding-top: 0;
  }
}

.officer-card-details-title {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-black);
}

.officer-card-bio-list {
  padding-left: 0;
  font-size: 0.9375rem;
  list-style: none;

  @media (width <= 767px) {
    display: block;
    padding-left: 0;
  }
}

.officer-card-bio-list li {
  display: flex;
  line-height: 1.7;
}

.officer-card-bio-list li::before {
  flex-shrink: 0;
  width: 80px;
  min-width: 80px;
  font-weight: 400;
  color: var(--color-black);

  @media (width <= 767px) {
    width: 60px;
    min-width: 60px;
  }
}

.officer-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 5%);

  &[open] {
    .officer-card-toggle .officer-toggle-icon::after {
      top: 55%;
      transform: translate(-50%, -50%) rotate(225deg);
    }

    @media (width <= 767px) {
      position: relative;
      padding-bottom: 80px;

      .officer-card-toggle {
        position: absolute;
        bottom: 30px;
        left: 50%;
        z-index: 10;
        margin: 0 auto;
        color: var(--color-accent);
        background-color: var(--color-white);
        transform: translateX(-50%);
      }

      .officer-card-toggle .officer-toggle-icon {
        background-color: var(--color-accent);
        border-color: var(--color-white);
      }

      .officer-card-toggle .officer-toggle-icon::after {
        top: 61%;
        border-color: var(--color-white);
      }
    }
  }
}

.history-section {
  padding-bottom: 5rem;

  @media (width <= 767px) {
    padding-bottom: 3rem;
  }
}

.history-section-title {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.history-section-since {
  margin-bottom: 2.5rem;
  font-family: var(--font-en);
  font-size: clamp(1.875rem, 1.554rem + 1.61vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-black);

  :is(html[lang='ja'], html[lang='jp']) :is(&:not(.en-label)) {
    font-size: clamp(1.75rem, 1.536rem + 1.07vw, 2.5rem);
  }

  @media (width <= 767px) {
    margin-bottom: 1.5rem;
  }
}

.history-navigation {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;

  @media (width <= 767px) {
    display: none; /* Hide navigation on mobile */
  }
}

.history-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  font-size: 24px;
  font-weight: 400;
  color: var(--color-black);
  cursor: pointer;
  background-color: var(--color-gray-bg);
  border: none;
  border-radius: 12px;
  transition: all 0.3s ease;

  &:hover {
    color: var(--color-white);
    background-color: var(--color-accent);
  }

  &.disabled {
    pointer-events: none;
    opacity: 0.3;
  }
}

.history-timeline {
  position: relative;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */

  &::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  &.active {
    display: flex; /* Show active content */
  }

  @media (width <= 767px) {
    display: flex; /* Always show on mobile */
    padding-bottom: 1rem;
    margin-top: 0; /* Remove top margin for seamless stacking */

    /* Add spacing between stacked timelines if needed */
    & + .history-timeline {
      margin-top: 2rem;
    }
  }
}

.history-decade {
  display: grid;
  grid-template-columns: 40px auto 1fr;
  width: 100%;
}

.history-decade-label {
  grid-row: 1;
  grid-column: 2;
  align-content: center;
  margin-right: 2.5rem;
  font-family: var(--font-en);
  font-size: 2rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  color: var(--color-black);
}

.timeline-marker-container {
  position: relative;
  display: flex;
  grid-row: 1; /* Force single row */
  grid-column: 1; /* Ensure marker is in the first column */
  justify-content: center;

  /* Per-item line */
  &::before {
    position: absolute;
    top: -1.5rem; /* Extend up into the gap */
    bottom: -1.5rem; /* Extend down into the gap */
    left: 50%;
    width: 1px;
    content: '';
    background-color: rgb(224 174 194 / 100%);
    transform: translateX(-50%);
  }

  @media (width <= 767px) {
    &::before {
      top: -1rem; /* Adjust for mobile gap (2rem) */
      bottom: -1rem;
    }
  }
}

/* First item: Start line at dot */
.history-decade:first-child .timeline-marker-container::before {
  top: 50%;
}

.history-decade:last-child .timeline-marker-container::before {
  bottom: 50%;
}

/* PC View Logic */
@media (width > 767px) {
  .history-decade.hidden-on-pc {
    display: none;
  }

  /* Adjust line start/end for visible groups on PC */

  /* Only clamp if it's the absolute start/end of the entire timeline */
  .history-decade.pc-view-first:first-child .timeline-marker-container::before {
    top: 50%;
  }

  .history-decade.pc-view-last:last-child .timeline-marker-container::before {
    bottom: 50%;
  }

  /* Add space for the extending line on the last visible item (if not the actual last item) to prevent scroll */
  .history-decade.pc-view-last:not(:last-child) {
    margin-bottom: 2rem;
  }
}

/* SP: Continuous Line */
@media (width <= 767px) {
  /* Ensure line connects between all items */
  .history-decade .timeline-marker-container::before {
    top: -1rem;
    bottom: -1rem;
  }

  /* Only the very first and very last items in the entire list should stop at the dot */
  .history-decade:first-child .timeline-marker-container::before {
    top: 50%;
  }

  .history-decade:last-child .timeline-marker-container::before {
    bottom: 50%;
  }
}

.timeline-line {
  display: none; /* Hide individual lines in favor of pseudo-element line */
}

.timeline-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 12px;
  height: 12px;
  background-color: var(--color-main);
  border-radius: 50%;
  transform: translate(-50%, -50%); /* Center vertically and horizontally */
}

.history-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, 200px);
  grid-row: 1;
  grid-column: 3;
  gap: 0.5rem;
  min-width: 1200px;
}

.history-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray);
  border-radius: 4px;
}

.history-card-header {
  padding: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  background-color: var(--color-black);
}

.history-card-body {
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-black);
}

.history-readmore {
  display: none;

  @media (width <= 767px) {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
  }
}

.history-readmore-btn {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-family: var(--font-en);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  cursor: pointer;
  background: none;
  border: none;

  .readmore-icon {
    display: block;
    width: 40px;
    height: 40px;
    transform: rotate(90deg); /* Rotate right arrow to point down */
    transition: transform 0.3s ease;
  }

  &.expanded {
    .readmore-icon {
      transform: rotate(-90deg); /* Rotate right arrow to point up */
    }
  }
}

/* SP Height Limitation */
@media (width <= 767px) {
  .history-timeline {
    position: relative; /* Context for pseudo-element */
    max-height: 600px;
    overflow-y: hidden;
    transition: max-height 0.5s ease-in-out;

    /* Gradient Mask */
    &::after {
      position: absolute;
      bottom: 0;
      left: 0;
      z-index: 2;
      width: 100%;
      min-width: 1200px; /* Ensure it covers the full scrollable width */
      height: 100px; /* Adjust height of fade */
      pointer-events: none;
      content: '';
      background: linear-gradient(
        to bottom,
        rgb(255 255 255 / 0%) 0%,
        rgb(255 255 255 / 100%) 100%
      );
      transition: opacity 0.3s ease;
    }

    &.expanded {
      max-height: 5000px;

      /* Hide mask when expanded */
      &::after {
        opacity: 0;
      }
    }
  }
}
