/* =====================================================
   GIÁO XỨ QUANG LÂM — CÂY KÝ SỬ (CHRONICLE TREE)
   assets/css/chronicle.css
   ===================================================== */

.chronicle-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem var(--sp-md);
}

.chronicle-header-box {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(108, 75, 255, 0.15), rgba(0, 180, 216, 0.1));
  border: 1px solid rgba(108, 75, 255, 0.25);
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
}
.chronicle-header-box::before {
  content: '📜';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 100px;
  opacity: 0.08;
  pointer-events: none;
}

/* ── Tree Trunk & Branches ── */
.chronicle-tree {
  position: relative;
  padding: 2rem 0;
}
.chronicle-tree::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary), var(--accent));
  transform: translateX(-50%);
  border-radius: var(--r-f);
  box-shadow: 0 0 15px rgba(108, 75, 255, 0.4);
}

/* ── Era Header Marker ── */
.era-marker {
  position: relative;
  z-index: 3;
  text-align: center;
  margin: 3rem auto 2.5rem;
  display: flex;
  justify-content: center;
}
.era-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg-surface);
  border: 2px solid var(--primary);
  border-radius: var(--r-f);
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 20px rgba(108, 75, 255, 0.35);
}

/* ── Tree Nodes / Events ── */
.tree-node {
  position: relative;
  margin-bottom: 2.5rem;
  display: flex;
  width: 100%;
}
.tree-node--left {
  justify-content: flex-start;
  padding-right: calc(50% + 30px);
}
.tree-node--right {
  justify-content: flex-end;
  padding-left: calc(50% + 30px);
}

/* Branch connector */
.tree-node::after {
  content: '';
  position: absolute;
  top: 24px;
  width: 30px;
  height: 2px;
  background: var(--primary);
  opacity: 0.6;
}
.tree-node--left::after {
  right: 50%;
}
.tree-node--right::after {
  left: 50%;
}

/* Center node point */
.tree-node-dot {
  position: absolute;
  left: 50%;
  top: 17px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--bg-base);
  box-shadow: 0 0 0 4px rgba(108, 75, 255, 0.3);
  z-index: 2;
  transition: all var(--t-fast);
}
.tree-node:hover .tree-node-dot {
  transform: translateX(-50%) scale(1.3);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* Node Content Card */
.node-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  transition: all var(--t-mid);
  position: relative;
}
.node-card:hover {
  background: var(--bg-hover);
  border-color: rgba(108, 75, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.node-year-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary-light);
  background: rgba(108, 75, 255, 0.15);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  margin-bottom: 0.5rem;
}
.node-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.node-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
}
.node-img {
  margin-top: 1rem;
  border-radius: var(--r-md);
  overflow: hidden;
  max-height: 220px;
}
.node-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Responsive Tree ── */
@media(max-width: 768px) {
  .chronicle-tree::before {
    left: 20px;
  }
  .tree-node--left, .tree-node--right {
    padding-left: 50px;
    padding-right: 0;
    justify-content: flex-start;
  }
  .tree-node::after {
    left: 20px !important;
    right: auto !important;
    width: 30px;
  }
  .tree-node-dot {
    left: 20px !important;
  }
}
