/* =========================================
   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;
  width: calc(100% -2rem);   /* 🔧 this is the fix */
  margin: 0.85rem auto 0 auto;
  padding: 0 0 var(--space-8);
  position: relative;
  left: -1.50rem;
}

.timeline-view-section {
  margin-top: 0.9rem;
  border-radius: var(--radius-3, 16px);
  background: linear-gradient(180deg, #fbfaf7 0%, #f3efe8 100%);
  border: 1px solid #b8ab98;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(90, 61, 42, 0.08);
  padding-top: var(--space-4);
  padding-right: var(--space-4);
  padding-bottom: var(--space-4);
  padding-left: calc(var(--space-4) - 8px);
  box-sizing: border-box;
}

.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);
  padding-top: 0.25rem;
}

#timeline-title {
  font-size: var(--fs-600);
  line-height: 1.2;
  text-align: center;
  margin: 0 0 0.35rem 0;
}

.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-range-line{
  text-align:center;
  font-size:1rem;
  font-weight:600;
  color:var(--color-ink, #21242a);
  margin:.3rem 0 .2rem; /* tighter than before */
}

.timeline-nudge {
  text-align: center;
  font-style: italic;
  margin-top: 1rem;
  opacity: 0.85;
}

.timeline-note {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 0.75rem;
}

/* 👇 ADD RIGHT HERE */
.timeline-edit-link{
  display:inline-block;
  margin-top:.2rem;
  margin-bottom:.65rem;
  font-size:.98rem;
  font-weight:600;
  color:#2f8e8c;
  text-decoration:none;
}

.timeline-edit-link:hover,
.timeline-edit-link:focus{
  text-decoration:underline;
}

/* Timeline action button style adjustment */

.timeline-actions .btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.timeline-actions .btn-ghost:hover,
.timeline-actions .btn-ghost:focus {
  background: #fff7c2;   /* same soft highlight used for current year */
  color: #000;
  border-color: #000;
}

.timeline-actions {
  margin-top: 0.5rem;
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: center;
}

#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: linear-gradient(180deg, #fbfaf7 0%, #f3efe8 100%);
  border: 1px solid #b8ab98;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(90, 61, 42, 0.08);
  padding-top: var(--space-4);
  padding-right: var(--space-4);
  padding-bottom: var(--space-4);
  padding-left: calc(var(--space-4) - 8px);
  box-sizing: border-box;
}

.timeline-scroll-hint{
  text-align:center;
  font-size:.95rem;
  line-height:1.45;
  color:var(--color-ink-muted, #5b6168);
  margin:0 0 .55rem;
}

/* -----------------------------------------
   Timeline return persistence note
   ----------------------------------------- */
.timeline-return-note {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #6b5a4a;
  text-align: center;
  opacity: 0.9;
}

/* =========================================
   Timeline container
   ========================================= */
#timeline-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto var(--space-7);
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 0.4rem;
  padding-bottom: var(--space-2);
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  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-start-hint {
  text-align: center;
  display: block;
  width: 100%;
  margin: 0.4rem auto 0.8rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-ink, #21242a);
  transition: opacity 0.4s ease;
}

.timeline-start-hint.is-faded {
  opacity: 0.25;
}

.timeline-trust {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.95rem;
  text-align: center;   /* ← THIS centers the text */
  color: #000;
  opacity: 0.85;
}

#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;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

 @media (max-width: 768px) {
  #timeline-container {
    padding-top: 0.4rem;
    padding-bottom: 0.75rem;
  }

  .timeline-year {
    width: 56px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .timeline-year-line {
    height: 24px;
  }

  .lifespan-progress-wrapper {
    padding: 0.75rem;
  }

  .lifespan-progress-bar {
    height: 16px;
  }

  .lifespan-progress-labels {
    font-size: 0.78rem;
  }

  .lifespan-current-year {
    font-size: 0.7rem;
  }
}

/* -----------------------------------------
   Early Access CTA
   ----------------------------------------- */
.early-access-cta {
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  padding: 0 var(--space-4);
}

.early-access-cta__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: #f6f1e7;
  border: 1px solid rgba(90, 61, 42, 0.18);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.early-access-cta__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b4d36;
}

.early-access-cta__title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.45rem, 2vw + 0.9rem, 2.1rem);
  line-height: 1.15;
  color: #2f241c;
}

.early-access-cta__text {
  margin: 0 auto 1.15rem;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.65;
  color: #3f3329;
}

.early-access-cta__button {
  margin-top: 0.25rem;
}

.early-access-cta__note {
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #5a4b3f;
}

