body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #e0eafc 0%, #fce1ec 100%);
    min-height: 100vh;
    margin: 0;
    color: #222;
    position: relative;
    overflow-x: hidden;
}



.sticky-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(135deg, #e0eafc 0%, #fce1ec 100%);
    box-shadow: 0 2px 12px 0 #2563eb22;
    padding-bottom: 0.5rem;
}



main {
    max-width: 700px;
    margin: 0 auto 0 auto;
    padding: 4.5rem 1rem 0 1rem; /* Add top padding to offset sticky header */
}



body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        url('https://www.transparenttextures.com/patterns/diamond-upholstery.png') repeat,
        linear-gradient(135deg, #e0eafc 0%, #fce1ec 100%);
    opacity: 0.28;
    z-index: 0;
    pointer-events: none;
}



/* User Controls */

.comment-input {
    text-align: left;
}

.user-controls {
    margin: 1rem auto 0;
    max-width: 500px;
    text-align: center;
}

.login-input {
    padding: 0.5rem;
    margin: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn {
    padding: 0.5rem 1rem;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn:hover {
    background: #357abd;
}

#login-section {
    margin: 0.5rem 0;
}

#user-info {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Comment Styles */
.comment {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
}

.comment-text {
    margin-bottom: 0.25rem;
    text-align: left;
    flex: 1;
    display: block;
    word-break: break-word;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
}

.comment-author {
    font-weight: 600;
    color: #2c5282;
}

.comment-time {
    color: #718096;
}

.comment-delete {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
}

.comment-delete:hover {
    color: #c53030;
}

.liked {
    color: #e53e3e;
}

.like-author {
    display: block;
    font-size: 0.8rem;
    color: #4a5568;
    margin-top: 0.25rem;
}

header {
    text-align: center;
    padding: 1rem 1rem 0.5rem 1rem;
    background: transparent;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
    color: #2563eb;
    display: block;
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}



h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
    color: #2563eb;
    display: block;
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}



.title-zoom-img {
    display: inline-block;
    width: 3.5rem;
    height: 3.5rem;
    margin-left: 0.7rem;
    vertical-align: middle;
    border-radius: 50%;
    box-shadow: 0 2px 10px #2563eb22;
    border: 2.5px solid #a7c7e7;
    overflow: hidden;
}
.title-zoom-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}




.subtitle {
    color: #555;
    font-size: 1.15rem;
    margin-bottom: 0;
}

main {
    max-width: 1400px;      /* or any value larger than 700px */
    margin-left: 11cm;      /* keep left margin as before */
    margin-right: 2cm;        /* extend to the right */
}

.month-slider-section {
    position: absolute;
    left: 0;
    background: linear-gradient(90deg, #a7c7e7 0%, #a7c7e7 60%, #ffe0e9 100%);
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px 0 #2563eb22;
    width: 180px;
    margin-left: 1.2rem;
    margin-top: 1cm;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    border-bottom: none;
    box-shadow: none;
    background: transparent;
    z-index: 120;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}
.slider-wrapper input[type="range"] {
    width: 100%;
}
.slider-value {
    position: absolute;
    top: 120%; /* below slider */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.0rem;
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
    pointer-events: none;
    margin-left: 1cm;
}

.slider-edge-right {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.3rem;
}

.slider-label-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.3rem;
}
#selected-month-label {
    display: inline-block;
    font-size: 1.08rem;
    color: #2563eb;
    font-weight: 600;
    background: none;
    padding: 0.1rem 0.7rem;
    border-radius: 0.7rem;
    text-align: center;
    letter-spacing: 0.01em;
    margin: 0 auto;
    margin-left: 1cm;
}

.timeline {
    position: relative;
    margin: 2rem 0;
    padding-left: 210px;
    min-height: 400px;
}



@media (max-width: 900px) {
    .month-slider-section {
        position: static;
        width: 100%;
        margin: 0 0 1.5rem 0;
        padding: 0 1rem 0 0;
        align-items: flex-start;
        background: none;
    }


    .timeline {
        padding-left: 30px;
    }


}



