/* =========================================
   Trights Blog AI Search：Blog一覧のAI相談BOX
   記事探索の流れを邪魔しない、軽い相談導線
========================================= */
.trights-ai-search {
  width: 100%;
  margin: 0 0 58px;
  padding: 27px 28px 26px;
  border: 0;
  border-left: 3px solid #0a8f95;
  background: #f4f8fa;
  color: #14243b;
  box-sizing: border-box;
}

.trights-ai-search__heading {
  max-width: 800px;
  margin: 0 0 17px;
}

.trights-ai-search__eyebrow {
  margin: 0 0 7px;
  color: #0a8f95;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.4;
}

.trights-ai-search h2 {
  margin: 0;
  color: #14243b;
  font-size: clamp(22px, 2.35vw, 27px);
  font-weight: 700;
  line-height: 1.45;
}

.trights-ai-search__heading > p:last-child {
  max-width: 760px;
  margin: 8px 0 0;
  color: #5e6d80;
  font-size: 14px;
  line-height: 1.8;
}

/* Blog一覧の相談フォームだけ、注意書きとボタンを同じ行へ収める */
#trights-ai-search .trights-ai-search__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 22px;
  align-items: end;
}

.trights-ai-search__input {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 13px 15px;
  resize: vertical;
  border: 1px solid #9eb0c2;
  border-radius: 0;
  background: #fff;
  color: #14243b;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  box-sizing: border-box;
}

.trights-ai-search__input:focus {
  outline: 2px solid rgba(10, 143, 149, .3);
  outline-offset: 1px;
  border-color: #0a8f95;
}

#trights-ai-search .trights-ai-search__input {
  grid-column: 1 / -1;
}

.trights-ai-search__button {
  align-self: flex-end;
  min-width: 164px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid #0a8f95;
  background: #0a8f95;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
}

#trights-ai-search .trights-ai-search__button {
  grid-column: 2;
  grid-row: 2;
}

.trights-ai-search__button:hover:not(:disabled),
.trights-ai-search__button:focus:not(:disabled) {
  background: #06777b;
  border-color: #06777b;
}

.trights-ai-search__button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.trights-ai-search__privacy-note {
  margin: 6px 0 0;
  color: #6d7b88;
  font-size: 10px;
  line-height: 1.4;
}

#trights-ai-search .trights-ai-search__privacy-note {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
}

.trights-ai-search__privacy-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.trights-ai-search__privacy-note a:hover,
.trights-ai-search__privacy-note a:focus {
  color: #4c6172;
}

.trights-ai-search__note,
.trights-ai-search__status {
  margin: 11px 0 0;
  color: #64788b;
  font-size: 12px;
  line-height: 1.7;
}

.trights-ai-search__status:not(:empty) {
  color: #0a7278;
  font-weight: 700;
}

.trights-ai-search__results {
  margin-top: 26px;
}

.trights-ai-search__results:empty {
  display: none;
}

.trights-ai-search__results-title {
  margin: 0 0 12px;
  color: #14243b;
  font-size: 18px;
  line-height: 1.5;
}

.trights-ai-search__result-list {
  border-top: 1px solid #bcc9d6;
}

.trights-ai-search__result {
  padding: 17px 0;
  border-bottom: 1px solid #bcc9d6;
}

.trights-ai-search__result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 7px;
  color: #60778d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.trights-ai-search__classification {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e5f4f3;
  color: #08787d;
}

.trights-ai-search__result-title {
  margin: 0;
  color: #14243b;
  font-size: 17px;
  line-height: 1.55;
}

.trights-ai-search__result-title a,
.trights-ai-search__result-link {
  color: inherit;
  text-decoration: none;
}

.trights-ai-search__result-title a:hover,
.trights-ai-search__result-title a:focus,
.trights-ai-search__result-link:hover,
.trights-ai-search__result-link:focus {
  color: #08787d;
}

