/* ==========================================================================
   FINAL SINGLE PAGES CSS (Portfolio & Timeline) - COMPACT CHARCOAL + ORANGE
   File: assets/css/single-pages.css
   ========================================================================== */

/* ==========================================================================
   LAYOUT CONFLICT PREVENTION - CRITICAL FOR HEADER POSITIONING
   ========================================================================== */

/* Ensure single pages don't inherit unwanted grid properties */
.single-timeline,
.single-portfolio {
    display: block !important;
    grid-template-columns: none !important;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Ensure header is full width and not in content grid */
.single-timeline .position-header,
.single-portfolio .project-header {
    width: 100% !important;
    display: block !important;
    position: relative !important;
    grid-column: 1 / -1 !important;
    z-index: 10 !important;
    margin: 0 !important;
    padding: 24px 0 32px !important; /* COMPACT: 60% reduction from original */
}

/* Prevent header from being part of any grid layout */
.position-header .container,
.project-header .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: block !important;
    grid-template-columns: none !important;
}

/* ==========================================================================
   PROFESSIONAL HEADER STYLES - CHARCOAL WITH ORANGE ACCENTS
   ========================================================================== */

/* Header Background - Executive Charcoal */
.project-header,
.position-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    position: relative;
}

.project-header::after,
.position-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 16px; /* COMPACT: Reduced from 30px */
    background: linear-gradient(135deg, transparent 0%, #f8f9fa 100%);
    transform: skewY(-1deg);
    transform-origin: bottom left;
}

/* Breadcrumb Navigation - Compact */
.breadcrumb {
    margin-bottom: 16px; /* COMPACT: Reduced from 30px */
    opacity: 0.9;
    font-size: 13px; /* COMPACT: Reduced from 14px */
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #fbbf24; /* BRIGHTER ORANGE on hover */
    text-decoration: underline;
    text-shadow: 0 1px 3px rgba(251, 191, 36, 0.4);
}

.back-link {
    background: rgba(255,255,255,0.15);
    padding: 4px 10px; /* COMPACT: Reduced from 5px 12px */
    border-radius: 16px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: #d97706; /* ORANGE: Professional highlight */
    color: white;
    text-decoration: none !important;
}

.separator {
    margin: 0 6px; /* COMPACT: Reduced from 0 10px */
    opacity: 0.7;
}

/* Hero Section - Compact */
.project-hero,
.position-hero {
    position: relative;
    z-index: 2;
}

/* Hero Content Structure - Proper Hierarchy */
.hero-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Titles - COMPACT sizing with proper hierarchy */
.project-title,
.position-title {
    font-size: 28px; /* SIGNIFICANTLY REDUCED from 40.8px */
    font-weight: bold;
    margin: 0 0 6px 0; /* REDUCED from 0 0 10px 0 */
    line-height: 1.1; /* TIGHTER line height */
    order: 1;
    color: #ffffff; /* PURE WHITE for maximum contrast */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Stronger shadow for depth */
}

.project-title a,
.position-title a {
    color: #ffffff; /* PURE WHITE for links */
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.project-title a:hover,
.position-title a:hover {
    color: #fbbf24; /* BRIGHTER ORANGE for better visibility */
    text-decoration: underline;
    text-shadow: 0 2px 6px rgba(251, 191, 36, 0.4); /* Orange glow on hover */
    opacity: 1;
}

/* Subtitles - COMPACT sizing with proper hierarchy */
.project-subtitle,
.position-subtitle {
    font-size: 16px; /* SIGNIFICANTLY REDUCED from 23.8px */
    color: #e5e7eb; /* LIGHT GRAY with high contrast */
    margin: 0 0 8px 0; /* REDUCED from 0 0 10px 0 */
    font-weight: 500; /* REDUCED from 600 */
    display: block;
    width: 100%;
    order: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle shadow for readability */
}

/* Meta Items - COMPACT and positioned UNDER subtitle */
.project-meta,
.position-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* COMPACT: Reduced from 15px */
    font-size: 12px; /* COMPACT: Reduced from 14px */
    margin-top: 0;
    clear: both;
    order: 3;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px; /* REDUCED from 8px */
    background: rgba(255, 255, 255, 0.25); /* MORE OPAQUE background */
    padding: 4px 8px; /* REDUCED from 6px 12px */
    border-radius: 16px; /* REDUCED from 20px */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4); /* STRONGER border */
    font-size: 11px; /* REDUCED from 13px */
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
}

