/**
 * Marthoma Church Theme - Timeline Widget Styles
 *
 * @package MarthomaChurch
 */

/* Main Container */
.marthoma-timeline-widget {
    width: 100%;
}

/* Main Title */
.timeline-main-title {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-weight: var(--marthoma-font-weight-heading, 600);
    color: var(--marthoma-primary, #000000);
    margin-bottom: 40px;
    text-align: center;
}

/* Wrapper - Side by Side Layout */
.timeline-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 50px;
}

/* Image Position Variants */
.timeline-wrapper.timeline-image-left {
    flex-direction: row;
}

.timeline-wrapper.timeline-image-right {
    flex-direction: row-reverse;
}

/* Main Image */
.timeline-main-image {
    flex: 0 0 40%;
    max-width: 40%;
    position: sticky;
    top: 100px;
}

.timeline-main-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    transition: opacity 0.2s ease-in-out;
}

.timeline-main-image img.timeline-image-fading {
    opacity: 0;
}

/* Timeline Container */
.timeline-container {
    flex: 1;
    position: relative;
}

/* Individual Entry */
.timeline-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0;
    position: relative;
}

/* Hide line for last entry only when collapsed */
.timeline-entry:last-child:not(.is-expanded) .timeline-connector-line {
    display: none;
}

/* Connector (Line only - no circle/dot) */
.timeline-connector {
    position: relative;
    margin-right: 20px;
    flex-shrink: 0;
    width: 2px;
    align-self: stretch;
}

/* Vertical Connector Line - hidden by default */
.timeline-connector-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 0;
    background-color: var(--marthoma-light-blue, #B7D8FB);
    transition: height 0.5s ease-out;
}

/* Show line only for expanded entry - animates from top to bottom */
.timeline-entry.is-expanded .timeline-connector-line {
    height: 100%;
}

/* Hide icon/dot completely */
.timeline-entry-icon {
    display: none;
}

.timeline-entry-icon img {
    display: none;
}

.timeline-entry-icon--default {
    display: none;
}

.timeline-dot {
    display: none;
}

/* Entry Wrapper */
.timeline-entry-wrapper {
    flex: 1;
    padding: 0 0 20px 0;
}

/* Entry Header */
.timeline-entry-header {
    margin-bottom: 8px;
}

.timeline-entry-title {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-weight: 600;
    font-size: 16px;
    color: var(--marthoma-primary, #000000);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.timeline-entry-number {
    color: var(--marthoma-button, #375EFB);
    font-weight: 700;
    margin-right: 4px;
}

.timeline-entry-subtitle {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    color: var(--marthoma-secondary, #54595F);
    font-weight: 500;
    margin: 0;
}

/* Entry Content */
.timeline-entry-content {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    color: var(--marthoma-text, #7A7A7A);
    line-height: 1.7;
    padding: 12px 0;
    overflow: hidden;
}

.timeline-entry-content p {
    margin-bottom: 12px;
}

.timeline-entry-content p:last-child {
    margin-bottom: 0;
}

/* Read More Button */
.timeline-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    color: #04141E;
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s ease;
    outline: none;
}

.timeline-read-more:hover {
    color: var(--marthoma-accent, #5251FF);
}

.timeline-read-more:focus {
    outline: none;
}

.timeline-read-more:focus-visible {
    outline: 2px solid var(--marthoma-accent, #5251FF);
    outline-offset: 2px;
    border-radius: 4px;
}

.read-more-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--marthoma-light-blue, #B7D8FB);
    border-radius: 50%;
    color: var(--marthoma-primary, #000000);
    transition: background-color 0.3s ease;
}

.timeline-read-more:hover .read-more-icon {
    background: var(--marthoma-button, #375EFB);
    color: #ffffff;
}

/* Expanded State Styling */
.timeline-entry.is-expanded .timeline-entry-wrapper {
    background: rgba(183, 216, 251, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-left: -16px;
    padding-left: 16px;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .timeline-main-image {
        flex: 0 0 35%;
        max-width: 35%;
    }

    .timeline-wrapper {
        gap: 40px;
    }
}

/* Mobile - Stack Layout */
@media (max-width: 768px) {
    .timeline-wrapper,
    .timeline-wrapper.timeline-image-left,
    .timeline-wrapper.timeline-image-right {
        flex-direction: column;
        gap: 30px;
    }

    .timeline-main-image {
        flex: 0 0 100%;
        max-width: 100%;
        position: relative;
        top: auto;
    }

    .timeline-main-image img {
        max-height: 300px;
        object-fit: cover;
    }

    .timeline-main-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .timeline-connector {
        margin-right: 16px;
    }

    .timeline-entry-title {
        font-size: 15px;
    }

    .timeline-entry-content {
        font-size: 13px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .timeline-connector {
        margin-right: 12px;
    }

    .timeline-entry.is-expanded .timeline-entry-wrapper {
        margin-left: -8px;
        padding: 12px;
        padding-left: 12px;
    }
}


/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .timeline-entry-content,
    .timeline-read-more,
    .timeline-entry-wrapper,
    .read-more-icon,
    .timeline-main-image img,
    .timeline-connector-line {
        transition: none;
    }

    .timeline-main-image img.timeline-image-fading {
        opacity: 1;
    }
}

/* ==========================================
   ELEMENTOR EDITOR
   ========================================== */
.elementor-editor-active .marthoma-timeline-widget {
    min-height: 200px;
}

.elementor-editor-active .timeline-entry-content {
    display: block !important;
}
