/* ========================================
   gitbook-style plugin — all shared CSS
   Single source of truth for all languages
   ======================================== */

/* Reset */
html, body {
  margin: 0;
  padding: 0;
}

/* Global font */
* {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ---- Layout (custom template) ---- */

.gb-root {
  min-height: 100vh;
  background: #fff;
}

/* Full-width header */
.gb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.gb-header-inner {
  max-width: 1536px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-sizing: border-box;
}

.gb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1a1a1a;
}

.gb-logo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gb-logo-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.gb-logo-tagline {
  font-size: 10px;
  color: #999;
  font-weight: 400;
}

.gb-logo img {
  height: 44px;
  width: auto;
}

/* Search box */
.gb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d5d9e0;
  border-radius: 12px;
  background: #fff;
  padding: 9px 12px;
  width: 224px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.15s;
  position: relative;
  margin-left: auto;
}

.gb-search:focus-within {
  border-color: #4183c4;
  box-shadow: 0 0 0 3px rgba(65,131,196,0.1);
}

.gb-search-icon {
  flex-shrink: 0;
  color: #aaa;
  width: 15px;
  height: 15px;
}

.gb-search input {
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  flex: 1;
  min-width: 0;
  padding: 0;
  color: #1c1d1f;
  -webkit-appearance: none;
}

.gb-search input::placeholder {
  color: #aaa;
}

.gb-search-kbd {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  margin-left: auto;
}

.gb-search-kbd kbd {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  color: #999;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.5;
}

/* Search results dropdown */
.gb-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

.gb-search-result {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.gb-search-result:last-child {
  border-bottom: none;
}

.gb-search-result:hover {
  background: #f5f8ff;
  color: #4183c4;
}

.gb-search-empty {
  padding: 16px;
  color: #999;
  font-size: 14px;
  text-align: center;
}

/* Centered container */
.gb-container {
  max-width: 1536px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
}

/* Sidebar */
.gb-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 20px 0 40px 0;
  scrollbar-width: none;
}

.gb-sidebar::-webkit-scrollbar {
  display: none;
}

/* Content */
.gb-content {
  flex: 1;
  min-width: 0;
  padding: 0 24px 60px 24px;
}

.gb-content .markdown-section {
  font-size: 15px;
  line-height: 1.7;
  color: #333;
}

.gb-content .markdown-section > *:not(.page-cover):not(.page-toc):not(.page-nav) {
  max-width: 860px;
}

.gb-content .markdown-section h1 {
  font-size: 2em;
  font-weight: 700;
  margin-top: 0;
  border-bottom: none;
}

.gb-content .markdown-section h2 {
  font-size: 1.5em;
  font-weight: 600;
  border-bottom: none;
}

.gb-content .markdown-section h3 {
  font-size: 1.2em;
  font-weight: 600;
}

.gb-content .markdown-section a {
  color: #4183c4;
}

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

