/* ガンガンガン速 博物館 — 共通スタイル v2 */
/* 文献・アーカイブ的デザイン × 2000年代の記憶 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600;700&family=Noto+Sans+JP:wght@400;700&family=Source+Code+Pro:wght@400;600&display=swap');

:root {
  --bg:          #f5f0e8;
  --bg-alt:      #edeae0;
  --bg-dark:     #1a1a2e;
  --paper:       #fdfaf4;
  --border:      #b8b0a0;
  --border-dark: #7a7060;
  --accent:      #1a3a6e;   /* 深紺 */
  --accent2:     #8b2500;   /* 深赤 */
  --accent3:     #5a7a1e;   /* 深緑 */
  --text:        #1c1c1c;
  --text-mid:    #444;
  --text-light:  #777;
  --link:        #1a3a6e;
  --link-visited:#5a1a6e;
  --link-hover:  #8b2500;
  --header-bg:   #0f1f4a;
  --header-text: #e8e0cc;
  --nav-bg:      #1a2e5a;
  --nav-hover:   #2a4070;
  --nav-active:  #8b2500;
  --tag-bg:      #1a3a6e;
  --tag-text:    #e8e0cc;
  --warn-bg:     #fff8e6;
  --warn-border: #c8a000;
  --code-bg:     #1a1a1a;
  --code-text:   #d4d0c8;
  --serif: 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
  --sans:  'Noto Sans JP', 'Meiryo', 'メイリオ', sans-serif;
  --mono:  'Source Code Pro', 'Courier New', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23b8b0a0' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: var(--text);
  min-height: 100vh;
  line-height: 1.8;
}

/* ===== SITE HEADER ===== */
.site-header {
  background: var(--header-bg);
  border-bottom: 4px solid var(--accent2);
  padding: 0;
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px 16px;
}

.site-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-logo-block {}

.site-logo-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  color: #8898b8;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.site-logo {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--header-text);
  letter-spacing: 2px;
  line-height: 1.2;
  text-decoration: none;
}
.site-logo:hover { color: #fff; }

.site-logo-sub {
  font-family: var(--sans);
  font-size: 11px;
  color: #8898b8;
  margin-top: 4px;
  letter-spacing: 1px;
}

.site-header-meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  color: #8898b8;
  line-height: 1.8;
}

