/* Project Detail Page Styles */

/* Touch-friendly enhancements */
.gallery-img, .btn, .nav-link, .skill-tag {
    /* Ensure minimum touch target size */
    min-height: 44px;
    /* Improve touch response */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Prevent horizontal overflow on all project pages */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Hero Image Section - First Element */
.project-hero-image-section {
    padding: 80px 0 20px;
    margin-top: 70px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.project-hero-image-section .hero-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    display: block;
}

.project-hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px 0 60px;
}

.project-hero-content {
    max-width: 800px;
}

.project-breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.project-breadcrumb a {
    color: #d84315;
    text-decoration: none;
}

.project-breadcrumb a:hover {
    text-decoration: underline;
}

.project-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #333;
    line-height: 1.2;
}

.project-subtitle {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.project-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #555;
    font-weight: 500;
}

.meta-item i {
    color: #d84315;
}

.project-hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Project Sections */
.project-section {
    padding: 80px 0;
}

.project-section.bg-light {
    background: #f8f9fa;
}

.section-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.content-main h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.content-main p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #555;
}

.project-info-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
}

.project-info-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
}

.project-info-card ul {
    list-style: none;
    padding: 0;
}

.project-info-card li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    color: #555;
}

.project-info-card li:last-child {
    border-bottom: none;
}

.project-info-card strong {
    color: #333;
}

