/* Weehawken History Timeline. Adapted from timeline_template.html (Weehawken History Timeline/Timeline Page). */
/* All styles are scoped to #wtm-timeline so the block can be embedded in another page. */
#wtm-timeline {
  --bg: var(--paper, #efe3c8);
  --panel: #fffaf0;
  --ink: #2b1d12;
  --muted: #5b4630;
  --line: #c9b07a;
  --accent: #7b2a22;
  --accent-soft: #f7efdb;
  --conflict: #a15c00;
  --conflict-soft: #fff3dc;
  --mark: #ffe58a;
  --focus: #1f5f99;
  font-family: 'Libre Baskerville', Georgia, serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 32px 48px;
  width: 100%;
  box-sizing: border-box;
}
#wtm-timeline *, #wtm-timeline *::before, #wtm-timeline *::after { box-sizing: border-box; }
#wtm-timeline .wtm-head h1 { font-family: 'Playfair Display', serif; font-weight: 800; font-size: 38px; line-height: 1.15; margin: 4px 0 6px; }
#wtm-timeline .wtm-head p { margin: 0 0 16px; color: var(--muted); font-size: .98rem; }

/* Controls */
#wtm-timeline .wtm-controls {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 12px 0 10px; border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
#wtm-timeline .wtm-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
#wtm-timeline label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: .8rem; }
#wtm-timeline input[type=search], #wtm-timeline input[type=number], #wtm-timeline select {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-height: 38px;
}
#wtm-timeline .wtm-search { flex: 1 1 280px; }
#wtm-timeline .wtm-search input { width: 100%; }
#wtm-timeline input[type=number] { width: 92px; }
#wtm-timeline select { max-width: 220px; }
#wtm-timeline .wtm-check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: .9rem; min-height: 38px; }
#wtm-timeline button {
  font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 11px; min-height: 38px;
}
#wtm-timeline button:hover { border-color: var(--accent); }
#wtm-timeline :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#wtm-timeline .wtm-status { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; color: var(--muted); }
#wtm-timeline .wtm-eras { display: flex; flex-wrap: wrap; gap: 6px; }
#wtm-timeline .wtm-eras button { font-size: .8rem; padding: 4px 9px; min-height: 30px; border-radius: 999px; }

/* Timeline */
#wtm-timeline .wtm-era-h {
  font-family: 'Playfair Display', serif; font-weight: 800; font-size: 1.7rem; margin: 34px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--accent);
  scroll-margin-top: 210px;
}
#wtm-timeline .wtm-list { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 3px solid var(--line); margin-left: 70px; }
#wtm-timeline .wtm-year {
  position: relative; list-style: none; margin: 18px 0 6px -26px; height: 0;
}
#wtm-timeline .wtm-year span {
  position: absolute; left: -84px; top: -12px; width: 70px; text-align: right;
  font-weight: bold; color: var(--accent); font-size: 1.05rem;
}
#wtm-timeline .wtm-ev { position: relative; margin: 8px 0; scroll-margin-top: 210px; }
#wtm-timeline .wtm-ev::before {
  content: ""; position: absolute; left: -34px; top: 15px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--panel); border: 3px solid var(--accent);
}
#wtm-timeline .wtm-ev.has-conflict::before { border-color: var(--conflict); }
#wtm-timeline .wtm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#wtm-timeline .wtm-ev.open .wtm-card { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
#wtm-timeline .wtm-toggle {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent;
  padding: 10px 14px; min-height: 0; font-family: inherit; font-size: 1rem;
}
#wtm-timeline .wtm-toggle:hover { background: var(--accent-soft); }
#wtm-timeline .wtm-date { display: block; font-family: 'Special Elite', monospace; font-size: .8rem; color: var(--accent); font-weight: 600; letter-spacing: .02em; }
#wtm-timeline .wtm-title { display: block; font-size: 1.04rem; margin-top: 1px; }
#wtm-timeline .wtm-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; font-family: 'Special Elite', monospace; }
#wtm-timeline .wtm-badge { font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); }
#wtm-timeline .wtm-badge.conf { background: var(--conflict-soft); color: var(--conflict); border-color: var(--conflict); font-weight: 600; }
#wtm-timeline .wtm-chev { float: right; color: var(--muted); font-family: 'Special Elite', monospace; margin-left: 8px; transition: transform .15s; }
#wtm-timeline .wtm-ev.open .wtm-chev { transform: rotate(90deg); }
#wtm-timeline .wtm-body { padding: 4px 16px 14px; border-top: 1px dashed var(--line); }
#wtm-timeline .wtm-body p { margin: 10px 0; }
#wtm-timeline .wtm-body .lbl { font-family: 'Special Elite', monospace; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 1px; }
#wtm-timeline .wtm-src { font-size: .92rem; }
#wtm-timeline .wtm-note { color: var(--ink); margin: 8px 0 0; font-size: .92rem; padding: 7px 10px; border-left: 3px solid var(--line); background: var(--bg); border-radius: 0 6px 6px 0; }
#wtm-timeline .wtm-note.conflict { border-left-color: var(--conflict); background: var(--conflict-soft); }
#wtm-timeline .wtm-actions { display: flex; gap: 8px; justify-content: flex-end; font-family: 'Special Elite', monospace; }
#wtm-timeline .wtm-actions button { font-size: .78rem; padding: 4px 9px; min-height: 30px; }
#wtm-timeline mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
#wtm-timeline .wtm-empty { padding: 30px; text-align: center; color: var(--muted); font-family: 'Special Elite', monospace; }
#wtm-timeline details.wtm-sources { margin-top: 40px; font-size: .9rem; }
#wtm-timeline details.wtm-sources summary { cursor: pointer; font-weight: bold; font-size: 1.05rem; }
#wtm-timeline details.wtm-sources li { margin: 6px 0; }
#wtm-timeline .wtm-foot { margin-top: 18px; color: var(--muted); font-size: .85rem; }

