/* =============================
   基本スタイル（共通）
============================= */
body {
  font-family:'Helvetica Neue',sans-serif;
  background:#fefaf7;
  margin:0;
  padding:1rem;
  display:flex;
  justify-content:center;
}

main { width:100%; max-width:900px; }

/* -----------------------------
   テーマカラー切替
----------------------------- */
:root {
  --accent: #f8c6d2;   /* デフォルト（yamatsumu用） */
  --accent-dark:#a35c81;
  --text-main:#6d5c6d;
  --header-bg:#f8e6f0;
}

body[data-theme="pink"] {
  --accent:#f8c6d2;
  --accent-dark:#a35c81;
  --header-bg:#f8e6f0;
  --text-main:#6d5c6d;
}

body[data-theme="green"] {
  --accent:#cfe7d2;
  --accent-dark:#7bbf6a;
  --header-bg:#e4f5e8;
  --text-main:#50644f;
}

body[data-theme="bluebrown"] {
  --accent:#bcd4e6;
  --accent-dark:#6a4e3c;
  --header-bg:#dfe9f3;
  --text-main:#4a4a4a;
}

:root {
  --link-color: #7bbf6a; /* デフォルト（yamatsumu） */
  --link-color-hover: #5da150;
}

/* =============================
      ヘッダー
============================= */
header {
  text-align:center;
  padding:1rem;
  background:var(--header-bg);
  border-radius:16px;
  color:var(--text-main);
  box-shadow:0 2px 8px rgba(0,0,0,0.1);
  position:sticky;
  top:0;
  z-index:10;
  transition: all 0.3s ease;
}
header.shrink { padding:0.2rem 0; }
header h1 { margin:0; font-size:1.6rem; font-weight:700; transition: all 0.3s ease; }
header.shrink h1 { font-size:1rem; }
header p { margin:0.2rem 0 0 0; font-size:0.7rem; color:var(--accent-dark); transition: all 0.3s ease; }
header.shrink p { font-size:0.7rem; }

.info-bar { font-size:0.75rem; color:var(--text-main); margin-top:0.3rem; }
.info-bar a { color:var(--accent-dark); text-decoration:none; font-weight:500; }
.info-bar a:hover { text-decoration:underline; }

/* =============================
      PC：ギャラリー横並び
============================= */
.gallery {
  margin-top: 20Px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:1rem;
}

/* =============================
      カード（共通）
============================= */
.card {
  background:#fff;
  border-radius:16px;
  box-shadow:0 4px 12px rgba(0,0,0,0.08);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  position:relative;
  padding:0.6rem;
  height:220px;
}

.card::before {
  content:'';
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:2px;
  background:var(--accent);
  border-radius:2px 2px 0 0;
}

.card-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex-grow: 1;   
}

.card img {
  width:100%;
  height:70px;
  object-fit:cover;
  border-radius:10px;
  margin-bottom:0.3rem;
  cursor:pointer;
}

.card-title {
  font-weight:600;
  font-size:0.82rem;
  color:var(--text-main);
  position:relative;
  padding-bottom:2px;
  margin-bottom:3px;
  cursor:pointer;
}

.card-title::after {
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
  height:1.5px;
  background:var(--accent);
  border-radius:1px;
}

.tags { min-height:20px; margin-bottom:3px; }

.tag {
  display:inline-block;
  background:var(--accent);
  color:var(--accent-dark);
  font-size:0.65rem;
  padding:2px 5px;
  border-radius:12px;
  margin-right:3px;
  cursor:pointer;
}

.tag.active-tag { font-weight:bold; text-decoration:underline; }

.card-desc {
  font-size:0.75rem;
  line-height:1.2;
  height: 40px;
  color:#555;
  flex-grow:1;
  overflow-y:auto;
  padding-right:3px;
}

/* ===== スクロールバー ===== */
.card-desc::-webkit-scrollbar { width:6px; }
.card-desc::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.15); border-radius:10px; }
.card-desc::-webkit-scrollbar-track { background:rgba(0,0,0,0.05); border-radius:10px; }

/* =============================
      ボタン & リアクション
============================= */

.card-footer {
  margin-top:6px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:5px;
}

.like-btn {
  cursor:pointer;
  color:var(--accent-dark);
  font-weight:bold;
  user-select:none;
  font-size:0.9rem;
  flex-shrink: 0; 
}


/* ▼ 下段（履歴ハート + 押せる♡）の横並び */
.card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ▼ リアクション履歴：カード幅ぴったりに収める */
.reaction-area {
  display:flex;
  flex-wrap:nowrap;   /* nowrap にしたいならこれでOK */
  gap:2px;
  align-items:center;
  max-width:100%;
  overflow:hidden;    /* ←あふれを隠す（超重要） */
  flex: 1;
}


/* ▼ 個々のハート */
.reaction {
  font-size: 0.75rem;
  line-height: 1;
  display: inline-block;
}



/* =============================
      プロフィール・広告
============================= */
.profile { margin-top:2rem; text-align:center; font: 0.8rem;}
.profile a { margin:0 0.5rem; color:var(--accent-dark); text-decoration:none; }
.profile a:hover { text-decoration:underline; }

.ad-area {
  margin:2rem auto 0 auto;
  text-align:center;
  padding:1rem;
  border-radius:12px;
  background:#fff0f5;
  background-color:var(--header-bg);
  box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

.ad-area p {
  color:var(--accent-dark);
  font-size: 0.8rem;
}

.ad-area a {
  color:var(--accent-dark);
  font-size: 0.8rem;
}

.ad-area a:hover {
  color: var(--link-color-hover);
  border-bottom-color: var(--link-color-hover);
}


.reaction-fly {
  font-size: 1rem;
  position: absolute;
  pointer-events: none;
}

/* 作品を見る + リアクション行のブロック */
.card-action-area {
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:2px;
}

/* 下段（リアクション履歴 + 押す♡）の横並び */
.card-action-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}

/* 「作品を見る」リンクのかわいいスタイル */
.card-action-area a {
  color: var(--link-color);
  font-size: 0.78rem;
  font-weight:600;
  text-decoration:none;

  display:inline-block;
  transition:0.2s;
}
.card-action-area a:hover {
  color: var(--link-color-hover);
  border-bottom-color: var(--link-color-hover);
}

/* 押せる♡ボタン */
.like-btn {
  cursor:pointer;
  color:#f080a0;
  font-weight:bold;
  font-size:1rem;
  user-select:none;
  position:relative;
  padding:0 4px;
}

/* =============================
     ▼ スマホ（600px以下）
     2 カラムレイアウト
============================= */
@media(max-width:600px){

  .gallery {
    grid-template-columns:1fr;
    gap:0.7rem;
  }

  .card {
    height:auto;
    padding:0;
    flex-direction:row;
  }

  .card-left {
    width:15%;
    min-width:60px;
  }

  .card img {
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:0;
    margin:0;
  }

  .card-content {
    width:85%;
    padding:10px 12px;
  }

  .card-title { font-size:0.78rem; margin-bottom:4px; }
  .tag { font-size:0.62rem; }
  .card-desc { max-height:48px; font-size:0.72rem; }

  .card a { font-size:0.72rem; }

  .card-footer {
    justify-content:flex-start;
    margin-top:8px;
  }
}
