/* Base Styles */
:root {
    --custbackcol: #f8f8f8;
    --text-color: #333;
    --muted-color: #777;
    --accent-color: #666;
    --border-color: #e0e0e0;
    --overlay-bg: rgba(248, 248, 248, 0.97);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.3s;
    --spacing: 20px;
    --max-width: 1200px;
    --item-width: 300px;
    --font-main: 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--custbackcol);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    transition: all var(--transition-speed) ease;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

a:hover {
    opacity: 0.7;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
}

button:hover {
    opacity: 0.7;
}

/* Header */
header {
    padding: var(--spacing);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-title {
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: var(--spacing);
}

.nav-menu a {
    padding: 5px 2px;
    border-bottom: 1px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
    border-bottom: 1px solid var(--text-color);
    opacity: 1;
}

.nav-toggle {
    display: none;
}

/* Timeline */
#timeline {
    max-width: 800px;
    margin: var(--spacing) auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
    padding: 0 var(--spacing);
}

.entry {
    position: relative;
    margin-bottom: var(--spacing);
    background: var(--custbackcol);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.entry:hover {
    transform: translateY(-3px);
    box-shadow: none;
}

.entry img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    object-position: center center;
    transition: transform var(--transition-speed) ease;
    display: block;
    margin: 0 auto;
    text-align: center;
}

.entry-info {
    display: none;  /* Hide the entire info section in the main timeline */
}

.entry[data-type="group"] .entry-info {
    display: none;  /* Also ensure group entries have no titles */
}

.overlay-content .entry-info,
.overlay-title-section {
    display: block;  /* Keep titles visible in the overlay */
    padding: 15px;
    text-align: center;
}

.overlay-content .entry-title,
.overlay-title-section h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: center;
    width: 100%;
}

.entry-date {
    color: var(--muted-color);
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-align: center;
}

.entry-description {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    text-align: center;
    margin: 0 auto;
    max-width: 90%;
}

.entry-description-full {
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Tags styling */
.entry-tags {
    margin-top: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Toggle: hide order numbers and tags everywhere */
body.hide-order-tags .temp-order-display,
body.hide-order-tags .overlay-order-display,
body.hide-order-tags .entry-tags {
    display: none !important;
}

/* Custom audio player */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 600px;
    flex-shrink: 0;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--custbackcol);
    border-radius: 40px;
}

.custom-audio-player .cap-play {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color, #333);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.12s ease;
}

.custom-audio-player .cap-play:hover {
    transform: scale(1.08);
    background: #000;
}

.custom-audio-player .cap-progress {
    flex: 1;
    height: 6px;
    cursor: pointer;
    accent-color: var(--accent-color, #333);
}

.custom-audio-player .cap-time {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--text-color);
    min-width: 38px;
    text-align: right;
}

.custom-audio-player .cap-volume {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-audio-player .cap-vol-icon {
    display: flex;
    align-items: center;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.custom-audio-player .cap-vol-slider {
    width: 110px;
    height: 6px;
    cursor: pointer;
    accent-color: var(--accent-color, #333);
}

/* Music / video entry thumbnail overlays */
.media-thumb-wrap {
    position: relative;
    width: 100%;
    display: block;
}

.music-thumb-wrap,
.video-thumb-wrap {
    position: relative;
    width: 100%;
    display: block;
}

.media-thumb-wrap img {
    box-sizing: border-box;
}

.music-note-overlay,
.video-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36%;
    max-width: 56px;
    aspect-ratio: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #000;
    box-sizing: border-box;
}

.music-note-overlay svg,
.video-icon-overlay svg {
    width: 83.333%;
    height: 83.333%;
    display: block;
    overflow: visible;
}

.group-item .media-thumb-wrap img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--custbackcol);
}

.grid-item .media-thumb-wrap {
    width: 100%;
}

.grid-item .media-thumb-wrap img {
    width: 100%;
    height: auto;
}

.tags-label {
    font-weight: 500;
    color: var(--muted-color);
    margin-right: 5px;
}

.tag {
    background-color: var(--accent-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 400;
    display: inline-block;
    margin: 2px;
}

.tag:hover {
    background-color: #444;
    cursor: pointer;
}

/* Overlay/Lightbox */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    pointer-events: none;
}

#overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
}

