/**
 * Author Personal Blog Pro - Home Series Reading Timeline Widget Stylesheet
 * Scoped under: .apb-timeline-section
 */

.apb-timeline-section {
  background-color: var(--apb-color-bg-alt, var(--apb-color-surface-alt, #f1f5f9));
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
  position: relative;
}

.apb-timeline-section .apb-front-section-header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.apb-timeline-section .apb-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--apb-font-size-xs, 0.75rem);
  font-weight: 700;
  color: var(--apb-color-accent, #e07a5f);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--apb-space-2, 0.5rem);
}

.apb-timeline-section .apb-front-section-title {
  font-family: var(--apb-font-serif, "Playfair Display", Georgia, serif);
  font-size: var(--apb-font-size-h2, clamp(1.85rem, 3.5vw, 2.75rem));
  font-weight: 800;
  color: var(--apb-color-heading, #0f172a);
  line-height: var(--apb-line-height-h2, 1.25);
  margin: 0 0 var(--apb-space-2, 0.5rem) 0;
}

.apb-timeline-section .apb-front-section-subtitle {
  font-size: var(--apb-font-size-base, 1rem);
  color: var(--apb-color-text-muted, #64748b);
  line-height: var(--apb-line-height-relaxed, 1.75);
  margin: 0;
}

/* Timeline Wrapper & Connector Line */
.apb-timeline-wrapper {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--apb-space-4, 1rem) 0;
}

.apb-timeline-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 32px;
  width: var(--apb-timeline-line-width, 3px);
  background: var(--apb-timeline-line-bg, linear-gradient(180deg, var(--apb-color-primary, #0d5c63) 0%, var(--apb-color-accent, #e07a5f) 50%, var(--apb-color-primary, #0d5c63) 100%));
  border-radius: var(--apb-radius-full, 9999px);
}

@media (min-width: 860px) {
  .apb-timeline-wrapper::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

.apb-timeline-item {
  position: relative;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  display: grid;
  grid-template-columns: 1fr;
}

.apb-timeline-item:last-child {
  margin-bottom: 0;
}

/* Timeline Number Node */
.apb-timeline-node {
  position: absolute;
  left: 32px;
  top: 24px;
  transform: translate(-50%, 0);
  width: 40px;
  height: 40px;
  border-radius: var(--apb-radius-full, 50%);
  background-color: var(--apb-color-bg-card, #ffffff);
  border: 3px solid var(--apb-color-primary, #0d5c63);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(13, 92, 99, 0.12), var(--apb-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  z-index: 3;
  color: var(--apb-color-primary, #0d5c63);
  font-weight: 800;
  font-size: 0.85rem;
  transition: all var(--apb-transition-smooth, 0.3s ease);
}

.apb-timeline-item.is-novella .apb-timeline-node {
  border-color: var(--apb-color-accent, #e07a5f);
  color: var(--apb-color-accent, #e07a5f);
  box-shadow: 0 0 0 4px rgba(224, 122, 95, 0.15), var(--apb-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.apb-timeline-item.is-finale .apb-timeline-node {
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2), var(--apb-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

/* Milestone Card */
.apb-timeline-card {
  margin-left: 68px;
  background-color: var(--apb-color-bg-card, #ffffff);
  border: 1px solid var(--apb-color-border, #e2e8f0);
  border-radius: var(--apb-radius-lg, 16px);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--apb-shadow-card, 0 4px 6px -1px rgba(0,0,0,0.08));
  transition: transform var(--apb-transition-smooth, 0.3s ease), box-shadow var(--apb-transition-smooth, 0.3s ease);
}

.apb-timeline-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--apb-shadow-card-hover, 0 12px 24px -4px rgba(15, 23, 42, 0.12));
}

@media (min-width: 860px) {
  .apb-timeline-item {
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
  }

  .apb-timeline-node {
    left: 50%;
  }

  .apb-timeline-item:nth-child(odd) .apb-timeline-card {
    grid-column: 1 / 2;
    margin-left: 0;
    margin-right: 15px;
  }

  .apb-timeline-item:nth-child(even) .apb-timeline-card {
    grid-column: 2 / 3;
    margin-left: 15px;
    margin-right: 0;
  }
}

.apb-timeline-card-grid {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: var(--apb-space-4, 1rem);
  align-items: start;
}

@media (max-width: 480px) {
  .apb-timeline-card-grid {
    grid-template-columns: 1fr;
  }
}

.apb-timeline-cover-wrap {
  position: relative;
}

.apb-timeline-cover-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--apb-radius-sm, 4px);
  box-shadow: -6px 10px 18px rgba(15, 23, 42, 0.15);
  transition: transform var(--apb-transition-smooth, 0.3s ease);
  display: block;
}

.apb-timeline-card:hover .apb-timeline-cover-img {
  transform: translateY(-2px) rotate(-1deg);
}

.apb-timeline-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apb-timeline-badge-bar {
  display: flex;
  align-items: center;
  gap: var(--apb-space-2, 0.5rem);
  flex-wrap: wrap;
}

.apb-timeline-order-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--apb-radius-full, 9999px);
  font-size: var(--apb-font-size-xs, 0.75rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--apb-color-primary-light, #eef7f7);
  color: var(--apb-color-primary, #0d5c63);
  border: 1px solid rgba(13, 92, 99, 0.2);
}

.apb-timeline-order-badge.badge-novella {
  background-color: var(--apb-color-accent-light, #fdf1ed);
  color: var(--apb-color-accent, #e07a5f);
  border-color: rgba(224, 122, 95, 0.25);
}

.apb-timeline-order-badge.badge-finale {
  background-color: #fef3c7;
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}

.apb-timeline-year {
  font-size: var(--apb-font-size-xs, 0.75rem);
  color: var(--apb-color-text-muted, #64748b);
  font-weight: 600;
}

.apb-timeline-title {
  font-family: var(--apb-font-serif, "Playfair Display", Georgia, serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--apb-color-heading, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.apb-timeline-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--apb-transition-fast, 0.15s ease);
}

.apb-timeline-title a:hover {
  color: var(--apb-color-primary, #0d5c63);
}

.apb-timeline-desc {
  font-size: var(--apb-font-size-xs, 0.75rem);
  color: var(--apb-color-text, #334155);
  line-height: 1.55;
  margin: 0;
}

.apb-timeline-formats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.apb-format-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--apb-radius-sm, 4px);
  background-color: var(--apb-color-bg-alt, #faf8f5);
  color: var(--apb-color-text-muted, #64748b);
  border: 1px solid var(--apb-color-border, #e2e8f0);
}

.apb-timeline-links {
  display: flex;
  align-items: center;
  gap: var(--apb-space-3, 0.75rem);
  margin-top: 6px;
}

.apb-timeline-sample-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--apb-font-size-xs, 0.75rem);
  font-weight: 700;
  color: var(--apb-color-primary, #0d5c63);
  text-decoration: none;
  transition: color var(--apb-transition-fast, 0.15s ease);
}

.apb-timeline-sample-link:hover {
  color: var(--apb-color-accent, #e07a5f);
}

.apb-timeline-bottom-action {
  text-align: center;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.apb-timeline-section .apb-timeline-bottom-action .apb-btn,
.apb-timeline-bottom-action .apb-btn {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}
