/* ==========================================
   section-cards.css
   エージェントB: ①作品・発信の紹介
   縦積み再構版（plan 1788228458330）
   ========================================== */

/* セクション全体 — 正: activity 高に追従 (frame stretch) */
.top-cards {
  padding: 0;
  width: 100%;
  flex: 1 !important;
  height: auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
}

/* タイトル */
.top-cards-title,
.top-page .top-content-left .top-cards-title,
.top-page .top-cards .top-cards-title {
  font-size: 1.4em;
  color: var(--color-main);
  border-bottom: 2px solid var(--color-sky);
  padding: 0.5em 0.8em 0.3em;
  margin-bottom: 1rem;
  text-align: left !important;
  width: 100%;
}

/* カードグリッド（2×2） — 等高をPC基底で担保 — 正: activity 高に追従 — 下端同期: 右とgap同期(0.8em) */
.top-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8em;
  grid-auto-rows: 1fr;
  min-width: 0;
  flex: 1;
  align-content: stretch;
  min-height: 0;
}

/* 各カード: Grid でシェブロン重なりを構造的に禁止（案A） — 正: activity 高に追従 — 垂直中央 + 右帯30px（完全tint一致・濃くしない / 1788234785602 27→30px 10%拡大 + absolute + 3px inset） — plan 1788232372710 / plan 1788423003233 */
.top-card {
  display: grid;
  grid-template-columns: 1fr 30px;
  grid-template-rows: auto auto;
  column-gap: 0;
  row-gap: 0.35em;
  padding: 0.9em 0 0.9em 1em;
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  /* plan 1788422502785: 通常時のごく薄い影を18枚に統一（hover 0 4px 12pxより明確に弱く） */
  box-shadow: 0 1px 3px rgba(31,32,65,0.06);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  box-sizing: border-box;
  height: auto;
  min-height: 72px;
  align-items: center;
  align-content: center;
  place-content: center;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* plan 1788441452706: 白カードhover統一トークンA（影＋浮きのみ・枠維持） */
@media (hover: hover) {
  .top-card:hover {
    border-color: var(--color-border, #DCE6EE);
    box-shadow: 0 4px 16px rgba(31, 32, 65, 0.12);
    transform: translateY(-2px);
  }
  .top-card:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(31, 32, 65, 0.10);
  }
}

.top-card:focus-visible {
  outline: 2px solid var(--color-fuji-deep, #5F568E);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .top-card {
    transition: none;
  }
  .top-card:hover,
  .top-card:active {
    transform: none;
    box-shadow: 0 1px 3px rgba(31, 32, 65, 0.06);
  }
}

@media print {
  .top-card:hover,
  .top-card:active {
    transform: none;
    box-shadow: none;
  }
}

/* カードヘッダ: アイコン+タイトルを横並び中央 — Grid 1列目1行目 — plan 1788234295409: breathing 0.6em — 2026-09-01: 視覚中心をグラデ左端に合わせるため左へ4px + 垂直視覚補正で2px下へ */
.top-card-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-width: 0;
  text-align: center;
  padding-right: 0.6em;
  transform: translate(-4px, 2px);
}

/* アイコン — fluid */
.top-card-icon {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  color: var(--color-main);
  flex: 0 0 clamp(28px, 6vw, 36px);
  width: clamp(28px, 6vw, 36px);
  height: clamp(28px, 6vw, 36px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 旧 .top-card-text は top-card-head に置換 — 互換維持のため残置（非表示相当） */
.top-card-text {
  display: contents;
}

/* カードタイトル */
.top-card-title {
  font-size: 1em;
  line-height: 1.2;
  color: var(--color-main);
  margin: 0;
}

/* カード説明 — 2行clampで等高担保 — Grid 1列目2行目でシェブロンと分離 — ヘッダと同様に中央揃え — plan 1788234295409: breathing 0.6em — 2026-09-01: 視覚中心をグラデ左端に合わせるため左へ4px + 垂直視覚補正で2px下へ */
.top-card-desc {
  grid-column: 1;
  grid-row: 2;
  padding-right: 0.6em;
  font-size: 0.85em;
  line-height: 1.4;
  color: var(--color-text);
  margin: 0;
  opacity: 0.8;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.85em * 1.4 * 2);
  text-align: center;
  transform: translate(-4px, 2px);
}

/* affordance: Grid 2列目 固定帯30px — 完全tint一致・濃くしない（var(--color-bg-jade,#EFF8F5)と同値 / 左フェード8px維持） + 3px inset白縁 — plan 1788234785602 / plan 1788423003233 */
.top-card .top-card-aff--iconOnly{
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  background: linear-gradient(to right, rgba(239,248,245,0) 0, var(--color-bg-jade, #EFF8F5) 8px);
  border-left: none;
  border-radius: 0 5px 5px 0;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

/* desc toggle — PC default: long visible, short hidden (≤1024で切替) */
.top-card-desc .desc-short{ display:none; }
.top-card-desc .desc-long{ display:inline; }

/* PC-only: 水平仕切り + 3行中央寄せ — plan 1788273929470 課題1 — baseは触らずPC限定で完結 — 2026-09-01微調整: 線幅1段階狭め + 説明を下へ0.15em + 視覚中心をグラデ左端(8px)に合わせるため左へ4px + 垂直視覚補正で2px下へ */
@media (min-width: 769px){
  .top-card{
    grid-template-rows: auto 1px auto;
    grid-template-columns: 1fr 30px;
    row-gap: 0.55em;
    align-content: center;
    place-content: center;
  }
  .top-card-head{ grid-row: 1; transform: translate(-4px, 2px); }
  .top-card::after{
    content: "";
    grid-column: 1;
    grid-row: 2;
    height: 1px;
    background: var(--color-border, #DCE6EE);
    margin: 0;
    align-self: center;
    width: calc(100% - 1.6em);
    justify-self: center;
    transform: translate(-4px, 2px);
  }
  .top-card-desc{ grid-row: 3; margin-top: 0.15em; transform: translate(-4px, 2px); }
}