/* ===== NAV ===== */
.site-nav {
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.site-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-link {
  display: block;
  padding: 10px 16px;
  color: #c8d4e8;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover  { background: var(--nav-hover); color: #fff; }
.nav-link.active { background: var(--nav-active); color: #fff; }
.nav-link:visited { color: #c8d4e8; }
.nav-link.active:visited { color: #fff; }

/* ===== LAYOUT ===== */
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ===== PAGE HERO ===== */
.page-hero {
  border-left: 5px solid var(--accent);
  padding: 16px 20px;
  background: var(--paper);
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.page-hero-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.page-hero-title {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  letter-spacing: 1px;
}

.page-hero-desc {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 8px;
  font-family: var(--sans);
}

/* ===== SECTION ===== */
.section {
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-head {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.section-title-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.section-body {
  padding: 20px 18px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}

.section-body p + p { margin-top: 12px; }

/* ===== WARN BOX ===== */
.warn-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn-border);
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.8;
  color: #6b4e00;
  font-family: var(--sans);
  margin-bottom: 20px;
}
.warn-box strong { color: #3d2c00; }

/* ===== TIMELINE ===== */
.timeline { list-style: none; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 72px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0 20px;
  margin-bottom: 0;
  position: relative;
}

.tl-item + .tl-item {
  border-top: 1px dashed var(--border);
}

.tl-item:last-child { }

.tl-date {
  padding: 14px 0 14px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-light);
  text-align: right;
  line-height: 1.5;
  padding-right: 16px;
  white-space: nowrap;
}

.tl-body {
  padding: 14px 0 14px 20px;
  font-size: 13px;
  line-height: 1.8;
  position: relative;
  border-left: none;
}

.tl-body::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--accent);
}

.tl-body strong { color: var(--accent); }

.tl-era-header {
  grid-column: 1 / -1;
  background: var(--accent);
  color: #fff;
  padding: 6px 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0;
}

/* ===== TABLE ===== */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
}

.ref-table th {
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ref-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.7;
}

.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:nth-child(even) td { background: var(--bg-alt); }
.ref-table tr:hover td { background: #e8eaf8; }

.ref-table a { color: var(--link); word-break: break-all; }
.ref-table a:visited { color: var(--link-visited); }
.ref-table a:hover { color: var(--link-hover); }

.ref-table .badge {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-mid);
  white-space: nowrap;
}

/* ===== VIDEO GRID ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.video-card {
  border: 1px solid var(--border);
  overflow: hidden;
  background: #111;
}

.video-card-title {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-desc {
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 11px;
  color: #aaa;
  line-height: 1.6;
  background: #1a1a1a;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.gallery-item {
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  background: #111;
  transition: border-color 0.15s;
}
.gallery-item:hover { border-color: var(--accent); }

.gallery-item-label {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
}

.gallery-item-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.gallery-placeholder {
  width: 100%;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 11px;
  font-family: var(--mono);
  gap: 6px;
  background: #111;
}
.gallery-placeholder .ph-icon { font-size: 28px; }

.gallery-caption {
  padding: 5px 8px;
  font-family: var(--sans);
  font-size: 11px;
  color: #888;
  background: #1a1a1a;
  line-height: 1.5;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-inner { position: relative; max-width: 90vw; }
.lightbox-inner img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  border: 2px solid #fff;
}
.lightbox-close {
  position: absolute;
  top: -40px; right: 0;
  background: var(--accent2);
  color: #fff;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
}
.lightbox-caption {
  color: #ccc;
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
  font-family: var(--sans);
}

/* ===== UNDER CONSTRUCTION ===== */
.construction-banner {
  background: repeating-linear-gradient(
    45deg,
    #f5c800, #f5c800 12px,
    #1a1a1a 12px, #1a1a1a 24px
  );
  padding: 3px;
  margin-bottom: 16px;
}
.construction-inner {
  background: var(--warn-bg);
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #5a3c00;
}

/* ===== ABOUT / PROSE ===== */
.prose {
  font-size: 14px;
  line-height: 1.95;
  color: var(--text);
}
.prose h2 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 24px 0 12px;
}
.prose h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin: 18px 0 8px;
}
.prose p + p { margin-top: 12px; }
.prose a { color: var(--link); }
.prose a:visited { color: var(--link-visited); }
.prose a:hover { color: var(--link-hover); }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--accent2); }

/* ===== CHANNEL LINK ===== */
.ext-link-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #cc0000;
  color: white;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #880000;
  margin-bottom: 16px;
  transition: background 0.15s;
}
.ext-link-box:hover { background: #aa0000; color: white; }
.ext-link-box:visited { color: white; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-dark);
  color: #8898b8;
  font-family: var(--sans);
  font-size: 12px;
  border-top: 3px solid var(--accent2);
  padding: 24px;
  text-align: center;
  line-height: 2;
}
.site-footer a { color: #8898b8; text-decoration: underline; }
.site-footer a:hover { color: #c8d4e8; }

/* ===== LINKS ===== */
a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); }

/* ===== CODE ===== */
code {
  font-family: var(--mono);
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1px 6px;
  font-size: 0.9em;
  border-radius: 2px;
}

pre {
  font-family: var(--mono);
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 16px;
  font-size: 12px;
  overflow-x: auto;
  line-height: 1.7;
  border: 1px solid #333;
}

/* ===== PROFILE TABLE ===== */
.profile-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
}
.profile-table th {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 7px 12px;
  text-align: left;
  width: 30%;
  font-weight: 700;
  color: var(--text-mid);
}
.profile-table td {
  border: 1px solid var(--border);
  padding: 7px 12px;
  line-height: 1.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .page-wrap { padding: 20px 16px 48px; }
  .site-header-inner { padding: 14px 16px 12px; }
  .site-header-meta { display: none; }
  .nav-link { padding: 9px 12px; font-size: 12px; }
  .section-body { padding: 14px 12px; }
  .timeline::before { left: 56px; }
  .tl-item { grid-template-columns: 56px 1fr; }
  .tl-date { font-size: 10px; }
  .tl-body { font-size: 12px; padding-left: 16px; }
  .video-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-table { font-size: 12px; }
  .ref-table th, .ref-table td { padding: 6px 8px; }
  .prose { font-size: 13px; }
}

@media (max-width: 400px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; }
  .timeline::before { display: none; }
  .tl-date {
    text-align: left;
    padding: 10px 0 0 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
  }
  .tl-body { padding-left: 0; border-left: 3px solid var(--border); padding-left: 10px; }
  .tl-body::before { display: none; }
}