.meta-item:hover {
    background: rgba(251, 191, 36, 0.3); /* BRIGHTER ORANGE tint on hover */
    border-color: rgba(251, 191, 36, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.meta-text {
    font-weight: 600; /* BOLDER for better readability */
    color: #ffffff; /* PURE WHITE for maximum contrast */
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.meta-icon {
    color: #fbbf24; /* BRIGHTER ORANGE for icons */
    font-size: 12px; /* REDUCED from 14px */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)); /* Icon shadow */
}

/* ==========================================================================
   CONTENT LAYOUT - COMPACT
   ========================================================================== */

.portfolio-content,
.position-content {
    padding: 0 0 32px; /* COMPACT: Reduced from 0 0 40px */
    margin-top: -16px; /* COMPACT: Reduced from -30px */
    position: relative;
    z-index: 3;
}

/* Ensure content grid only applies to content, not header */
.content-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 40px !important; /* INCREASED gap to prevent overlap */
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    align-items: start !important; /* Align items to top */
}

/* MAIN CONTENT AREA - PREVENT OVERFLOW */
.main-content-area {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    width: 100%; /* Ensure it doesn't exceed grid column */
    max-width: 100%; /* Prevent overflow */
}

.content-section {
    padding: 28px; /* COMPACT: Reduced from 40px */
    border-bottom: 1px solid #e5e7eb;
}

.content-section:last-child {
    border-bottom: none;
}

.content-section h3 {
    font-size: 20px; /* COMPACT: Reduced from 24px */
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0; /* COMPACT: Reduced from 0 0 20px 0 */
    padding-bottom: 8px; /* COMPACT: Reduced from 10px */
    border-bottom: 2px solid #d97706; /* ORANGE: Professional accent */
}

.section-content {
    color: #555;
    line-height: 1.6; /* COMPACT: Reduced from 1.7 */
}

/* Featured Image - Compact */
.featured-image-section {
    padding: 0;
    border-bottom: none;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   SHARED SIDEBAR STYLES - COMPACT WITH ORANGE ACCENTS
   ========================================================================== */

.project-sidebar,
.position-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%; /* Full width of sidebar column */
    max-width: 350px; /* Reasonable maximum width */
    position: relative; /* Normal flow positioning */
    top: 0; /* Reset any absolute positioning */
}

/* SIDEBAR SECTIONS - BETTER SPACING */
.sidebar-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0; /* Remove any margin that might cause issues */
}

.sidebar-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-1px); /* COMPACT: Reduced from -2px */
}

.sidebar-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #d97706;
    word-wrap: break-word; /* Prevent long text from overflowing */
}

/* Detail Lists - Compact with Orange Hover */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* COMPACT: Reduced from 15px */
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align to top for multi-line content */
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    flex-wrap: wrap; /* Allow wrapping if needed */
    gap: 8px; /* Space between label and value */
}

.detail-item:hover {
    background: rgba(217, 119, 6, 0.04); /* ORANGE: Professional tint */
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 4px;
    margin: 0 -8px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong,
.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    min-width: 80px; /* Minimum width for labels */
    flex-shrink: 0; /* Don't shrink labels */
}

.detail-item span,
.detail-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    word-wrap: break-word; /* Break long words */
    overflow-wrap: break-word; /* Modern property for word breaking */
    flex: 1; /* Take remaining space */
    min-width: 0; /* Allow shrinking */
}

