/* =========================================================
   架空ニコニコ大百科 風テンプレート
   ---------------------------------------------------------
   - index.html            : YAMADA本記事
   - articles/*.html       : 関連項目の暫定記事
   - video/truth.html      : 関連動画クリック後のローディング演出
   - img/yamada-aa.png     : AA風イメージ画像
   ========================================================= */

/* ---------- Base ---------- */
body {
  margin: 0;
  font-family: "Meiryo", "Hiragino Kaku Gothic ProN", sans-serif;
  background: #eee;
  color: #222;
  font-size: 14px;
}

a {
  color: #0645ad;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Header ---------- */
#topbar {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #252525;
  color: #fff;
  border-bottom: 4px solid #999;
}

#topbar a {
  color: #fff;
}

.logo {
  margin-right: 28px;
  font-size: 20px;
  font-weight: bold;
}

.search {
  margin-left: auto;
}

.search input {
  width: 260px;
  padding: 5px;
  border: 1px solid #777;
}

.search button {
  padding: 5px 12px;
}

/* ---------- Layout ---------- */
#wrap {
  width: 1060px;
  margin: 18px auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

#main {
  width: 760px;
}

#side {
  width: 280px;
}

.breadcrumb {
  margin: -4px 0 8px;
  color: #777;
  font-size: 12px;
}

/* ---------- Boxes ---------- */
.box {
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #bbb;
}

.box-head {
  padding: 7px 10px;
  background: linear-gradient(#f8f8f8, #ddd);
  border-bottom: 1px solid #bbb;
  font-weight: bold;
}

.box-body {
  padding: 12px;
}

/* ---------- Article ---------- */
.article-title {
  margin-bottom: 12px;
  padding: 14px 16px 10px;
  background: #fff;
  border: 1px solid #bbb;
}

.article-title h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: bold;
}

.reading {
  color: #777;
  font-size: 13px;
}

.meta {
  margin-top: 10px;
  color: #666;
  font-size: 12px;
}

.article {
  padding: 18px 22px;
  background: #fff;
  border: 1px solid #bbb;
}

.article h2 {
  margin: 28px 0 12px;
  padding: 6px 10px;
  background: #f2f2f2;
  border-left: 8px solid #555;
  border-bottom: 1px solid #bbb;
  font-size: 20px;
}

.article h3 {
  margin-top: 22px;
  border-bottom: 1px solid #ccc;
  font-size: 16px;
}

.article p,
.article ul {
  line-height: 1.8;
}

.notice {
  margin: 14px 0;
  padding: 10px;
  background: #ffffe8;
  border: 1px solid #ccc;
}

/* ---------- Sidebar ---------- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.info-table th {
  width: 90px;
  padding: 6px;
  background: #eee;
  border: 1px solid #ccc;
  text-align: left;
}

.info-table td {
  padding: 6px;
  border: 1px solid #ccc;
}

.tag {
  display: inline-block;
  margin: 3px;
  padding: 3px 7px;
  background: #f2f2f2;
  border: 1px solid #ccc;
  font-size: 12px;
}

.article-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

/* ---------- AA image ---------- */
.aa-image {
  text-align: center;
}

.aa-image img {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #ccc;
  image-rendering: auto;
}

.aa-caption {
  margin-top: 6px;
  color: #777;
  font-size: 12px;
}

/* ---------- Related videos ---------- */
.video-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #ddd;
}

.video-item:first-child {
  border-top: none;
}

.video-thumb {
  width: 120px;
  height: 70px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ddd;
  border: 1px solid #bbb;
  color: #777;
  font-size: 12px;
}

.video-info {
  flex: 1;
}

.video-info p {
  margin: 5px 0 0;
  line-height: 1.5;
}

.video-meta {
  margin-top: 3px;
  color: #777;
  font-size: 12px;
}

/* ---------- BBS ---------- */
.comment {
  padding: 10px 4px;
  border-top: 1px solid #ccc;
  line-height: 1.6;
}

.comment:first-child {
  border-top: none;
}

.comment-no {
  color: #080;
  font-weight: bold;
}

.comment-date {
  color: #777;
  font-size: 12px;
}

/* ---------- Loading page ---------- */
.loading-area {
  padding: 28px 14px;
  text-align: center;
}

.loading-title {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: bold;
}

.loading-desc {
  color: #555;
}

.loading-bar {
  width: 70%;
  height: 12px;
  margin: 18px auto;
  overflow: hidden;
  background: #eee;
  border: 1px solid #bbb;
}

.loading-bar::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  background: #999;
  animation: load-slide 1.2s linear infinite;
}

.loading-status {
  color: #666;
  font-size: 13px;
}

.backlink {
  margin-top: 14px;
  font-size: 13px;
}

@keyframes load-slide {
  from { margin-left: -42%; }
  to   { margin-left: 100%; }
}