@media (max-width: 640px) {
  #wtm-timeline .wtm-list { margin-left: 8px; padding-left: 20px; }
  #wtm-timeline .wtm-year span { position: static; display: block; width: auto; text-align: left; margin: 0 0 0 -2px; }
  #wtm-timeline .wtm-year { height: auto; margin: 16px 0 4px -20px; padding-left: 20px; }
  #wtm-timeline .wtm-ev::before { left: -28px; }
  #wtm-timeline .wtm-controls { position: static; }
  #wtm-timeline .wtm-era-h, #wtm-timeline .wtm-ev { scroll-margin-top: 10px; }
}
@media print {
  #wtm-timeline .wtm-controls, #wtm-timeline .wtm-actions { display: none; }
  #wtm-timeline .wtm-body { display: block !important; }
}

/* Added for the Weehawken Time Machine site */
#wtm-timeline .wtm-head .crumbs { font-family: 'Special Elite', monospace; font-size: 15px; }
#wtm-timeline .wtm-src a { white-space: nowrap; }
#wtm-timeline .wtm-ai { font-size: .9rem; margin: -6px 0 14px; padding: 8px 12px; background: var(--accent-soft); border-left: 4px solid var(--brass, #b08a3c); }
#wtm-timeline .wtm-badge { font-family: 'Special Elite', monospace; }
@media (max-width: 640px) { #wtm-timeline { padding: 20px 14px 40px; } #wtm-timeline .wtm-head h1 { font-size: 30px; } }

/* Staff: editing one event on the page (public/js/timeline-edit.js) */
#wtm-timeline .wtm-edit-hint { font-size: .85rem; color: var(--muted); }
#wtm-timeline .wtm-actions { flex-wrap: wrap; align-items: center; }
#wtm-timeline .wtm-edited { font-size: .75rem; color: var(--muted); }
#wtm-timeline .wtm-editform { display: grid; gap: 4px; margin: 6px 0; padding: 12px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 6px; }
#wtm-timeline .wtm-editform label { font-weight: bold; margin-top: 8px; }
#wtm-timeline .wtm-editform input, #wtm-timeline .wtm-editform textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: .95rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
#wtm-timeline .wtm-editform textarea { resize: vertical; line-height: 1.45; }
#wtm-timeline .wtm-editform small { color: var(--muted); font-size: .8rem; }
#wtm-timeline .wtm-editform .wtm-edittip { margin-top: 8px; }
#wtm-timeline .wtm-editrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
#wtm-timeline .wtm-editrow button { min-height: 34px; padding: 4px 12px; }
#wtm-timeline .wtm-editrow .wtm-save { background: var(--accent); color: #fff; border-color: var(--accent); }
#wtm-timeline .wtm-editrow .wtm-revert { margin-left: auto; }
#wtm-timeline .wtm-editmsg { margin: 0; font-weight: bold; color: var(--accent); }
#wtm-timeline .wtm-editmsg:empty { display: none; }