.overlay-content {
    position: relative;
    max-width: 95%;
    width: auto;
    height: 95vh;
    margin: 2.5vh auto;
    padding: 10px;
    z-index: 1001;
    background-color: var(--custbackcol);
    border-radius: 4px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    color: #000;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
    transition: background-color 0.15s ease, transform 0.15s ease;
    z-index: 1002;
}

.close-button:hover {
    background-color: #fff;
    transform: scale(1.08);
}

.content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(95vh - 40px);
    overflow-y: auto;
    padding: 5px;
    padding-right: 12px;
    width: 100%;
    flex: 1;
    position: relative; /* Added for absolute positioning of navigation */
    scrollbar-gutter: stable;
}

.content-container > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.1s ease-out;
    cursor: zoom-in;
    display: block;
    margin: 0 auto;
    /* Ensure image is always fully visible */
    object-position: center;
    /* Reduced padding to use more space */
    padding: 5px;
    /* Ensure proper scaling on mobile */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.content-container > h2 {
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.overlay-title-section {
    padding: 0 10px;
    margin-top: 10px;
    text-align: center;
}

.overlay-title-section h2 {
    margin-bottom: 5px;
    font-size: 0.8rem;
    font-weight: 400;
}

.overlay-title-section .entry-description-full {
    margin-bottom: 0;
    line-height: 1.3;
    color: var(--text-color);
    font-size: 0.7rem;
}

/* Single-entry overlay: image uses full height, meta sits to the side */
.overlay-content:has(.content-container[data-entry-type="single"]) {
    flex-direction: row;
    align-items: stretch;
}

.overlay-content:has(.content-container[data-entry-type="single"]) .content-container {
    flex: 1;
    min-width: 0;
    height: 100%;
}

.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section {
    width: 100px;
    flex-shrink: 0;
    overflow-y: auto;
    text-align: left;
    padding: 56px 8px 14px 8px;
    margin-top: 0 !important;
}

.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section h2,
.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .overlay-order-display,
.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .entry-tags,
.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .entry-description-full {
    text-align: left;
    width: 100%;
}

.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .overlay-order-display {
    margin: 0 0 6px 0;
    font-size: 0.75rem;
    color: var(--muted-color);
    line-height: 1.2;
}

.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .entry-tags {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.65rem;
}

.overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .tag {
    padding: 1px 5px;
    font-size: 0.6rem;
    border-radius: 8px;
    margin: 1px;
}

.navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 20px;
    pointer-events: none; /* So it doesn't interfere with content scrolling */
    z-index: 1002;
}

.prev-button, .next-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    color: #000;
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
    transition: background-color 0.15s ease, transform 0.15s ease;
    pointer-events: auto;
}

.prev-button:hover, .next-button:hover {
    background-color: #fff;
    transform: scale(1.08);
}

/* When only next button is visible, position it on the right */
.navigation.next-only {
    justify-content: flex-end;
}

/* When only prev button is visible, position it on the left */
.navigation.prev-only {
    justify-content: flex-start;
}

/* Ensure navigation works well on mobile */
@media (max-width: 768px) {
    .navigation {
        padding: 0 10px;
    }
    
    .prev-button, .next-button {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* Grid View */
.grid-view {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--spacing);
    padding: var(--spacing);
    width: 100%;
    scrollbar-width: thin;
}

.grid-item {
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 200px;
}

.grid-item:hover {
    transform: scale(1.03);
}

.grid-item img {
    width: 100%;
    height: 200px; /* Increased height since no title space needed */
    object-fit: contain;
}

.item-title {
    margin-top: 5px;
    font-size: 0.9rem;
    text-align: center;
    padding: 2px 5px;
    display: none; /* Hide titles in grid view */
}

/* Hide titles in grid view */
.grid-item .item-title {
    display: none;
}

/* About Page */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing);
}

.about-container h1 {
    font-weight: 300;
    font-size: 2rem;
    margin-bottom: var(--spacing);
}

.about-content p {
    margin-bottom: var(--spacing);
}

.contact {
    margin-top: calc(var(--spacing) * 2);
}

.contact h2 {
    font-weight: 300;
    font-size: 1.5rem;
    margin-bottom: var(--spacing);
}

.email {
    font-family: var(--font-mono);
}

