/* ===================================================
   Court Claim Templates — Public Styles  v1.3.1
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

.cct-widget {
  --cct-navy:        #0b2340;
  --cct-navy-hover:  #122d52;
  --cct-blue:        #1a5fa3;
  --cct-blue-light:  #e8f1fb;
  --cct-gold:        #b07d0c;
  --cct-gold-light:  #fdf3d8;
  --cct-gold-hover:  #9a6c09;
  --cct-bg:          #f0f4f9;
  --cct-surface:     #ffffff;
  --cct-border:      #dde4ef;
  --cct-text:        #1a2740;
  --cct-muted:       #586a84;
  --cct-radius-lg:   20px;
  --cct-radius-md:   14px;
  --cct-radius-sm:   10px;
  --cct-shadow-card: 0 4px 24px rgba(11, 35, 64, 0.09), 0 1px 4px rgba(11, 35, 64, 0.06);
  --cct-shadow-btn:  0 4px 12px rgba(176, 125, 12, 0.22);
  --cct-transition:  0.18s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: 'Source Sans 3', inherit;
  color: var(--cct-text);
  line-height: 1.5;
}

.cct-widget * {
  box-sizing: border-box;
}

.cct-widget button,
.cct-widget input,
.cct-widget select,
.cct-widget textarea,
.cct-widget a {
  font: inherit;
}

/* ── Layout ───────────────────────────────────────── */

.cct-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  background: var(--cct-bg);
  border-radius: var(--cct-radius-lg);
  padding: 20px;
}

.cct-sidebar,
.cct-preview {
  background: var(--cct-surface);
  border: 1px solid var(--cct-border);
  border-radius: var(--cct-radius-lg);
  box-shadow: var(--cct-shadow-card);
}

/* ── Sidebar ──────────────────────────────────────── */

.cct-sidebar {
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 20px;
}

.cct-sidebar-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cct-border);
  margin-bottom: 16px;
}

.cct-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cct-blue);
  margin-bottom: 6px;
}

.cct-eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--cct-blue);
  border-radius: 2px;
}

.cct-sidebar h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--cct-navy);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ── Search ───────────────────────────────────────── */

.cct-search-wrap {
  margin-bottom: 16px;
  position: relative;
}

.cct-search-wrap::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23586a84' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='m13 13 3.5 3.5'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
  opacity: 0.7;
}

.cct-search {
  width: 100%;
  border: 1.5px solid var(--cct-border);
  border-radius: var(--cct-radius-md);
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  outline: none;
  background: var(--cct-bg);
  color: var(--cct-text);
  transition: border-color var(--cct-transition), box-shadow var(--cct-transition), background var(--cct-transition);
}

.cct-search::placeholder {
  color: var(--cct-muted);
}

.cct-search:focus {
  border-color: var(--cct-blue);
  box-shadow: 0 0 0 3px rgba(26, 95, 163, 0.12);
  background: var(--cct-surface);
}

/* ── Tree list ────────────────────────────────────── */

.cct-list {
  max-height: 720px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--cct-border) transparent;
}

.cct-list::-webkit-scrollbar { width: 5px; }
.cct-list::-webkit-scrollbar-track { background: transparent; }
.cct-list::-webkit-scrollbar-thumb { background: var(--cct-border); border-radius: 99px; }

.cct-tree-group {
  margin-bottom: 8px;
  border-radius: var(--cct-radius-md);
  overflow: hidden;
  border: 1px solid var(--cct-border);
}

/* Parent accordion button */
.cct-tree-parent {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  color: #fff;
  background: var(--cct-navy);
  border: 0;
  border-radius: 0;
  padding: 12px 14px 12px 40px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--cct-transition);
}

.cct-tree-parent:hover,
.cct-tree-parent:focus {
  background: var(--cct-navy-hover);
  outline: none;
}

.cct-tree-parent:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}

/* Chevron icon via SVG background */
.cct-tree-parent::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3l4 4-4 4'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform var(--cct-transition);
}

.cct-tree-group.is-open .cct-tree-parent::before {
  transform: translateY(-50%) rotate(270deg);
}