/* Technology & Tool Tags - Orange Theme */
.tech-tags, 
.tools-tags,
.technologies-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    max-width: 100%; /* Prevent overflow */
}

.tech-tag {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap; /* Keep tags on one line */
    flex-shrink: 0; /* Don't shrink tags */
}

.tech-tag:hover {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    transform: translateY(-1px) scale(1.02); /* SUBTLE: Reduced transform */
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.tool-tag {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: white;
    padding: 4px 8px; /* COMPACT: Reduced from 6px 12px */
    border-radius: 16px; /* COMPACT: Reduced from 20px */
    font-size: 11px; /* COMPACT: Reduced from 13px */
    font-weight: 500;
    transition: all 0.3s ease;
}

.tool-tag:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

/* Awards - Orange Accent */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* COMPACT: Reduced from 10px */
}

.award-item {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
    padding: 8px 12px; /* COMPACT: Reduced from 12px 16px */
    border-radius: 6px; /* COMPACT: Reduced from 8px */
    border-left: 3px solid #f59e0b;
    font-size: 13px; /* COMPACT: Reduced from 14px */
    color: #333;
    transition: all 0.3s ease;
}

.award-item:hover {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(245, 158, 11, 0.12) 100%);
    transform: translateX(3px); /* COMPACT: Reduced from 5px */
    border-left-color: #d97706;
}

/* Category Links - Orange Hover */
.categories-list,
.category-list {
    display: flex;
    flex-direction: column;
    gap: 6px; /* COMPACT: Reduced from 8px */
}

.category-link {
    display: block;
    padding: 6px 10px; /* COMPACT: Reduced from 8px 12px */
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px; /* COMPACT: Reduced from 6px */
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    font-size: 13px; /* COMPACT: Reduced */
}

.category-link:hover {
    background: #d97706; /* ORANGE: Professional accent */
    color: white;
    border-color: #d97706;
    text-decoration: none;
    transform: translateX(3px); /* COMPACT: Reduced from 5px */
}

/* Navigation Links - Orange Theme */
.navigation-links {
    display: flex;
    flex-direction: column;
    gap: 8px; /* COMPACT: Reduced from 12px */
}

.nav-link {
    display: block;
    padding: 10px 12px; /* COMPACT: Reduced from 12px 16px */
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 4px; /* COMPACT: Reduced from 6px */
    text-decoration: none;
    color: #1f2937;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 13px; /* COMPACT: Reduced */
}

.nav-link:hover {
    background: #d97706; /* ORANGE: Professional accent */
    color: white;
    border-color: #d97706;
    text-decoration: none;
    transform: translateX(3px); /* COMPACT: Reduced from 5px */
}

.back-btn {
    background: #d97706;
    color: white;
    border-color: #d97706;
}

.back-btn:hover {
    background: #b45309;
    border-color: #b45309;
    transform: translateX(3px) scale(1.01); /* COMPACT: Reduced transform */
}

/* Status Badges - Orange Theme */
.status-completed { 
    background: #10b981; 
    color: white; 
    padding: 3px 6px; /* COMPACT: Reduced from 4px 8px */
    border-radius: 10px; /* COMPACT: Reduced from 12px */
    font-size: 11px; /* COMPACT: Reduced from 12px */
    font-weight: 500; 
    display: inline-block;
}

.status-in-progress { 
    background: #d97706; /* ORANGE: Professional status */
    color: white; 
    padding: 3px 6px; /* COMPACT: Reduced from 4px 8px */
    border-radius: 10px; /* COMPACT: Reduced from 12px */
    font-size: 11px; /* COMPACT: Reduced from 12px */
    font-weight: 500; 
    display: inline-block;
}

.status-planned { 
    background: #6b7280; 
    color: white; 
    padding: 3px 6px; /* COMPACT: Reduced from 4px 8px */
    border-radius: 10px; /* COMPACT: Reduced from 12px */
    font-size: 11px; /* COMPACT: Reduced from 12px */
    font-weight: 500; 
    display: inline-block;
}

