.hidden { display: none !important; }

:root {
  --bg: #f5f2ed;
  --ink: #1e1e1e;
  --ink-soft: #888;
  --accent: #b3717c;
  --line: #d8d2c8;
}

/* ダークモードは無効化（インスタ等アプリ内ブラウザ対策） */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Shippori Mincho", "Hiragino Mincho Pro", "Yu Mincho", serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.7;
}

.page {
  max-width: 560px;
  padding: 40px 28px 120px;
}

/* ヘッダー：左揃え・素っ気なく */
.page-header {
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 0;
}

.header-title-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.page-header h1 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.header-mark {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

/* 印（二重円）小さく左に添える */
.mark {
  position: relative;
  width: 22px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}
.mark .circle {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  top: 2px;
}
.mark .circle-a {
  left: 0;
  border: 1px solid var(--ink-soft);
  background: transparent;
}
.mark .circle-b {
  left: 8px;
  background: var(--accent);
  opacity: 0.7;
}

/* タイムライン */
.timeline {
  display: flex;
  flex-direction: column;
}

/* 日付ラベル */
.date-row {
  margin: 52px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-row:first-of-type {
  margin-top: 0;
}

.date-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

/* エントリ */
.entry {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.entry:last-of-type {
  border-bottom: 1px solid var(--line);
}

.entry-time {
  font-size: 0.7rem;
  color: var(--ink-soft);
  padding-top: 3px;
  letter-spacing: 0.03em;
  font-family: "Zen Kaku Gothic New", sans-serif;
}

.entry-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.entry-title {
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--ink);
  word-break: break-all;
}

.entry-excerpt {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.entry-more {
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  font-family: "Zen Kaku Gothic New", sans-serif;
}

.entry-more:hover {
  text-decoration: underline;
}

/* もっと見る */
.more {
  margin-top: 48px;
}

.more a {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  font-family: "Zen Kaku Gothic New", sans-serif;
}

.more a:hover {
  color: var(--ink);
}

/* 空 */
.empty {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 80px 0;
  letter-spacing: 0.1em;
}

.empty a { color: var(--accent); }

/* フッター */
.page-footer {
  margin-top: 80px;
  font-size: 0.65rem;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  font-family: "Zen Kaku Gothic New", sans-serif;
}

/* 個別ページ */
.page-header-entry {
  margin-bottom: 36px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-family: "Zen Kaku Gothic New", sans-serif;
  transition: color 0.15s;
}

.back-link:hover { color: var(--ink); }

.entry-page .date-row {
  margin: 0 0 20px;
}

.entry-full {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.entry-full-title {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.entry-full-body {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
}

/* シェアボタン */
.share-area {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.share-btn:hover {
  color: var(--accent);
}

.share-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.share-btn:hover .share-btn-icon {
  border-color: var(--accent);
}

.share-btn-label {
  font-family: "Shippori Mincho", serif;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
}

.archive-icon-link {
  margin-left: auto;
  color: var(--ink-soft);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.archive-icon-link:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .page { padding: 32px 16px 80px; }
  .entry { grid-template-columns: 38px 1fr; }
}

/* 画像サムネイル（一覧） */
.entry-thumb-link { display: block; flex-shrink: 0; }
.entry-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* サムネイルありの横並びレイアウト */
.entry-with-thumb {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.entry-text-col {
  flex: 1;
  min-width: 0;
}

/* 画像（個別ページ） */
.entry-full-image {
  width: 100%;
  border-radius: 6px;
  display: block;
  margin-bottom: 20px;
}

/* タグ */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.entry-tag {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 0.68rem;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0.05em;
  transition: color 0.15s, border-color 0.15s;
}

.entry-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* タグフィルターバー */
.tag-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
}

.tag-filter-label {
  font-family: "Shippori Mincho", serif;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.tag-filter-clear {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 0.68rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.tag-filter-clear:hover { color: var(--ink); }

/* ヘッダーアイコン群 */
.header-icons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-icon-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.header-icon-btn:hover,
.header-icon-btn.active {
  color: var(--accent);
  background: rgba(0,0,0,0.04);
}

/* 検索バー */
.search-bar {
  margin-bottom: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--bg);
  transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
}

.search-input-wrap svg {
  color: var(--ink-soft);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: "Shippori Mincho", serif;
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
}

#search-input::placeholder { color: var(--ink-soft); }

.search-close-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.search-close-btn:hover { color: var(--ink); }

/* 検索結果 */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-count {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  margin: 0 0 12px;
}

.search-status {
  font-family: "Shippori Mincho", serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 40px 0;
  letter-spacing: 0.1em;
  margin: 0;
}

.search-entry {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  transition: opacity 0.15s;
}

.search-entry:last-child { border-bottom: 1px solid var(--line); }
.search-entry:hover { opacity: 0.7; }

.search-entry-meta {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 0.68rem;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.search-entry-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.search-entry-text { flex: 1; min-width: 0; }

.search-entry-title {
  font-family: "Shippori Mincho", serif;
  font-size: 0.92rem;
  font-weight: 500;
  margin: 0 0 3px;
  line-height: 1.6;
}

.search-entry-excerpt {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-hl {
  background: transparent;
  color: var(--accent);
  font-style: normal;
}

/* 旧クラスとの互換 */
.archive-icon-link {
  display: none;
}

.header-title-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

/* 埋め込みコンテンツ */
.embed-wrap {
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
}

.embed-video {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
}

.embed-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 8px;
}

.embed-shorts {
  position: relative;
  padding-top: 177.78%; /* 9:16 */
  max-width: 360px;
}

.embed-shorts iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 8px;
}

.embed-tweet {
  max-width: 550px;
}

.embed-tweet .twitter-tweet {
  margin: 0 !important;
}

.footer-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: "Shippori Mincho", serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  margin-right: 20px;
  transition: color 0.15s;
}

.footer-back-link:hover { color: var(--accent); }
