/* =========================================================================
   GTV Timeline — Front-end Styles
   VERSION: 3.0
   ========================================================================= */

:root {
    --brand-purple:    #5e2d79;
    --purple-2:        #8e44ad;
    --purple-3:        #4a235a;
    --bg-purple-light: #fdfaff;
    --bg-hover-tint:   #faf5fd;
    --nav-text-color:  #888;
    --year-color:      #999;
}

/* Sticky fix — WordPress themes often set overflow:hidden on content wrappers */
.entry-content,
.site-content,
.content-area,
.inside-article,
.post-content {
    overflow: visible !important;
}

/* --- Hero (Desktop) --- */
.timeline-hero {
    position: relative; width: 100vw; margin-left: -50vw; left: 50%;
    display: flex; flex-wrap: wrap; min-height: 550px; margin-bottom: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.hero-left {
    width: 50%; background-color: var(--brand-purple); color: white;
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px 80px; box-sizing: border-box;
}
.hero-left h1 {
    font-size: 3.2rem; font-weight: 800; line-height: 1.1; text-transform: uppercase;
    color: white; position: relative; margin: 0 0 35px 0; padding-bottom: 20px;
}
.hero-left h1::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 60px; height: 3px; background-color: white;
}
.hero-left p {
    font-size: 1.1rem; line-height: 1.6; color: rgba(255,255,255,0.9);
    margin-bottom: 20px; max-width: 600px;
}
.hero-right {
    width: 50%; background-size: cover; background-position: center; position: relative;
}
.hero-right::before {
    content: ''; position: absolute; inset: 0;
    background-color: rgba(0,0,0,0.5); z-index: 1;
}
.hero-image-caption {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
    padding: 30px 20px 14px; font-size: 0.78rem; line-height: 1.4;
    color: rgba(255,255,255,0.85); font-style: italic;
}

/* --- Timeline Layout --- */
.timeline-wrapper {
    display: flex; justify-content: center; position: relative;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    max-width: 1200px; margin: 0 auto; align-items: flex-start;
}
.timeline-container {
    position: relative; max-width: 1050px; margin: 0 auto;
    padding: 20px 0 120px; flex-grow: 1;
}

/* Central line */
.timeline-container::after {
    content: ''; position: absolute; width: 4px;
    background-color: var(--brand-purple);
    top: 0; bottom: 60px; left: 50%; margin-left: -2px;
}
/* Diamond end cap */
.timeline-container::before {
    content: ''; position: absolute; bottom: 60px; left: 50%;
    width: 12px; height: 12px; background-color: var(--brand-purple);
    transform: translateX(-50%) rotate(45deg); z-index: 2;
}

/* Footer link */
.timeline-footer {
    position: absolute; bottom: 15px; width: 100%; text-align: center; z-index: 5;
}
.back-to-top-link {
    display: inline-block; color: var(--brand-purple); font-weight: bold;
    text-decoration: none; font-size: 0.9rem; text-transform: uppercase;
    letter-spacing: 1px; transition: all 0.2s ease;
}
.back-to-top-link:hover { color: var(--purple-2); transform: translateY(-3px); }
.back-to-top-link span { font-size: 1.2em; vertical-align: middle; margin-left: 5px; }

/* --- Event Row --- */
.timeline-row {
    display: flex; align-items: center; justify-content: center;
    width: 100%; margin-bottom: 80px; position: relative;
    scroll-margin-top: 180px;
}
.timeline-row::after {
    content: ''; position: absolute; width: 20px; height: 20px;
    left: 50%; transform: translateX(-50%);
    background-color: var(--bg-purple-light);
    border: 4px solid var(--brand-purple);
    border-radius: 50%; z-index: 2;
    transition: background-color 0.3s, border-color 0.3s;
}
.timeline-row:hover::after { background-color: var(--brand-purple); border-color: var(--purple-2); }

/* --- Images --- */
.timeline-image-wrapper {
    width: 45%; padding-right: 40px; text-align: right;
    box-sizing: border-box; position: relative;
}
.timeline-image-wrapper img {
    max-width: 100%; height: auto; border-radius: 8px;
    border: 1px solid #eee; transition: transform 0.3s; cursor: zoom-in;
}
.zoom-hint {
    display: block; font-size: 0.75rem; color: #999; margin-top: 5px;
    opacity: 0; transition: opacity 0.3s; text-transform: uppercase; letter-spacing: 0.5px;
}
.timeline-image-wrapper:hover .zoom-hint { opacity: 1; }

