/* ==========================================================================
   LOGBOOK TIMELINE PAGE STYLES
   ========================================================================== */

body.bg-organic {
    background-color: var(--bg-color); /* Organic Cream #F8F7F2 */
}

.page-content {
    padding-top: 130px;
    padding-bottom: 80px;
}

/* 1. Hero Section */
.logbook-hero {
    max-width: 900px;
    margin-bottom: 60px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 30px;
}

.search-bar-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 8px 16px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
}

.search-bar-wrapper svg {
    color: var(--text-gray);
    margin-right: 12px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    outline: none;
}

.btn-filter {
    background: #F4F3ED;
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-filter:hover { background: #E8E7DF; }

/* 2. Layout Grid */
.logbook-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
    align-items: start;
}

/* 3. Left Sidebar (Index) */
.timeline-sidebar {
    position: sticky;
    top: 120px;
    background: transparent;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.index-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.index-list li {
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
    transition: all 0.2s ease;
}

.index-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.index-list li a span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #DCDBCF;
}

.index-list li.active, .index-list li:hover {
    background: rgba(30, 67, 37, 0.05);
    color: var(--primary-color);
}

.index-list li.active a span {
    background: var(--primary-color);
}

/* 4. Right Timeline Core */
.timeline-core {
    position: relative;
    padding: 20px 0;
}

.timeline-progress-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #DCDBCF;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-progress-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 0%;
    background: var(--primary-color);
    z-index: 2;
    transition: height 0.1s ease;
}

.phase-badge {
    position: relative;
    z-index: 10;
    background: #F4E8D4;
    color: #B7791F;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 24px;
    border-radius: 50px;
    margin: 0 auto 60px auto;
    width: fit-content;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    scroll-margin-top: 140px; /* Jarak aman saat di-scroll melalui index */
}

/* 5. Timeline Item Layout */
.timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 80px;
    position: relative;
    z-index: 5;
    opacity: 0;
    scroll-margin-top: 140px;
}

.timeline-item.left-aligned { flex-direction: row; }
.timeline-item.right-aligned { flex-direction: row-reverse; }

.t-content, .t-media {
    width: calc(50% - 40px);
}

.timeline-item.left-aligned .t-content {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.t-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #DCDBCF;
    border: 3px solid var(--bg-color);
    z-index: 10;
    transition: all 0.3s;
}

.t-marker.active {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(30, 67, 37, 0.15);
}

.t-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.t-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.t-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 67, 37, 0.08);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.t-desc {
    color: var(--text-gray);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.t-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Chip Buttons & Links */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #E8E7DF;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(30, 67, 37, 0.03);
}

.t-media {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    cursor: pointer;
}

.t-media img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.t-media:hover img {
    transform: scale(1.05);
}

.media-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 20px 16px 12px 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: rgba(30, 67, 37, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform 0.3s, background 0.3s;
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--primary-color);
}

.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-gray);
    color: var(--text-dark);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ==========================================================================
   6. LOGBOOK DETAIL MODAL (FOTO, VIDEO & BERITA)
   ========================================================================== */

.logbook-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 16, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.logbook-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.logbook-modal-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 860px;
    max-height: 88vh;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logbook-modal-overlay.active .logbook-modal-card {
    transform: translateY(0) scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px; right: 24px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #F4F3ED;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-dark);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--primary-color);
    color: white;
}

.modal-scroll-content {
    padding: 40px;
    max-height: 88vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 28px;
}

.modal-badge-category {
    display: inline-block;
    background: rgba(30, 67, 37, 0.08);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 10px;
}

.modal-meta {
    font-size: 0.9rem;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot-separator {
    color: #ccc;
}

/* Modal Media Section (Grid Foto & Video) */
.modal-media-section {
    margin-bottom: 32px;
}

.modal-media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.media-box {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 220px;
    background: #f0f0f0;
}

.media-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-label {
    position: absolute;
    bottom: 8px; left: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

/* Video Frame Styling */
.modal-video-box {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.video-responsive {
    position: relative;
    padding-bottom: 52%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Modal Article Typography (Narasi Berita Panjang) */
.modal-article-body {
    color: #333;
    font-size: 1.05rem;
    line-height: 1.8;
    border-top: 1px solid #E8E7DF;
    padding-top: 28px;
}

.modal-article-body p {
    margin-bottom: 18px;
}

.modal-article-body h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 28px 0 12px 0;
}

.modal-article-body blockquote {
    border-left: 4px solid var(--primary-color);
    background: #F8F7F2;
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #4A5568;
}

/* Responsiveness */
@media (max-width: 992px) {
    .logbook-layout {
        grid-template-columns: 1fr;
    }
    .timeline-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 40px;
    }
    .index-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .index-list li {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.8rem; }
    .timeline-progress-line { left: 20px; }
    
    .timeline-item, .timeline-item.left-aligned, .timeline-item.right-aligned {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 60px;
    }

    .t-content, .t-media { width: 100%; }

    .timeline-item.left-aligned .t-content {
        text-align: left;
        align-items: flex-start;
    }

    .t-marker {
        left: 20px;
        top: 0;
        transform: translate(-50%, 0);
    }
    
    .t-media { margin-top: 20px; }

    .modal-scroll-content { padding: 24px; }
    .modal-media-grid { grid-template-columns: 1fr; }
    .modal-title { font-size: 1.6rem; }
}