/* ========================================
   Thoughts Database
======================================== */

.thoughts-page {
  box-sizing: border-box;
}

.thoughts-page *,
.thoughts-page *::before,
.thoughts-page *::after {
  box-sizing: border-box;
}


/* ========================================
   検索
======================================== */

.thoughts-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 14px;
  margin: 0 0 36px;
}

.thoughts-search {
  display: block;
  min-width: 0;
}

.thoughts-search-label {
  display: block;
  margin-bottom: 6px;
  color: #5769b7;
  font-family: "Montserrat", "Zen Kaku Gothic New", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
}

.thoughts-search input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 16px;

  color: inherit;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(87, 105, 183, 0.45);
  border-radius: 0;

  font: inherit;

  backdrop-filter: blur(8px);
}

.thoughts-search input:focus {
  background: rgba(255, 255, 255, 0.75);
  border-color: #5769b7;
  outline: 2px solid rgba(135, 191, 242, 0.25);
  outline-offset: 2px;
}

.thoughts-clear-button {
  min-height: 48px;
  margin: 0;
  padding: 10px 20px;

  color: #5769b7;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(87, 105, 183, 0.45);
  border-radius: 0;

  font: inherit;
  cursor: pointer;

  backdrop-filter: blur(8px);

  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.thoughts-result-count {
  min-width: 4.5em;
  margin: 0;
  padding-bottom: 12px;

  color: #9aa9b8;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-align: right;
}

@media (hover: hover) {
  .thoughts-clear-button:hover {
    background: rgba(135, 191, 242, 0.32);
    border-color: rgba(87, 105, 183, 0.75);
    transform: translateY(-2px);
  }
}


/* ========================================
   一覧カード
======================================== */

.thoughts-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.thoughts-card {
  position: relative;
  min-width: 0;
  min-height: 250px;

  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(87, 105, 183, 0.35);

  overflow: hidden;
  backdrop-filter: blur(7px);

  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.thoughts-card::before,
.thoughts-card::after {
  position: absolute;
  right: 20px;
  bottom: 20px;

  content: "";
  display: block;
  background: rgba(87, 105, 183, 0.55);

  transition:
    width 0.25s ease,
    height 0.25s ease;
}

.thoughts-card::before {
  width: 34px;
  height: 1px;
}

.thoughts-card::after {
  width: 1px;
  height: 34px;
}

.thoughts-card[hidden] {
  display: none;
}

.thoughts-card-link {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;

  padding: 28px 58px 28px 28px;

  color: inherit;
  text-decoration: none;
}

.thoughts-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.thoughts-card-title {
  min-width: 0;
  margin: 0;

  color: #16455d;
  font-size: clamp(1.45rem, 1.25rem + 0.5vw, 2rem);
  font-weight: normal;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.thoughts-card-rating {
  flex-shrink: 0;
  margin: 2px 0 0;

  color: #16455d;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.thoughts-card-properties {
  display: grid;
  gap: 12px;
  margin: 0;
}

.thoughts-property {
  display: grid;
  grid-template-columns: 6em minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.thoughts-property dt {
  margin: 0;

  color: #9aa9b8;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
}

.thoughts-property dd {
  min-width: 0;
  margin: 0;

  font-size: 1.15rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}


/* ========================================
   タグ
======================================== */

.thoughts-card-tags,
.thoughts-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin: 22px 0 0;
  padding: 0;

  list-style: none;
}

.thoughts-card-tags li,
.thoughts-detail-tags li {
  padding: 6px 12px;

  color: #225b75;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(55, 120, 170, 0.38);
  border-radius: 999px;

  font-size: 0.9rem;
  line-height: 1.3;

  backdrop-filter: blur(5px);
}

@media (hover: hover) {
  .thoughts-card:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(87, 105, 183, 0.65);
    transform: translateY(-4px);
  }

  .thoughts-card:hover::before {
    width: 46px;
  }

  .thoughts-card:hover::after {
    height: 46px;
  }
}


/* ========================================
   検索結果なし
======================================== */

.thoughts-empty,
.thoughts-no-results {
  margin: 40px 0 10px;
  color: #9aa9b8;
  text-align: center;
}


/* ========================================
   個別ページ
======================================== */

.thoughts-back {
  margin: 0 0 20px;
}

.thoughts-back a {
  display: inline-flex;
  align-items: center;

  padding: 9px 16px;

  color: #225b75;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(87, 105, 183, 0.35);

  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-decoration: none;

  backdrop-filter: blur(7px);

  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
}

.thoughts-detail {
  max-width: 1000px;
  margin: 0 auto;
  padding: 38px;

  color: #111;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(87, 105, 183, 0.35);

  backdrop-filter: blur(9px);
}

.thoughts-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 25px;
  padding-bottom: 20px;

  border-bottom: 2px solid rgba(85, 165, 200, 0.4);
}

.thoughts-detail-title {
  margin: 0;

  color: #174764;
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.7rem);
  font-weight: normal;
  line-height: 1.45;
  letter-spacing: 0.08em;
}