/* Footer */
footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
    text-align: center;
    color: var(--muted-color);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* Embedded Media */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.audio-container {
    width: 100%;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audio-container img {
    margin-bottom: 20px;
}

.audio-container audio {
    width: 100%;
    max-width: 500px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: white;
        flex-direction: column;
        padding: var(--spacing);
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
        z-index: 100;
    }
    
    .nav-menu.visible {
        transform: translateX(0);
    }
    
    .nav-menu li {
        margin: 15px 0;
    }
    
    .overlay-content {
        width: 95%;
        height: 95vh; /* Ensure consistent height on mobile */
        margin: 2.5vh auto; /* Consistent margins */
    }
}

/* Tag filter header — fixed bar at top when tag mode active */
.tag-filter-header {
    background-color: var(--accent-color);
    color: white;
    padding: 12px 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

body.tag-filter-active .tag-filter-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

body.tag-filter-active #timeline {
    padding-top: 62px;
}

.tag-filter-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 400;
}

.clear-filter-btn {
    background-color: white;
    color: var(--accent-color);
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.clear-filter-btn:hover {
    background-color: #f0f0f0;
}

/* Group entry styles */
.group-entry-container {
    width: 100%;
    background: var(--custbackcol);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing);
}

.group-header {
    display: none;
}

/* But show them in overlay */
.overlay-content .group-header {
    display: block;
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid var(--border-color);
}

.group-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
    gap: 15px;
    padding: 20px;
    justify-content: center;
    justify-items: center;
    max-width: 100%;
}

.group-item {
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.group-item:hover {
    transform: translateY(-5px);
}

.group-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--custbackcol);
}

.group-item .item-title {
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-color);
    width: 100%;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .group-items-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 15px;
    }
    
    .group-item img {
        height: 120px;
    }
    
    .group-item .item-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .group-items-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        padding: 12px;
    }
    
    .group-item img {
        height: 100px;
    }
}

/* Update entry styles to remove group-specific styles */
.entry[data-type="group"] {
    box-shadow: none;
    background: transparent;
}

.entry[data-type="group"]:hover {
    transform: none;
}

/* Remove the old group indicator since we're showing items directly */
.group-indicator {
    display: none;
} 

/* Mobile-specific image handling */
@media (max-width: 768px) {
    /* Stack the single-entry image and its meta vertically on small screens */
    .overlay-content:has(.content-container[data-entry-type="single"]) {
        flex-direction: column;
    }

    .overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section {
        width: 100%;
        padding: 10px;
        margin-top: 10px !important;
        text-align: center;
    }

    .overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section h2,
    .overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .overlay-order-display,
    .overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .entry-tags,
    .overlay-content:has(.content-container[data-entry-type="single"]) .overlay-title-section .entry-description-full {
        text-align: center;
    }

    .content-container > img {
        width: 100%;
        height: 100%;
        padding: 5px;
        /* Ensure touch-friendly interaction */
        touch-action: manipulation;
    }
    
    /* Prevent zoom on double-tap for mobile */
    .content-container > img {
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Ensure images work well on all screen sizes */
@media (max-height: 600px) {
    .content-container > img {
        width: 100%;
        height: 100%;
    }
} 

/* Audio entry styles */
.audio-visual {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.audio-visual .audio-icon {
    font-size: 4rem;
    color: #666;
}

.audio-visual .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.audio-visual:hover .play-button {
    opacity: 1;
}

/* Group view audio items */
.group-item .audio-visual {
    height: 150px;
}

.group-item .audio-visual .audio-icon {
    font-size: 2rem;
}

.group-item .audio-visual .play-button {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

/* Audio thumbnails */
.audio-thumbnail {
    cursor: default !important;
    pointer-events: none !important;
    width: 100% !important;
    height: 80vh !important;  /* Increased from 70vh to 80vh */
    object-fit: contain !important;
    margin: 20px auto !important;
    display: block !important;
}

/* Audio container adjustments */
.audio-container {
    width: 100%;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audio-container img {
    width: 100%;
    height: 80vh;  /* Match the thumbnail height */
    object-fit: contain;
    margin-bottom: 30px;
}

/* Ensure audio visuals maintain aspect ratio on mobile */
@media (max-width: 768px) {
    .audio-visual {
        height: 200px;
    }
    
    .group-item .audio-visual {
        height: 120px;
    }
} 

.temp-order-display {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1;
} 