/* =================================================================
   TD History Page — scoped styles
   All classes prefixed with td_history-
   Fonts: Playfair Display (headings & timeline dates), Barlow Condensed
================================================================= */

/* ── CSS custom properties ── */
.page-template-page-history .footer-contact{

}
.td_history-hero,
.td_history-legacy,
.td_history-video-section,
.td_history-timeline {
    --tdh-navy:     #0f2246;
    --tdh-azure:    #112a42;
    --tdh-orange:   #e29229;
    --tdh-white:    #ffffff;
    --tdh-silver:   #c5c5c5;
    --tdh-blue:     #5aa9d7;
    --tdh-light-bg: #f7f7f7;
    --tdh-slide-bg: #f8f7f7;
    --tdh-dark-text:#1a2744;
}

/* =================================================================
   NAV-ONLY HEADER (history page replaces standard banner)
================================================================= */
.td_history-header {
    background-image: none !important;
    background-color: var(--tdh-navy, #0f2246) !important;
}

/* =================================================================
   HERO
================================================================= */
.td_history-hero {
    position: relative;
    height: 841px;
    overflow: hidden;
    display: flex;
    align-items: end;
    padding: 0 1px;
    flex-direction: column;
}
.td_history-hero .container {
    z-index: 2;
    position: relative;
}
.td_history-hero__overlay+.container {
    z-index: 3;
}
.td_history-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.td_history-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(16,53,85,0.1), rgba(16,53,85,0.55));
    z-index: 1;
    mix-blend-mode: multiply;
}

.td_history-hero__content {
    position: relative;
    z-index: 2;
    text-align: left;
    max-width: 700px;
    padding-right: 85px;
    margin-left: auto;
}

.td_history-hero__est {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 32px;
    color: var(--tdh-white);
    letter-spacing: -0.2px;
    line-height: 46px;
    margin-bottom: 10px;
}

.td_history-hero__headline {
    font-size: 96px;
    line-height: 100px;
    margin-bottom: 26px;
    margin-top: 0;
}

.td_history-hero__headline--orange {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--tdh-orange);
}

.td_history-hero__headline--white {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    color: var(--tdh-white);
    letter-spacing: -0.2px;
}

.td_history-hero__sub {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 21px;
    color: var(--tdh-white);
    line-height: 29px;
    max-width: 600px;
    margin-left: auto;
}

/* =================================================================
   LEGACY SECTION
================================================================= */
.td_history-legacy {
    display: flex;
    min-height: 466px;
}

.td_history-legacy__left {
    flex: 1;
    background: var(--tdh-orange);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 40px 64px;
}

.td_history-legacy__heading {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 48px;
    color: var(--tdh-azure);
    letter-spacing: -0.2px;
    line-height: 1.15;
    text-align: left;
    max-width: 450px;
    margin-left: auto;
}

.td_history-legacy__heading em {
    font-style: normal;
    color: var(--tdh-white);
}

.td_history-legacy__right {
    flex: 1;
    background: var(--tdh-white);
    display: flex;
    align-items: center;
    padding: 40px 64px;
}

.td_history-legacy__text-wrap {
    max-width: 581px;
}

.td_history-legacy__text-wrap p {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 23px;
    color: var(--tdh-azure);
    margin-bottom: 10px;
}

.td_history-legacy__text-wrap p:last-child {
    margin-bottom: 0;
}

.td_history-legacy__quote {
    font-style: italic;
    color: var(--tdh-orange) !important;
}

/* =================================================================
   VIDEO SECTION
================================================================= */
.td_history-video-section {
    background: var(--tdh-navy);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 64px;
}

.td_history-video-section__frame {
    position: relative;
    max-width: 860px;
    width: 100%;
    aspect-ratio: 860 / 483.75;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.td_history-video-section__placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.td_history-video-section__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(200,135,58,0.05) 0%, rgba(200,135,58,0) 60%);
    z-index: 1;
}

