/* ==========================================================================
   work.css — Work experience: clean single-rail timeline (light)
   Depends on theme.css + blog.css. The Work page does NOT load Bootstrap,
   so .container / .row here are ours (no grid-class collision).
   ========================================================================== */

.timeline {
  position: relative;
  max-width: 780px;
  margin: 12px auto 0;
  padding: 4px 0;
}

/* The rail */
.timeline::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--border-strong) 6%, var(--border-strong) 94%, transparent);
}

/* Every entry sits to the right of the rail (single column, any width) */
.timeline .container,
.timeline .container.left,
.timeline .container.right {
  position: relative;
  width: 100%;
  left: 0;
  padding: 0 0 26px 40px;
  background: transparent;
}

.timeline .container:last-child {
  padding-bottom: 0;
}

/* Node on the rail */
.timeline .container::after,
.timeline .container.left::after,
.timeline .container.right::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 1px;
  right: auto;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Content card */
.content {
  position: relative;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.content:hover {
  transform: translateY(-2px);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow);
}

/* Date label */
.content h2 {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.content h4 {
  margin: 6px 0 4px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
}

.content b {
  color: var(--text);
}

.content ul {
  margin: 8px 0 6px;
  padding-left: 1.15em;
}

.content li {
  margin-bottom: 6px;
  color: var(--text-muted);
  line-height: 1.6;
}

.content li::marker {
  color: var(--accent);
}

.content p {
  margin: 6px 0;
  line-height: 1.7;
}

/* Reset the inner .entry so it doesn't render as a second card */
.content .entry {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.content .entry:hover {
  background: none;
}

/* Tidy, uniform company logos (override the media-logo-% widths) */
.content img[class^="media-logo"] {
  display: inline-block;
  height: 34px;
  width: auto;
  max-width: 150px;
  margin: 0 10px 12px 0;
  vertical-align: middle;
  object-fit: contain;
  background: none;
  border: 0;
  padding: 0;
}

/* Embedded video rows: always 2 equal columns so all iframes are the same size */
.content .row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.content .row iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ==========================================================================
   Work page — sidebar nav layout
   ========================================================================== */
.work-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 28px;
}

.work-layout .timeline {
  max-width: 100%;
  margin: 0;
}

.work-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.work-nav {
  list-style: none;
  padding: 6px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-nav li { margin: 0; }

.work-nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: none !important;
  line-height: 1.3;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.work-nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.work-nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.work-nav-date {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
}

.work-nav-link.is-active .work-nav-date {
  color: inherit;
  opacity: 0.75;
}

/* Scroll target offset — each container clears the sticky nav */
.timeline .container[id] {
  scroll-margin-top: calc(var(--nav-h) - 52px);
}

@media (max-width: 760px) {
  .work-layout {
    grid-template-columns: 1fr;
    gap: 0;
    overflow-x: clip;
    overflow-y: visible;
  }

  .work-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 4px);
    z-index: 90;
    background: var(--bg);
    padding-bottom: 14px;
    margin-bottom: 0;
  }

  .work-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .work-nav li { flex: 0 0 auto; }

  .work-nav-link {
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
    border: 1px solid var(--border);
    flex-direction: row;
    gap: 4px;
    align-items: center;
  }

  .work-nav-link.is-active { border-color: var(--accent-ring); }
  .work-nav-date { display: none; }

  /* The desktop offset above is tuned for the vertical sidebar layout and
     throws off scroll position once the nav becomes a horizontal strip —
     fall back to the site's normal scroll-padding-top baseline on mobile. */
  .timeline .container[id] {
    scroll-margin-top: 0;
  }
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 600px) {
  .timeline .container,
  .timeline .container.left,
  .timeline .container.right {
    padding-left: 32px;
  }

  .content {
    padding: 16px 16px;
  }

  .content .row {
    grid-template-columns: 1fr;
  }
}