@media (max-width: 640px) {
  .early-access-cta {
    padding: 0 var(--space-3);
  }

  .early-access-cta__inner {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .early-access-cta__text,
  .early-access-cta__note {
    font-size: 0.95rem;
  }
}

/* =========================================
   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);
}

.timeline-years-heading{
  margin-top:.2rem; /* this is key */
}

/* Ordinary year-label color coding only
   Past = brown, Future = green, Final zone = yellow */

.timeline-year--past .timeline-year-label {
  color: #5a3d2a;
}

.timeline-year--future .timeline-year-label {
  color: #2f8e4f;
}

.timeline-year--final-zone .timeline-year-label {
  color: #a17800;
  font-weight: 600;
}

/* 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);
  display: flex;
  align-items: center;
  justify-content: center;
}

.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: #000;
  font-weight: 700;
  font-size: 1.40rem;
  letter-spacing: 0.02em;
}

.year-separator {
  margin: 0 0.35rem;
  font-weight: 700;
  color: #000;
}

/* =========================================
   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);
}

.year-active {
  border: 2px solid rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

/* =========================================
   Lifespan progress bar
   ========================================= */

.lifespan-progress-wrapper {
  position: relative;
  margin-top: 0;
  margin-bottom:.4rem; /* was likely ~.7–1rem */
  padding: var(--space-4);
  border: 1px solid #2f5fa7;
  border-radius: var(--radius-2, 10px);
}

.lifespan-current-year {
  position: absolute;
  top: -8px;
  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: "";
  display: block;
  width: 2px;
  height: 18px;
  margin: 6px auto 0;
  background: #111;
  border-radius: 2px;
}

.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: 0.45rem;
}

.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 (single line)
   ========================================= */

.lifespan-legend {
  margin-top: 0.2rem;
  margin-bottom: 0.7rem;
  text-align: center;
}

.lifespan-legend-item {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  font-size: var(--fs-300);
  line-height: 1.4;
}

.legend-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,.35);
  margin-right: 0.15rem;
}

.legend-swatch-brown { background: #5a3d2a; }
.legend-swatch-green { background: #2f8e4f; }
.legend-swatch-yellow { background: #e6b800; }

.legend-key {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.legend-brown { color: #5a3d2a; }
.legend-green { color: #2f8e4f; }
.legend-yellow { color: #a17800; }

.legend-dash {
  margin: 0 0.2rem;
  font-weight: 600;
}

.legend-sep {
  margin: 0 0.6rem;
  opacity: 0.5;
}

.legend-text {
  color: var(--ink);
}

@media (max-width: 640px) {
  .lifespan-legend-item {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .legend-swatch {
    width: 11px;
    height: 11px;
  }
}

/* Timeline action button override */

.timeline-actions .btn.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.timeline-actions .btn.btn-ghost:hover,
.timeline-actions .btn.btn-ghost:focus {
  background: #fff7c2;     /* soft yellow highlight */
  color: #000;
  border-color: #000;
  box-shadow: none;
}

.lifespan-progress-wrapper{
  padding-bottom:.4rem !important;
  margin-bottom:.25rem !important;
}

.timeline-years-heading{
  margin-top:0 !important;
}

.timeline-section,
.timeline-years-section,
.timeline-main{
  padding-top: 0.9rem !important;
}

/* NOTE:
   This file currently mirrors /styles/timeline.css.
   After MVP stabilization, consolidate to a single timeline.css source.
*/

/* =========================================
   Timeline page button hover override
   Prevent dark global hover from fixpack
   ========================================= */

.timeline-actions .btn.btn-ghost:hover,
.timeline-actions .btn.btn-ghost:focus,
.timeline-actions .btn.btn-ghost:active {
  background: #fff7c2 !important;   /* soft highlight like current-year */
  color: #000 !important;
  border-color: #000 !important;
  box-shadow: none !important;
}

/* =========================================
   Timeline horizontal scrollbar styling
   ========================================= */

/* Chrome, Edge, Safari */
.timeline-scroll::-webkit-scrollbar {
  height: 10px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: #e6e6e6; /* light track */
  border-radius: 10px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  background: #4a7bd1; /* medium blue */
  border-radius: 10px;
}

.timeline-scroll::-webkit-scrollbar-thumb:hover {
  background: #355fa8; /* darker on hover */
}

/* Firefox */
.timeline-scroll {
  scrollbar-color: #4a7bd1 #e6e6e6;
  scrollbar-width: thin;
}

.timeline-scroll {
  cursor: grab;
}

.timeline-scroll:active {
  cursor: grabbing;
}