.td_history-video-section__play {
    position: relative;
    z-index: 2;
    width: 72px;
    height: 72px;
    border-radius: 36px;
    background: rgba(15, 34, 70,0.7);
    border: 2px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.td_history-video-section__frame:hover .td_history-video-section__play {
    background: rgba(15,34,70,0.8);
    transform: scale(1.05);
}

.td_history-video-section__embed {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 3;
}

.td_history-video-section__embed iframe,
.td_history-video-section__embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =================================================================
   TIMELINE SECTION
================================================================= */
.td_history-timeline {
    background: var(--tdh-light-bg);
    display: flex;
}

/* ── Sidebar ── */
.td_history-timeline__sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--tdh-navy);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 32px 22px 32px 26px;
    overflow-y: auto;
    align-self: stretch;
    z-index: 2;
    align-items: center;
}

.td_history-timeline__sidebar-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 24px;
    color: var(--tdh-white);
    letter-spacing: -0.2px;
    line-height: 1.168;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.td_history-timeline__year-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.td_history-timeline__year-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    width: 100%;
    text-align: left;
    transition: opacity 0.2s;
}

.td_history-timeline__year-btn:hover { opacity: 0.8; }

.td_history-timeline__year-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--tdh-silver);
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.td_history-timeline__year-btn--active .td_history-timeline__year-dot {
    background: var(--tdh-orange);
    transform: scale(1.5);
}

.td_history-timeline__year-label {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--tdh-silver);
    letter-spacing: -0.2px;
    transition: color 0.2s, font-size 0.2s, font-weight 0.2s;
}

.td_history-timeline__year-btn--active .td_history-timeline__year-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--tdh-orange);
}

/* ── Main content ── */
.td_history-timeline__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 731px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: none;
}

.td_history-timeline__main-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    opacity: 0.15;
}

.td_history-timeline__main > * { position: relative; z-index: 1; }

/* ── Ribbon ── */
.td_history-timeline__ribbon-outer {
    overflow: hidden;
    background: rgba(248,247,247,0.95);
    backdrop-filter: blur(2px);
    flex-shrink: 0;
    position: relative;
    cursor: auto;
}

.td_history-timeline__ribbon {
    display: flex;
    will-change: transform;
    transition: transform 0.48s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}

.td_history-timeline__ribbon::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 44px;
    width: calc(100% * (var(--tdh-item-count, 13) - 1) / 3);
    height: 1px;
    background: rgba(233,150,62,0.35);
    z-index: 0;
}

.td_history-timeline__ribbon-item {
    flex: 0 0 33.333%;
    padding: 20px 44px 12px;
    position: relative;
}

.td_history-tri__cat {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 10px;
    line-height: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(26,39,68,0.35);
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
}

.td_history-tri__dot-row {
    display: flex;
    align-items: center;
    height: 12px;
    margin-bottom: 8px;
    position: relative;
}

.td_history-tri__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tdh-orange);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: background 0.3s, transform 0.3s;
}

.td_history-timeline__ribbon-item--active .td_history-tri__cat {
    color: var(--tdh-dark-text);
}

/* Timeline year numbers use Playfair Display */
.td_history-tri__year {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 88px;
    line-height: 88px;
    letter-spacing: -4px;
    color: rgba(26,39,68,0.12);
    transition: color 0.3s;
}

.td_history-timeline__ribbon-item--active .td_history-tri__year {
    color: var(--tdh-dark-text);
}

/* ── Slides ── */
.td_history-timeline__slides-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.td_history-timeline__slides-viewport {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    overflow-y: auto;
}

.td_history-timeline__slide {
    position: absolute;
    inset: 0;
    display: none;
    padding: 24px 44px 16px;
    gap: 24px;
    will-change: transform, opacity;
}

.td_history-timeline__slide--active {
    display: flex;
}