.thoughts-detail-rating {
  flex-shrink: 0;
  margin: 7px 0 0;

  color: #174764;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.thoughts-detail-properties {
  display: grid;
  gap: 0;
  margin: 30px 0 0;

  border-top: 1px solid rgba(70, 120, 150, 0.2);
}

.thoughts-detail-property {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);

  border-bottom: 1px solid rgba(70, 120, 150, 0.2);
}

.thoughts-detail-property dt,
.thoughts-detail-property dd {
  margin: 0;
  padding: 12px 16px;
}

.thoughts-detail-property dt {
  color: #16455d;
  background: rgba(122, 193, 220, 0.24);

  font-weight: 700;
  white-space: nowrap;
}

.thoughts-detail-property dd {
  min-width: 0;

  background: rgba(255, 255, 255, 0.34);

  line-height: 1.7;
  overflow-wrap: anywhere;
}


/* ========================================
   公式・配信リンク
======================================== */

.thoughts-official-link {
  margin: 24px 0 0;
}

.thoughts-official-link a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;

  color: #225b75;
  background: rgba(122, 193, 220, 0.2);
  border: 1px solid rgba(55, 120, 170, 0.4);

  text-decoration: none;

  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
}

.thoughts-official-link a::after {
  content: "↗";
  margin-left: 10px;
}

@media (hover: hover) {
  .thoughts-back a:hover {
    background: rgba(135, 191, 242, 0.32);
    transform: translateX(-4px);
  }

  .thoughts-official-link a:hover {
    background: rgba(122, 193, 220, 0.38);
    transform: translateY(-2px);
  }
}


/* ========================================
   Markdown本文
======================================== */

.thoughts-markdown {
  margin-top: 42px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.thoughts-markdown h1 {
  margin: 44px 0 18px;
  padding-bottom: 8px;

  color: #174764;
  border-bottom: 2px solid rgba(85, 165, 200, 0.4);

  font-size: 1.5rem;
}

.thoughts-markdown h2 {
  margin: 34px 0 14px;
  color: #174764;
  font-size: 1.3rem;
}

.thoughts-markdown h3 {
  margin: 26px 0 10px;
  color: #174764;
  font-size: 1.1rem;
}

.thoughts-markdown p {
  margin: 0 0 1.3em;
}

.thoughts-markdown ul {
  margin: 0 0 1.4em;
  padding-left: 1.5em;
}

.thoughts-markdown li {
  margin-bottom: 5px;
}


/* ========================================
   ネタバレ折りたたみ
======================================== */

.thoughts-markdown details {
  margin: 18px 0;

  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(78, 155, 194, 0.4);

  overflow: hidden;
}

.thoughts-markdown summary {
  padding: 14px 18px;

  color: #184c68;
  background: linear-gradient(
    90deg,
    rgba(90, 170, 210, 0.22),
    rgba(255, 255, 255, 0)
  );

  font-weight: 700;
  cursor: pointer;
}

.thoughts-markdown details[open] summary {
  border-bottom: 1px solid rgba(78, 155, 194, 0.25);
}

.thoughts-markdown details > :not(summary) {
  margin-right: 18px;
  margin-left: 18px;
}


/* ========================================
   タブレット
======================================== */

@media screen and (max-width: 768px) {
  .thoughts-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .thoughts-result-count {
    grid-column: 1 / -1;
    padding: 0;
  }

  .thoughts-card-grid {
    grid-template-columns: 1fr;
  }

  .thoughts-detail {
    padding: 28px 20px;
  }
}


/* ========================================
   スマホ
======================================== */

@media screen and (max-width: 520px) {
  .thoughts-toolbar {
    display: block;
  }

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

  .thoughts-result-count {
    margin-top: 12px;
  }

  .thoughts-card {
    min-height: 0;
  }

  .thoughts-card-link {
    padding: 22px 42px 22px 18px;
  }

  .thoughts-card-header {
    display: block;
  }

  .thoughts-card-rating {
    margin-top: 10px;
  }

  .thoughts-property {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .thoughts-back a {
    width: 100%;
    justify-content: center;
  }

  .thoughts-detail {
    padding: 22px 16px;
  }

  .thoughts-detail-header {
    display: block;
  }

  .thoughts-detail-rating {
    margin-top: 12px;
  }

  .thoughts-detail-property {
    grid-template-columns: 1fr;
  }

  .thoughts-detail-property dt {
    padding-bottom: 7px;
  }

  .thoughts-detail-property dd {
    padding-top: 7px;
  }

  .thoughts-official-link a {
    width: 100%;
    justify-content: center;
  }
}