/* 基本的なスタイルリセット */
body,
h1,
p,
h2,
h3,
ul {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", "Arial", "Hiragino Sans", "Meiryo", sans-serif;
  line-height: 1.7;
  background-color: #f8f9fa;
  color: #343a40;
}

header {
  background: #343a40;
  color: #fff;
  padding: 1rem 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative; /* For positioning home button */
}

h1 {
  text-align: center;
  flex: 1;
  margin: 0 1rem;
}
h1 small {
  font-size: 0.5em; /* Smaller font for subtitle */
  opacity: 0.8;
}

/* --- Home Button --- */
.home-button {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.3s;
}

.home-button:hover {
  opacity: 0.8;
}

.home-button .icon {
  font-size: 1.5rem;
}

@media (max-width: 768px) {
  .home-button {
    left: 10px;
    font-size: 0.9rem;
    top: 20px; /* Adjust top position */
    transform: translateY(0); /* Remove vertical centering */
  }

  .home-button .icon {
    font-size: 1.2rem;
  }

  /* Adjust header padding for mobile to prevent overlap */
  header {
    padding-top: 6rem; /* Increased padding to give space for buttons and h1 */
    padding-bottom: 1.5rem;
  }

  h1 {
    flex-direction: column;
    gap: 0;
    margin-top: 0; /* Ensure no extra margin */
    margin-bottom: 0; /* Ensure no extra margin */
  }

  h1 small {
    font-size: 0.4em;
  }

  .menu-button {
    right: 10px;
    font-size: 0.9rem;
    padding: 6px 12px;
    top: 20px; /* Adjust top position */
    transform: translateY(0); /* Remove vertical centering */
  }

  .menu-button .icon {
    font-size: 1.2rem;
  }

  .menu-button.is-sticky {
    top: 10px;
    right: 10px;
  }
}

main {
  padding: 20px 10px;
  margin: 0 auto;
  width: 90%;
  max-width: 1200px;
  background: #fff;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

section,
article {
  margin-bottom: 40px;
}

h2,
h3 {
  margin-bottom: 20px;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 10px;
}

ul {
  padding-left: 20px;
  margin-top: 15px;
}

li {
  margin-bottom: 10px;
}

/* --- Table Styles --- */
.table-container {
  overflow-x: auto; /* Enables horizontal scrolling on small screens */
  margin: 20px 0;
}

table {
  width: 100%;
  min-width: 600px; /* Prevents table from becoming too cramped */
  border-collapse: collapse;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th,
td {
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  text-align: left;
}

thead th {
  background-color: #495057;
  color: #fff;
  font-weight: bold;
}

tbody tr:nth-of-type(even) {
  background-color: #f8f9fa;
}

tbody tr:hover {
  background-color: #e9ecef;
}

/* --- Note Style --- */
.note {
  color: #c0392b; /* Strong red color */
  font-weight: 500;
  background-color: #fdf2f2;
  border: 1px solid #f8d7da;
  border-left-width: 5px;
  border-radius: 5px;
  padding: 15px;
  margin: 25px 0;
}

.note strong {
  font-weight: bold;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  main {
    width: 95%;
    padding: 15px 5px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }
}

/* --- Back to Top Button --- */
#back-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: rgba(52, 58, 64, 0.9);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

#back-to-top-btn.show {
  opacity: 0.6;
  visibility: visible;
}

#back-to-top-btn:hover {
  opacity: 1;
}

#back-to-top-btn .arrow {
  font-size: 20px;
  line-height: 1;
}

#back-to-top-btn .progress-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
}

/* --- AI Service Image --- */
.service-image-container {
  width: 100%;
  max-width: 800px; /* Max width for desktop */
  height: auto; /* Fixed height for desktop */
  margin-bottom: 20px;
  margin-right: 20px;
  background-color: #e9ecef; /* Placeholder background */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: -2px 2px rgba(0, 0, 0, 0.1);
}

.service-image {
  width: 95%;
  height: 95%;
  object-fit: cover; /* Cover the container, cropping if necessary */
  display: block;
}

@media (max-width: 880px) {
  .ai-image-container {
    width: 100%;
    height: auto;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .service-image-container {
    max-width: 100%; /* Full width on mobile */
    height: 200px; /* Adjust height for mobile */
  }
}

/* --- AI Service Card Styles --- */
.service-card {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-left: 5px solid #007bff;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease-in-out;
  display: flex; /* Use flexbox for main layout */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  align-items: flex-start; /* Align items to the top */
}

.service-card h3 {
  width: 100%; /* Make heading take full width */
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: #343a40;
  border-bottom: none;
}

.service-card .service-image-container {
  flex: 0 0 400px; /* Fixed width for image container on desktop */
  height: 300px;
  margin-right: 20px; /* Space between image and info */
  margin-bottom: 20px; /* Space below image on wrap */
}

.service-card .info-grid {
  flex: 1; /* Take remaining space */
  min-width: 300px; /* Ensure info grid doesn't shrink too much */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

@media (max-width: 768px) {
  .service-card .service-image-container {
    flex: 0 0 100%; /* Full width on mobile */
    margin-right: 0;
  }

  .service-card .info-grid {
    flex: 0 0 100%; /* Full width on mobile */
  }
}

.service-card .info-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid transparent; /* Add transparent border to prevent layout shift */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out,
    border-color 0.2s ease-in-out;
}

.service-card .info-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #dee2e6; /* Add a subtle border color on hover */
}

