/* Jewish Women Timeline CSS */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --timeline-primary: #a1b0d8;
    --timeline-primary-dark: #8a9ac4;
    --timeline-accent: #bb5a3a;
    --timeline-accent-light: rgba(187, 90, 58, 0.15);
    --timeline-text: #333;
    --timeline-text-muted: #666;
    --timeline-bg: #f9f9f9;
    --timeline-card-bg: #ffffff;
    --timeline-border: #e0e0e0;
    --timeline-line: #0e4d92;
    --timeline-transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --timeline-transition-fast: 0.2s ease;
    --timeline-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --timeline-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --timeline-shadow-active: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Break out of WordPress constrained layouts */
#jewish-women-timeline-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding: 0 1rem;
    box-sizing: border-box;
}

.jewish-timeline {
    font-family: 'Heebo', sans-serif;
    width: 100%;
    margin: 3rem auto;
    padding: 0;
    color: var(--timeline-text);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.timeline-header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 700px;
}

.timeline-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--timeline-primary);
    font-weight: 600;
}

.timeline-header p {
    font-size: 1.2rem;
    color: var(--timeline-text-muted);
}

/* ============================================
   Progress Indicator
   ============================================ */
.timeline-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--timeline-text-muted);
}

.timeline-progress-counter {
    font-weight: 600;
    color: var(--timeline-primary);
    min-width: 50px;
    text-align: center;
}

.timeline-progress-bar {
    width: 150px;
    height: 4px;
    background: var(--timeline-border);
    border-radius: 2px;
    overflow: hidden;
}

.timeline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--timeline-primary), var(--timeline-accent));
    border-radius: 2px;
    transition: width var(--timeline-transition);
}

