/* ============================================================
   technomed Firmengeschichte — CSS overrides
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;700&display=swap');

/* ================================================================
   PAGE GRID
   ================================================================ */
.firmengeschichte_grid {
    height: 100%;
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-auto-flow: row;
    gap: 0;
    font-family: 'Noto Sans', 'Roboto', sans-serif;
    overflow-y: auto;
    position: relative;
}

/* ================================================================
   YEAR SIDEBAR
   ================================================================ */
.yearselector {
    height: 100%;
    width: 80px;
    text-align: center;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: 1px solid #eef1f5;
    z-index: 10;
}

/* Override DxList items inside year selector */
.yearselector .dx-list-item {
    font-family: 'Figtree', 'Noto Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    padding: 6px 0;
    transition: color 0.15s, background 0.15s;
    border-left: 3px solid transparent;
}
.yearselector .dx-list-item:hover {
    color: #0F172A;
    background: rgba(3,169,244,0.04);
}
.yearselector .dx-list-item.dx-state-focused,
.yearselector .dx-list-item.dx-list-item-selected {
    font-weight: 700;
    color: var(--matblue);
    background: rgba(3,169,244,0.06);
    border-left: 3px solid var(--matblue);
}

/* ================================================================
   HEADER
   ================================================================ */
.firmengeschichteHeader {
    font-family: 'Figtree', 'Noto Sans', sans-serif;
    font-size: clamp(15px, 1.8vw, 18px);
    font-style: normal;
    font-weight: 400;
    color: #0F172A;
    text-shadow: 0 1px 3px rgba(255,255,255,0.6);
    line-height: 1.5;
}
.firmengeschichteHeader b {
    font-weight: 700;
}

#fgboxHeader {
    padding-top: 24px !important;
    padding-bottom: 8px !important;
}

/* ================================================================
   MAIN CONTAINER
   ================================================================ */
#main {
    position: fixed;
    top: 170px;
    right: 0;
    bottom: 30px;
    left: 80px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--matblue) transparent;
}

/* ================================================================
   BACKGROUND IMAGE — subtle
   ================================================================ */
#firmengeschichte_backgr {
    opacity: 0.25 !important;
}

/* ================================================================
   TIMELINE PLUGIN OVERRIDES (time_line.css)
   ================================================================ */

/* Font family */
div.timeline {
    font-family: 'Noto Sans', 'Roboto', sans-serif !important;
}

/* ── Spine ── */
div.timeline div.spine {
    width: 3px !important;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--matblue) 0%, #64748B 100%) !important;
}

/* ── Spine dots ── */
div.timeline_left div.timeline_element:after,
div.timeline_right div.timeline_element:after,
div.timeline_dual div.timeline_element_left:after,
div.timeline_dual div.timeline_element_right:after {
    background-color: #94A3B8 !important;
    border: 3px solid #fff !important;
    box-shadow: 0 0 0 2px rgba(3,169,244,0.15) !important;
    width: 12px !important;
    height: 12px !important;
}
div.timeline_left div.timeline_element:hover:after,
div.timeline_right div.timeline_element:hover:after,
div.timeline_dual div.timeline_element_left:hover:after,
div.timeline_dual div.timeline_element_right:hover:after {
    background-color: var(--matblue) !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 0 3px rgba(3,169,244,0.25) !important;
}

/* ── Dashed connector lines ── */
div.timeline_left div.timeline_element:before,
div.timeline_right div.timeline_element:before,
div.timeline_dual div.timeline_element_left:before,
div.timeline_dual div.timeline_element_right:before {
    border-top-color: #CBD5E1 !important;
}

/* ── Year separator pills ── */
div.timeline div.date_separator span {
    background: var(--matblue) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 20px !important;
    font-family: 'Figtree', 'Noto Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(3,169,244,0.2) !important;
    width: 120px !important;
    height: 34px !important;
    line-height: 34px !important;
}

/* ── Timeline cards ── */
div.timeline_element_box {
    border-radius: 12px !important;
    border: 1px solid #eef1f5 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
}
div.timeline_element_box:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06) !important;
    border-color: #dde4ed !important;
}