.timeline {
    position: relative;
    margin: 2rem 0;
    padding-left: 30px;
    min-height: 400px;
}



@media (max-width: 900px) {
    .month-slider-section {
        margin: 0 0 1.5rem 0;
        padding: 0 1rem 0 0;
        align-items: flex-start;
    }


}



.month-slider-label {
    min-width: 120px;
    margin-right: 0.5rem;
    text-align: right;
}



.month-slider-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: 0;
}



.month-slider-label {
    min-width: 120px;
    margin-right: 0.5rem;
    text-align: left;
}



.month-slider-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: 30px;
}



.month-slider-section label, .month-slider-section span {
    margin-bottom: 0.3rem;
}



.month-slider-section input[type="range"] {
    width: calc(100% - 40px);
    max-width: 400px;
    min-width: 140px;
    margin-bottom: 0.6rem;
    margin-left: 0;
}



.timeline {
    position: relative;
    margin: 2rem 0;
    padding-left: 30px;
}



.timeline-month {
    scroll-margin-top: 5.5rem;
}



.timeline:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    width: 4px;
    height: 100%;
    background: #2563eb33;
    border-radius: 2px;
}



.timeline-month-marker {
    position: relative;
    height: 0;
    margin: 2.5rem 0 1rem 0;
}



.timeline-month-marker::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    width: 60px;
    height: 4px;
    background: #2563eb66;
    border-radius: 2px;
    z-index: 2;
}



@media (max-width: 600px) {
    .timeline-month-marker::before {
        left: 50%;
        transform: translateX(-50%);
        width: 50vw;
        min-width: 80px;
    }


}



.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    position: relative;
}



.timeline-img {
    flex-shrink: 0;
    width: 135px;
    height: 135px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px #2563eb22;
    background: #fff;
    margin-right: 1.5rem;
    position: relative;
    z-index: 2;
}



.timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.img-zoom-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    display: block;
    width: 100%;
    height: 100%;
}



.timeline-actions {
    margin-top: 1cm; /* Add 1cm margin above the actions */
    padding: 0.5rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.7rem;
}

.like-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s;
    outline: none;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}
.like-btn.liked .like-icon {
    color: #e63946;
    text-shadow: 0 2px 8px #e6394622;
}
.like-btn .like-icon {
    font-size: 1.25rem;
    color: #bbb;
    transition: color 0.2s;
}
.like-count {
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 0.1rem;
}
.comments {
    width: 100%;
    margin-top: 0.2rem;
}
.comments-list {
    margin-bottom: 0.3rem;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.97rem;
    color: #333;
}
.comment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.1rem 0.2rem;
    border-radius: 0.6rem;
    position: relative;
    transition: background 0.15s;
}
.comment:hover, .comment:focus-within {
    background: #f3f3fa;
}
.comment-delete {
    background: none;
    border: none;
    color: #e63946;
    font-size: 1.1rem;
    font-weight: bold;
    margin-left: 0.5rem;
    border-radius: 50%;
    width: 1.7em;
    height: 1.7em;
    line-height: 1.7em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comment:hover .comment-delete,
.comment:focus-within .comment-delete {
    opacity: 1;
}
.comment-delete:hover, .comment-delete:focus {
    background: #ffe6e9;
    color: #b71c1c;
    outline: none;
    opacity: 1;
}

.comment-form {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}
.comment-input {
    flex: 1;
    padding: 0.25rem 0.7rem;
    border-radius: 1rem;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    outline: none;
    background: #f7fafd;
    transition: border 0.2s;
    text-align: left;
}
.comment-input:focus {
    border: 1.5px solid #2563eb;
}
.comment-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 1rem;
    padding: 0.25rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-submit:hover, .comment-submit:focus {
    background: #1746a2;
}

@media (max-width: 900px) {
    .timeline-actions {
        align-items: stretch;
    }
    .comments-list {
        max-height: 80px;
    }
}

.img-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.88);
    animation: fadeIn 0.2s;
}

