/* ==========================================================
   Fulltext Judgment Display — fulltext.css
   Embedded within case pages (cases/case-*.html)
   ========================================================== */

/* --- Container --- */
.rt-cp-fulltext {
  margin: var(--rt-space-lg, 2rem) 0;
}
.rt-cp-fulltext h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Metadata badges */
.ft-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 0.75rem;
}
.ft-meta-item {
  font-size: 0.78rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
}

/* --- Outer toggle --- */
.ft-container {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.ft-toggle {
  cursor: pointer;
  padding: 14px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e40af;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  user-select: none;
  list-style: none;
  transition: background 0.2s;
}
.ft-toggle:hover {
  background: linear-gradient(135deg, #dbeafe, #dcfce7);
}
.ft-toggle::-webkit-details-marker { display: none; }
.ft-container[open] .ft-toggle {
  border-bottom: 1px solid #e5e7eb;
}

/* --- Inner body --- */
.ft-body {
  padding: 16px 20px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fafbfc;
}

/* --- Section toggle --- */
.ft-section {
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}
.ft-section-title {
  cursor: pointer;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}
.ft-section-title:hover { background: #f3f4f6; }
.ft-section-title::-webkit-details-marker { display: none; }
.ft-section-title::before {
  content: '▶ ';
  font-size: 0.7rem;
  color: #9ca3af;
  transition: transform 0.15s;
}
.ft-section[open] .ft-section-title::before {
  content: '▼ ';
}

/* Section color accents */
.ft-section-judgment .ft-section-title {
  border-left: 3px solid #2563eb;
  color: #1e40af;
}
.ft-section-claim .ft-section-title {
  border-left: 3px solid #d97706;
  color: #92400e;
}

/* --- Section body text --- */
.ft-section-body {
  padding: 12px 16px;
  font-size: 0.82rem;
  line-height: 1.85;
  color: #374151;
  word-break: break-all;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
}

/* --- Keyword highlight --- */
.ft-highlight {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

/* --- Source attribution --- */
.ft-source {
  font-size: 0.75rem;
  color: #9ca3af;
  padding: 8px 20px 12px;
  margin: 0;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* --- Section color accents: judgment body --- */
.ft-section-judgment .ft-section-body {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
}

/* --- Party split (原告/被告) --- */
.ft-party {
  margin: 12px 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.ft-party-plaintiff {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}
.ft-party-defendant {
  border: 1px solid #fecaca;
  background: #fef2f2;
}
.ft-party-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  margin: 0;
}
.ft-label-plaintiff {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}
.ft-label-defendant {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}
.ft-party-content {
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.85;
}

/* --- Fulltext legend --- */
.ft-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}
.ft-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #4b5563;
}
.ft-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --- In-page search box --- */
.ft-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ft-search-input {
  width: 160px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.8rem;
  outline: none;
}
.ft-search-input::placeholder { color: rgba(255,255,255,0.6); }
.ft-search-input:focus { background: rgba(255,255,255,0.25); border-color: #fff; }

/* --- Inline fulltext search bar (visible in fulltext section) --- */
.ft-inline-search {
  margin: 12px 0;
}
.ft-inline-input {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.88rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.ft-inline-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.ft-inline-input::placeholder { color: #9ca3af; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .ft-body { padding: 10px 12px; max-height: 50vh; }
  .ft-section-body { font-size: 0.78rem; padding: 8px 10px; }
  .ft-toggle { padding: 12px 14px; font-size: 0.85rem; }
  .ft-party { padding: 8px 10px; }
}
