/* ネタのタネ — ミッドナイト・シティライツ（夜景テーマ） */
:root {
  --bg: #070b18;
  --bg-soft: #0b1122;
  --card: #101729;
  --card-2: #0d1424;
  --ink: #e9ecf5;
  --sub: #8b93a8;
  --gold: #f0b429;
  --gold-soft: #ffd27d;
  --green: #4ade80;
  --green-deep: #2fae63;
  --line: rgba(255, 255, 255, 0.09);
  --red: #ff6b5e;
  --serif: "Shippori Mincho B1", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
}

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

body {
  font-family: var(--sans);
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 8%, rgba(255,255,255,0.28) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 42%, rgba(255,255,255,0.22) 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 64%, rgba(255,255,255,0.20) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 88%, rgba(255,255,255,0.25) 50%, transparent 51%),
    linear-gradient(180deg, #070b18 0%, #090e1e 60%, #070b18 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.85;
}

a { color: var(--gold-soft); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--gold); text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ===== ヒーロー（3D地球 夜景） ===== */
.site-header {
  position: relative;
  height: 340px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #04060f 0%, #081026 70%, var(--bg) 100%);
}
#earth-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,11,24,0) 55%, var(--bg) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  width: 100%;
  animation: hero-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
.logo {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 24px rgba(240, 180, 41, 0.45), 0 2px 14px rgba(0, 0, 0, 0.6);
}
.logo:hover { text-decoration: none; color: #fff; }
.logo-mark { filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.7)); }
.tagline {
  font-size: 14px;
  letter-spacing: 0.22em;
  color: rgba(233, 236, 245, 0.85);
  margin-top: 6px;
}
.hero-note {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: rgba(240, 180, 41, 0.75);
  margin-top: 18px;
}

/* ===== ナビ ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 24, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(240, 180, 41, 0.35);
}
.nav-tabs { display: flex; gap: 4px; overflow-x: auto; }
.nav-tab {
  position: relative;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
}
.nav-tab::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-tab:hover { color: var(--gold-soft); text-decoration: none; }
.nav-tab:hover::after, .nav-tab.active::after { transform: scaleX(1); }
.nav-tab.active { color: var(--gold-soft); }

/* ===== レイアウト ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  padding: 28px 16px 56px;
}
@media (max-width: 860px) {
  .main-grid { grid-template-columns: 1fr; }
  .site-header { height: 280px; }
  .logo { font-size: 34px; }
}

.page-heading { font-family: var(--serif); font-size: 24px; margin-bottom: 10px; }

/* ===== スクロールリビール ===== */
.reveal { opacity: 0; transform: translateY(26px); }
.revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-col > .card:nth-child(2).revealed { transition-delay: 0.07s; }
.main-col > .card:nth-child(3).revealed { transition-delay: 0.14s; }
.main-col > .card:nth-child(4).revealed { transition-delay: 0.21s; }

/* ===== カード ===== */
.card, .article {
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s, box-shadow 0.35s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 180, 41, 0.45);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(240, 180, 41, 0.10);
}
.card { display: flex; gap: 18px; align-items: flex-start; overflow: hidden; }
.card-thumb { flex: 0 0 176px; }
.card-thumb img {
  width: 176px;
  height: 118px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card-thumb img { transform: scale(1.05); }
.card-body { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .card { flex-direction: column; }
  .card-thumb { flex: none; width: 100%; }
  .card-thumb img { width: 100%; height: 170px; }
}
.article-eyecatch {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 0 0 18px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}
.card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--sub); margin-bottom: 8px;
}
.chip {
  background: rgba(74, 222, 128, 0.14);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 999px;
  padding: 1px 12px;
  font-size: 12px;
}
.chip:hover { background: rgba(74, 222, 128, 0.26); text-decoration: none; color: var(--green); }
.card-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 8px;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--gold-soft); text-decoration: none; }
.card-summary { font-size: 14px; color: #b6bdcf; }
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; font-size: 13px; gap: 10px;
}
.tag { color: var(--green); font-size: 12.5px; margin-right: 6px; }
.readmore {
  background: rgba(240, 180, 41, 0.10);
  border: 1px solid rgba(240, 180, 41, 0.45);
  border-radius: 999px;
  padding: 5px 16px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--gold-soft);
  transition: background 0.25s, box-shadow 0.25s;
}
.readmore:hover {
  background: rgba(240, 180, 41, 0.22);
  box-shadow: 0 0 16px rgba(240, 180, 41, 0.25);
  text-decoration: none;
}

.new-badge {
  background: var(--red);
  color: #fff;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  animation: new-pulse 2.2s ease-in-out infinite;
}
@keyframes new-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 94, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 107, 94, 0); }
}

/* ===== 記事 ===== */
.article-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.5;
  margin: 8px 0 20px;
}
.article-body p { margin: 14px 0; }
.body-h2 {
  font-family: var(--serif);
  font-size: 20px;
  border-left: 4px solid var(--gold);
  padding-left: 12px;
  margin: 28px 0 10px;
}

/* 記事内画像 */
.inline-img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 12px 0;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}