.service-card .info-item strong {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.service-card .info-item p,
.service-card .info-item ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #212529;
}

.service-card .info-item li {
  margin-bottom: 5px;
}

.service-card .url-link {
  display: inline-block;
  margin-top: 5px;
  font-weight: bold;
  color: #007bff;
  text-decoration: none;
}

.service-card .url-link:hover {
  text-decoration: underline;
}

/* --- Pagination Styles --- */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 20px;
}

.pagination ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 10px;
}

.pagination li a {
  display: block;
  padding: 10px 15px;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  text-decoration: none;
  color: #007bff;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.pagination li a:hover {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

.pagination li a.active {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
  cursor: default;
}

/* --- Menu Button --- */
.menu-button {
  /* Reset button default styles */
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  position: absolute; /* Back to absolute for initial positioning */
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.3s, background-color 0.3s, transform 0.3s; /* Add transform to transition */
  z-index: 1001; /* Above header */
  background-color: #343a40; /* Header background color */
  padding: 8px 15px; /* For oval shape */
  border-radius: 20px; /* For oval shape */
  border: 1px solid rgba(255, 255, 255, 0.3); /* Subtle border */
  opacity: 80%;
}

.menu-button:hover {
  opacity: 0.9;
  background-color: #495057; /* Slightly darker on hover */
}

.menu-button .icon {
  font-size: 1.5rem;
}

/* Sticky state for menu button */
.menu-button.is-sticky {
  position: fixed;
  top: 20px; /* Fixed position from top */
  right: 20px;
  transform: translateY(0); /* Reset transform for fixed position */
  border-color: rgba(
    255,
    255,
    255,
    0.5
  ); /* Slightly more visible border when sticky */
}

/* Adjust header padding - revert previous change */
header {
  padding: 1.5rem 0;
}

@media (max-width: 768px) {
  .menu-button {
    right: 10px;
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .menu-button .icon {
    font-size: 1.2rem;
  }

  .menu-button.is-sticky {
    top: 10px;
    right: 10px;
  }

  header h1 {
    flex-direction: column;
    gap: 0;
  }

  header h1 small {
    font-size: 0.4em;
  }
}

footer {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 20px;
  background: #343a40;
  color: #fff;
}
/* --- Off-canvas Menu Styles --- */
.off-canvas-menu {
  position: fixed;
  top: 0;
  right: -300px; /* Initially hidden (moved right) */
  width: 300px;
  height: 100%;
  background-color: #343a40;
  color: #fff;
  z-index: 1002; /* Above everything */
  visibility: hidden; /* Added for menu visibility control */
  transition: right 0.3s ease-in-out, visibility 0.3s ease-in-out; /* Added visibility to transition */
  overflow-y: auto; /* Allow scrolling if content is too long */
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

.off-canvas-menu.open {
  right: 0; /* Show menu by moving it to visible area */
  visibility: visible; /* Added for menu visibility control */
}

.off-canvas-menu ul {
  list-style: none;
  padding: 60px 0 20px 0; /* Top padding to avoid overlap with close area */
  margin: 0;
}

.off-canvas-menu ul li {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.off-canvas-menu ul li a {
  display: block;
  padding: 15px 25px;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background-color 0.3s;
}

.off-canvas-menu ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* --- Overlay Styles --- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001; /* Below menu but above other content */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .off-canvas-menu {
    width: 250px;
    right: -250px;
  }

  .off-canvas-menu ul li a {
    padding: 12px 20px;
    font-size: 1rem;
  }
}
/* --- Close Menu Button --- */
.close-menu-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  z-index: 1003;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.close-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 更新情報アコーディオン */
.accordion-header {
  background-color: #f8f9ff;
  border-left: 4px solid #764ba2;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s, border-radius 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header:hover {
  background-color: #e9eafc;
}

.accordion-header h2 {
  margin: 0;
  border: none;
  padding: 0;
  font-size: 1.5rem;
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1rem;
  color: #495057;
}

.accordion-header.active .toggle-icon {
  transform: rotate(180deg);
}

.accordion-header.active {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.accordion-content {
  display: none; /* 初期状態は非表示 */
  padding: 20px;
  border: 1px solid #e9eafc;
  border-top: none;
  border-radius: 0 0 5px 5px;
  background-color: #fff;
}

.accordion-content.active {
  display: block; /* activeクラスが付いたら表示 */
}

/* 更新情報リストのスタイルをaccordion-content内に適用 */
.accordion-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.accordion-content li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #e9eafc;
  flex-wrap: wrap;
}

.accordion-content li:last-child {
  border-bottom: none;
}

.accordion-content li strong {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #333;
}

/* --- Timeline Card Styles --- */
.timeline-card {
  background-color: #f0f4f8;
  border: 1px solid #e9ecef;
  border-left: 5px solid #17a2b8;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.timeline-card h3 {
  width: 100%;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: #17a2b8;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-card h3 .icon {
  font-size: 2rem;
}

.timeline-card .info-grid {
  flex: 1;
  min-width: 300px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.timeline-card .info-item {
  background: #ffffff;
  padding: 20px;
  border-radius: 5px;
  border: 1px solid #dee2e6;
}

.timeline-card .info-item strong {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.timeline-button {
  display: inline-block;
  padding: 12px 25px;
  background-color: #17a2b8;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.3s;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.timeline-button:hover {
  background-color: #138496;
  transform: translateY(-2px);
}
