/* Unified Container System for Runpoint */
/* This file provides consistent container layouts across all pages */

/* ============================================
   PANEL LAYOUTS - Two-panel pages
   ============================================ */

/* Left panel - consistent for thoughts, projects, jobs pages */
.left-panel {
    width: 40%;
    min-width: 400px;
    overflow-y: auto;
    border-right: 2px solid #0B1215;
    padding: 40px;
    background: #FFFFFC;
}

/* Hide scrollbars while maintaining scroll functionality */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    display: none;
}

.left-panel,
.right-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Right panel - content display area */
.right-panel {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #FFFFFC;
}

/* Content area within right panel */
.content-display {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 40px;
}

/* Hide scrollbar for content-display as well */
.content-display::-webkit-scrollbar {
    display: none;
}

.content-display {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Select prompt for empty state */
.select-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 16px;
    font-style: italic;
}

/* ============================================
   LIST ITEMS - Unified item styling
   ============================================ */

/* Base list item - used for all listing pages */
.list-item {
    margin-bottom: 30px; /* Consistent vertical spacing */
    padding: 20px 10px; /* Increased padding for better touch targets */
    margin-left: -10px;
    margin-right: -10px;
    cursor: pointer;
    transition: background 0.1s;
    display: block; /* Changed from flex to block for stacked layout */
}

/* Item with thumbnail variant */
.list-item.has-thumbnail {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    min-height: auto; /* Don't force minimum height */
}

/* Fix thumbnail alignment to prevent extra spacing */
.list-item.has-thumbnail .list-item-content {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.list-item-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 0;
}

.list-item:hover {
    background: #f9f9f9;
}

.list-item.active {
    background: #ececec;
}

/* Item content container */
.list-item-content {
    flex: 1;
}

/* Item title */
.list-item-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: #0B1215;
    display: block; /* Changed from flex to block */
    line-height: 1.4;
}

/* External link icon */
.external-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.external-link-icon:hover {
    color: #000;
}

.external-link-icon svg {
    width: 14px;
    height: 14px;
}

/* Item metadata */
.list-item-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
    flex-wrap: wrap;
    align-items: center;
}

.list-item-date {
    font-weight: 700;
}

.list-item-author {
    color: #666;
    margin-right: 4px;
}

/* Field note type badges (thought/project) */
.field-note-type {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.field-note-type.thought {
    background: #e8f4fd;
    color: #1a73e8;
}

.field-note-type.project {
    background: #fef3e2;
    color: #ea6b00;
}

.list-item.active .field-note-type {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Item description */
.list-item-description {
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 0; /* Remove any bottom margin */
}

/* Tags container */
.list-item-tags {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Individual tag */
.list-item-tag {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #555;
}

.content-display .post-meta {
    flex-wrap: wrap;
    row-gap: 12px;
}

.content-display .post-tags {
    flex-basis: 100%;
    margin-top: 4px;
}

/* Thumbnail styles moved up to consolidate with has-thumbnail section */

/* ============================================
   SINGLE COLUMN LAYOUTS
   ============================================ */

/* Container for single column pages (about, contact) */
.single-column-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    background: #FFFFFC;
}

/* ============================================
   MOBILE RESPONSIVE DESIGN
   ============================================ */

/* Close button for mobile detail view */
.close-detail {
    display: none;
    position: fixed; /* Fixed instead of absolute to stay in viewport */
    top: 15px; /* Positioned near the top of viewport */
    right: 20px;
    width: 30px;
    height: 30px;
    background: #0B1215;
    color: #FFFFFC;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

@media (max-width: 1200px) {
    .left-panel {
        width: 50%;
    }
}

@media (max-width: 768px) {
    /* Left panel becomes full width on mobile */
    .left-panel {
        width: 100%;
        min-width: unset;
        border-right: none;
        height: calc(100vh - var(--header-height, 64px)); /* Account for fixed header */
        padding: 20px;
        padding-top: 10px;
        padding-bottom: 80px; /* Extra bottom padding for scrolling */
    }
    
    /* Right panel slides in from the right on mobile */
    .right-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: #FFFFFC;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        padding-top: var(--header-height, 64px);
    }
    
    .right-panel.mobile-active {
        right: 0;
    }
    
    /* Show close button only when right panel is active on mobile */
    .right-panel.mobile-active .close-detail {
        display: flex;
    }
    
    /* Adjust content padding on mobile */
    .content-display {
        padding: 20px 20px 80px; /* Reduced top padding on mobile */
    }
    
    /* Hide select prompt on mobile */
    .select-prompt {
        display: none;
    }
    
    /* Adjust list item padding on mobile */
    .list-item {
        padding: 20px 10px; /* Keep consistent padding with desktop */
        margin-left: -10px;
        margin-right: -10px;
        margin-bottom: 25px; /* Slightly less margin on mobile */
    }
    
    .list-item-title {
        font-size: 16px;
    }
    
    /* Single column adjustments */
    .single-column-content {
        padding: 20px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Border utilities */
.border-bottom-2 {
    border-bottom: 2px solid #0B1215;
}

.border-right-2 {
    border-right: 2px solid #0B1215;
}

/* Spacing utilities */
.mb-40 {
    margin-bottom: 40px;
}

.mb-20 {
    margin-bottom: 20px;
}

.pb-20 {
    padding-bottom: 20px;
}

.pb-10 {
    padding-bottom: 10px;
}