/* Children panel */
.cct-tree-children {
  background: var(--cct-surface);
  padding: 10px 10px 10px 12px;
  border-top: 1px solid var(--cct-border);
}

.cct-tree-group.is-collapsed .cct-tree-children {
  display: none;
}

/* Sub-category label */
.cct-tree-child {
  margin-bottom: 8px;
}

.cct-tree-child-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cct-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 6px 0 5px;
}

.cct-tree-child-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cct-blue);
  flex-shrink: 0;
}

.cct-tree-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cct-tree-direct-items {
  margin-bottom: 6px;
}

.cct-tree-child .cct-tree-items {
  padding-left: 10px;
}

/* Item buttons */
.cct-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  text-align: left;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--cct-radius-sm);
  padding: 9px 10px;
  cursor: pointer;
  transition: background var(--cct-transition), border-color var(--cct-transition), color var(--cct-transition);
  color: var(--cct-text);
}

.cct-item:hover {
  background: var(--cct-blue-light);
  border-color: rgba(26, 95, 163, 0.2);
}

.cct-item:focus-visible {
  outline: 2px solid var(--cct-blue);
  outline-offset: 1px;
}

.cct-item.is-active {
  background: var(--cct-gold-light);
  border-color: rgba(176, 125, 12, 0.35);
  color: var(--cct-gold-hover);
}

.cct-item.is-active .cct-item-title {
  font-weight: 700;
}

.cct-item-title {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
}

/* Empty states */
.cct-no-item {
  display: inline-block;
  color: var(--cct-muted);
  background: var(--cct-bg);
  border: 1.5px dashed var(--cct-border);
  border-radius: var(--cct-radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}

.cct-empty {
  color: var(--cct-muted);
  margin: 0;
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

/* ── Preview panel ────────────────────────────────── */

.cct-preview {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cct-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--cct-border);
  background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
}

.cct-preview-title-wrap {
  min-width: 0;
  flex: 1;
}

.cct-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cct-muted);
  margin-bottom: 6px;
}

.cct-preview-head h3 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--cct-navy);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.cct-current-desc {
  margin: 6px 0 0;
  color: var(--cct-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Download button */
.cct-word-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 200px;
  white-space: nowrap;
  background: var(--cct-gold);
  color: #fff;
  border-radius: var(--cct-radius-md);
  padding: 11px 18px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: center;
  box-shadow: var(--cct-shadow-btn);
  transition: background var(--cct-transition), box-shadow var(--cct-transition), transform var(--cct-transition);
  flex-shrink: 0;
}

.cct-word-link::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3v10M6 9l4 4 4-4M4 16h12'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

.cct-word-link:hover,
.cct-word-link:focus {
  color: #fff;
  background: var(--cct-gold-hover);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(176, 125, 12, 0.3);
  transform: translateY(-1px);
  outline: none;
}

.cct-word-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(176, 125, 12, 0.4);
}

.cct-word-link:active {
  transform: translateY(0);
}

.cct-word-link.is-hidden {
  display: none;
}

/* Info row */
.cct-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--cct-border);
  color: var(--cct-muted);
  font-size: 12.5px;
  background: #fafbfd;
  min-height: 38px;
}

.cct-info-row span:empty {
  display: none;
}

/* Frame area */
.cct-frame-wrap {
  position: relative;
  background: #f8fafc;
  flex: 1;
}

.cct-frame {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
}

.cct-frame.is-hidden {
  display: none;
}

.cct-no-doc {
  display: none;
  padding: 64px 24px;
  text-align: center;
  color: var(--cct-muted);
  font-size: 14px;
}

.cct-no-doc.is-visible {
  display: block;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 980px) {
  .cct-layout {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }

  .cct-sidebar {
    position: static;
  }

  .cct-list {
    max-height: 400px;
  }
}

@media (max-width: 640px) {
  .cct-preview-head {
    flex-direction: column;
    gap: 12px;
  }

  .cct-word-link {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 560px) {
  .cct-preview-head h3 {
    font-size: 18px;
  }

  .cct-sidebar h2 {
    font-size: 17px;
  }

  .cct-tree-children {
    padding: 8px;
  }
}
