/* ============================================================
   Rankbeta — Timeline History Widget
   Dark-luxury theme: #0d0d0d bg · #C9A052 gold · warm white text
   Desktop: horizontal timeline (year above dot, content below)
   Mobile:  vertical stacked cards with left dot column
   ============================================================ */

/* ── Widget wrapper resets ── */
.rb-th-section,
.elementor-widget-rankbeta_th,
.elementor-widget-rankbeta_th .elementor-widget-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ── Section wrapper ── */
.rb-th-section {
    position: relative;
    width: 100%;
    background-color: #0d0d0d;
    overflow: hidden;
}

/* ── Inner ── */
.rb-th-inner {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 80px 60px;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.rb-th-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.rb-th-eyebrow {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: #C9A052;
}

/* Decorative gold line under eyebrow */
.rb-th-eyebrow::after {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: rgba(201,160,82,0.5);
    margin: 8px auto 0;
}

.rb-th-heading {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.2;
    color: #ffffff;
}

.rb-th-subheading {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.75;
    color: rgba(240,234,216,0.65);
    max-width: 560px;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.rb-th-timeline {
    margin-top: 60px;
}

/* Flex row: each item takes equal width */
.rb-th-items {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    /* gap is set via Elementor control (item_gap) — applies on mobile stack */
}

/* ── Single timeline item ── */
.rb-th-item {
    flex: 1;
    min-width: 0;   /* prevents overflow in flex */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Year label above the dot ── */
.rb-th-year {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #C9A052;
    text-align: center;
    margin-bottom: 10px;
    padding: 0 8px;
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    /* background transparent by default — Elementor controls override */
}

/* ── Node row: left-seg | dot | right-seg ── */
.rb-th-node-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.rb-th-line-seg {
    flex: 1;
    height: 1px;
    background-color: rgba(201,160,82,0.45);
}

.rb-th-line-seg--hidden {
    background-color: transparent !important;
    pointer-events: none;
}

.rb-th-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #C9A052;
    box-shadow: 0 0 0 5px rgba(201,160,82,0.2);
    position: relative;
    z-index: 2;
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.rb-th-item:hover .rb-th-dot {
    box-shadow: 0 0 0 8px rgba(201,160,82,0.25);
    transform: scale(1.25);
}

/* ── Content body below the dot ── */
.rb-th-body {
    padding: 24px 14px 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* ── Image wrapper ── */
.rb-th-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 18px;
    /* clip zoom-on-hover inside border-radius */
}

.rb-th-img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.45s ease;
}

/* ── Item heading ── */
.rb-th-item-title {
    margin: 0 0 8px 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    color: #ffffff;
}

/* Gold accent line above each item title */
.rb-th-item-title::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(201,160,82,0.5);
    margin: 0 auto 10px;
}

/* ── Item description ── */
.rb-th-item-desc {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.75;
    color: rgba(240,234,216,0.6);
}

/* ============================================================
   ENTRANCE ANIMATIONS
   IntersectionObserver adds .rb-th-anim--visible
   ============================================================ */
.rb-th-anim {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.rb-th-anim.rb-th-anim--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── 1024px: slightly tighter ── */
@media (max-width: 1024px) {
    .rb-th-inner      { padding: 60px 40px; }
    .rb-th-heading    { font-size: 30px; }
    .rb-th-item-title { font-size: 15px; }
    .rb-th-body       { padding: 20px 10px 0; }
    .rb-th-img-wrap   { height: 170px; }
}

/* ── 767px: mobile — vertical stacked ── */
@media (max-width: 767px) {
    .rb-th-inner  { padding: 48px 24px; }
    .rb-th-header { gap: 10px; }
    .rb-th-heading { font-size: 26px; }
    .rb-th-subheading { font-size: 14px; }

    /* ── Switch to vertical layout ── */
    .rb-th-items {
        flex-direction: column;
        align-items: stretch;
        gap: 40px;
        position: relative;
        padding-left: 28px;  /* space for the left vertical line */
    }

    /* Vertical connector line on the left */
    .rb-th-items::before {
        content: '';
        position: absolute;
        left: 7px;   /* center over the dot (dot is 12px, left offset = 28px - 12px/2 - 3px ≈ 16px? let me calc: dot left = 28px - dot-center; dot center in node-row = left col = 0px from left of .rb-th-node-row; .rb-th-node-row is full-width but we moved it ... let's just keep it at 7px which is half-dot-width) */
        top: 20px;   /* starts just below first dot */
        bottom: 20px;
        width: 1px;
        background: rgba(201,160,82,0.3);
        z-index: 0;
    }

    /* ── Each item: left dot column + right content ── */
    .rb-th-item {
        flex-direction: row;
        align-items: flex-start;
        gap: 0;
    }

    /* Dot + node-row: fixed left strip */
    .rb-th-node-row {
        flex-direction: column;
        width: 16px;         /* just wide enough for the dot */
        flex-shrink: 0;
        align-items: center;
        margin-left: -28px;  /* pull back to sit on the vertical line */
        padding-top: 2px;
        margin-right: 16px;  /* gap between dot and content */
    }

    .rb-th-line-seg {
        display: none;       /* no horizontal lines on mobile */
    }

    /* Dot: style for mobile — ring style against dark bg */
    .rb-th-dot {
        background: #0d0d0d;
        border: 2px solid #C9A052;
        box-shadow: none;
    }

    /* Year: hidden in desktop position (above dot);
       shown via data-year pseudo on .rb-th-body */
    .rb-th-year {
        display: none;
    }

    /* Content (body) fills the right side */
    .rb-th-body {
        flex: 1;
        text-align: left;
        padding: 0;
        min-width: 0;
    }

    /* Show year inline at top of content on mobile via data attribute */
    .rb-th-body::before {
        content: attr(data-year);
        display: block;
        font-family: 'Montserrat', sans-serif;
        font-weight: 700;
        font-size: 11px;
        letter-spacing: 2.5px;
        text-transform: uppercase;
        color: #C9A052;
        margin-bottom: 8px;
    }

    /* Left-align title accent line on mobile */
    .rb-th-item-title::before {
        margin: 0 0 8px 0;
    }

    /* Image fills width on mobile */
    .rb-th-img-wrap {
        height: 160px;
        width: 100%;
        margin-bottom: 14px;
    }

    .rb-th-item-title { font-size: 15px; }
    .rb-th-item-desc  { font-size: 13px; }

    /* Skip entrance animations on mobile */
    .rb-th-anim {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ── Narrow phones ── */
@media (max-width: 380px) {
    .rb-th-inner { padding: 40px 16px; }
    .rb-th-items { padding-left: 24px; }
    .rb-th-items::before { left: 5px; }
    .rb-th-node-row { margin-left: -24px; }
    .rb-th-img-wrap { height: 140px; }
}