.gb-sidebar ul.summary {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gb-sidebar ul.summary li a,
.gb-sidebar ul.summary li span {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #5f6368;
  padding: 8px 16px;
  line-height: 1.6;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.gb-sidebar ul.summary li a:hover {
  color: #333;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
}

.gb-sidebar ul.summary li.active > a {
  color: #4183c4;
  font-weight: 500;
  background: rgba(65,131,196,0.06);
  border-right: 2px solid #4183c4;
}

.gb-sidebar ul.summary li.header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1a1a1a;
  padding: 20px 16px 6px;
  margin-top: 4px;
}

.gb-sidebar ul.summary li.divider {
  display: none;
}

.gb-sidebar ul.summary li ul {
  padding-left: 0;
}

.gb-sidebar ul.summary li ul li a {
  padding-left: 28px;
}

.gb-sidebar ul.summary li ul li ul li a {
  padding-left: 40px;
}


/* Toggle chapters chevrons */
.gb-sidebar .chapter > a,
.gb-sidebar .chapter > span {
  display: flex;
  align-items: center;
}

.gb-sidebar .gb-toggle {
  background: none;
  border: none;
  padding: 0;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.gb-sidebar .gb-toggle:hover {
  background: rgba(0,0,0,0.05);
}

.gb-sidebar .gb-toggle::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #999;
  border-bottom: 1.5px solid #999;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.gb-sidebar .chapter.expanded > a .gb-toggle::before,
.gb-sidebar .chapter.expanded > span .gb-toggle::before {
  transform: rotate(45deg);
}

.gb-sidebar .chapter .articles {
  display: none;
}

.gb-sidebar .chapter.expanded > .articles {
  display: block;
}

/* ---- Banner / Cover Image ---- */

.page-cover {
  max-width: none;
  width: calc(100% + 48px);
  margin-left: -24px;
  margin-right: -24px;
  overflow: hidden;
  margin-bottom: 24px;
}

.page-cover img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* ---- Breadcrumbs ---- */

.breadcrumb {
  margin-bottom: 8px;
}

.breadcrumb span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #4183c4;
  text-transform: uppercase;
}

/* ---- Right-side TOC ---- */

.page-toc {
  position: fixed;
  top: 380px;
  right: 40px;
  width: 200px;
  max-height: calc(100vh - 400px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  z-index: 10;
}

@media (max-width: 1500px) {
  .page-toc {
    display: none;
  }
}

.page-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid #e0e0e0;
}

.page-toc li {
  padding: 4px 0 4px 12px;
}

.page-toc li.toc-h3 {
  padding-left: 24px;
}

.page-toc a {
  color: #888;
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

.page-toc a:hover {
  color: #333;
}

.page-toc li.active > a {
  color: #4183c4;
  font-weight: 500;
}

.page-toc li.active {
  border-left: 2px solid #4183c4;
  margin-left: -1px;
}

/* ---- Prev/Next Navigation ---- */

.page-nav {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 24px;
  max-width: 860px;
}

.page-nav a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  flex: 1;
  padding: 16px;
  border: 1px solid #e2e6ec;
  border-radius: 4px;
  text-decoration: none !important;
  transition: border-color 0.15s;
  min-width: 0;
}

.page-nav a:hover {
  border-color: #4183c4;
}

.page-nav-prev {
  flex-direction: row-reverse;
}

.page-nav-prev .page-nav-text {
  text-align: left;
}

.page-nav-next .page-nav-text {
  text-align: right;
  flex: 1;
}

.page-nav-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.page-nav-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 2px;
}

.page-nav-title {
  font-size: 15px;
  color: #333;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-nav-arrow {
  color: #ccc;
  font-size: 18px;
  flex-shrink: 0;
}

.page-nav a:hover .page-nav-arrow {
  color: #4183c4;
}

.page-nav a:hover .page-nav-title {
  color: #4183c4;
}

/* ---- Last Updated ---- */

.last-updated {
  font-size: 12px;
  color: #888;
  margin-top: 32px;
  max-width: 860px;
}

.last-updated time {
  color: #888;
}

/* ---- Page Disclaimer Footer ---- */

.page-disclaimer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 11px;
  line-height: 1.6;
  color: #bbb;
  max-width: 860px;
  text-align: center;
}

.page-disclaimer a {
  color: #333;
  text-decoration: underline;
}

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

.sidebar-footer {
  padding: 20px 16px 40px;
  margin-top: 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
}

.sidebar-footer-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sidebar-footer-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
}

.sidebar-footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-footer-links a {
  color: #bbb;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.sidebar-footer-links a:hover {
  color: #555;
}

.sidebar-footer-links img {
  opacity: 0.5;
  transition: opacity 0.15s;
}

.sidebar-footer-links a:hover img {
  opacity: 0.8;
}

/* ---- Hint/Callout Boxes ---- */
/* Styles are in gitbook-plugin-hints/assets/plugin-hints.css */

/* ---- External Link Indicators ---- */

.gb-content a[href^="http"]:not([href*="cat.town"]):not([href*="localhost"])::after {
  content: " \2197";
  font-size: 0.75em;
  vertical-align: super;
  color: #888;
  text-decoration: none;
  display: inline;
}

/* ---- Item Cards (shared content styles) ---- */

.item-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  max-width: 300px;
}

.item-card img {
  width: 85%;
  border-radius: 8px;
  margin: 0 auto 1rem auto;
  display: block;
}

.item-card h3 {
  color: #1a1a1a;
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
}

.item-card .rarity {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  font-weight: bold;
}

