/* Prevent text selection inside timeline */
#timeline-embed, #timeline-embed * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Prevent WordPress admin frontend block selection */
.wp-block-html {
    pointer-events: none;
    /* Fix: keep the block in a low stacking order so page nav dropdowns
       (which come earlier in the DOM) can paint above it */
    position: relative;
    z-index: 0;
}
.wp-block-html #timeline-embed,
.wp-block-html #timeline-embed * {
    pointer-events: auto;
}

/* Remove focus outline on navigation arrows */
.tl-slidenav-next:focus,
.tl-slidenav-previous:focus {
    outline: none !important;
}

/* Search Button Styles */
.tl-menubar-button {
    padding: 4px !important;
    margin: 2px 0 !important;
}

.tl-menubar {
    padding: 4px 0 !important;
    top: auto !important;
    bottom: 31px !important;
}

/* Search Modal */
.tl-search-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tl-search-modal-content {
    background-color: #fff;
    margin: 80px auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tl-search-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tl-search-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.tl-search-close {
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.tl-search-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.tl-search-input-container {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.tl-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.tl-search-input:focus {
    outline: none;
    border-color: #4285f4;
}

.tl-search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.tl-search-result-item {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.tl-search-result-item:hover {
    background-color: #f8f9fa;
}

.tl-search-result-item:last-child {
    border-bottom: none;
}

.tl-search-result-headline {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.tl-search-result-date {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.tl-search-result-text {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
}

.tl-search-highlight {
    background-color: #fff176;
    font-weight: 600;
    padding: 0 2px;
}

.tl-search-no-results {
    padding: 40px 24px;
    text-align: center;
    color: #999;
    font-size: 15px;
}

.tl-search-status {
    padding: 12px 24px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

/* Image Lightbox */
#timeline-embed .tl-slide .tl-media img.tl-media-image {
    cursor: zoom-in;
}

.tl-img-lightbox {
    display: none;
    position: fixed;
    z-index: 10050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-sizing: border-box;
}

.tl-img-lightbox.is-open {
    display: flex;
}

.tl-img-lightbox-backdrop {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background:
        radial-gradient(ellipse 85% 65% at 50% 42%, rgba(58, 58, 62, 0.38) 0%, transparent 55%),
        radial-gradient(ellipse 120% 100% at 50% 100%, rgba(0, 0, 0, 0.42) 0%, transparent 45%),
        rgba(22, 22, 26, 0.82);
}

.tl-img-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: 94vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.tl-img-lightbox-panel > * {
    pointer-events: auto;
}

.tl-img-lightbox-frame {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.tl-img-lightbox-toolbar {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 10;
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 6px 4px 7px;
    border-radius: 999px;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: rgba(48, 48, 52, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(0);
    backdrop-filter: blur(16px) saturate(0);
    border: none;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.22);
}

.tl-img-lightbox-toolbar button.tl-img-lightbox-btn-zoom {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f2;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.tl-img-lightbox-toolbar button.tl-img-lightbox-btn-zoom:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.tl-img-lightbox-toolbar button.tl-img-lightbox-btn-zoom:active {
    transform: scale(0.94);
}

.tl-img-lightbox-toolbar button#tl-img-zoom-reset {
    min-width: auto;
    height: 24px;
    padding: 0 9px;
    margin-left: 1px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 248, 250, 0.98);
    cursor: pointer;
    font-family: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.tl-img-lightbox-toolbar button#tl-img-zoom-reset:hover {
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.tl-img-lightbox-toolbar button#tl-img-zoom-reset:active {
    transform: scale(0.96);
}

.tl-img-lightbox-zoom-label {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(232, 232, 236, 0.98);
    min-width: 38px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding: 0 2px;
}

.tl-img-lightbox-viewport-shell {
    position: relative;
    display: inline-block;
    vertical-align: top;
    max-width: 92vw;
    max-height: 92vh;
    box-sizing: border-box;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(165deg, rgba(72, 72, 78, 0.28) 0%, transparent 44%),
        linear-gradient(180deg, #2a2a2f 0%, #1c1c20 100%);
    border-radius: 12px;
    border: none;
    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.22),
        0 16px 40px -8px rgba(0, 0, 0, 0.32);
}

.tl-img-lightbox-viewport-shell::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    pointer-events: none;
    z-index: 5;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.tl-img-lightbox-close {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 4;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(58, 58, 62, 0.92);
    -webkit-backdrop-filter: blur(14px) saturate(0);
    backdrop-filter: blur(14px) saturate(0);
    color: #fafafa;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.28),
        0 3px 12px rgba(0, 0, 0, 0.28);
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.tl-img-lightbox-close:hover {
    background: rgba(72, 72, 78, 0.96);
    color: #fff;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.38),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

.tl-img-lightbox-viewport {
    position: relative;
    z-index: 1;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    cursor: grab;
    text-align: center;
    white-space: nowrap;
}

.tl-img-lightbox-viewport::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.tl-img-lightbox-viewport-shell.is-locked .tl-img-lightbox-viewport {
    height: 100%;
    min-height: 0;
}

.tl-img-lightbox-viewport.is-dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

.tl-img-lightbox-scale-wrap {
    display: inline-block;
    vertical-align: middle;
    white-space: normal;
    padding: 16px;
    text-align: left;
}

.tl-img-lightbox-scale-wrap img {
    display: block;
    max-width: min(88vw, 1200px);
    width: auto;
    height: auto;
    vertical-align: middle;
    border-radius: 3px;
    border: none;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 6px 22px rgba(0, 0, 0, 0.2);
}