.timeline-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.timeline-navigation button {
    background: var(--timeline-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.timeline-navigation button:hover:not(:disabled) {
    background: var(--timeline-primary);
    transform: scale(1.05);
}

.timeline-navigation button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.timeline-navigation select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--timeline-primary);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: white;
    min-width: 220px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timeline-wrapper {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    padding: 0;
    height: 520px; /* Fixed height for consistency */
    width: calc(100% - 2rem);
    max-width: 100%;
    border: 2px solid var(--timeline-primary);
    border-radius: 8px;
    background-color: var(--timeline-bg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Main horizontal line */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 0%;
    right: 0%;
    top: 50%;
    height: 4px;
    background: linear-gradient(to right, rgba(14, 77, 146, 0.1), #a1b0d8 50%, rgba(14, 77, 146, 0.1));
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
}

.timeline-track {
    display: flex;
    position: relative;
    min-width: 100%;
    z-index: 1;
    transition: transform 0.5s ease;
    align-items: center;
    height: 100%;
    padding: 0 80px;
}

/* Timeline events (each woman) */
.timeline-event {
    min-width: 280px;
    width: 280px;
    height: 100%;
    margin: 0 1.5rem;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-event:hover .timeline-content {
    transform: scale(1.02);
    box-shadow: var(--timeline-shadow-hover);
}

.timeline-event.active {
    z-index: 5;
}

/* Position content boxes above and below the timeline */
.timeline-event.even .timeline-content {
    position: absolute;
    bottom: calc(50% + 25px);
}

.timeline-event.odd .timeline-content {
    position: absolute;
    top: calc(50% + 25px);
}

/* Marker dot on the timeline */
.timeline-marker {
    width: 14px;
    height: 14px;
    background-color: var(--timeline-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 3px white;
    cursor: pointer;
}

.timeline-event:hover .timeline-marker {
    background-color: var(--timeline-accent);
    transform: translate(-50%, -50%) scale(1.1);
}

.timeline-event.active .timeline-marker {
    background-color: var(--timeline-accent);
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(187, 90, 58, 0.3);
}


/* Add connecting line from content to timeline for even events */
.timeline-event.even .timeline-content::after {
    content: '';
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, var(--timeline-primary), var(--timeline-line));
    left: 50%;
    bottom: -25px;
    height: 25px;
    transform: translateX(-50%);
    z-index: 2;
}

/* Add connecting line from content to timeline for odd events */
.timeline-event.odd .timeline-content::before {
    content: '';
    position: absolute;
    width: 2px;
    background: linear-gradient(to top, var(--timeline-primary), var(--timeline-line));
    left: 50%;
    top: -25px;
    height: 25px;
    transform: translateX(-50%);
    z-index: 2;
}

/* Content box */
.timeline-content {
    padding: 1rem;
    background: var(--timeline-card-bg);
    border-radius: 8px;
    box-shadow: var(--timeline-shadow);
    text-align: left;
    width: 260px;
    height: 200px; /* Fixed height for consistency */
    transition: all var(--timeline-transition);
    position: relative;
    z-index: 3;
    border: 1px solid var(--timeline-border);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
}

.timeline-content:hover {
    box-shadow: var(--timeline-shadow-hover);
}

.timeline-event.active .timeline-content {
    transform: translateY(-8px);
    box-shadow: var(--timeline-shadow-active);
    border-left: 4px solid var(--timeline-accent);
    background: linear-gradient(135deg, #fff 0%, var(--timeline-accent-light) 100%);
}

.timeline-event.active .timeline-title {
    color: var(--timeline-accent);
}

/* Content components - simplified for preview with short description */
.timeline-period {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--timeline-accent);
    margin-bottom: 0.15rem;
}

.timeline-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--timeline-line);
    line-height: 1.3;
    font-weight: 600;
    flex-shrink: 0;
}

.timeline-years {
    display: block;
    font-size: 0.8rem;
    color: var(--timeline-text-muted);
    font-weight: normal;
    margin-top: 0.1rem;
    margin-bottom: 0.3rem;
}

.timeline-image {
    margin: 0 -1rem 0.5rem;
    overflow: hidden;
    border-radius: 4px;
    height: 70px;
    width: calc(100% + 2rem);
    flex-shrink: 0;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.timeline-event.active .timeline-image img {
    transform: scale(1.02);
}

.timeline-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--timeline-text-muted);
    overflow: hidden;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* Read more button */
.timeline-read-more {
    margin-top: 0.5rem;
    align-self: flex-end;
    font-size: 0.8rem;
    color: var(--timeline-primary);
    font-weight: 500;
    cursor: pointer;
}

.timeline-description::-webkit-scrollbar {
    width: 6px;
}

.timeline-description::-webkit-scrollbar-thumb {
    background: #0e4d92;
    border-radius: 3px;
}

.timeline-description::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--timeline-primary);
    background: white;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0.7;
    pointer-events: none;
}

/* Star of David animation */
.star-of-david {
    width: 30px;
    height: 30px;
    position: absolute;
    z-index: 10;
    opacity: 0;
    animation: starAnimation 2s ease forwards;
}

.star-of-david:before,
.star-of-david:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border: 2px solid #0e4d92;
    opacity: 0.6;
}

.star-of-david:before {
    clip-path: polygon(50% 0%, 100% 75%, 0% 75%);
}

.star-of-david:after {
    clip-path: polygon(50% 100%, 100% 25%, 0% 25%);
}