.trights-ai-search__result-excerpt {
  margin: 6px 0 0;
  color: #5e6d80;
  font-size: 14px;
  line-height: 1.75;
}

.trights-ai-search__result-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
  color: #60778d;
  font-size: 12px;
}

.trights-ai-search__result-link {
  color: #14243b;
  font-weight: 700;
}

.trights-ai-search__show-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 14px;
  padding: 0 15px;
  border: 1px solid #9eb0c2;
  background: #fff;
  color: #14243b;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.trights-ai-search__show-more:hover,
.trights-ai-search__show-more:focus {
  border-color: #0a8f95;
  color: #08787d;
}

@media (max-width: 781px) {
  .trights-ai-search {
    margin-bottom: 46px;
    padding: 22px 20px 22px;
  }

  .trights-ai-search h2 {
    font-size: 22px;
  }

  .trights-ai-search__heading > p:last-child {
    font-size: 14px;
    line-height: 1.75;
  }

  #trights-ai-search .trights-ai-search__form {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .trights-ai-search__input {
    min-height: 76px;
  }

  #trights-ai-search .trights-ai-search__privacy-note,
  #trights-ai-search .trights-ai-search__button {
    grid-column: 1;
    grid-row: auto;
  }

  #trights-ai-search .trights-ai-search__privacy-note {
    margin-top: 1px;
  }

  #trights-ai-search .trights-ai-search__button {
    align-self: stretch;
    width: 100%;
    margin-top: 2px;
  }

  .trights-ai-search__privacy-note {
    font-size: 10px;
    line-height: 1.35;
  }
}

/* 検索結果の文脈と並び替え */
.trights-ai-search__results-query {
  margin: -4px 0 14px;
  color: #5e6d80;
  font-size: 13px;
  line-height: 1.7;
}

.trights-ai-search__sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
}

.trights-ai-search__sort-label {
  color: #60778d;
  font-size: 12px;
  font-weight: 700;
}

.trights-ai-search__sort-button {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid #9eb0c2;
  border-radius: 0;
  background: #fff;
  color: #14243b;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.trights-ai-search__sort-button:hover,
.trights-ai-search__sort-button:focus {
  border-color: #0a8f95;
  color: #08787d;
}

.trights-ai-search__sort-button.is-active,
.trights-ai-search__sort-button[aria-pressed="true"] {
  border-color: #0a8f95;
  background: #e5f4f3;
  color: #08787d;
}

@media (max-width: 781px) {
  .trights-ai-search__results-query {
    margin-bottom: 12px;
  }
}

/* AIによる回答 */
.trights-ai-search__answer {
  margin: 0 0 26px;
  padding: 22px 24px 20px;
  border: 1px solid #9eb0c2;
  border-left: 4px solid #0a8f95;
  background: #fff;
}

.trights-ai-search__answer-eyebrow {
  margin: 0 0 6px;
  color: #0a8f95;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.4;
}

.trights-ai-search__answer-title {
  margin: 0 0 13px;
  color: #14243b;
  font-size: 20px;
  line-height: 1.45;
}

.trights-ai-search__answer-body {
  color: #34495f;
  font-size: 15px;
  line-height: 1.9;
}

.trights-ai-search__answer-summary {
  margin: 0;
  color: #14243b;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.9;
}

.trights-ai-search__answer-sources {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #ccd6df;
}

.trights-ai-search__answer-sources-title {
  margin: 0 0 7px;
  color: #60778d;
  font-size: 12px;
  font-weight: 700;
}

.trights-ai-search__answer-source-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.trights-ai-search__answer-source-list li {
  margin: 0;
  padding: 5px 0 5px 14px;
  position: relative;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.trights-ai-search__answer-source-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #0a8f95;
}

.trights-ai-search__answer-source-list a {
  color: #14243b;
  text-decoration: none;
}

.trights-ai-search__answer-source-list a:hover,
.trights-ai-search__answer-source-list a:focus {
  color: #08787d;
}

.trights-ai-search__answer-note,
.trights-ai-search__answer-unavailable {
  margin: 14px 0 0;
  color: #64788b;
  font-size: 12px;
  line-height: 1.7;
}

.trights-ai-search__answer.is-unavailable {
  border-left-color: #9eb0c2;
}

@media (max-width: 781px) {
  .trights-ai-search__answer {
    padding: 20px 18px 18px;
  }

  .trights-ai-search__answer-title {
    font-size: 18px;
  }

  .trights-ai-search__newsletter {
    margin-top: 24px;
    padding: 19px 18px 18px;
  }

  .trights-ai-search__newsletter-title {
    font-size: 17px;
  }

  .trights-ai-search__newsletter-headline {
    font-size: 15px;
  }
}

/* 個別記事のAI相談導線 */
.trights-ai-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 34px 0;
  padding: 24px 26px;
  border: 1px solid #bcc9d6;
  border-left: 4px solid #0a8f95;
  background: #f8fbfd;
  color: #14243b;
}