/* ── Card title bar ── */
div.timeline_title {
    margin: 12px 14px 8px !important;
    font-size: 11px !important;
    color: #64748B !important;
    font-family: 'Noto Sans', sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
div.timeline_title span.timeline_title_label {
    font-weight: 700 !important;
    color: #0F172A !important;
    font-size: 13px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
div.timeline_title span.timeline_title_date {
    color: var(--matblue) !important;
    font-weight: 600 !important;
    font-size: 11px !important;
}

/* ── Card content text ── */
div.timeline_element.blog_post div.content {
    font-size: 13px !important;
    padding: 10px 14px 14px !important;
    line-height: 1.6 !important;
    color: #475569 !important;
}

/* ── Gallery images — keep original horizontal scroll, just style ── */
div.timeline_element.gallery div.scroll_container {
    margin: 8px !important;
    border-radius: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--matblue) transparent;
}
div.timeline_element.gallery div.img_container {
    border-radius: 4px !important;
    overflow: hidden;
}
div.timeline_element.gallery div.img_container img {
    border-radius: 4px !important;
}

/* ── Blog post slider images ── */
div.timeline_element.blog_post div.slider_container img {
    border-radius: 0 !important;
}

/* ── Lightbox overlay ── */
div.timeline_overlay {
    background: rgba(0,0,0,0.88) !important;
    z-index: 10000 !important;
}
div.timeline_overlay .lightbox {
    border-radius: 8px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
div.timeline_overlay .lightbox img {
    border-radius: 8px !important;
}

/* Close button — fix: make it a visible X */
div.timeline_overlay .lightbox .navigation a.close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.15) !important;
    text-decoration: none !important;
    position: absolute;
    top: -44px;
    right: 0;
    transition: background 0.2s;
    cursor: pointer;
}
div.timeline_overlay .lightbox .navigation a.close:hover {
    background: rgba(255,255,255,0.3) !important;
}
div.timeline_overlay .lightbox .navigation a.close::after {
    content: '\00D7';
    font-size: 22px;
    color: #fff;
    line-height: 1;
}

/* Nav arrows */
div.timeline_overlay .lightbox .navigation span.prev,
div.timeline_overlay .lightbox .navigation span.next {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.12) !important;
    cursor: pointer;
    transition: background 0.2s;
}
div.timeline_overlay .lightbox .navigation span.prev:hover,
div.timeline_overlay .lightbox .navigation span.next:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* ── Load More / Load All — centered ── */
#main {
    text-align: center;
}
#timeline {
    text-align: left;
}
#loadmore, #loadall {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 10px;
    font-family: 'Noto Sans', 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    margin: 16px 8px;
}

#loadmore {
    background: var(--matblue);
    color: #fff;
    box-shadow: 0 4px 16px rgba(3,169,244,0.3);
}
#loadmore:hover {
    background: #0295d6;
    box-shadow: 0 6px 24px rgba(3,169,244,0.4);
}

#loadall {
    background: rgba(255,255,255,0.6);
    color: #0F172A;
    border: 1px solid #e0e4ea;
    backdrop-filter: blur(4px);
}
#loadall:hover {
    background: rgba(255,255,255,0.85);
    border-color: var(--matblue);
    color: var(--matblue);
}

/* ── Timeline card max sizing (prevent oversized cards on tablets) ── */
div.timeline_dual div.timeline_element_left,
div.timeline_dual div.timeline_element_right {
    max-width: 520px;
}
div.timeline_center div.timeline_element {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
div.timeline_element.blog_post div.slider_container img {
    max-height: 400px;
    object-fit: cover;
    width: 100%;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    #main {
        left: 80px;
    }
    div.timeline_dual div.timeline_element_left,
    div.timeline_dual div.timeline_element_right {
        max-width: 420px;
    }
}

@media (max-width: 768px) {
    /* Year sidebar: keep readable — 70px min, never narrower */
    .firmengeschichte_grid {
        grid-template-columns: 70px 1fr;
    }
    .yearselector {
        width: 70px;
        min-width: 70px;
    }
    .yearselector .dx-list-item {
        font-size: 12px;
        padding: 5px 0;
    }
    #main {
        left: 70px;
        top: 150px;
    }
}

@media (prefers-reduced-motion: reduce) {
    div.timeline_element_box,
    div.timeline div.spine,
    div.timeline div.date_separator span {
        transition: none !important;
    }
}
