/* EraArchive — components.css */

/* Article / section card */
.card {
  background: var(--color-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin-top: 0; }
.card--link {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card--link:hover, .card--link:focus {
  border-color: var(--color-accent-dark);
  transform: translateY(-2px);
}
.card--link .eyebrow { display: block; margin-bottom: 0.4em; }
.card--link h3 { color: var(--color-text); }

/* Fakta perlu disemak plate */
.fakta-plate {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px dashed var(--color-accent-dark);
  border-radius: var(--radius);
  background: rgba(184,115,51,0.08);
  padding: 14px 16px;
  margin: 1.2em 0;
  font-size: 0.95rem;
}
.fakta-plate svg { flex-shrink: 0; margin-top: 2px; }
.fakta-plate strong { color: var(--color-accent-dark); }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  padding: 14px 0;
  color: var(--color-text);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--color-accent-dark);
}

/* Pill filter buttons (decade filter) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}
.pill {
  border: 1px solid var(--color-accent-dark);
  background: transparent;
  color: var(--color-text);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}
.pill[aria-pressed="true"] {
  background: var(--color-accent-dark);
  color: var(--color-light);
}
.pill:hover { border-color: var(--color-dark); }

/* Graph container */
.graph-wrap {
  background: var(--color-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.graph-scroll {
  overflow-x: auto;
}
#network-graph svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 480px;
}
.graph-node circle {
  fill: var(--color-light);
  stroke: var(--color-accent-dark);
  stroke-width: 2;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
.graph-node.type-society circle { fill: #E4C9A6; }
.graph-node.type-location circle { fill: #EFE6D8; }
.graph-node text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  fill: var(--color-text);
  pointer-events: none;
}
.graph-node { cursor: pointer; }
.graph-node.is-muted { opacity: 0.3; }
.graph-node.is-active circle,
.graph-node:hover circle,
.graph-node:focus circle {
  stroke: var(--color-dark);
  stroke-width: 3;
}
.graph-node.is-selected circle {
  stroke: var(--color-accent-dark);
  stroke-width: 4;
}
.graph-edge {
  stroke: var(--color-accent-dark);
  stroke-width: 1.5;
  opacity: 0.55;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
.graph-edge.is-muted { opacity: 0.08; }
.graph-edge.is-active { opacity: 1; stroke-width: 2.5; }

@media (prefers-reduced-motion: reduce) {
  .graph-node circle, .graph-edge { transition: none; }
}

@media (max-width: 480px) {
  #network-graph { display: none; }
  .graph-fallback-list { display: block !important; }
}

/* Info card (node detail) */
.node-card {
  border: 1px solid var(--color-accent-dark);
  border-radius: var(--radius);
  background: var(--color-light);
  padding: 18px;
  margin-top: 16px;
  max-height: 340px;
  overflow-y: auto;
}
.node-card[hidden] { display: none; }
.node-card h3 { margin-top: 0; }
.node-card .eyebrow { display: block; margin-bottom: 0.4em; }
.node-card__close {
  float: right;
  background: transparent;
  border: 1px solid var(--color-accent-dark);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 0.85rem;
}
.node-card__relations {
  list-style: none;
  padding: 0;
  margin: 0.8em 0 0;
}
.node-card__relations li {
  border-top: 1px solid var(--color-border);
  padding: 8px 0;
}
.empty-state {
  border: 1px dashed var(--color-accent-dark);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  color: var(--color-text);
}

/* Fallback text list under graph */
.graph-fallback-list h3 { margin-top: 1.4em; }
.graph-fallback-list ul { margin-bottom: 1.2em; }

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-item summary {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 14px;
  font-family: var(--font-body);
  color: var(--color-accent-dark);
  font-size: 1.4rem;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-answer { padding-bottom: 16px; }

/* Source list */
.source-list { list-style: none; padding: 0; }
.source-list li {
  border-left: 3px solid var(--color-accent);
  padding: 8px 0 8px 14px;
  margin-bottom: 10px;
}

/* Table */
table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
th { font-family: var(--font-heading); font-weight: 600; }

/* Decorative divider motif */
.motif-divider {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border: none;
  margin: 0;
}

/* 404 */
.not-found {
  text-align: center;
  padding: 80px 0;
}