.trights-ai-entry--end {
  margin-top: 46px;
}

.trights-ai-entry__eyebrow,
.trights-ai-modal__eyebrow,
.trights-ai-search__newsletter-eyebrow {
  margin: 0 0 6px;
  color: #0a8f95;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.4;
}

.trights-ai-entry h3 {
  margin: 0;
  color: #14243b;
  font-size: 20px;
  line-height: 1.5;
}

.trights-ai-entry__description,
.trights-ai-entry--sidebar > p:not(.trights-ai-entry__eyebrow) {
  margin: 8px 0 0;
  color: #5e6d80;
  font-size: 14px;
  line-height: 1.8;
}

.trights-ai-entry__example {
  margin: 10px 0 0;
  color: #60778d;
  font-size: 12px;
  line-height: 1.7;
}

.trights-ai-entry__action {
  min-width: 192px;
}

.trights-ai-entry__button,
.trights-ai-search__newsletter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid #0a8f95;
  border-radius: 0;
  background: #0a8f95;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.trights-ai-entry__button:hover,
.trights-ai-entry__button:focus,
.trights-ai-search__newsletter-button:hover,
.trights-ai-search__newsletter-button:focus {
  border-color: #06777b;
  background: #06777b;
  color: #fff;
}

.trights-ai-entry--sidebar {
  display: block;
  margin: 0;
  padding: 20px;
}

.trights-ai-entry--sidebar h3 {
  font-size: 18px;
}

.trights-ai-entry--sidebar .trights-ai-entry__button {
  width: 100%;
  margin-top: 16px;
}

/* AI回答の直後に出すメルマガ導線 */
.trights-ai-search__newsletter {
  margin-top: 28px;
  padding: 22px 22px 21px;
  border: 1px solid #bcdedc;
  border-left: 4px solid #0a8f95;
  background: #f2faf9;
}

.trights-ai-search__newsletter-title {
  margin: 0;
  color: #14243b;
  font-size: 18px;
  line-height: 1.55;
}

.trights-ai-search__newsletter-headline {
  margin: 8px 0 0;
  color: #14243b;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.75;
}

.trights-ai-search__newsletter-text {
  margin: 8px 0 0;
  color: #4f6679;
  font-size: 14px;
  line-height: 1.8;
}

.trights-ai-search__newsletter-button {
  min-height: 42px;
  margin-top: 17px;
  padding: 0 15px;
  font-size: 13px;
}

/* 記事末尾：AI相談とメルマガ登録の2つの次の一歩 */
.trights-ai-next-steps {
  margin: 54px 0 34px;
  padding: 0;
  color: #14243b;
}

.trights-ai-next-steps__header {
  margin: 0 0 18px;
}

.trights-ai-next-steps__header h2 {
  margin: 0;
  color: #14243b;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
}