/* ---------- Footer / Responsive ---------- */
.footer {
  margin: 24px;
  text-align: center;
  color: #777;
  font-size: 12px;
}

@media (max-width: 900px) {
  #wrap {
    width: auto;
    margin: 10px;
    display: block;
  }

  #main,
  #side {
    width: auto;
  }

  .search input {
    width: 150px;
  }
}


/* ---------- Comment post form (display only) ---------- */
.post-form {
  margin-top: 14px;
  padding: 10px;
  background: #f7f7f7;
  border: 1px solid #ccc;
}

.post-form-title {
  margin-bottom: 8px;
  font-weight: bold;
}

.post-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.post-form-row label {
  width: 42px;
  color: #555;
}

.post-form input,
.post-form textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #bbb;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
}

.post-form input {
  padding: 4px 6px;
  color: #555;
}

.post-form textarea {
  height: 76px;
  padding: 6px;
  resize: vertical;
}

.post-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: #777;
  font-size: 12px;
}

.post-form button {
  padding: 4px 14px;
  border: 1px solid #999;
  background: linear-gradient(#fff, #ddd);
  color: #333;
  cursor: default;
}


/* ---------- Breadcrumb / Post form fixes v6 ---------- */
.breadcrumb {
  display: block;
  box-sizing: border-box;
  margin: 0 0 10px;
  padding: 6px 9px;
  background: #fff;
  border: 1px solid #ccc;
  color: #666;
  font-size: 12px;
  line-height: 1.5;
}

.breadcrumb a { color: #0645ad; }
.breadcrumb-plain { color: #777; }
.breadcrumb-current { color: #333; font-weight: bold; }

.post-form {
  display: block;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 12px;
  background: #f8f8f8;
  border: 1px solid #bbb;
}

.post-form-title {
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}

.post-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.post-form-row label { width: 42px; color: #555; }

.post-form input,
.post-form textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #aaa;
  background: #fff;
  color: #222;
  font-family: inherit;
  font-size: 13px;
}

.post-form input { padding: 5px 6px; }

.post-form textarea {
  display: block;
  min-height: 78px;
  padding: 6px;
  resize: vertical;
}

.post-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: #777;
  font-size: 12px;
}

.post-form button {
  flex: none;
  padding: 5px 16px;
  border: 1px solid #999;
  background: linear-gradient(#fff, #ddd);
  color: #333;
  font-family: inherit;
  cursor: pointer;
}


/* ---------- Related video thumbnails integrated ---------- */
.video-thumb {
  overflow: hidden;
  text-decoration: none;
  background: #111;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ---------- Fake Nico-style player for video/truth.html ---------- */
.fake-video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border: 1px solid #111;
}

.fake-video-player img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fake-comment-layer {
  position: absolute;
  inset: 0 0 42px 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.fake-nico-comment {
  position: absolute;
  right: -120%;
  white-space: nowrap;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  text-shadow: 2px 2px 3px #000, -1px -1px 2px #000;
  animation: fake-nico-flow 3s linear forwards;
}

@keyframes fake-nico-flow {
  from { right: -120%; }
  to { right: 110%; }
}

.fake-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: rgba(0,0,0,.70);
  cursor: pointer;
  z-index: 5;
}

.fake-play-button::before {
  content: "";
  position: absolute;
  left: 33px;
  top: 23px;
  border-left: 26px solid #fff;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
}

.fake-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 0 12px;
  color: #ddd;
  background: rgba(0,0,0,.80);
  font-size: 12px;
  z-index: 3;
}

.fake-seekbar {
  flex: 1;
  height: 5px;
  overflow: hidden;
  background: #444;
  border-radius: 999px;
}

.fake-progress {
  width: 4%;
  height: 100%;
  background: #ddd;
}

.fake-loading-mask {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #000;
  font-size: 18px;
  letter-spacing: .08em;
  z-index: 6;
}

.fake-player-caption {
  margin-top: 8px;
  color: #666;
  font-size: 13px;
}


/* ---------- Fake Nico comment list under player ---------- */
.nico-comments {
  margin-top: 14px;
  border: 1px solid #cfcfcf;
  background: #fff;
}

.nico-comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: linear-gradient(#f8f8f8, #e8e8e8);
  border-bottom: 1px solid #cfcfcf;
  font-weight: bold;
  font-size: 13px;
}

.nico-comments-tabs {
  font-weight: normal;
  color: #666;
  font-size: 12px;
}

.nico-comments-body {
  max-height: 220px;
  overflow-y: auto;
  font-size: 13px;
}

.nico-comment-row {
  display: grid;
  grid-template-columns: 58px 1fr 78px;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  line-height: 1.4;
}

.nico-comment-row:nth-child(even) {
  background: #fafafa;
}

.nico-comment-time {
  color: #777;
  white-space: nowrap;
}

.nico-comment-text {
  color: #222;
}

.nico-comment-date {
  color: #999;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
}
