/* Node Archive Page Styles */

.node-section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.node-container {
  padding: 0;
}

.node-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 30px;
  text-align: center;
  color: #333;
  border-bottom: 2px solid #333;
  padding-bottom: 15px;
}

/* Intro Section */
.node-intro {
  margin-bottom: 40px;
  text-align: center;
}

.intro-text {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 10px;
  color: #333;
}

/* Search Section */
.search-section {
  margin-bottom: 50px;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.search-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.search-form {
  max-width: 800px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: end;
}

.search-group {
  flex: 1;
  min-width: 200px;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.search-select,
.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
}

.search-select:focus,
.search-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.search-button {
  background-color: #0066cc;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  height: 48px;
  white-space: nowrap;
}

.search-button:hover {
  background-color: #0052a3;
}

/* Recommended Section */
.recommended-section {
  margin-bottom: 60px;
}

.recommended-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.recommended-note {
  font-size: 14px;
  color: #666;
  margin-bottom: 30px;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.node-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  background: white;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.node-category-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.node-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.node-category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.node-catch-copy {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #333;
  line-height: 1.4;
}

.node-name {
  font-size: 12px;
  font-style: italic;
  margin-bottom: 12px;
  color: #555;
}

.node-content-text {
  font-size: 12px;
  line-height: 1.5;
  color: #555;
  margin: 0;
}

.node-description {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.node-description-image {
  float: left;
  width: 80px;
  height: 80px;
  margin-right: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  object-fit: cover;
}

.node-content {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 15px;
  flex-grow: 1;
}

.node-image {
  flex-shrink: 0;
}

.node-img {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
}

.node-text {
  flex: 1;
}

.node-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.node-card-link:hover .node-card {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.node-link {
  display: block;
  padding: 8px 16px;
  background-color: #e9ecef;
  color: #495057;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: normal;
  text-align: right;
  width: fit-content;
  margin-left: auto;
  margin-right: 0;
}

.node-link:hover {
  background-color: #dee2e6;
  color: #343a40;
}

/* Genre Section */
.genre-section {
  margin-bottom: 60px;
}

.genre-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.genre-note {
  font-size: 14px;
  color: #666;
  margin-bottom: 30px;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.genre-card {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 25px;
  background: #f8f9fa;
}

.genre-card-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.genre-description {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 20px;
}

.genre-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.genre-list li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}

.genre-list li:before {
  content: "•";
  position: absolute;
  left: 0;
  font-weight: bold;
  color: #333;
}

/* 4件目以降を隠す（初期状態） */
.genre-list:not(.expanded) > li:nth-child(n+4) {
  display: none;
}

/* 展開時はすべて表示 */
.genre-list.expanded > li {
  display: list-item;
}

.sub-list {
  display: none;
  margin-top: 8px;
  margin-left: 20px;
}

.sub-list.show {
  display: block;
  margin-top: 8px;
  margin-left: 20px;
}

.sub-list li:before {
  content: "◦";
  color: #666;
}

.genre-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
}

.genre-link:hover {
  text-decoration: underline;
}

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
  color: white;
  margin-left: 8px;
}

.genre-note-text {
  font-size: 12px;
  color: #666;
  margin-left: 8px;
}

.more-link {
  color: #0066cc;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}

.more-link:hover {
  text-decoration: underline;
}

/* Table Section */
.table-section {
  margin-bottom: 40px;
}

.table-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.table-container {
  overflow-x: auto;
  border-radius: 8px 8px 0 0;
  border: 1px solid #ddd;
  border-bottom: none;
  -webkit-overflow-scrolling: touch;
}

.nodes-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 600px;
}

.nodes-table th {
  background-color: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-weight: bold;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  white-space: normal;;
}

.nodes-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.nodes-table th:nth-child(1),
.nodes-table td:nth-child(1) {
  min-width: 200px;
  max-width: 250px;
}

.nodes-table th:nth-child(2),
.nodes-table td:nth-child(2) {
  min-width: 150px;
}

.nodes-table th:nth-child(3),
.nodes-table td:nth-child(3) {
  min-width: 100px;
}

.nodes-table th:nth-child(4),
.nodes-table td:nth-child(4) {
  min-width: 80px;
  text-align: center;
}

.nodes-table tbody tr:hover {
  background-color: #f8f9fa;
}

.table-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
}

.table-link:hover {
  text-decoration: underline;
}

/* Responsive Design */
/* Desktop medium styles */
@media (max-width: 1024px) and (min-width: 987px) {
  .node-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .genre-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet styles */
@media (max-width: 986px) and (min-width: 769px) {
  .node-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .node-section {
    padding: 30px 15px;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-group {
    min-width: auto;
  }

  .search-button {
    width: 100%;
    margin-top: 10px;
  }

  .node-grid {
    grid-template-columns: 1fr;
  }

  .genre-grid {
    grid-template-columns: 1fr;
  }

  .node-description {
    font-size: 11px;
  }

  .recommended-title,
  .genre-title,
  .table-title {
    font-size: 24px;
  }

  .search-title {
    font-size: 20px;
  }
}

@media (max-width: 650px) {
  .node-intro {
    text-align: left;
  }
}

/* Pagination Styles */
.pagination-wrapper {
  margin-top: 0;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 20px;
}

.pagination-info {
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagination-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background-color: white;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.pagination-btn:not(.disabled):hover {
  background-color: #0066cc;
  color: white;
  border-color: #0066cc;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-number {
  min-width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid #ddd;
  background-color: white;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pagination-number:not(.active):hover {
  background-color: #0066cc;
  color: white;
  border-color: #0066cc;
}

.pagination-number.active {
  background-color: #0066cc;
  color: white;
  border-color: #0066cc;
  font-weight: bold;
  cursor: default;
  pointer-events: none;
}

.pagination-ellipsis {
  padding: 8px 4px;
  color: #666;
  font-size: 14px;
}

/* Responsive Pagination */
@media (max-width: 768px) {
  .pagination-wrapper {
    flex-direction: column;
    gap: 15px;
  }

  .pagination-info {
    text-align: center;
  }
  .pagination {
    gap: 6px;
  }

  .pagination-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .pagination-number {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .pagination-info {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .pagination-wrapper {
    gap: 12px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .pagination-numbers {
    gap: 3px;
  }

  .pagination-number {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 4px;
  }

  .pagination-info {
    font-size: 12px;
  }

  /* Hide middle numbers on very small screens */
  .pagination-number:nth-child(n + 4):nth-child(-n + 5) {
    display: none;
  }
}