.trights-ai-next-steps__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.trights-ai-next-steps__card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px 24px 22px;
  border: 1px solid #bcc9d6;
  border-left: 4px solid #0a8f95;
  background: #f8fbfd;
  box-sizing: border-box;
}

.trights-ai-next-steps__card--newsletter {
  border-color: #bcdedc;
  border-left-color: #0a8f95;
  background: #f2faf9;
}

.trights-ai-next-steps__card h3 {
  margin: 0;
  color: #14243b;
  font-size: 18px;
  line-height: 1.55;
}

.trights-ai-next-steps__card > p:not(.trights-ai-entry__eyebrow):not(.trights-ai-next-steps__example) {
  margin: 10px 0 0;
  color: #4f6679;
  font-size: 14px;
  line-height: 1.8;
}

.trights-ai-next-steps__example {
  margin: 10px 0 0;
  color: #60778d;
  font-size: 12px;
  line-height: 1.7;
}

.trights-ai-next-steps__action {
  margin-top: auto;
  padding-top: 18px;
}

.trights-ai-next-steps__card .trights-ai-entry__button,
.trights-ai-next-steps__card .trights-ai-search__newsletter-button {
  width: 100%;
}

/* クリック時だけ開くAI相談モーダル */
.trights-ai-modal {
  width: min(840px, calc(100% - 34px));
  max-width: none;
  max-height: min(86vh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  background: #fff;
  color: #14243b;
  box-shadow: 0 18px 58px rgba(20, 36, 59, .24);
}

.trights-ai-modal::backdrop {
  background: rgba(20, 36, 59, .64);
}

.trights-ai-modal__inner {
  max-height: min(86vh, 920px);
  overflow: auto;
  padding: 28px 30px 32px;
}

.trights-ai-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.trights-ai-modal__header h2 {
  margin: 0;
  color: #14243b;
  font-size: 24px;
  line-height: 1.45;
}

.trights-ai-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #b8c6d1;
  border-radius: 50%;
  background: #fff;
  color: #4d6275;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.trights-ai-modal__close:hover,
.trights-ai-modal__close:focus {
  border-color: #0a8f95;
  color: #08787d;
}

.trights-ai-modal__context {
  margin: 16px 0 17px;
  color: #5e6d80;
  font-size: 14px;
  line-height: 1.8;
}

.trights-ai-modal__form {
  grid-template-columns: 1fr;
}

.trights-ai-modal__form .trights-ai-search__button {
  align-self: flex-start;
  min-height: 48px;
}

@media (max-width: 781px) {
  .trights-ai-modal__form .trights-ai-search__button {
    align-self: stretch;
  }
}

.trights-ai-modal__inner .trights-ai-search__results {
  margin-top: 24px;
}

@media (max-width: 781px) {
  .trights-ai-entry {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 28px 0;
    padding: 21px 19px;
  }

  .trights-ai-entry--end {
    margin-top: 36px;
  }

  .trights-ai-entry h3 {
    font-size: 18px;
  }

  .trights-ai-entry__action,
  .trights-ai-entry__button {
    width: 100%;
  }

  .trights-ai-next-steps {
    margin-top: 42px;
  }

  .trights-ai-next-steps__header {
    margin-bottom: 14px;
  }

  .trights-ai-next-steps__header h2 {
    font-size: 20px;
  }

  .trights-ai-next-steps__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .trights-ai-next-steps__card {
    padding: 21px 19px 20px;
  }

  .trights-ai-next-steps__card h3 {
    font-size: 17px;
  }

  .trights-ai-modal {
    width: min(100% - 20px, 840px);
    max-height: 92vh;
  }

  .trights-ai-modal__inner {
    max-height: 92vh;
    padding: 22px 18px 24px;
  }

  .trights-ai-modal__header h2 {
    font-size: 20px;
  }

  .trights-ai-modal__context {
    margin-top: 14px;
  }
}