/* Slide enter/exit animations */
@keyframes tdHistorySlideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes tdHistorySlideInFromLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@keyframes tdHistorySlideOutToLeft {
    from { transform: translateX(0);     opacity: 1; }
    to   { transform: translateX(-100%); opacity: 0; }
}
@keyframes tdHistorySlideOutToRight {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

.td_history-slide--in-right  { animation: tdHistorySlideInFromRight  0.48s cubic-bezier(0.4,0,0.2,1) forwards; }
.td_history-slide--in-left   { animation: tdHistorySlideInFromLeft   0.48s cubic-bezier(0.4,0,0.2,1) forwards; }
.td_history-slide--out-left  { animation: tdHistorySlideOutToLeft    0.48s cubic-bezier(0.4,0,0.2,1) forwards; }
.td_history-slide--out-right { animation: tdHistorySlideOutToRight   0.48s cubic-bezier(0.4,0,0.2,1) forwards; }

/* Slide content stagger */
@keyframes tdHistoryContentFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.td_history-content--stagger-1 { animation: tdHistoryContentFadeUp 0.4s ease 0.30s both; }
.td_history-content--stagger-2 { animation: tdHistoryContentFadeUp 0.4s ease 0.40s both; }
.td_history-content--stagger-3 { animation: tdHistoryContentFadeUp 0.4s ease 0.50s both; }

.td_history-timeline__slide-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Slide titles use Playfair Display */
.td_history-timeline__slide-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--tdh-orange);
    line-height: 27.5px;
    margin-bottom: 12px;
    will-change: opacity, transform;
}

.td_history-timeline__slide-text {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 23px;
    color: var(--tdh-azure);
    overflow: auto;
    flex: 1;
    will-change: opacity, transform;
}

.td_history-timeline__slide-right {
    flex: 0 0 625px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    will-change: opacity, transform;
}

.td_history-timeline__slide-photo {
    width: 100%;
    height: 350px;
    max-height: 350px;
    border: 1px solid rgba(0,0,0,0.07);
    overflow: hidden;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.td_history-timeline__slide-caption {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 23px;
    color: var(--tdh-dark-text);
}

/* ── Timeline nav ── */
.td_history-timeline__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 44px;
    cursor: auto;
    height: 56px;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: var(--tdh-slide-bg);
    flex-shrink: 0;
}

.td_history-timeline__nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 1.28px;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.td_history-timeline__nav-btn:hover { opacity: 0.7; }

.td_history-timeline__nav-btn--prev { color: var(--tdh-navy); }
.td_history-timeline__nav-btn--next { color: var(--tdh-navy); }

.td_history-timeline__nav-btn--prev:disabled,
.td_history-timeline__nav-btn--next:disabled {
    opacity: 0.3;
    cursor: default;
}

.td_history-timeline__nav-btn svg { height: 28px; width: auto; }

.td_history-timeline__counter {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 31px;
}

