/* Project Detail Page Styles */

/* Hide breadcrumb on project pages - force hide everywhere */
.breadcrumb,
.project-hero .breadcrumb,
#breadcrumb-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Rich Text Images */
.rich-text-image {
    margin: 2rem 0;
    text-align: center;
}

.rich-text-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.rich-text-image img:hover {
    transform: scale(1.02);
}

.rich-text-image figcaption {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

/* Loading Page */
.loading-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.loading-content {
    text-align: center;
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Project Hero */
.project-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
}

/* Force consistent hero overlay padding */
.project-hero-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 0 !important; /* Remove all padding */
    margin: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
}

/* Force consistent hero content positioning */
.project-hero-content {
    width: 100% !important;
    padding: 3rem 0 3rem 0 !important; /* All padding here for consistency */
    margin: 0 !important;
}

.project-hero-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.project-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6) contrast(1.1);
}

.project-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 4rem 0;
}

.project-hero-content {
    color: white;
    max-width: 800px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.project-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

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

.project-hero .breadcrumb a:hover {
    opacity: 0.8;
}

/* First element in hero content - force consistent spacing */
.project-hero-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.project-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 !important; /* Reset all margins */
    padding: 0 !important; /* Reset all padding */
    margin-bottom: 1rem !important; /* Only bottom margin */
    line-height: 1.2;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.9);
}

.project-summary {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    text-align: justify;
    text-justify: inter-word;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.project-hero .project-category {
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-date {
    font-size: 0.9rem;
    opacity: 0.8;
}

.project-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Project Article */
.project-article {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.project-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Main Content */
.project-main {
    max-width: none;
}

.project-description {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: justify;
    text-justify: inter-word;
}

.project-description h2,
.project-description h3,
.project-description h4 {
    color: var(--text-primary);
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.project-description h2 {
    font-size: 2rem;
    font-weight: 600;
}

.project-description h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.project-description h4 {
    font-size: 1.25rem;
    font-weight: 500;
}

.project-description p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-word;
}

.project-description ul,
.project-description ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.project-description li {
    margin-bottom: 0.5rem;
}

.project-description blockquote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-secondary);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.project-description img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Project Tags Section */
.project-tags-section {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.project-tags-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-tag {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.project-tag:hover {
    border-color: var(--accent);
    background: rgba(34, 197, 94, 0.1);
}

/* Project Gallery Section */
.project-gallery-section {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.project-gallery-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-image {
    position: relative;
    aspect-ratio: 16/10;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.02);
}

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

/* Sidebar */
.project-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.project-info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}

.project-info-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.project-info {
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Related Projects */
.related-projects {
    padding: 4rem 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.related-projects .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.related-projects .section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.related-projects .section-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Error Page */
.error-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .project-content-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .project-sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .project-hero {
        height: 60vh;
        min-height: 400px;
    }
    
    .project-hero-overlay {
        padding: 4rem 0 3rem 0;
    }
    
    .project-hero-content {
        padding: 0 1rem;
    }
    
    /* Mobile breadcrumb styling */
    .project-hero .breadcrumb {
        margin-top: 1rem;
        margin-bottom: 1.5rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .project-title {
        font-size: 2.5rem;
        margin-top: 1.5rem; /* Consistent mobile spacing */
    }
    
    .project-summary {
        font-size: 1.1rem;
    }
    
    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .project-article {
        padding: 2rem 0;
    }
    
    .project-content-wrapper {
        gap: 2rem;
    }
    
    .project-description {
        font-size: 1rem;
    }
    
    .project-gallery {
        grid-template-columns: 1fr;
    }
    
    .error-content h1 {
        font-size: 2rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .project-hero-overlay {
        padding: 5rem 0 2rem 0; /* Sufficient padding to clear navigation */
    }
    
    .project-hero .breadcrumb {
        font-size: 0.8rem;
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .project-title {
        font-size: 2rem;
    }
    
    .project-summary {
        font-size: 1rem;
    }
    
    .project-info-card {
        padding: 1.5rem;
    }
}

/* Animation for fade in */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}