/* Person Timeline2 CSS */

/* Base Timeline Styles */
.lp-timeline2 {
    font-family: var(--lp-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    min-height: auto;
}

.lp-timeline2 h3 {
    font-family: var(--lp-font-family, inherit);
    color: var(--lp-heading-color, #2c3e50);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

.lp-timeline2 .section-container {
    background: var(--lp-section-bg, #ffffff) !important;
    border: var(--lp-section-border, 1px solid #e1e5e9) !important;
    border-radius: var(--lp-section-radius, 8px) !important;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: var(--lp-section-shadow, 0 1px 3px rgba(0,0,0,0.1)) !important;
}

.lp-timeline2 .section-title {
    background: var(--lp-section-bg, #ffffff);
    margin: 0;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--lp-heading-color, #2c3e50);
    border-bottom: 1px solid var(--lp-border-color, #e1e5e9);
    font-family: var(--lp-font-family, inherit);
}

.lp-timeline2-item {
    display: flex;
    margin-bottom: 25px;
    background: var(--lp-background-color, #ffffff);
    border: 1px solid var(--lp-border-color, #e1e5e9);
    border-radius: var(--lp-section-radius, 8px);
    overflow: hidden;
    box-shadow: var(--lp-section-shadow, 0 1px 3px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
}

.lp-timeline2-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Major life events stand out; residences/records are quieter */
.lp-timeline2-item.lp-timeline-supporting {
    opacity: 0.88;
    box-shadow: none;
    background: #fafbfc;
}
.lp-timeline2-item.lp-timeline-supporting .lp-timeline2-date {
    background: #f1f3f5;
}
.lp-timeline2-item.lp-timeline-supporting h4 {
    font-size: 15px;
    font-weight: 500;
    color: #5c6570;
}
.lp-timeline2-item.lp-timeline-major {
    border-color: #cfd6dd;
}
.lp-timeline2-item.lp-timeline-major h4 {
    font-size: 17px;
}

/* Collapsible decade sections */
.lp-decade-group {
    margin: 0 0 22px 0;
    border: 1px solid #d8dee4;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.lp-decade-group-toggle {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid #e8ecf0;
    background: #f4f6f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 14px 16px;
    font: inherit;
    font-weight: 700;
    color: #2c3e50;
    text-align: left;
}
.lp-decade-group-toggle:hover {
    background: #ebeef2;
}
.lp-decade-group-chevron {
    color: #6b7682;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.lp-decade-group:not(.is-open) .lp-decade-group-chevron {
    transform: rotate(-90deg);
}
.lp-decade-group-label {
    font-size: 1.15em;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.lp-decade-group-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}
.lp-decade-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #e4e9ee;
    border: 1px solid #d3dae2;
    font-size: 12px;
    font-weight: 600;
    color: #44515c;
    line-height: 1.4;
}
.lp-decade-chip-icon {
    font-size: 13px;
    line-height: 1;
}
.lp-decade-chip-label {
    font-size: 11px;
    letter-spacing: 0.01em;
}
.lp-decade-chip-count {
    font-variant-numeric: tabular-nums;
    color: #2c3e50;
}
.lp-decade-chip-more {
    background: transparent;
    border-style: dashed;
    color: #6b7682;
}
.lp-decade-group-count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
    color: #6b7682;
    flex-shrink: 0;
}
.lp-decade-group-hint {
    font-size: 12px;
    font-weight: 600;
    color: #0073aa;
    text-decoration: underline;
}
.lp-decade-group-hint .lp-hint-show {
    display: none;
}
.lp-decade-group:not(.is-open) .lp-decade-group-hint .lp-hint-hide {
    display: none;
}
.lp-decade-group:not(.is-open) .lp-decade-group-hint .lp-hint-show {
    display: inline;
}
.lp-decade-group-body {
    padding: 14px 14px 6px;
}
.lp-decade-group-body[hidden] {
    display: none !important;
}

.lp-timeline2-date {
    background: #f8f9fa;
    color: var(--lp-text-color, #495057);
    padding: 20px;
    min-width: 120px;
    text-align: center;
    border-right: 1px solid var(--lp-border-color, #e1e5e9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lp-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.lp-date-day {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.5px;
}

.lp-date-year {
    font-size: 20px;
    font-weight: 700;
    color: var(--lp-heading-color, #2c3e50);
    letter-spacing: 0.5px;
}

.lp-date-age {
    font-size: 10px;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.lp-timeline2-content {
    flex: 1;
    padding: 20px;
    background: var(--lp-background-color, #ffffff);
}

.lp-timeline2-content h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--lp-heading-color, #2c3e50);
    font-family: var(--lp-font-family, inherit);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-event-narrative {
    color: var(--lp-text-color, #333);
    line-height: 1.8;
    font-size: 16px;
    margin: 20px 0;
    font-weight: 400;
}

.lp-event-narrative a {
    color: var(--lp-link-color, #007cba);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.lp-event-narrative a:hover {
    color: var(--lp-link-hover-color, #005a87);
    text-decoration: underline;
}

.lp-decade-marker {
    display: flex;
    align-items: center;
    margin: 60px 0 40px 0;
    position: relative;
}

.lp-decade-line {
    flex: 1;
    height: 2px;
    background: var(--lp-border-color, #dee2e6);
    border-radius: 1px;
}

.lp-decade-label {
    background: #f8f9fa;
    color: var(--lp-text-color, #495057);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin: 0 20px;
    font-family: var(--lp-font-family, inherit);
    border: 1px solid var(--lp-border-color, #dee2e6);
    font-size: 14px;
}







/* Legacy Theme Overrides */
.lp-timeline2.inherit-theme {
    font-family: inherit !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
    min-height: auto !important;
    box-sizing: border-box !important;
}

.lp-timeline2.inherit-theme .lp-timeline2-item {
    background: white !important;
    border: 1px solid #ddd !important;
    display: table !important;
    width: 100% !important;
    margin-bottom: 15px !important;
    table-layout: fixed !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.lp-timeline2.inherit-theme .lp-timeline2-date {
    background: #666 !important;
    color: white !important;
    padding: 15px !important;
    display: table-cell !important;
    width: 100px !important;
    vertical-align: middle !important;
    text-align: center !important;
    border-right: 1px solid #ddd !important;
}

.lp-timeline2.inherit-theme .lp-timeline2-content {
    padding: 20px !important;
    display: table-cell !important;
    vertical-align: top !important;
    background: white !important;
}




.lp-timeline2.inherit-theme .lp-date-day {
    color: rgba(255, 255, 255, 0.85) !important;
    background: none !important;
    padding: 0 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.lp-timeline2.inherit-theme .lp-date-year {
    color: white !important;
    background: none !important;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    margin: 4px 0 !important;
    line-height: 1 !important;
}

.lp-timeline2.inherit-theme .lp-date-badge {
    color: white !important;
    background: none !important;
    padding: 0 !important;
}

.lp-timeline2.inherit-theme h3,
.lp-timeline2.inherit-theme .lp-timeline2-content h4 {
    font-family: inherit !important;
    color: #333 !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
}

.lp-timeline2.inherit-theme .section-container {
    background: transparent !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin-bottom: 20px !important;
    box-shadow: none !important;
}

.lp-timeline2.inherit-theme .section-title {
    background: #f5f5f5 !important;
    color: inherit !important;
    border-bottom: 1px solid #ddd !important;
}

.lp-timeline2.inherit-theme .lp-decade-marker {
    display: block !important;
    margin: 30px 0 20px 0 !important;
}

.lp-timeline2.inherit-theme .lp-decade-line {
    display: none !important;
}

.lp-timeline2.inherit-theme .lp-decade-label {
    background: #f5f5f5 !important;
    color: inherit !important;
    border: 1px solid #ddd !important;
    margin: 0 !important;
    text-align: center !important;
    padding: 8px 15px !important;
}

/* Modal Styles */
.lp-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.lp-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.lp-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.lp-modal-close:hover {
    color: black;
}

#lp-answer-text {
    width: 100%;
    min-height: 200px;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

.lp-save-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

.lp-save-btn:hover {
    background: #005a87;
}

/*
 * Leaflet tile grid / marker boxes: theme CSS often applies border,
 * max-width:100%, or height:auto to all img tags. That breaks OSM tiles.
 * Not a map/plugin setting — CSS conflict only.
 */
#timeline2-map.leaflet-container,
.lp-timeline2 .leaflet-container {
    background: #ddd;
    max-width: 100%;
}

#timeline2-map .leaflet-tile-pane img,
#timeline2-map img.leaflet-tile,
.lp-timeline2 .leaflet-tile-pane img,
.lp-timeline2 img.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    width: 256px !important;
    height: 256px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

#timeline2-map .leaflet-marker-icon,
#timeline2-map .leaflet-marker-shadow,
.lp-timeline2 .leaflet-marker-icon,
.lp-timeline2 .leaflet-marker-shadow {
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .lp-timeline2-item {
        flex-direction: column;
    }
    .lp-timeline2-date {
        min-width: auto;
        padding: 15px;
    }
    .lp-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    .lp-timeline2 {
        padding: 0;
    }
    #timeline2-map {
        height: 240px !important;
        max-width: 100%;
    }
}