.td_history-timeline__counter-cur { color: var(--tdh-dark-text); }
.td_history-timeline__counter-tot { color: #999; }

/* ── Mobile dropdown ── */
.td_history-timeline-mobile-select {
    display: none;
}

/* =================================================================
   RESPONSIVE — TABLET
================================================================= */
@media (max-width: 1024px) {
    .td_history-hero { padding: 0 40px; }
    .td_history-hero__headline { font-size: 64px; line-height: 70px; }

    .td_history-legacy__heading { font-size: 36px; }

    .td_history-timeline__slide-right { flex: 0 0 320px; }
}

/* =================================================================
   RESPONSIVE — MOBILE
================================================================= */
@media (max-width: 768px) {
    /* Hero */
    .top-menu {z-index: 4!important;}
    .td_history-hero {
        height: 570px;
        padding: 0 20px;
        justify-content: flex-start;
        align-items: center;
        padding-bottom: 60px;

    }

    .td_history-hero__bg, .td_history-hero__overlay {height:600px;}
    .td_history-hero .container:not(.td_history-hero__content) {position: static; z-index:2;}
    .td_history-hero__content { text-align: left; padding-right: 0; position: static!important;margin-top:auto;z-index: 1!important;}
    .td_history-hero__est     { font-size: 20px; line-height: 22px; }
    .td_history-hero__headline { font-size: 50px; line-height: 55px; }
    .td_history-hero__sub     { font-size: 16px; line-height: 24px; max-width: 306px; margin-left: 0; }

    /* Legacy */
    .td_history-legacy { flex-direction: column; height: auto; }
    .td_history-legacy__left  { padding: 50px 20px; justify-content: flex-start; }
    .td_history-legacy__right { padding: 50px 20px; }
    .td_history-legacy__heading { font-size: 38px; margin-left: 0; max-width: none; }

    /* Video */
    .td_history-video-section { padding: 80px 20px; }
    /*
    .td_history-video-section__frame { aspect-ratio: unset; height: 180px; }
 */
    /* Timeline */
    .td_history-timeline { flex-direction: column; }
    .td_history-timeline__main { cursor: auto; }

    .td_history-timeline__sidebar {
        width: 100%;
        height: auto;
        flex-direction: column;
        gap: 0;
        padding: 24px 20px 16px;
        overflow-y: visible;
    }

    .td_history-timeline__sidebar-title {
        display: flex;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        margin-bottom: 16px;
        font-size: 24px;
    }

    .td_history-timeline__year-list { display: none; }

    .td_history-timeline-mobile-select {
        display: block;
        width: 100%;
    }

    .td_history-timeline-mobile-select__btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border: 1px solid var(--tdh-white);
        border-radius: 32px;
        padding: 8px 22px;
        width: 100%;
        background: none;
        cursor: pointer;
        color: var(--tdh-orange);
        font-family: 'Roboto', sans-serif;
        font-weight: 600;
        font-size: 18px;
        letter-spacing: -0.2px;
    }

    .td_history-timeline-mobile-select__arrow {
        width: 14px;
        height: 14px;
        opacity: 0.8;
        transform: rotate(0deg);
        transition: transform 0.2s;
        flex-shrink: 0;
    }

    .td_history-timeline-mobile-select__arrow--open { transform: rotate(180deg); }

    .td_history-timeline-mobile-select__dropdown {
        display: none;
        flex-direction: column;
        background: var(--tdh-navy);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 8px;
        margin-top: 6px;
        overflow: hidden;
    }

    .td_history-timeline-mobile-select__dropdown--open { display: flex; }

    .td_history-timeline-mobile-select__option {
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px 22px;
        color: var(--tdh-silver);
        font-family: 'Roboto', sans-serif;
        font-size: 15px;
        text-align: left;
        transition: background 0.15s;
    }

    .td_history-timeline-mobile-select__option:hover { background: rgba(255,255,255,0.08); }
    .td_history-timeline-mobile-select__option--active { color: var(--tdh-orange); font-weight: 600; }

    .td_history-timeline__main {
        height: auto;
        min-height: 700px;
    }

    /* Ribbon — 1 item per view on mobile */
    .td_history-timeline__ribbon-item {
        flex: 0 0 100%;
        padding: 20px 20px 10px;
    }

    .td_history-tri__year { font-size: 56px; line-height: 60px; }

    .td_history-timeline__slide {
        flex-direction: column;
        padding: 16px 20px 0;
        gap: 16px;
    }

    .td_history-timeline__slide-right {
        flex: none;
        width: 100%;
    }

    .td_history-timeline__slide-photo { height: 200px; }

    .td_history-timeline__nav { padding: 0 20px; }
}

.custom-cursor {
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.6);
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
    transform: translate(-50%,-50%) scale(1);
    font-family: "Darline Serif Regular",serif;
    font-size: .85rem;
    letter-spacing: 1px;
    color: #fff;
    background: #0F2246BF;
    backdrop-filter: blur(4px);
    transition: border-color .25s ease,background .25s ease,transform .25s ease,opacity .4s ease;
    opacity: 1
}

.custom-cursor.next,.custom-cursor.prev {
    transform: translate(-50%,-50%) scale(1.25)
}

.custom-cursor.clicked {
    transform: translate(-50%,-50%) scale(.9);
    opacity: .7
}

.custom-cursor.next:after {
    content: "NEXT"
}

.custom-cursor.prev:after {
    content: "PREV"
}
@media (max-width: 768px) {
    .custom-cursor {
        display: none!important
    }
}
