/* =========================================
   AThetalife • timeline.css (v1.3 stable repaired)
   Horizontal timeline + notes + lifespan progress
   ========================================= */

/* =========================================
   Timeline page layout
   ========================================= */

.page-your-timeline .wp-site-blocks > main,
body.page-id-26 .wp-site-blocks > main {
  margin-top: 0;
}

.timeline-main {
  max-width: 1120px;
  margin: -2rem auto 0 auto;
  padding: 0 var(--space-4) var(--space-8);
}

.timeline-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: var(--space-1) !important;
}

.timeline-header h1 {
  margin-top: 0 !important;
}

.timeline-header-section {
  margin-bottom: var(--space-3);
}

#timeline-title {
  font-size: var(--fs-600);
  line-height: 1.2;
  text-align: center;
}

.timeline-subtitle {
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.timeline-range {
  font-weight: 700;
  text-align: center;
  width: 100%;
  margin: 0.25rem auto 0.5rem auto;
}

.timeline-actions {
  margin-bottom: var(--space-4);
}

#timeline-range {
  display: block;
  width: 100%;
  text-align: center !important;
  margin: 0.25rem auto 0.5rem auto;
  font-weight: 700;
}

.timeline-view-section {
  border-radius: var(--radius-3, 16px);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}

.timeline-scroll-hint {
  font-size: var(--fs-300);
  color: var(--muted);
  margin-bottom: var(--space-3);
}

/* =========================================
   Timeline container
   ========================================= */

#timeline-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: var(--space-4);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-7);
  box-sizing: border-box;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

#timeline-container .timeline-year {
  flex: 0 0 auto;
  margin-right: var(--space-3);
}

#timeline-container .timeline-year:last-child {
  margin-right: 0;
}

#timeline-container .timeline-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
}

/* =========================================
   Individual year tick
   ========================================= */

.timeline-year {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  scroll-snap-align: center;
}

.timeline-year:hover {
  transform: translateY(-2px);
}

.timeline-year-line {
  width: 2px;
  height: 32px;
  background: var(--border);
  margin-bottom: var(--space-1);
}

/* Birth year */
.timeline-year--birth .timeline-year-line {
  background: var(--accent-amber, #b9924a);
}

.timeline-year--birth .timeline-year-label {
  color: var(--accent-amber, #b9924a);
  font-weight: 600;
}

.timeline-year--current {
  background: #fff7c2;
  border-radius: 12px;
  color: #000 !important;
}

.timeline-year--current .timeline-year-label {
  color: #000 !important;
  font-weight: 700;
}

.timeline-year--current .timeline-year-line {
  background: #000 !important;
}

.timeline-year--end .timeline-year-label {
  color: var(--accent-red, #d9534f);
  font-weight: 600;
}

/* Year has notes */
.timeline-year--has-notes .timeline-year-label::after {
  content: "•";
  margin-left: 0.15rem;
  font-size: 0.8em;
  color: var(--accent-amber, #b9924a);
}

/* =========================================
   You Are Here indicator
   ========================================= */

.you-are-here {
  margin-top: var(--space-3);
  font-size: var(--fs-300);
}

.you-are-here .flag {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-right: var(--space-2);
}

.you-are-here .year-label {
  color: var(--muted);
}

/* =========================================
   Notes panel
   ========================================= */

.year-notes-title {
  font-weight: 700;
  margin: 0;
}

#year-notes-panel,
.year-notes-panel {
  margin-top: var(--space-4);
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
}

#year-notes-panel,
.year-notes-panel {
  scroll-margin-top: 1.5rem;
}

.year-notes-panel-inner {
  background: var(--bg);
  border: 1px solid #000;
  border-radius: var(--radius-3, 16px);
  padding: var(--space-4);
}

.year-notes-heading h2 {
  font-size: var(--fs-500);
  margin: 0;
}

.year-notes-heading .year-label {
  font-size: var(--fs-300);
  color: var(--muted);
}

.year-notes-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-2, 10px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  margin-bottom: var(--space-3);
}

.year-notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.year-notes-actions .btn {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.year-notes-actions .btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.year-notes-actions .btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.year-notes-actions .btn-danger {
  background: transparent;
  border: 1px solid var(--accent-red, #d9534f);
  color: var(--accent-red, #d9534f);
}

.year-notes-status {
  margin-top: var(--space-2);
  font-size: var(--fs-300);
  color: var(--muted);
}

/* =========================================
   Lifespan progress bar
   ========================================= */

.lifespan-progress-wrapper {
  position: relative;
  margin-top: 0;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid #2f5fa7;
  border-radius: var(--radius-2, 10px);
}

.lifespan-current-year {
  position: absolute;
  top: 2px;
  left: 0;
  transform: translateX(-50%);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  z-index: 3;
}

.lifespan-current-year::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 1px;
  width: 2px;
  height: 6px;
  background: var(--brand);
  transform: translateX(-50%);
}

.lifespan-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.lifespan-progress-title {
  text-align: center;
  font-size: var(--fs-300);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.lifespan-progress-bar {
  position: relative;
  height: 24px;
  width: 100%;
  background: #e8e6df;
  border-radius: 12px;
  overflow: hidden;
  margin-top: var(--space-0);
}

/* Past (light brown) */
#lifespan-progress-past {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #5a3d2a;
  width: 0%;
  transition: width 0.6s ease;
}

/* Future (green) */
#lifespan-progress-future {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #2f8e4f;
  width: 0%;
  transition: width 0.6s ease, left 0.6s ease;
}

/* Final 10% (yellow) */
#lifespan-progress-final {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 10%;
  background: #e6b800;
}

/* =========================================
   Lifespan progress legend
   ========================================= */

.lifespan-legend {
  margin-top: var(--space-3);
  display: grid;
  gap: 0.45rem;
  text-align: center;
}

.lifespan-legend {
  margin-top: var(--space-4);
}

.lifespan-legend-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: var(--fs-300);
  line-height: 1.45;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  margin-right: 0.2rem;
  vertical-align: middle;
}

.legend-swatch-brown {
  background: #5a3d2a;
}

.legend-swatch-green {
  background: #2f8e4f;
}

.legend-swatch-yellow {
  background: #e6b800;
}

.legend-key {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.legend-brown {
  color: #5a3d2a;
}

.legend-green {
  color: #2f8e4f;
}

.legend-yellow {
  color: #e6b800;
}

.legend-dash {
  color: #000;
  font-weight: 600;
}

.legend-text {
  color: #000;
}

.legend-text em {
  font-style: italic;
}

/* Mobile tightening */
@media (max-width: 640px) {
  .lifespan-legend-item {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .legend-swatch {
    width: 11px;
    height: 11px;
  }

/* NOTE:
   This file currently mirrors /styles/timeline.css.
   After MVP stabilization, consolidate to a single timeline.css source.
*/