/* ==========================================================================
   MOBILE RESPONSIVE DESIGN - EVEN MORE COMPACT
   ========================================================================== */

@media (max-width: 768px) {
    /* Mobile header even more compact */
    .single-timeline .position-header,
    .single-portfolio .project-header {
        padding: 16px 0 24px !important; /* MOBILE: Further reduced for mobile */
    }
    
    /* Reduce font sizes further on mobile */
    .project-title,
    .position-title {
        font-size: 22px; /* MOBILE: Reduced from 32px */
    }
    
    .project-subtitle,
    .position-subtitle {
        font-size: 14px; /* MOBILE: Reduced from 20px */
        margin-bottom: 12px; /* MOBILE: Reduced from 20px */
    }
    
    /* Stack meta items vertically on mobile */
    .project-meta,
    .position-meta {
        flex-direction: column;
        gap: 6px; /* MOBILE: Reduced from 10px */
        align-items: flex-start;
    }
    
    .meta-item {
        width: auto;
        min-width: auto;
        padding: 3px 6px; /* MOBILE: Reduced for mobile */
        font-size: 10px; /* MOBILE: Reduced */
    }
    
    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important; /* MOBILE: Reduced from 30px */
    }
    
    .content-section {
        padding: 20px; /* MOBILE: Reduced from 25px */
    }
    
    .sidebar-section {
        padding: 16px; /* MOBILE: Reduced from 20px */
    }
    
    .breadcrumb {
        font-size: 11px; /* MOBILE: Reduced from 12px */
        margin-bottom: 12px; /* MOBILE: Reduced from original */
    }
    
    .separator {
        margin: 0 4px; /* MOBILE: Reduced from 0 5px */
    }
}

@media (max-width: 480px) {
    .project-header,
    .position-header {
        padding: 12px 0 20px !important; /* SMALL MOBILE: Very compact for small mobile */
    }
    
    .project-title,
    .position-title {
        font-size: 20px; /* SMALL MOBILE: Reduced from 28px */
    }
    
    .project-subtitle,
    .position-subtitle {
        font-size: 13px; /* SMALL MOBILE: Reduced from 18px */
        margin-bottom: 8px; /* SMALL MOBILE: Reduced from 15px */
    }
    
    .project-meta,
    .position-meta {
        gap: 4px; /* SMALL MOBILE: Reduced from 8px */
    }
    
    .meta-item {
        padding: 2px 5px; /* SMALL MOBILE: Very compact for small mobile */
        font-size: 9px; /* SMALL MOBILE: Reduced from 12px */
    }
    
    .content-section {
        padding: 16px; /* SMALL MOBILE: Reduced from 20px */
    }
    
    .sidebar-section {
        padding: 12px; /* SMALL MOBILE: Reduced from 15px */
    }
    
    .breadcrumb {
        margin-bottom: 8px; /* SMALL MOBILE: Very compact */
        font-size: 10px; /* SMALL MOBILE: Reduced from 11px */
    }
    
    .separator {
        display: none; /* SMALL MOBILE: Hide separators on very small screens */
    }
    
    .breadcrumb a {
        display: inline-block;
        margin: 1px 3px 1px 0; /* SMALL MOBILE: Very compact spacing */
    }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

.project-title:focus,
.position-title:focus,
.nav-link:focus,
.category-link:focus {
    outline: 2px solid #d97706; /* ORANGE: Professional focus indicator */
    outline-offset: 2px;
}

/* Screen reader text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .project-header,
    .position-header {
        background: #000000 !important;
    }
    
    .meta-item {
        border-width: 2px !important;
    }
    
    .sidebar-section {
        border-width: 2px !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .meta-item,
    .nav-link,
    .category-link,
    .tech-tag,
    .tool-tag {
        transition: none !important;
    }
    
    .meta-item:hover,
    .sidebar-section:hover,
    .award-item:hover {
        transform: none !important;
    }
}