#img-modal-caption {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 1.2rem 2.2rem 1.2rem 0;
    margin: 0;
    text-shadow: 0 2px 12px #000a;
    max-width: 350px;
    word-break: break-word;
    background: none;
    box-shadow: none;
}

@media (min-width: 900px) {
    #img-modal {
        flex-direction: row;
    }
    #img-modal-caption {
        display: block;
        align-self: flex-start;
        margin-left: 0;
        margin-right: 2.2rem;
        padding: 0;
        text-align: left;
        max-width: 350px;
    }
    .img-modal-content {
        max-width: 60vw;
        margin-right: 0;
    }
}

.img-modal-content {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px #0005;
    background: #fff;
    display: block;
    margin: 0 auto;
}



.img-modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    text-shadow: 0 2px 8px #000;
}



.img-modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    color: #2563eb;
    font-size: 2.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px #0003;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}


.img-modal-arrow.left { left: 2rem; }


.img-modal-arrow.right { right: 2rem; }


.img-modal-arrow:hover, .img-modal-arrow:focus {
    background: #fff;
    opacity: 1;
    outline: 2px solid #2563eb;
}


@media (max-width: 600px) {
    .img-modal-arrow { display: none; }

@media (max-width: 600px) {
  .img-modal-arrow {
    display: block !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    z-index: 10001;
    opacity: 0.85;
    cursor: pointer;
  }
  .img-modal-arrow.left { left: 1rem; }
  .img-modal-arrow.right { right: 1rem; }
}



}




@keyframes fadeIn {
    from { opacity: 0; }


    to { opacity: 1; }


}



.timeline-content {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px #2563eb11;
    position: relative;
    z-index: 1;
    width: 520px;
    max-width: 100vw;
    min-width: 220px;
    margin-bottom: 1cm;
    margin-right: 2cm;
    box-sizing: border-box;
}

@media (max-width: 900px) {
  .timeline-content {
    width: 80vw;
    min-width: 180px;
    margin-right: 1vw;
    padding: 1rem;
  }
  .timeline-actions {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 90vw;
    max-width: 99vw;
  }
}

@media (max-width: 600px) {
  .timeline {
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .timeline-item {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .timeline-img {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    margin: 0 auto 1rem auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  .timeline-img img {
    width: 96vw !important;
    max-width: 96vw !important;
    height: auto !important;
    border-radius: 1rem !important;
    object-fit: cover !important;
  }
  .timeline-content {
    width: 96vw !important;
    max-width: 96vw !important;
    min-width: 0 !important;
    margin: 0 auto 1rem auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }
  .timeline-actions {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 0 auto 1rem auto !important;
  }
  .month-slider-section {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 2vw !important;
    box-sizing: border-box !important;
  }
  .month-slider-section input[type="range"] {
    width: 90vw !important;
    max-width: 100% !important;
  }
  /* --- Robust order/display rules for timeline image/caption on mobile --- */
  .timeline-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .timeline-img {
    display: block !important;
    order: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 auto 1rem auto !important;
    height: auto !important;
    z-index: 2 !important;
  }
  .timeline-content {
    order: 1 !important;
  }
  #img-modal {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    z-index: 9999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.88) !important;
  }
  #img-modal-caption {
    position: absolute !important;
    left: 0; right: 0; bottom: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    background: rgba(0,0,0,0.65) !important;
    color: #fff !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0.8rem 1rem 1.2rem 1rem !important;
    box-sizing: border-box !important;
    z-index: 10002 !important;
    display: block !important;
    border-radius: 0 0 1rem 1rem !important;
  }
  #img-modal-full {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    max-height: 80vh !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    z-index: 10000 !important;
    pointer-events: none !important;
}

#img-modal-video {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    max-height: 80vh !important;
    margin: 0 auto !important;
    background: #000 !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
}

