@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
:root {
    --color-red-primary: #dc2626;
    --color-red-dark: #991b1b;
    --color-red-header-solid: #b91c1c;
    --color-bg-light: #f7f7f7;
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-bg-light);
    color: #333;
}
.page-container { background-color: var(--color-bg-light); }
.header-red-solid { background-color: var(--color-red-header-solid); }
.timeline-events-wrapper { position: relative; padding-bottom: 5rem; }
.timeline-line { position: absolute; left: 50%; width: 4px; background-color: #e5e7eb; top: 0; bottom: 0; transform: translateX(-50%); }
.timeline-progress { position: absolute; left: 50%; width: 4px; background-color: var(--color-red-primary); top: 0; height: 0; transform: translateX(-50%); transition: background-color 0.3s ease; z-index: 10; }
.timeline-marker-dot {
    box-shadow: 0 0 0 12px var(--color-bg-light);
    z-index: 30;
    position: relative;
}
.timeline-marker-dot span {
    position: relative;
    z-index: 40;
}
/* Use margin-top for entrance animation to avoid creating a new stacking context
     (transform on the event creates a stacking context and can cause the timeline
     line to appear above the marker). Using margin avoids that. */
@keyframes slideInUp {
    0% { opacity: 0; margin-top: 50px; }
    75% { opacity: 0.7; margin-top: -5px; }
    100% { opacity: 1; margin-top: 0; }
}
.timeline-event.hidden-item { opacity: 0; margin-top: 50px; }
.timeline-event.visible-item { animation: slideInUp 0.8s ease-out forwards; }
@media (max-width: 768px) {
    .timeline-line, .timeline-progress { left: 20px; transform: none; }
    .timeline-item-right { margin-left: 50px; }
    .timeline-item-left { margin-right: 0; margin-left: 50px; text-align: left; }
    .timeline-event.md\:flex > div:nth-child(1), .timeline-event.md\:flex > div:nth-child(3) { order: initial; }
    .timeline-image { margin-bottom: 1rem; }
    .timeline-image-right { order: initial; }
    .timeline-marker-dot { box-shadow: 0 0 0 8px var(--color-bg-light); }
}

/* Small helper styles used by the template */
.hidden { display: none !important; }
.fixed { position: fixed !important; }

/* Preloader spinner fallbacks in case not present elsewhere */
@keyframes spin { to { transform: rotate(360deg); } }
.preloader-spinner { border-radius: 50%; }

/* Make sure the timeline markers are visible on dark headers */
.timeline-marker-dot { background: var(--color-red-primary); color: #fff; }

/* Basic responsive container adjustments */
.max-w-5xl { max-width: 64rem; }

/* Small accessibility focus helpers */
:focus { outline: 3px solid rgba(220,38,38,0.18); outline-offset: 2px; }

/* Enhanced timeline cards and marker styles */
.timeline-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    border-radius: 14px;
    padding: 1.15rem;
    box-shadow: 0 8px 24px rgba(16,24,40,0.08), 0 2px 6px rgba(16,24,40,0.04);
    border: 1px solid rgba(16,24,40,0.04);
    transition: transform 240ms ease, box-shadow 240ms ease, filter 240ms ease;
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}
.timeline-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(16,24,40,0.12); }
.card-media { flex: 0 0 88px; border-radius: 10px; overflow: hidden; }
.card-image { width: 88px; height: 88px; object-fit: cover; display: block; }
.card-body { flex: 1 1 auto; min-width: 0; }
.card-meta { display:flex; gap:0.6rem; align-items:center; margin-bottom:0.35rem; }
.year-pill { background: linear-gradient(90deg,var(--color-red-primary),var(--color-red-dark)); color:#fff; padding:0.25rem 0.5rem; border-radius:999px; font-weight:700; font-size:0.85rem; display:inline-block; }
.badge { font-size:0.7rem; color:var(--color-red-primary); padding:0.18rem 0.45rem; border-radius:999px; background:rgba(220,38,38,0.07); border:1px solid rgba(220,38,38,0.06); }
.card-title { font-size:1.05rem; font-weight:700; margin:0.15rem 0 0.45rem; color:#0f172a; }
.card-desc { color:#334155; font-size:0.94rem; line-height:1.45; max-height:8.9rem; overflow:auto; }
.card-footer { margin-top:0.6rem; }
.source-link { color:var(--color-red-primary); font-weight:600; text-decoration:none; }
.source-link:hover { text-decoration:underline; }

/* Ensure the timeline line stays underneath markers by placing it at a very low z-index
   and forcing markers into a higher stacking layer. Also ensure markers are positioned
   (relative) so their z-index is effective. */
.timeline-line { z-index: 0; background-color: #e6e7eb; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02); }
.timeline-progress { z-index: 0; }
.timeline-marker-dot {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    background: linear-gradient(180deg,var(--color-red-primary),var(--color-red-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(16,24,40,0.12), 0 2px 6px rgba(16,24,40,0.06);
    border: 6px solid var(--color-bg-light); /* creates visible gap so the line looks cut */
    transition: transform 220ms ease;
    position: relative; /* ensure z-index applies */
    z-index: 9999; /* ensure marker sits above the timeline */
}
.timeline-marker-dot span { font-weight:700; font-size:0.95rem; letter-spacing:0.5px; z-index: 10000; position: relative; }
.timeline-marker-dot:hover { transform: translateY(-6px) scale(1.02); }

/* Pill-style marker: horizontal capsule with a small white circular badge centered (matches supplied design) */
.timeline-marker-dot.pill {
    /* Much narrower capsule */
    width: 150px;
    height: 48px;
    min-width: 120px;
    padding: 0 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg,var(--color-red-primary),var(--color-red-dark));
    box-shadow: 0 10px 28px rgba(16,24,40,0.12);
    border: 6px solid var(--color-bg-light); /* mask the vertical line behind the pill */
    position: relative;
}
.timeline-marker-dot.pill .inner-badge {
    width: 24px;
    height: 24px;
    background: #fff;
    color: var(--color-red-primary);
    border-radius: 999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    box-shadow: 0 6px 12px rgba(16,24,40,0.10);
    font-size:0.72rem;
}

/* small connector so the central line visually connects under the pill */
.timeline-marker-dot.pill::after {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: #e9e9ea;
    z-index: 6;
    border-radius: 1px;
}

/* Make pill responsive: shrink on narrow screens */
@media (max-width: 1024px) {
    .timeline-marker-dot.pill { width: 140px; height:44px; border-width:6px; padding:0 8px; }
    .timeline-marker-dot.pill .inner-badge { width:22px; height:22px; font-size:0.68rem; }
}

/* Layout tweaks for the card columns to keep consistent spacing around the centered marker.
    Only the left/right columns should take 50% width; the marker must not stretch to 50%.
*/
.timeline-event > .timeline-item-left,
.timeline-event > .timeline-item-right { flex-basis: 50%; }
.timeline-event > .timeline-marker-dot { flex: 0 0 auto; display:flex; align-items:center; justify-content:center; }
.timeline-event .order-1, .timeline-event .order-3 { display:flex; }
.timeline-event .timeline-item-left .timeline-card { margin-left:auto; }
.timeline-event .timeline-item-right .timeline-card { margin-right:auto; }

/* Mobile: stack cards, marker aligned left with the line */
@media (max-width: 768px) {
    .timeline-line, .timeline-progress { left: 36px; transform: none; }
    .timeline-marker-dot { margin: 0 0 0 -32px; position: relative; }
    .timeline-card { width: calc(100% - 72px); }
    .timeline-event { padding-left: 72px; }
    .timeline-event > div { width: 100%; }
    .card-media { flex: 0 0 72px; }
    .card-image { width:72px; height:72px; }
}

/* Accessibility and small polish */
.timeline-card:focus { outline: 3px solid rgba(99,102,241,0.12); }

/* Card wrapper + top accent: make card body white, centered text and subtle shadow (match screenshot) */
.timeline-card { position: relative; padding: 0.6rem 0; }
.timeline-card .card-accent { position: absolute; top: 6px; left: 12px; width: 48px; height: 8px; border-radius: 8px 8px 0 0; background: linear-gradient(90deg,var(--color-red-primary),var(--color-red-dark)); box-shadow: 0 2px 6px rgba(16,24,40,0.06); z-index:5; }
.timeline-card .card-content { background: #fff; padding: 1.15rem; border-radius: 12px; box-shadow: 0 10px 20px rgba(16,24,40,0.06); border: 1px solid rgba(16,24,40,0.04); text-align: center; position: relative; }

/* Make left-column cards narrower to resemble screenshot */
.timeline-item-left .card-content, .timeline-item-right .card-content { max-width: 360px; margin: 0; }

/* subtle decorative top-left curve (visual only) */
.timeline-card .card-content::before { content: ''; position: absolute; left: 14px; top: 8px; width: 12px; height: 6px; border-top-left-radius: 8px; border-top-right-radius: 8px; background: transparent; z-index: 6; }

/* Image pill (small rounded box for images on the right) */
.image-pill { display:inline-block; background: #fff; padding: 8px; border-radius: 12px; box-shadow: 0 8px 24px rgba(16,24,40,0.06); max-width: 360px; }
.image-pill .timeline-image { display:block; border-radius:8px; max-width: 320px; height:auto; }

/* Tweak pill marker size to match screenshot */
/* Tweak pill marker size to match screenshot (final adjustments above) */

/* Subtle vertical line color & spacing */
.timeline-line { width: 3px; background-color: #e9e9ea; }
.timeline-progress { width: 3px; background-color: var(--color-red-primary); }

/* Alignments to center pill exactly on the 50% line */
.timeline-marker-dot { display:flex; align-items:center; justify-content:center; }

/* Mobile tweaks for image pill and marker */
@media (max-width: 768px) {
    .image-pill { display:block; width: calc(100% - 96px); }
    .timeline-marker-dot.pill { width: 140px; height:44px; }
}