/* Xポスト静的カード（ビルド時取得） */
.x-card {
  background: #0a0f1c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 18px 0;
  max-width: 550px;
  font-size: 15px;
  transition: border-color 0.3s;
}
.x-card:hover { border-color: rgba(255, 255, 255, 0.3); }
.x-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.x-card-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.x-card-names { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 0; }
.x-card-name { font-weight: 700; color: #fff; }
.x-card-id { font-size: 13px; color: var(--sub); }
.x-card-logo { font-size: 22px; color: #fff; }
.x-card-text { color: #dbe0ec; }
.x-card-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.x-card-photos a { flex: 1 1 45%; }
.x-card-photo {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}
.x-card-foot {
  display: flex; align-items: center; gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--sub);
}
.x-card-likes { color: #f9197f; }
.x-card-foot a { margin-left: auto; font-size: 13px; }

/* X（旧Twitter）ポスト埋め込み — widgets.js 読み込み前のフォールバック */
blockquote.twitter-tweet {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 16px 0;
  max-width: 550px;
  font-size: 14px;
}
blockquote.twitter-tweet::before {
  content: "𝕏 ポストを読み込み中…";
  display: block;
  color: var(--sub);
  font-size: 12.5px;
  margin-bottom: 6px;
}
.twitter-tweet-rendered::before { content: none; }

/* スレ風レス */
.res {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 17px;
  margin: 14px 0;
  transition: border-color 0.3s, background 0.3s;
}
.res:hover { border-color: rgba(240, 180, 41, 0.3); background: rgba(255, 255, 255, 0.045); }
.res-head { font-size: 13px; margin-bottom: 4px; }
.res-num { color: var(--gold); font-weight: 700; }
.res-name { color: var(--green); font-weight: 600; }
.res-body { font-size: 15px; }
.anchor { color: var(--gold); font-weight: 600; }

/* 管理人コメント */
.admin-comment {
  background: rgba(240, 180, 41, 0.08);
  border: 1px solid rgba(240, 180, 41, 0.4);
  border-radius: 10px;
  padding: 15px 17px;
  margin: 22px 0;
  font-size: 15px;
}
.admin-label {
  font-family: var(--serif);
  font-weight: 800; font-size: 13px; color: var(--gold-soft); margin-bottom: 4px;
  letter-spacing: 0.1em;
}

.article-tags { margin: 18px 0 6px; }

/* シェアボックス */
.share-box {
  border: 1px solid rgba(240, 180, 41, 0.5);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 28px 0;
  background:
    radial-gradient(600px 120px at 20% 0%, rgba(240, 180, 41, 0.10), transparent),
    var(--card-2);
}
.share-box h2 { font-family: var(--serif); font-size: 17px; margin-bottom: 14px; letter-spacing: 0.06em; }
.x-btn {
  display: inline-block;
  background: #fff;
  color: #0a0a0a;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 28px;
  margin-right: 10px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.x-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 255, 255, 0.25);
  text-decoration: none;
  color: #000;
}
.copy-btn {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 9px 22px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  font-family: var(--sans);
  transition: background 0.25s, transform 0.25s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.share-box textarea {
  width: 100%;
  margin-top: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #c6cddd;
  background: rgba(0, 0, 0, 0.3);
  resize: none;
  font-family: var(--sans);
}

/* 関連記事 */
.related {
  border-top: 1px solid var(--line);
  margin-top: 26px; padding-top: 16px;
}
.related h2 { font-family: var(--serif); font-size: 16px; margin-bottom: 8px; }
.related ul { padding-left: 20px; font-size: 14px; }
.back { margin-top: 20px; font-size: 14px; }

/* ===== サイドバー ===== */
.sidebar { align-self: start; position: sticky; top: 64px; }
.side-box {
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px 19px;
  margin-bottom: 18px;
}
.side-box h2 {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(240, 180, 41, 0.5);
  padding-bottom: 7px;
  margin-bottom: 12px;
}

.rank-list { display: flex; flex-direction: column; gap: 11px; font-size: 13px; }
.rank-item { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; }
.rank-badge {
  min-width: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  border-radius: 5px;
  color: #0a0a0a;
  background: rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
}
.rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) { color: var(--sub); }
.rank-1 {
  background: linear-gradient(120deg, #d8a127, #ffd97a 45%, #d8a127);
  background-size: 200% 100%;
  animation: shine 3s linear infinite;
}
@keyframes shine {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.rank-2 { background: linear-gradient(120deg, #9aa2b1, #d6dbe4); }
.rank-3 { background: linear-gradient(120deg, #a4713d, #cf9a63); }

.cat-list { list-style: none; font-size: 14px; }
.cat-list li { border-bottom: 1px dashed var(--line); padding: 7px 2px; }
.cat-list .count { color: var(--sub); font-size: 12px; }
.about p { font-size: 13px; color: #b6bdcf; margin: 6px 0; }

/* ===== フッター ===== */
.site-footer {
  background: #04060f;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 12.5px;
  padding: 26px 0;
  text-align: center;
}
.site-footer a { color: var(--gold); }

/* ===== モーション低減設定 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