#img-modal-full[style*="display: none"] {
    display: none !important;
}
#img-modal-video[style*="display: block"] {
    display: block !important;
}
#img-modal-video[style*="display: none"] {
    display: none !important;
}
  .img-modal-arrow.left {
    position: absolute !important;
    top: 50% !important;
    left: 1.2rem !important;
    transform: translateY(-50%) !important;
    z-index: 10011 !important;
    display: block !important;
    background: rgba(0,0,0,0.4) !important;
    color: #fff !important;
    font-size: 2.2rem !important;
    width: 3.2rem !important;
    height: 3.2rem !important;
    border-radius: 50% !important;
    border: none !important;
    opacity: 0.9 !important;
    cursor: pointer !important;
}
.img-modal-arrow.right {
    position: absolute !important;
    top: 50% !important;
    right: 1.2rem !important;
    transform: translateY(-50%) !important;
    z-index: 10011 !important;
    display: block !important;
    background: rgba(0,0,0,0.4) !important;
    color: #fff !important;
    font-size: 2.2rem !important;
    width: 3.2rem !important;
    height: 3.2rem !important;
    border-radius: 50% !important;
    border: none !important;
    opacity: 0.9 !important;
    cursor: pointer !important;
}
  #img-modal-close {
    position: absolute !important;
    top: 1.2rem !important;
    right: 1.2rem !important;
    z-index: 99999 !important;
    font-size: 2.2rem !important;
    background: linear-gradient(rgba(0,0,0,0.85),rgba(0,0,0,0.6)) !important;
    color: #fff !important;
    width: 3.2rem !important;
    height: 3.2rem !important;
    border-radius: 50% !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 12px #000c, 0 0 0 4px #fff8 !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    pointer-events: auto !important;
  }
}




.timeline-content h2 {
    margin: 0 0 0.4rem 0;
    color: #2563eb;
    font-size: 1.25rem;
}



.timeline-date {
    display: inline-block;
    margin-bottom: 0.7rem;
    color: #888;
    font-size: 0.95rem;
}



/* Ensure caption text appears before like/comment actions */
.timeline-content {
    order: 1;
}
.timeline-actions {
    order: 2;
    margin-top: -0.2cm;
    margin-left: -0.5cm;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    background: #f1f5f9;
    color: #888;
    font-size: 1rem;
    margin-top: 3rem;
}



@media (max-width: 600px) {
  #img-modal {
  }
    main {
        width: 100vw;
        max-width: 100vw;
        margin-left: auto;
        margin-right: auto;
        padding: 0 2vw;
        padding-top: 21em !important;
        box-sizing: border-box;
    }
    .month-slider-section {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0.2rem 0 0.2rem 0 !important;
        padding: 0 2vw !important;
        box-sizing: border-box !important;
        align-items: center !important;
        display: flex !important;
        flex-direction: row !important;
    }
    .month-slider-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        width: 100%;
        min-width: 0;
        overflow-x: auto;
        gap: 0.2rem !important;
    }
    .slider-edge {
        white-space: nowrap !important;
        font-size: 0.92rem !important;
        flex: 0 0 auto !important;
        max-width: 22vw !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .slider-wrapper {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    .month-slider-section input[type="range"] {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .month-slider-label {
        font-size: 0.95rem !important;
        margin-bottom: 0 !important;
        margin-right: 0.3rem !important;
        display: inline-flex !important;
        align-items: center !important;
        vertical-align: middle !important;
    }
    .month-slider-controls {
        margin: 0 !important;
        padding: 0 !important;
        gap: 0.2rem !important;
        display: flex !important;
        align-items: center !important;
    }
    .slider-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }
    .slider-edge, .slider-value {
        font-size: 0.92rem !important;
        margin: 0 !important;
        padding: 0 0.2rem !important;
    }
    .month-slider-section input[type="range"] {
        width: 100% !important;
        box-sizing: border-box !important;
    }


    .month-slider-section input[type="range"] {
        width: 90vw;
        max-width: 100%;
    }



    .timeline {
        padding-left: 0;
    }


    .timeline-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }


    .timeline-img {
        width: 90vw;
        max-width: 320px;
        height: auto;
        margin: 0 auto 1rem auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .timeline-img img {
        width: 100%;
        height: auto;
        border-radius: 1rem;
        object-fit: cover;
    }


    .timeline-content {
        padding: 1rem;
    }


}

/* Comment success message */
.comment-success {
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
