/* ============================================================
   Divi Timeline Module — Horizontal Timeline
   Diseño minimalista, elegante, con scroll suave
   ============================================================ */

/* ── Custom properties (defaults, overridden per-module) ──── */
.dtm-timeline-wrap {
    --dtm-accent:   #1a1a2e;
    --dtm-line:     #e0e0e0;
    --dtm-year-fg:  #ffffff;
    --dtm-title:    #1a1a2e;
    --dtm-desc:     #888888;
    --dtm-dot:      48px;
    --dtm-card-min: 220px;

    /* internal tokens */
    --dtm-radius:   12px;
    --dtm-gap:      48px;
    --dtm-card-pad: 20px 22px;
    --dtm-shadow:   0 8px 32px rgba(0,0,0,.08);
    --dtm-font-sans: 'Outfit', 'DM Sans', system-ui, sans-serif;
    --dtm-ease:     cubic-bezier(.4,0,.2,1);
}

/* ── Outer wrap ───────────────────────────────────────────── */
.dtm-timeline-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 60px 0 48px;
    box-sizing: border-box;
    font-family: var(--dtm-font-sans);
}

/* ── Scrollable container ─────────────────────────────────── */
.dtm-timeline-scroll {
    position: relative;
    width: 100%;
}

/* ── Track (line + items) ─────────────────────────────────── */
.dtm-line-track {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 56px;
    cursor: grab;
    user-select: none;
}
.dtm-line-track:active { cursor: grabbing; }
.dtm-line-track::-webkit-scrollbar { display: none; }

/* ── Horizontal line ─────────────────────────────────────── */
.dtm-line {
    position: absolute;
    top: calc(50% + 12px); /* vertically centred on the node row */
    left: 0;
    right: 0;
    height: 2px;
    background: var(--dtm-line);
    pointer-events: none;
    transform: translateY(-50%);
}
/* gradient fade at edges */
.dtm-line::before,
.dtm-line::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.dtm-line::before {
    left: 0;
    background: linear-gradient(to right, #fff 20%, transparent);
}
.dtm-line::after {
    right: 0;
    background: linear-gradient(to left, #fff 20%, transparent);
}

/* ── Items row ──────────────────────────────────────────────── */
.dtm-items {
    display: flex;
    align-items: flex-end;   /* cards hang above the node row */
    gap: var(--dtm-gap);
    padding: 0 24px 0 24px;
    width: max-content;
}

/* ── Single item ─────────────────────────────────────────── */
.dtm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: var(--dtm-card-min);
    max-width: 300px;
    position: relative;
    animation: dtm-rise .55s var(--dtm-ease) both;
}
.dtm-item:nth-child(2)  { animation-delay: .08s; }
.dtm-item:nth-child(3)  { animation-delay: .16s; }
.dtm-item:nth-child(4)  { animation-delay: .24s; }
.dtm-item:nth-child(5)  { animation-delay: .32s; }
.dtm-item:nth-child(6)  { animation-delay: .40s; }
.dtm-item:nth-child(7)  { animation-delay: .48s; }
.dtm-item:nth-child(n+8){ animation-delay: .56s; }

@keyframes dtm-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ─────────────────────────────────────────────────── */
.dtm-card {
    width: 100%;
    margin-bottom: 20px;
    transition: transform .3s var(--dtm-ease), box-shadow .3s var(--dtm-ease);
}
.dtm-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--dtm-shadow), 0 2px 8px rgba(0,0,0,.04);
}
.dtm-card-inner {
    background: #ffffff;
    border-radius: var(--dtm-radius);
    box-shadow: var(--dtm-shadow);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.05);
}

/* optional image inside card */
.dtm-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f4f4f4;
}
.dtm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s var(--dtm-ease);
}
.dtm-card:hover .dtm-card-image img {
    transform: scale(1.05);
}

.dtm-card-body {
    padding: var(--dtm-card-pad);
}
.dtm-card-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dtm-title);
    line-height: 1.3;
    letter-spacing: -.01em;
}
.dtm-card-desc {
    margin: 0;
    font-size: .825rem;
    color: var(--dtm-desc);
    line-height: 1.6;
}

/* ── Connector area ────────────────────────────────────────── */
.dtm-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* vertical stem connecting card to node */
.dtm-connector::before {
    content: '';
    width: 1px;
    height: 20px;
    background: var(--dtm-line);
    display: block;
    /* already taken care of by the flex gap above */
}

/* ── Node (dot) ─────────────────────────────────────────────── */
.dtm-node {
    width: var(--dtm-dot);
    height: var(--dtm-dot);
    border-radius: 50%;
    background: var(--dtm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: transform .3s var(--dtm-ease), box-shadow .3s var(--dtm-ease);
    box-shadow: 0 0 0 4px rgba(255,255,255,1), 0 0 0 5px var(--dtm-line);
    flex-shrink: 0;
}
.dtm-item:hover .dtm-node {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(255,255,255,1), 0 0 0 6px var(--dtm-accent);
}

/* image inside node */
.dtm-dot-img {
    width: 68%;
    height: 68%;
    object-fit: cover;
    border-radius: 50%;
}

/* icon inside node */
.dtm-dot-icon {
    font-size: calc(var(--dtm-dot) * .42);
    color: #ffffff;
    line-height: 1;
}

/* plain dot fallback */
.dtm-dot-default {
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background: rgba(255,255,255,.6);
}

/* ── Year badge ─────────────────────────────────────────────── */
.dtm-year-badge {
    background: var(--dtm-accent);
    color: var(--dtm-year-fg);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.4;
}

/* ── Navigation arrows ─────────────────────────────────────── */
.dtm-arrows {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}
.dtm-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--dtm-line);
    background: transparent;
    color: var(--dtm-accent);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .22s, color .22s, border-color .22s, transform .22s;
    line-height: 1;
}
.dtm-arrow:hover {
    background: var(--dtm-accent);
    color: #ffffff;
    border-color: var(--dtm-accent);
    transform: scale(1.08);
}
.dtm-arrow:disabled {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}

/* ── Edge fade overlays (left / right) ─────────────────────── */
.dtm-timeline-scroll::before,
.dtm-timeline-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 48px; /* don't cover arrows */
    width: 64px;
    pointer-events: none;
    z-index: 3;
}
.dtm-timeline-scroll::before {
    left: 0;
    background: linear-gradient(to right, #fff 30%, transparent);
}
.dtm-timeline-scroll::after {
    right: 0;
    background: linear-gradient(to left, #fff 30%, transparent);
}

/* ── Responsive: stack on very small screens ─────────────────── */
@media (max-width: 600px) {
    .dtm-line-track { padding: 0 24px; }
    .dtm-item { min-width: 160px; }
    .dtm-card-title { font-size: .9rem; }
    .dtm-card-desc  { font-size: .78rem; }
}