/* Technical Approach */
.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.approach-step {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

.approach-step h3 {
    margin-bottom: 1rem;
    color: #333;
}

.approach-step p {
    color: #666;
    line-height: 1.6;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    justify-items: center;
}

.video-item {
    max-width: 800px;
    width: 100%;
}

.video-item iframe {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Skills Tags Simple Layout */
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.skills-tags .skill-tag {
    background: white;
    color: #333;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.skills-tags .skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #d84315;
}

/* Project Navigation Improvements */
.project-navigation {
    padding: 2rem 0;
    background: #f8f9fa;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.nav-buttons .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 6px;
    min-width: 140px;
}

/* Footer improvements */
.footer .social-links a {
    color: #ffffff !important;
    margin: 0 15px;
    transition: all 0.3s ease;
    font-size: 1.8rem;
    text-decoration: none;
}

.footer .social-links a:hover {
    color: #4a90e2 !important;
    transform: translateY(-3px) scale(1.1);
}

/* Modal fix for dimming issue */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -20px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Contributions */
.contributions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contribution-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

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

.contribution-item i {
    font-size: 2.5rem;
    color: #d84315;
    margin-bottom: 1.5rem;
}

.contribution-item h3 {
    margin-bottom: 1rem;
    color: #333;
}

.contribution-item p {
    color: #666;
    line-height: 1.6;
}

/* Photo Gallery */
.gallery-description {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

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

.gallery-item {
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: auto;
    min-height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    display: block;
}

.gallery-placeholder {
    grid-column: 1 / -1;
    background: #fbe9e7;
    border: 2px dashed #d84315;
    border-radius: 15px;
    padding: 4rem 2rem;
    text-align: center;
    color: #d84315;
}

.gallery-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gallery-placeholder p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.gallery-placeholder small {
    color: #999;
}

/* Skills Developed */
.skills-developed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
}

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

.skill-tag {
    background: #fbe9e7;
    color: #d84315;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: #d84315;
    color: white;
    transform: translateY(-2px);
}

/* Project Outcomes */
.outcomes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.outcome-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.outcome-item h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.outcome-item p {
    color: #666;
    line-height: 1.6;
}

/* Project Navigation */
.project-navigation {
    background: #2c3e50;
    padding: 3rem 0;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-buttons .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal for Image Gallery */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    opacity: 0.7;
}

/* Image Gallery Styles */
.image-gallery {
    margin: 4rem 0;
    padding: 3rem 0;
    background: #f8f9fa;
    border-radius: 20px;
}

.image-gallery h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.gallery-intro {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.gallery-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gallery-caption {
    padding: 1.5rem;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    text-align: center;
    background: white;
}

/* Skills Section */
.skills-section {
    margin: 4rem 0;
    padding: 3rem 0;
    background: white;
    border-radius: 20px;
}

.skills-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.skill-tag {
    background: #fbe9e7;
    color: #d84315;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skill-tag:hover {
    background: #d84315;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

/* Video Section Styles */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.video-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.video-item:hover {
    transform: translateY(-2px);
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.video-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.video-item p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .section-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-info-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .project-hero {
        padding: 100px 0 60px;
    }
    
    .project-title {
        font-size: 2.5rem;
    }
    
    .project-meta {
        gap: 1rem;
    }
    
    .approach-grid {
        grid-template-columns: 1fr;
    }
    
    .contributions-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-buttons {
        justify-content: center;
        text-align: center;
    }
    
    .nav-buttons .btn {
        flex: 1;
        min-width: 200px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .project-title {
        font-size: 2rem;
    }
    
    .project-subtitle {
        font-size: 1.1rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Slideshow Styles */
.slideshow-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.slide {
    display: none;
    position: relative;
    animation: slideIn 0.5s ease-in-out;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f8f9fa;
}

.slide-content {
    padding: 30px;
    background: #ffffff;
}

.slide-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.slide-content p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.slide-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

.slide-indicators {
    text-align: center;
    padding: 20px;
    background: #ffffff;
}

.indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ddd;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.indicator.active,
.indicator:hover {
    background: #d84315;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile responsive for slideshow */
@media (max-width: 768px) {
    .slide img {
        height: 250px;
    }
    
    .slide-content {
        padding: 20px;
    }
    
    .slide-content h3 {
        font-size: 1.3rem;
    }
    
    .slide-nav {
        padding: 10px 15px;
        font-size: 16px;
    }
}

/* Video Gallery Styles */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.video-item {
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-item iframe {
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item iframe:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Mobile responsive for videos */
@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .video-item iframe {
        width: 280px;
        height: 498px;
    }
}

/* Parts List Styles */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.part-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #d84315;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.part-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.part-item strong {
    color: #333;
    font-weight: 600;
}

/* Mobile responsive for parts list */
@media (max-width: 768px) {
    .parts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .part-item {
        padding: 12px;
    }
}

/* Enhanced Mobile Responsiveness for Project Details */
@media (max-width: 768px) {
    /* Strict overflow prevention */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: calc(100vw - 30px);
        box-sizing: border-box;
    }
    
    /* Ensure all sections fit within viewport */
    section, .project-section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .project-hero-image-section {
        padding: 60px 0 15px;
        margin-top: 60px;
        width: 100%;
    }

    .project-hero {
        padding: 20px 0 40px;
        width: 100%;
    }

    .project-title {
        font-size: 2rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .project-subtitle {
        font-size: 16px;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .project-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        width: 100%;
    }

    .meta-item {
        font-size: 14px;
        word-wrap: break-word;
    }

    .project-section {
        padding: 30px 0 !important;
        width: 100%;
    }

    .project-section h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
    }

    .gallery-description {
        font-size: 16px;
        margin-bottom: 20px;
        word-wrap: break-word;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
        max-width: 100%;
    }

    .gallery-img {
        height: 250px;
        width: 100%;
        max-width: 100%;
        object-fit: cover;
    }

    .skills-tags {
        gap: 8px;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .skill-tag {
        padding: 8px 12px;
        font-size: 13px;
        max-width: calc(50% - 4px);
        text-align: center;
        word-wrap: break-word;
    }

    .project-navigation {
        padding: 30px 0;
        width: 100%;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    .nav-buttons .btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        padding: 12px 20px;
        font-size: 14px;
        box-sizing: border-box;
    }

    .video-item iframe {
        width: 100%;
        max-width: 320px;
        height: 180px;
    }

    .slideshow-embed iframe {
        height: 400px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure video gallery doesn't overflow */
    .video-gallery {
        width: 100%;
        max-width: 100%;
        justify-items: center;
    }
    
    /* Parts list mobile fixes */
    .parts-grid {
        width: 100%;
        max-width: 100%;
    }
    
    .part-item {
        width: 100%;
        max-width: 100%;
        word-wrap: break-word;
    }
}

@media (max-width: 480px) {
    /* Ultra-strict mobile overflow prevention */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: calc(100vw - 30px);
        box-sizing: border-box;
    }
    
    /* Ensure everything fits on small screens */
    * {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .project-hero-image-section {
        padding: 50px 0 10px;
        margin-top: 50px;
        width: 100%;
    }

    .project-hero {
        padding: 15px 0 30px;
        width: 100%;
    }

    .project-title {
        font-size: 1.6rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .project-subtitle {
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .project-breadcrumb {
        font-size: 13px;
        word-wrap: break-word;
    }

    .meta-item {
        font-size: 13px;
        word-wrap: break-word;
    }

    .project-section {
        padding: 20px 0 !important;
        width: 100%;
        max-width: 100vw;
    }

    .project-section h2 {
        font-size: 1.5rem;
        word-wrap: break-word;
    }

    .gallery-description {
        font-size: 14px;
        word-wrap: break-word;
    }

    .gallery-img {
        height: 220px;
        width: 100%;
        max-width: 100%;
        object-fit: cover;
    }

    .skill-tag {
        padding: 6px 10px;
        font-size: 12px;
        max-width: calc(100% - 8px);
        margin: 2px;
        text-align: center;
        word-wrap: break-word;
    }

    .nav-buttons .btn {
        padding: 10px 16px;
        font-size: 13px;
        width: 100%;
        max-width: calc(100vw - 60px);
        box-sizing: border-box;
    }

    .video-item iframe {
        width: 100%;
        max-width: calc(100vw - 40px);
        height: 160px;
    }

    .slideshow-embed iframe {
        height: 300px;
        width: 100%;
        max-width: calc(100vw - 30px);
    }

    .part-item {
        padding: 10px;
        font-size: 14px;
        width: 100%;
        max-width: 100%;
        word-wrap: break-word;
    }
    
    /* Ensure hero image doesn't overflow */
    .hero-img {
        width: 100%;
        max-width: calc(100vw - 30px);
        height: auto;
    }
    
    /* Prevent any grid from overflowing */
    .photo-gallery,
    .video-gallery,
    .parts-grid,
    .skills-tags {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .project-title {
        font-size: 1.4rem;
    }

    .project-section h2 {
        font-size: 1.3rem;
    }

    .gallery-img {
        height: 200px;
    }

    .video-item iframe {
        max-width: 260px;
        height: 150px;
    }

    .slideshow-embed iframe {
        height: 250px;
    }
}