/**
 * Naify API Reference CSS
 *
 * API リファレンスページ専用スタイル。
 * base (body, a, code, view-transition) は style.css に定義済み。
 * このファイルは API 固有のコンポーネントのみ。
 */

/* ── Layout ── */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 120px;
  min-height: calc(100vh - 200px);
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}
.page-title:empty {
  display: none;
}
.dev-desc {
  color: #475569;
  font-size: 13px;
  margin: 0 0 12px;
}
.dev-desc-sub {
  color: #64748b;
  font-size: 12px;
  margin-top: -4px;
  max-width: 860px;
}
.dev-desc-sub code {
  font-size: 11px;
}

.main-content table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: none;
  border-spacing: 0;
}
.main-content th,
.main-content td {
  border: 1px solid #e8e0d4;
  padding: 7px 10px;
  vertical-align: top;
  text-align: left;
}
.main-content th {
  background: #ede6da;
  white-space: nowrap;
  font-size: 12px;
  color: #5c4a3a;
}

/* ── Visibility Badges ── */
.badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  margin-right: 2px;
}
.badge-public    { background: #dcfce7; color: #16a34a; }
.badge-protected { background: #fef9c3; color: #a16207; }
.badge-private   { background: #fee2e2; color: #dc2626; }
.badge-static    { background: #dbeafe; color: #2563eb; }
.badge-override  { background: #f3e8ff; color: #7c3aed; text-decoration: none; }
.badge-override:hover { text-decoration: underline; }
.badge-kind      { background: #f5f0e8; color: #64748b; margin-right: 4px; }

/* ── Compat Upgrade Badge ── */
.badge-compat {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  background: #fef9c3;
  color: #a16207;
  margin-left: 2px;
}

/* ── Type Colors ── */
.type-link { color: #16a34a; text-decoration: underline; text-decoration-style: dotted; }
.type-name { color: #16a34a; }
.type-code { color: #0f766e; font-size: 12px; }

/* ── Member Names ── */
.method-name   { color: #2563eb; font-weight: 600; font-size: 13px; }
.property-name { color: #7c3aed; font-weight: 600; font-size: 13px; }

/* ── Method Signature ── */
.method-params { color: #64748b; font-size: 11px; }
.method-return { font-size: 12px; }

/* ── Reset global code style in API tables / signatures ── */
.ref-table code,
.class-usage code,
.class-usage code[class*="language-"] {
  font-family: 'Fira Code', Consolas, monospace;
  font-size: 12px !important;
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* ── Table ── */
.ref-table          { width: 100%; border-collapse: collapse; }
.ref-table th       { text-align: left; font-size: 12px; color: #5c4a3a; padding: 4px 8px; border-bottom: 2px solid #e8e0d4; }
.ref-table td       { padding: 6px 8px; border-bottom: 1px solid #e8e0d4; vertical-align: top; }
.ref-table td.nowrap { white-space: nowrap; font-size: 13px; }
.ref-table td.desc  { color: #475569; font-size: 13px; }

/* ── Section Headings ── */
.ref-section-title {
  font-size: 13px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 6px;
}
.ref-section-title-inherited {
  font-size: 13px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 6px;
}

/* ── Design Note ── */
.design-note {
  margin-top: 4px;
  padding: 4px 10px;
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  font-size: 11px;
  color: #15803d;
  border-radius: 0 4px 4px 0;
}
.design-note-section {
  margin: 24px 0 0;
  padding: 18px 20px 20px;
  border: 1px solid #dbeee0;
  border-radius: 12px;
  background: #f6fcf7;
}
.design-note-section h3 {
  font-size: 13px;
  color: #16a34a;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.design-note .fa-lightbulb,
.design-note-section .fa-lightbulb { margin-right: 4px; }
.design-note-item {
  padding: 6px 12px;
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  font-size: 12px;
  color: #15803d;
  border-radius: 0 4px 4px 0;
  margin-bottom: 4px;
}
.design-note-item a {
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
}
.design-note-target {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}
.design-note-target a { color: inherit; text-decoration: none; }
.design-note-target a:hover { text-decoration: underline; }
.design-note-body {
  white-space: pre-line;
  line-height: 1.7;
  color: #475569;
  font-size: 13px;
}
.design-note-item p { margin: 0; }
.design-note-item pre.md-code-block {
  display: inline;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.design-note-item pre.md-code-block code {
  display: inline;
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  white-space: pre-line;
}

/* ── Class Info Panel ── */
.class-panel {
  background: #fff;
  border: 1px solid #e8e0d4;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 12px 0 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.class-summary {
  font-size: 15px;
  color: #334155;
  font-weight: 600;
  margin: 0 0 6px;
}
.class-description {
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}
.class-description p { margin: 0 0 10px; }
.class-description p:last-child { margin-bottom: 0; }
.class-description ul { margin: 0 0 10px; padding-left: 20px; }
.class-description li { margin-bottom: 3px; }
.class-description code {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  background: #f5f0e8;
  border: 1px solid #e8e0d4;
  border-radius: 4px;
  padding: 1px 5px;
  color: #1e293b;
}
.class-description .md-code-block {
  background: #1e293b;
  color: #e8e0d4;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 8px 0;
}
.class-description .md-code-block[class*="language-"] {
  tab-size: 4;
}
.class-description .md-code-block code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.class-description strong { color: #1e293b; }
.class-usage {
  background: #1e293b;
  color: #e8e0d4;
  padding: 12px 16px;
  border-radius: 8px;
  font: 12px/1.6 'Fira Code', Consolas, monospace !important;
  overflow-x: auto;
  margin: 12px 0 0;
  border: none;
}

/* ── Inheritance Info ── */
.inherit-label { color: #94a3b8; }
.inherit-link  { color: #b9652d; text-decoration: none; }
.inherit-link:hover { text-decoration: underline; }

/* ── Breadcrumb ── */
.breadcrumb { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.breadcrumb a { color: #b9652d; text-decoration: none; }
.breadcrumb .sep { font-size: 8px; color: #cbd5e1; margin: 0 2px; }
.breadcrumb-current { color: #334155; }

/* ── Namespace Cards ── */
.ns-card {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: #fff;
  color: #7a4420;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #e8e0d4;
  box-shadow: 0 2px 8px rgba(185,101,45,0.06);
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.ns-card:hover {
  background: #fff7ee;
  border-color: #d4956a;
  box-shadow: 0 4px 14px rgba(185,101,45,0.12);
  text-decoration: none;
}
.ns-card small { color: #a08a6e; }

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
}
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  padding: 4px 8px;
  background: #1e293b;
  color: #e8e0d4;
  font-size: 11px;
  font-family: sans-serif;
  font-weight: 400;
  white-space: nowrap;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

.inherit-link code { color: inherit; }

/* ── Badge: PHP Compat ── */
.badge-php-compat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #dbeafe;
  color: #2563eb;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Badge: Upgrade ── */
.badge-upgrade {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fef9c3;
  color: #a16207;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Class Relation (extends / implements / use) ── */
.class-relation {
  font-size: 13px;
  color: #475569;
  margin: 2px 0;
}
.class-relation:first-child { margin-top: 4px; }

/* ── Section Heading (namespace / class list) ── */
.main-content .section-heading {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
  border-bottom: 1px solid #e8e0d4;
  padding-bottom: 4px;
  margin: 16px 0 8px;
}
.main-content .section-heading a {
  color: #1e293b;
  text-decoration: none;
}

/* ── Package Cards (TOP page) ── */
.pkg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.pkg-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e8e0d4;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(185,101,45,0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.pkg-card:hover {
  border-color: #d4956a;
  background: #fff7ee;
  box-shadow: 0 6px 20px rgba(185,101,45,0.1);
  text-decoration: none;
}
.pkg-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff4e9;
  color: #b9652d;
  font-size: 20px;
}
.pkg-card-body { flex: 1; min-width: 0; }
.pkg-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #4a3d2e;
}
.pkg-card-desc {
  margin-top: 4px;
  font-size: 13px;
  color: #7a6e5e;
  line-height: 1.5;
}
.pkg-card-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: #d4956a;
  font-weight: 700;
}

/* ── Namespace Cards Container ── */
.ns-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ── Namespace Section ── */
.ns-section { margin-bottom: 24px; }

/* ── Class List Table ── */
.class-link {
  font-weight: 600;
}
.class-desc {
  color: #475569;
  font-size: 13px;
}

/* ── Inherit Class Name (in inherited tables) ── */
.inherit-class-name {
  color: #64748b;
  font-size: 12px;
}

/* Search UI は /css/search.css に分離済み */

