/* ==========================================================
   HKH Historical Timeline  —  timeline.css
   ========================================================== */

.hkh-timeline-wrap {
    font-family: var(--font-body, 'Open Sans', sans-serif);
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 0 60px;
}

/* ----------------------------------------------------------
   CONTENT PANEL
   ---------------------------------------------------------- */
.hkh-tl-panel {
    display: flex;
    height: 360px;        /* fixed — never jumps regardless of image or text length */
    margin-bottom: 56px;
    background: #faf8f3;
    border: 1px solid #e0d5be;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 18px rgba(0,0,0,0.10);
    position: relative;
}

/* Image column — width adapts to image aspect ratio at fixed panel height */
.hkh-tl-panel-image {
    flex-shrink: 0;
    min-width: 160px;
    max-width: 55%;
    overflow: hidden;
    background: #d6c9ad;
    position: relative;
    will-change: transform, opacity;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hkh-tl-panel-image img {
    height: 100%;      /* fill panel height exactly */
    width: auto;       /* natural width at that height — no cropping */
    display: block;
    max-width: 100%;
}

/* Year badge fallback */
.hkh-tl-year-bg {
    width: 240px;     /* fixed width when showing year badge instead of image */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #4a3c28 0%, #7a6545 100%);
    flex-direction: column;
    gap: 8px;
}
.hkh-tl-year-bg span {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 68px;
    font-weight: 200;
    color: rgba(255,255,255,0.75);
    letter-spacing: -2px;
    line-height: 1;
}
.hkh-tl-year-bg small {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

/* Text column */
.hkh-tl-panel-text {
    flex: 1;
    padding: 32px 40px 32px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    will-change: transform, opacity;
    overflow: hidden;
    min-width: 0;
}

.hkh-tl-year-label {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #9a7f55;
    margin-bottom: 12px;
}

.hkh-tl-headline {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 22px;
    font-weight: 600;
    color: #2a2018;
    line-height: 1.38;
    margin: 0 0 16px;
}

.hkh-tl-blurb {
    font-size: 15px;
    line-height: 1.75;
    color: #5a4a38;
    margin: 0 0 24px;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.hkh-tl-readmore {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
    padding: 10px 22px;
    background: var(--color-primary, #7fba27);
    color: #fff !important;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 4px;
    transition: background 0.2s ease, transform 0.15s ease;
}
.hkh-tl-readmore:hover {
    background: #5a8a1a;
    transform: translateX(3px);
}
.hkh-tl-readmore::after {
    content: '→';
    font-size: 15px;
    font-weight: 400;
}

/* Hover hint shown when no entry is locked */
.hkh-tl-hint {
    font-size: 13px;
    color: #b0966e;
    font-style: italic;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.hkh-tl-hint.visible {
    opacity: 1;
}

/* ----------------------------------------------------------
   TIMELINE BAR
   ---------------------------------------------------------- */
.hkh-tl-bar-wrap {
    position: relative;
    padding: 0 52px;
    user-select: none;
}

/* Prev / Next buttons */
.hkh-tl-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 2px solid #d6c9ad;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a7f55;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 2;
    padding: 0;
    margin-top: -8px; /* vertically centre on the circles */
}
.hkh-tl-nav-btn:hover {
    background: #9a7f55;
    border-color: #9a7f55;
    color: #fff;
}
.hkh-tl-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.hkh-tl-nav-prev { left: 0; }
.hkh-tl-nav-next { right: 0; }

/* Scrollable strip */
.hkh-tl-bar-scroll {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 16px 10px 24px;
}
.hkh-tl-bar-scroll::-webkit-scrollbar { display: none; }

/* Inner row */
.hkh-tl-bar-inner {
    position: relative;
    display: flex;
    align-items: center;
    min-width: max-content;
    padding: 0 10px;
}

/* Connecting line — centred on circles (circles are 52px, so line at 26px from top) */
.hkh-tl-bar-inner::before {
    content: '';
    position: absolute;
    top: 26px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #ede4ce, #c8b898 15%, #c8b898 85%, #ede4ce);
    z-index: 0;
}

/* Individual year node */
.hkh-tl-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    padding: 0 12px;
    outline: none;
    transition: transform 0.25s ease;
}

.hkh-tl-node:hover {
    transform: translateY(-5px);
}

.hkh-tl-node:focus-visible .hkh-tl-circle {
    outline: 2px solid #7fba27;
    outline-offset: 3px;
}

/* Large circle with year inside */
.hkh-tl-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c8b898;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: all 0.28s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.hkh-tl-node-year {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 11px;
    font-weight: 700;
    color: #9a7f55;
    letter-spacing: -0.3px;
    text-align: center;
    line-height: 1.1;
    transition: color 0.25s ease;
    pointer-events: none;
}

/* Hover state */
.hkh-tl-node:hover .hkh-tl-circle {
    background: #f5efe0;
    border-color: #9a7f55;
    box-shadow: 0 4px 16px rgba(154,127,85,0.25);
    transform: scale(1.12);
}
.hkh-tl-node:hover .hkh-tl-node-year {
    color: #4a3c28;
}

/* Active (locked) state */
@keyframes hkh-tl-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(127,186,39,0.55), 0 4px 16px rgba(127,186,39,0.2); }
    60%  { box-shadow: 0 0 0 10px rgba(127,186,39,0),   0 4px 16px rgba(127,186,39,0.2); }
    100% { box-shadow: 0 0 0 0   rgba(127,186,39,0),    0 4px 16px rgba(127,186,39,0.2); }
}

.hkh-tl-node.active .hkh-tl-circle {
    background: var(--color-primary, #7fba27);
    border-color: var(--color-primary, #7fba27);
    transform: scale(1.18);
    animation: hkh-tl-pulse 1.8s ease-out infinite;
}
.hkh-tl-node.active .hkh-tl-node-year {
    color: #fff;
    font-size: 12px;
}
.hkh-tl-node.active:hover .hkh-tl-circle {
    transform: scale(1.18);
}

/* Mini label below circle */
.hkh-tl-node-label {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 9.5px;
    font-weight: 500;
    color: #c8b898;
    text-align: center;
    white-space: nowrap;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.25s ease;
    line-height: 1.3;
}
.hkh-tl-node:hover .hkh-tl-node-label {
    color: #7a6545;
}
.hkh-tl-node.active .hkh-tl-node-label {
    color: var(--color-primary, #7fba27);
}

/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */
@media (max-width: 860px) {
    .hkh-tl-panel-image { width: 280px; }
    .hkh-tl-panel-text  { padding: 28px; }
    .hkh-tl-headline    { font-size: 19px; }
}

@media (max-width: 660px) {
    .hkh-tl-panel { flex-direction: column; height: auto; min-height: 0; }
    .hkh-tl-panel-image { width: 100%; height: 220px; flex-shrink: 0; max-width: 100%; }
    .hkh-tl-panel-image img { width: 100%; height: 100%; object-fit: cover; }
    .hkh-tl-panel-text  { padding: 22px; }
    .hkh-tl-headline    { font-size: 18px; }
    .hkh-tl-blurb       { font-size: 14px; }
    .hkh-tl-bar-wrap    { padding: 0 40px; }
    .hkh-tl-circle      { width: 42px; height: 42px; }
    .hkh-tl-node-year   { font-size: 9.5px; }
    .hkh-tl-node        { padding: 0 8px; }
    .hkh-tl-node-label  { display: none; }
}
