.sozai_search {
  width: 60%; /* カラムの幅 */
  margin-bottom: 20px;

    color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f6;
  --text: #1b2430;
  --muted: #627083;
  --line: #d9e0e8;
  --accent: #3659c9;
  --accent-dark: #2745a5;
  --danger: #b42318;
  --shadow: 0 14px 35px rgba(27, 36, 48, 0.08);

}


@media screen and (max-width: 768px) {
  .sozai_search {
    width: 100%; /* デスクトップビュー以下で1カラムになる */
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.page-header {
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.search-panel,
.result-section {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 24px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 18px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(54, 89, 201, 0.12);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
}

.button-primary,
.button-secondary,
.pagination button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

.button-primary {
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.result-section {
  margin-top: 28px;
  padding: 28px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 22px;
}

.result-header h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.result-count {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.result-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(27, 36, 48, 0.1);
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-soft);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-image {
  display: grid;
  height: 100%;
  place-items: center;
  color: #8995a5;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.card-body {
  padding: 18px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.category {
  color: var(--accent);
  font-weight: 800;
}

.card-body h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.card-body p {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}


.loading[hidden],
.message[hidden] {
  display: none;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 120px;
  color: var(--muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.message {
  padding: 20px;
  border-radius: 14px;
  text-align: center;
}

.message-info {
  color: var(--muted);
  background: var(--surface-soft);
}

.message-error {
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #fecdca;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.pagination button {
  min-width: 44px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.pagination button.is-current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .search-form {
    grid-template-columns: 1fr 1fr;
  }

  .field-wide {
    grid-column: 1 / -1;
  }

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

@media (max-width: 580px) {
  .search-panel,
  .result-section {
    border-radius: 18px;
  }

  .search-form,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .actions {
    grid-column: auto;
  }

  .actions {
    display: grid;
  }

  .result-section {
    padding: 20px;
  }
}


.result-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
}

.result-card-link:focus-visible {
  outline: 3px solid rgba(54, 89, 201, 0.45);
  outline-offset: 4px;
}

.result-card-link:hover .result-card {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(27, 36, 48, 0.1);
}

.card-more {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.detail-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

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

.detail-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.detail-image {
  aspect-ratio: 16 / 8;
  background: var(--surface-soft);
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-content {
  padding: clamp(24px, 5vw, 48px);
}

.detail-content h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.15;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-category {
  color: var(--accent);
  font-weight: 800;
}

.detail-description {
  margin-bottom: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.9;
}

.detail-error {
  padding: 36px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

@media (max-width: 580px) {
  .detail-page {
    width: min(100% - 20px, 860px);
    padding-top: 28px;
  }

  .detail-card {
    border-radius: 18px;
  }

  .detail-image {
    aspect-ratio: 16 / 10;
  }
}