@media screen and (min-width: 1201px) {
    .timeline-row:nth-child(3n+1) .timeline-image-wrapper img { box-shadow: -12px 12px 0 var(--brand-purple); }
    .timeline-row:nth-child(3n+2) .timeline-image-wrapper img { box-shadow: -12px 12px 0 var(--purple-2); }
    .timeline-row:nth-child(3n+3) .timeline-image-wrapper img { box-shadow: -12px 12px 0 var(--purple-3); }
    .timeline-image-wrapper img:hover { transform: scale(1.02); }
}

/* --- Content Box --- */
.timeline-content-wrapper { width: 45%; padding-left: 40px; box-sizing: border-box; }
.timeline-content {
    background-color: var(--bg-purple-light); padding: 30px;
    border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 5px solid var(--brand-purple); position: relative;
    transition: all 0.3s;
}
.timeline-content:hover {
    transform: translateY(-5px);
    background-color: var(--bg-hover-tint);
    border-left-color: var(--purple-2);
    box-shadow: 0 12px 30px rgba(94,45,121,0.15);
}
.timeline-content::before {
    content: ''; position: absolute; top: 50%; left: -10px; margin-top: -10px;
    border-width: 10px; border-style: solid;
    border-color: transparent var(--brand-purple) transparent transparent;
    transition: border-color 0.3s;
}
.timeline-content:hover::before { border-color: transparent var(--purple-2) transparent transparent; }
.timeline-date {
    font-weight: 600; color: var(--year-color); text-transform: uppercase;
    font-size: 0.9rem; letter-spacing: 1px; margin-bottom: 8px; display: block;
}
.timeline-content h2 {
    margin-top: 0; font-size: 1.6rem; font-weight: 800;
    color: #333; line-height: 1.2; margin-bottom: 15px;
}
.timeline-content p { color: #555; font-size: 1rem; line-height: 1.6; margin-bottom: 20px; }

/* --- Buttons --- */
.timeline-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.read-more-btn, .video-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background-color: var(--brand-purple); color: white;
    text-decoration: none; padding: 10px 22px; border-radius: 4px;
    font-size: 0.85rem; font-weight: bold; transition: all 0.2s;
    border: 2px solid var(--brand-purple); cursor: pointer;
    font-family: inherit; line-height: 1;
}
.read-more-btn:hover, .video-btn:hover {
    background-color: white; color: var(--brand-purple);
}
.read-more-btn:active, .video-btn:active {
    background-color: var(--purple-3) !important;
    border-color: var(--purple-3) !important;
    color: white !important; transform: translateY(2px);
}
.video-btn span { margin-right: 6px; font-size: 1.3em; vertical-align: middle; }