.item-card .rarity.common { color: #fff; background: #c6c3ba; padding: 5px 14px; border-radius: 4px; display: inline-block; }
.item-card .rarity.uncommon { color: #fff; background: #2fa357; padding: 5px 14px; border-radius: 4px; display: inline-block; }
.item-card .rarity.rare { color: #fff; background: #00a5ec; padding: 5px 14px; border-radius: 4px; display: inline-block; }
.item-card .rarity.epic { color: #fff; background: #8a53ff; padding: 5px 14px; border-radius: 4px; display: inline-block; }
.item-card .rarity.legendary { color: #fff; background: #bea000; padding: 5px 14px; border-radius: 4px; display: inline-block; }

.item-card .value { color: #2fa357; margin-bottom: 0.5rem; font-size: 1.4rem; font-weight: bold; }
.item-card .condition { color: #000; margin-bottom: 0.5rem; font-size: 1.4rem; font-weight: bold; }
.item-card .flavor { color: #8a8982; font-style: italic; margin: 0; font-size: 1.2rem; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 1rem;
}

.item-row {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem 2.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
}

.rod-img { width: 140px; height: 140px; object-fit: contain; border-radius: 10px; }

.rod-details { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rod-details h3 { margin: 0 0 4px 0; font-size: 1.18em; display: flex; align-items: center; gap: 10px; font-weight: 600; }

.rarity { font-size: 0.8em; padding: 1px 7px; border-radius: 6px; font-weight: bold; display: inline-block; vertical-align: middle; color: #fff; }
.rarity.common { background: #c6c3ba; }
.rarity.uncommon { background: #2fa357; }
.rarity.rare { background: #00a5ec; }
.rarity.epic { background: #8a53ff; }
.rarity.legendary { background: #bea000; }

.rod-details > .rarity { align-self: flex-start; }

.stats { margin: 0 0 4px 0; padding-left: 18px; font-size: 0.98em; color: #333; }
.stats li.special { color: #b85c00; font-weight: bold; }

.flavor { font-style: italic; color: #7a7a7a; margin: 0; font-size: 0.97em; }
.reputation { font-size: 0.97em; color: #bf4f85; font-style: italic; margin-bottom: 4px; }

/* ---- Tables ---- */

.markdown-section table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 14px;
}

.markdown-section table th {
  background: #f8f9fa;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
}

.markdown-section table td {
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  vertical-align: top;
}

.markdown-section table tr:hover {
  background: #f8f9fa;
}

/* ---- Search Results Dropdown ---- */

.gb-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

.gb-search-result {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.gb-search-result:last-child {
  border-bottom: none;
}

.gb-search-result:hover {
  background: #f5f7fa;
  color: #4183c4;
}

.gb-search-empty {
  padding: 16px;
  color: #999;
  font-size: 14px;
  text-align: center;
}

/* ---- Code blocks ---- */

.markdown-section code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #c7254e;
}

.markdown-section pre {
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.markdown-section pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* ---- Mobile Menu Toggle ---- */

.gb-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #333;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Sidebar overlay backdrop ---- */

.gb-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
  -webkit-tap-highlight-color: transparent;
}

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

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

  .gb-header-inner {
    padding: 0 16px;
  }

  /* Search: hide kbd hints, make flexible */
  .gb-search {
    width: auto;
    flex: 1;
    min-width: 0;
    max-width: 200px;
    margin-left: auto;
  }

  .gb-search-kbd {
    display: none;
  }

  .gb-search-results {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    max-height: calc(100vh - 100px);
  }

  /* Sidebar: off-canvas drawer */
  .gb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: 20px;
    box-shadow: none;
  }

  .gb-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .gb-sidebar-overlay.visible {
    display: block;
  }

  /* Content: full width */
  .gb-content {
    padding: 0 16px 60px 16px;
  }

  .page-cover {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
  }

  .page-cover img {
    height: 180px;
  }

  /* Nav cards: stack vertically */
  .page-nav {
    flex-direction: column;
  }

  /* Item grids: single column */
  .item-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem 0;
  }

  .item-card {
    max-width: none;
  }

  /* Item rows: stack */
  .item-row {
    flex-direction: column;
    padding: 1.25rem;
    text-align: center;
  }

  .rod-img {
    width: 100px;
    height: 100px;
  }

  /* Tables: horizontal scroll */
  .markdown-section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Code blocks: smaller on mobile */
  .markdown-section pre {
    padding: 12px;
    font-size: 12px;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .gb-search {
    max-width: 140px;
    padding: 7px 10px;
  }

  .gb-logo span {
    display: none;
  }

  .gb-sidebar {
    width: 260px;
  }
}