@keyframes starAnimation {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    25% {
        opacity: 1;
        transform: scale(1) rotate(30deg);
    }
    75% {
        opacity: 1;
        transform: scale(1) rotate(330deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Star of David decorative element for active markers */
.timeline-event.active .timeline-marker::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 12px solid rgba(187, 90, 58, 0.4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotateStar 4s infinite linear;
}

.timeline-event.active .timeline-marker::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 12px solid rgba(187, 90, 58, 0.4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotateStar 4s infinite linear reverse;
}

@keyframes rotateStar {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .timeline-wrapper {
        height: 480px;
        width: calc(100% - 1rem);
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .timeline-header h2 {
        font-size: 1.8rem;
    }

    .timeline-wrapper {
        width: calc(100% - 1rem);
        height: 480px;
    }

    .timeline-event {
        min-width: 280px;
        width: 280px;
        margin: 0 1.5rem;
    }

    .timeline-content {
        padding: 1.2rem;
        width: 260px;
    }

    .timeline-title {
        font-size: 1.1rem;
        margin-bottom: 0.7rem;
    }

    .timeline-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .timeline-image {
        height: 90px;
        margin-bottom: 0.7rem;
    }
}

@media (max-width: 576px) {
    .timeline-header h2 {
        font-size: 1.5rem;
    }

    .timeline-header p {
        font-size: 1rem;
    }

    .timeline-navigation {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .timeline-navigation button {
        width: 36px;
        height: 36px;
    }

    .timeline-navigation select {
        min-width: 140px;
        font-size: 0.9rem;
    }

    .timeline-wrapper {
        height: 440px;
        padding: 0;
    }

    .timeline-event {
        min-width: 240px;
        width: 240px;
        margin: 0 1rem;
    }

    .timeline-content {
        padding: 1rem 1rem 0.8rem;
        width: 220px;
    }

    .timeline-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .timeline-description {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .timeline-image {
        height: 100px;
        margin: 0 -1rem 0.7rem;
        width: calc(100% + 2rem);
    }

    .timeline-marker {
        width: 20px;
        height: 20px;
    }

    .timeline-event.active .timeline-marker {
        width: 26px;
        height: 26px;
    }
}

/* Media query for extra small devices */
@media (max-width: 400px) {
    .timeline-wrapper {
        height: 400px;
    }

    .timeline-content {
        width: 200px;
        padding: 0.8rem;
    }

    .timeline-title {
        font-size: 0.9rem;
    }

    .timeline-image {
        height: 80px;
    }

    .timeline-description {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

/* Modal styling */
.timeline-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.timeline-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.timeline-modal {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    position: relative;
    overflow-y: auto;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.timeline-modal-overlay.active .timeline-modal {
    transform: scale(1);
    opacity: 1;
}

.timeline-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    background: #f1f1f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--timeline-text);
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.2s ease;
}

.timeline-modal-close:hover {
    background: #e0e0e0;
}

.timeline-modal-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.timeline-modal-period {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--timeline-accent);
    margin-bottom: 0.2rem;
}

.timeline-modal-title {
    font-size: 1.6rem;
    color: var(--timeline-primary);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.timeline-modal-years {
    font-size: 1rem;
    color: var(--timeline-text-muted);
}

.timeline-modal-image {
    margin: 1rem 0;
    text-align: center;
}

.timeline-modal-image img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.timeline-modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--timeline-text);
}

/* Format paragraphs in modal description */
.timeline-modal-description p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.timeline-modal-description p:last-child {
    margin-bottom: 0;
}

/* Format headings in modal description */
.timeline-modal-description h1 {
    font-size: 1.6rem;
    color: var(--timeline-primary);
    margin: 1.5rem 0 0.8rem;
}

.timeline-modal-description h2 {
    font-size: 1.4rem;
    color: var(--timeline-primary);
    margin: 1.4rem 0 0.7rem;
}

.timeline-modal-description h3 {
    font-size: 1.2rem;
    color: var(--timeline-accent);
    margin: 1.2rem 0 0.6rem;
}

.timeline-modal-description h4 {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1rem 0 0.5rem;
}

/* Format strong text */
.timeline-modal-description strong {
    font-weight: 700;
    color: var(--timeline-text);
}

/* Mobile styles for modal */
@media (max-width: 576px) {
    .timeline-modal {
        width: 95%;
        padding: 1rem;
    }
    
    .timeline-modal-title {
        font-size: 1.3rem;
    }
    
    .timeline-modal-years {
        font-size: 0.9rem;
    }
    
    .timeline-modal-image img {
        max-height: 200px;
    }
    
    .timeline-modal-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .timeline-modal-description p {
        margin-bottom: 0.8rem;
        line-height: 1.5;
    }
    
    .timeline-modal-description h1 {
        font-size: 1.3rem;
        margin: 1.2rem 0 0.6rem;
    }
    
    .timeline-modal-description h2 {
        font-size: 1.2rem;
        margin: 1.1rem 0 0.5rem;
    }
    
    .timeline-modal-description h3 {
        font-size: 1.1rem;
        margin: 1rem 0 0.4rem;
    }
    
    .timeline-modal-description h4 {
        font-size: 1rem;
        margin: 0.9rem 0 0.3rem;
    }
}