/* --- Lightbox --- */
.lightbox-overlay {
    display: none; position: fixed; z-index: 99999;
    padding-top: 50px; inset: 0;
    background-color: rgba(0,0,0,0.9);
}
.lightbox-content {
    margin: auto; display: block; max-width: 90%; max-height: 80vh;
    border-radius: 4px; box-shadow: 0 0 20px rgba(255,255,255,0.2);
    animation: zoomIn 0.3s;
}
@keyframes zoomIn { from { transform: scale(0); } to { transform: scale(1); } }
#lightbox-caption {
    margin: auto; display: block; width: 80%; max-width: 700px;
    text-align: center; color: #ccc; padding: 15px 0; font-size: 1.1rem;
}
.lightbox-close {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; z-index: 100000;
    background: none; border: none;
}
.lightbox-close:hover { color: #bbb; }
.video-overlay { justify-content: center; align-items: center; padding-top: 0; }
.video-container-popup {
    position: relative; width: 80%; max-width: 900px;
    aspect-ratio: 16 / 9; background: black;
}
.video-container-popup iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* --- Side Nav (Desktop) --- */
.timeline-side-nav {
    position: -webkit-sticky; position: sticky;
    top: 80px; margin-left: 20px; padding-top: 20px;
    min-width: 80px; max-height: calc(100vh - 100px);
    overflow-y: auto; height: fit-content; display: none;
}
@media screen and (min-width: 1201px) { .timeline-side-nav { display: block; } }
.timeline-side-nav ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid #eee; }
.timeline-side-nav li { margin-bottom: 0; }
.timeline-side-nav a {
    display: block; padding: 8px 15px; color: var(--nav-text-color);
    text-decoration: none; font-weight: bold; font-size: 14px;
    position: relative; transition: all 0.2s;
}
.timeline-side-nav a::before {
    content: ''; position: absolute; left: -2px; top: 50%;
    transform: translateY(-50%); width: 2px; height: 0;
    background-color: var(--brand-purple); transition: height 0.2s;
}
.timeline-side-nav a.active { color: var(--brand-purple); font-size: 16px; }
.timeline-side-nav a.active::before { height: 100%; }
.nav-item-top { margin-top: 15px !important; border-top: 1px solid #eee; padding-top: 10px; }
.nav-top-link { color: var(--brand-purple) !important; }
.nav-top-link span { font-size: 14px; margin-left: 3px; }

/* --- Tablet & Mobile --- */
@media screen and (max-width: 1200px) {
    .timeline-hero {
        width: 100%; margin-left: 0; left: 0; margin-bottom: 0 !important;
        flex-direction: column; background-color: var(--brand-purple);
        box-shadow: none; min-height: auto;
    }
    .hero-left, .hero-right { width: 100% !important; }
    .hero-right { height: 400px; order: -1; }
    .hero-left { padding: 40px 30px; text-align: left; background-color: transparent; }
    .hero-left h1 { font-size: 2.5rem; }
    .hero-image-caption {
        position: static; background: rgba(0,0,0,0.6);
        padding: 8px 15px; font-size: 0.75rem; color: rgba(255,255,255,0.75);
    }

    .timeline-side-nav {
        display: block; order: -1; width: 100%; margin-left: 0;
        background: #fff; position: -webkit-sticky; position: sticky;
        top: 0; z-index: 999; border-bottom: 1px solid #eee;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        padding: 0; height: auto; max-height: none; overflow-y: visible;
    }
    .timeline-side-nav ul {
        display: flex; flex-direction: row; overflow-x: auto;
        white-space: nowrap; padding: 15px 10px; padding-right: 50px;
        border-left: none; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .timeline-side-nav ul::-webkit-scrollbar { display: none; }
    .timeline-side-nav li { margin: 0; padding: 0; }
    .timeline-side-nav a {
        padding: 8px 16px; background: #f4f4f4; border-radius: 20px;
        margin-right: 10px; font-size: 0.9rem; color: #666;
    }
    .timeline-side-nav a::before { display: none; }
    .timeline-side-nav a.active { background: var(--brand-purple); color: white; }
    .nav-item-top { display: none; }
    .timeline-side-nav::after {
        content: '\2192'; position: absolute; right: 0; top: 0; bottom: 0; width: 50px;
        background: linear-gradient(to right, rgba(255,255,255,0), #fff 40%);
        display: flex; align-items: center; justify-content: center;
        color: var(--brand-purple); font-size: 24px; font-weight: bold;
        pointer-events: none; animation: arrowBounce 1s infinite alternate;
    }
    @keyframes arrowBounce { from { transform: translateX(0); } to { transform: translateX(5px); } }

    .timeline-wrapper { flex-direction: column; }
    .timeline-container { padding-top: 40px; padding-bottom: 40px; }
    .timeline-container::before { display: none; }
    .timeline-footer { display: none; }
    .timeline-container::after { left: 20px; bottom: 0; }

    .timeline-row {
        flex-direction: column; align-items: flex-start; margin-bottom: 40px;
    }
    .timeline-row::after { left: 20px; transform: translateX(-50%); top: 0; }
    .timeline-image-wrapper {
        width: 100%; padding-right: 0; padding-left: 45px;
        text-align: center; margin-bottom: 15px;
    }
    .timeline-image-wrapper img { margin: 0 auto; display: inline-block; }
    .timeline-content-wrapper { width: 100%; padding-left: 45px; }
    .timeline-content::before { display: none; }
    .timeline-content,
    .timeline-image-wrapper img,
    .read-more-btn,
    .video-btn { border-radius: 0 !important; }
}

/* =========================================================================
   HOMEPAGE PREVIEW — horizontal scrollable timeline strip
   [timeline_preview] shortcode
   ========================================================================= */

.gtv-preview {
    width: 100%;
    margin: 0 0 3rem;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Header row */
.gtv-preview__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 3px solid var(--brand-purple, #5e2d79);
}
.gtv-preview__heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: #333;
    margin: 0;
}
.gtv-preview__view-all {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-purple, #5e2d79);
    text-decoration: none;
    white-space: nowrap;
}
.gtv-preview__view-all:hover { text-decoration: underline; }

/* Outer — positions arrows alongside track */
.gtv-preview__outer {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
}

/* Arrow buttons */
.gtv-preview__arrow {
    flex-shrink: 0;
    width: 40px;
    background: var(--brand-purple, #5e2d79);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0.3; /* updated by JS */
    z-index: 2;
}
.gtv-preview__arrow:hover { background: #4a235a; }
.gtv-preview__arrow--prev { border-radius: 4px 0 0 4px; }
.gtv-preview__arrow--next { border-radius: 0 4px 4px 0; }

/* Scrollable track wrapper */
.gtv-preview__track-wrap {
    flex: 1;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding: 1rem 1rem 1.25rem;
    background: #fdfaff;
    border: 1px solid #e8dff0;
}
.gtv-preview__track-wrap::-webkit-scrollbar { display: none; }

/* Track — horizontal flex row */
.gtv-preview__track {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    width: max-content;
}

/* Individual card */
.gtv-preview__card {
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e0d5eb;
    border-top: 4px solid var(--brand-purple, #5e2d79);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-top-color 0.2s;
    position: relative;
    overflow: hidden;
}
.gtv-preview__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(94, 45, 121, 0.15);
    border-top-color: #8e44ad;
}

/* Image */
.gtv-preview__img-wrap {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #f0e8f8;
    flex-shrink: 0;
}
.gtv-preview__img-wrap--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.gtv-preview__no-img { font-size: 2.5rem; opacity: 0.3; }
.gtv-preview__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gtv-preview__card:hover .gtv-preview__img { transform: scale(1.04); }

/* Card body */
.gtv-preview__card-body {
    padding: 1rem 1rem 0.5rem;
    flex: 1;
}
.gtv-preview__year {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 0.375rem;
}
.gtv-preview__title {
    font-size: 0.975rem;
    font-weight: 800;
    color: #222;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}
.gtv-preview__excerpt {
    font-size: 0.825rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* CTA link at card bottom */
.gtv-preview__cta {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-purple, #5e2d79);
    border-top: 1px solid #f0e8f8;
    margin-top: auto;
    transition: background 0.15s;
}
.gtv-preview__card:hover .gtv-preview__cta {
    background: #f9f4fd;
}

/* Final "View all" card */
.gtv-preview__card--more {
    border-top-color: #8e44ad;
    background: linear-gradient(135deg, #4a235a 0%, #5e2d79 100%);
    color: #fff;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 160px;
    width: 160px;
}
.gtv-preview__card--more:hover {
    border-top-color: #c084fc;
    box-shadow: 0 8px 24px rgba(94, 45, 121, 0.3);
}
.gtv-preview__more-icon {
    font-size: 2.5rem;
    color: rgba(255,255,255,0.6);
    display: block;
}
.gtv-preview__more-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.4;
}

/* Mobile — stack vertically, hide arrows */
@media screen and (max-width: 640px) {
    .gtv-preview__arrow { display: none; }
    .gtv-preview__track-wrap {
        padding: 0.75rem 0;
        background: transparent;
        border: none;
    }
    .gtv-preview__track {
        flex-direction: column;
        width: 100%;
    }
    .gtv-preview__card {
        width: 100%;
        flex-direction: row;
        border-top: none;
        border-left: 4px solid var(--brand-purple, #5e2d79);
    }
    .gtv-preview__card:hover { border-left-color: #8e44ad; }
    .gtv-preview__img-wrap {
        width: 100px;
        height: auto;
        min-height: 100px;
        flex-shrink: 0;
        border-radius: 0;
    }
    .gtv-preview__card-body { padding: 0.75rem; }
    .gtv-preview__cta { display: none; }
    .gtv-preview__card--more {
        width: 100%;
        flex-direction: row;
        border-left: 4px solid #c084fc;
        border-top: none;
        min-height: 60px;
        border-radius: 4px;
    }
    .gtv-preview__more-icon { font-size: 1.5rem; }
    .gtv-preview__header { flex-direction: column; gap: 0.5rem; }
}
