:root {
  --card-bg:#fff;
  --text:#fff;
  --muted:#B7B7B7;
  --radius:10px;
  --gap:25px;
  --maxw:100%;
}

/* ===== グリッド全体 ===== */
.topics {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: var(--gap);
  margin: 60px auto 0 auto;
  max-width: var(--maxw);
  padding: 0 0 120px;
}

/* ===== カラム全体（フル幅） ===== */
.col {
  grid-column: span 12;
}

/* ===== カード本体 ===== */
.card {
  background: #121111;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #535353;
  align-items: stretch;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* ===== サムネイル ===== */
.card__thumb {
  aspect-ratio: 198 / 159;
  border-radius: 10px 10px 0 0;
  width: 100%;
  position: relative;
  background: #f5f5f5;
  overflow: hidden;
}
.card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ===== 本文エリア ===== */
.card__body {
  padding: 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: calc(21px + 20px);
  background-color: transparent;
}
.card__title {
  /* font-size: clamp(16px, 1.7vw, 26px); */
  font-size: 1em;
  margin: 0;
  letter-spacing: .02em;
  color: var(--text);

}

/* ===== メタ情報（日時など） ===== */
.meta {
  font-size: 1em;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  justify-content: flex-end;
  position: absolute;
  bottom: 10px;
  right: 10px;
}
.meta__label {
  width: 10px;
  height: 10px;
   display: inline-block;

}
.meta__label img
{
  width: 100%;
  height: 100%;
}

/* ===== フッター（ボタンなど） ===== */
.card__footer {
  margin-top: auto;
  padding-top: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 21px;
}

/* ===== 背景が黒系ページに馴染ませる ===== */
body {
  background: #000;
  color: var(--text);
}

/* ===== 詳細ページ ===== */
.topic-detail
{
  width: 90%;
  margin: 60px auto ;
  max-width: 700px;
}
.topic-meta
{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
}
.topic-meta>img
{
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 10px;
}
.topic-meta>time
{
  color: #B7B7B7;
  font-size: 16px;
}
.topic-title
{
  font-size: 30px;
  margin-bottom: 30px;
  line-height: 40px;
}
.topic-figure
{
  width: 100%;
  margin: 30px auto;

  /* display: none; */
}
.topic-figure>img
{
  width: 100%;
  /* aspect-ratio: 75/58; */
  border-radius: 10px;
}

.topic-detail .topic-body
{
  font-size: 18px;
  font-weight: 400;
  line-height: 32px;
}

.topic-back
{
  width: 300px;
  aspect-ratio: 30/6;
  background-image: url(../img/back-btn.svg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin: 60px auto;
  overflow: hidden;
}
.topic-back>a
{
  display: inline-flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  padding-left: 10px;
  position: relative;
}
.topic-back>a::before
{
  content: "";
  position:absolute;
  width: 15px;
  aspect-ratio: 11/9;
  background-image: url(../img/aroww-left.svg);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  left: 50px;
}
.topic-extra
{
  margin-top: 20px;
}
.topic-extra img
{
  margin: 0 auto 30px;
  border-radius: 8px;
}
.topic-btn
{
  display: block;
  position: relative;
  width: 100%;
  padding: 1.5% 3%;
  padding-right: calc(3%+15px);
  background-color: #fff;
  box-sizing: border-box;
  color: #0D0C0C;
  font-size: 18px;
  text-align: center;
  border-radius: 8px;
}
.topic-btn::after
{
  content: "";
  width: 15px;
  aspect-ratio: 1/1;
  background-image: url(../img/link.svg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  top: 50%;
  right: 30%;
  transform: translate(-50%,-50%);
}
/* NEWバッジ */
.card { position: relative; }
.card__thumb { position: relative; }

.badge-new{
  position: absolute;
  width: 50px;
  aspect-ratio: 50/23;
  top: 7px;
  right: 10px;
  background: #CF2827;
  color: #fff;
  line-height: 1;
  border-radius: 2px;
  letter-spacing: .04em;
  display: none;
  z-index: 2;
  font-size: 14px;
}

/* JSで .is-new が付いたカードだけ表示 */
.card.is-new .badge-new{ display: inline-flex; justify-content: center; align-items: center;}

@media screen and (min-width:768px) {
  .topic-back:hover,
  .topic-btn:hover
  {
    opacity: 0.8;
    transition: all 0.3s;
  }

}
@media screen and (max-width:767px) {
  .card
  {
    width: 100%;
  }
    .topics {
   grid-template-columns: repeat(2, 1fr); 
    gap: 15px;
    margin: 40px auto 0;
    max-width: 100%;
    padding: 0 0 120px;
}
.badge-new {
    width: 40px;
    background: #CF2827;
    font-size: 12px;
}
.card__thumb
{
  aspect-ratio: 165/130;
}
.card__body {
    /* padding: 10px 10px; */
    padding: 10px 13px;
    flex-direction: column;
    gap: 10px;
    /* padding-bottom: calc(10px + 20px); */
    padding-bottom: calc(16px + 15px);
    background-color: #121111;
    /* position: relative; */
}
.card__title
{
      font-size: clamp(14px, 1.7vw, 26px);
}
.topic-detail
{
  margin-top: 30px;
}
.topic-meta
{
  margin-bottom: 10px;
}
.topic-meta>img
{
  height: 20px;
}
.topic-title{
  line-height: 1.5em;
  font-size: 24px;
}
.topic-figure
{
  margin: 30px 0 10px 0;
}
.topic-back
{
  width: 80%;
  max-width: 300px;
  min-width: 200px;
}
.topic-back>a::before {

    left: 15%;
}
.topic-btn
{
  font-size: 15px;
  padding: 10px 0;
}
.topic-btn::after
{
  right: calc(50% - 120px);
}
.topic-extra img
{
  border-radius: 5px;
  margin: 0 auto 10px;
}
}