/* ----------------------------------------------------------
   todome 画面説明書 — FF14 マニュアル風 (モノトーン基調)
   ---------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #f1f3f5;
  --border: #e1e4e8;
  --border-strong: #cfd5db;
  --text: #1f2328;
  --text-soft: #57606a;
  --text-muted: #8b949e;
  --accent: #6b4fe1; /* todome のパープル系アクセント */
  --accent-soft: #efeaff;
  --topbar-h: 56px;
  --sidebar-w: 260px;
  --content-w: 960px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", Roboto,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.topbar-brand:hover {
  text-decoration: none;
}

.topbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.topbar-title {
  font-size: 15px;
}

.topbar-title em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 500;
  margin-left: 6px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.topbar-right a {
  color: var(--text-soft);
}

.topbar-right a:hover {
  color: var(--accent);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
}

/* ---------------- Layout ---------------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 0 48px;
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--bg-soft);
}

.sidebar-group {
  padding: 0 16px;
  margin-bottom: 18px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.sidebar-group-title::before {
  content: "▾";
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.sidebar-group.is-collapsed .sidebar-group-title::before {
  transform: rotate(-90deg);
}

.sidebar-group.is-collapsed .sidebar-links {
  display: none;
}

.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  display: block;
  padding: 6px 10px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 14px;
}

.sidebar-link:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.sidebar-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ---------------- Main content ---------------- */

.main {
  padding: 40px 32px 96px;
  min-width: 0;
}

.container {
  max-width: var(--content-w);
  margin: 0 auto;
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb .sep {
  margin: 0 6px;
}

h1.page-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

p.page-lead {
  font-size: 16px;
  color: var(--text-soft);
  margin: 0 0 24px;
}

h2.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 40px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

h3.subsection-title {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 8px;
}

.section p,
.section li {
  font-size: 14.5px;
  color: var(--text);
}

.section ul,
.section ol {
  padding-left: 22px;
}

.section li + li {
  margin-top: 4px;
}

.section code {
  background: var(--bg-code);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.hero-shot {
  margin: 0 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0b0d12; /* ダーク枠で暗いスクショと馴染ませる */
  box-shadow: var(--shadow-md);
}

.hero-shot img {
  width: 100%;
  display: block;
}

.inline-shot {
  margin: 16px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b0d12;
}

.inline-shot img {
  width: 100%;
}

figcaption {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  text-align: center;
}

/* Feature table */
table.feature-table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0 24px;
  font-size: 14px;
}

table.feature-table th,
table.feature-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

table.feature-table th {
  background: var(--bg-soft);
  font-weight: 600;
  width: 200px;
  color: var(--text-soft);
  font-size: 13px;
}

/* Callout */
.callout {
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
}

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

/* Prev / next navigation */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pager a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s ease;
}

.pager a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.pager a .pager-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pager a .pager-title {
  font-weight: 600;
  margin-top: 2px;
}

.pager .pager-next {
  text-align: right;
}

/* ---------------- Index (top) page ---------------- */

.hero {
  padding: 56px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.hero p {
  color: var(--text-soft);
  font-size: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0 40px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 56px;
}

.highlight-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 860;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #0b0d12;
  box-shadow: var(--shadow-md);
}

.highlight-card figcaption {
  padding: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 1200px) {
  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .highlight-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------------- Image lightbox ---------------- */

.is-zoomable {
  cursor: zoom-in;
}

body.lightbox-lock {
  overflow: hidden;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 12, 18, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  transition: opacity 0.18s ease;
  cursor: zoom-out;
}

.lightbox-overlay.is-open {
  opacity: 1;
}

.lightbox-img {
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #0b0d12;
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
  background: #ffffff;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
  transition: all 0.15s ease;
  color: var(--text);
}

.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-1px);
}

.card-thumb {
  aspect-ratio: 16 / 10;
  background: #0b0d12;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.card-body {
  padding: 14px 16px;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 4px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.5;
}

/* ---------------- Footer ---------------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.footer a {
  color: var(--text-muted);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: min(80vw, 320px);
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 15;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 14;
  }

  .main {
    padding: 24px 16px 64px;
  }

  .hero {
    padding: 32px 0;
  }

  .hero h1 {
    font-size: 28px;
  }

  .pager {
    grid-template-columns: 1fr;
  }
}
