/* Home Page Specific Styles */

/* Hero Section */
.hero {
    background: url('../pics/farm.PNG') no-repeat center center/cover;
    min-height: 70vh;
    color: var(--light-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem 0;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 71, 161, 0.7); /* Same as primary-color with opacity */
    z-index: -1;
}

.hero .container {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--light-color);
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    margin: 0;
}

/* Services Section */
.service-cards {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.card-clickable:hover .card-cta {
    opacity: 1;
}

.card-cta {
    margin-top: 1.5rem;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 1;
    transition: opacity 0.3s ease;
    letter-spacing: 0.5px;
}

/* Touch device support - show "Click for more" on mobile */
@media (hover: none) and (pointer: coarse) {
    .card-cta {
        opacity: 0.7;
    }
}

.services .container {
    align-items: center;
    justify-content: space-between;
}

/* Solutions Section */
.solutions .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.solution-content {
    flex: 1;
    padding-right: 2rem;
}

.solution-content h2 {
    text-align: left;
}

.solution-content ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 2rem;
}

.solution-content ul li {
    margin-bottom: 1rem;
}

.solution-image {
    flex: 1;
    height: 300px;
    background: url('https://picsum.photos/seed/solutions/600/400') no-repeat center center/cover;
    border-radius: 5px;
}

/* Success Stories Section */
.success-stories {
    background: var(--secondary-color);
}

.story-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.story-cards .card {
    background-size: cover;
    background-position: center;
    color: var(--light-color);
    height: 350px;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-cards .card h4 {
    color: var(--light-color);
    margin: 0;
    font-size: 1.2rem;
}

.story-cards .card:nth-child(1) {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://picsum.photos/seed/manufacturing/400/300');
}
.story-cards .card:nth-child(2) {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://picsum.photos/seed/construction/400/300');
}
.story-cards .card:nth-child(3) {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://picsum.photos/seed/healthcare/400/300');
}

/* CTA Section */
.cta {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 3rem 0;
}

.cta .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cta h2 {
    color: var(--light-color);
    text-align: left;
    margin-bottom: 1rem;
}

/* CTA Section Button Override */
.cta .btn {
    background: var(--light-color);
    color: var(--primary-color);
    font-weight: bold;
    border: 2px solid var(--light-color);
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.cta .btn:hover {
    background: transparent;
    color: var(--light-color);
    border: 2px solid var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Blog Insights Section */
.blog-cards {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.blog-cards .card {
    text-align: left;
}

.view-all-btn {
    text-align: center;
}

/* ISO Section */
.iso-section h2 {
    color: red;
}

/* Gallery Section */
.gallery-section {
    padding: 4rem 0;
    color: var(--primary-color);
}

.gallery-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
}

.gallery-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    grid-auto-flow: dense;
    grid-auto-rows: minmax(250px, auto);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Landscape images (horizontal) */
.gallery-item.landscape {
    grid-column: span 1;
    grid-row: span 1;
}

.gallery-item.landscape img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

/* Portrait images (vertical) */
.gallery-item.portrait {
    grid-column: span 1;
    grid-row: span 2;
}

.gallery-item.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 3 / 4;
}

/* Square images */
.gallery-item.square {
    grid-column: span 1;
    grid-row: span 1;
}

.gallery-item.square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--light-color);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.gallery-overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.gallery-item.hidden {
    display: none;
}

/* Fullscreen Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
}

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

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* Portrait images in modal */
.modal-content.portrait img {
    max-width: 70vw;
    max-height: 90vh;
    height: auto;
    width: auto;
}

/* Landscape images in modal */
.modal-content.landscape img {
    max-width: 90vw;
    max-height: 70vh;
    height: auto;
    width: auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

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

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    color: #333;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10000;
}

.modal-nav:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

.modal-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    text-align: center;
}

.modal-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.modal-info p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Animation for modal */
.image-modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Make gallery items more obvious they're clickable */
.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    border-radius: 50%;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Home Page Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .service-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .story-cards,
    .blog-cards {
        flex-direction: column;
        gap: 1.5rem;
    }

    .solutions .container {
        flex-direction: column;
        gap: 2rem;
    }

    .solution-content {
        padding-right: 0;
    }

    .solution-image {
        margin-top: 0;
    }

    .cta .container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .cta-content {
        margin-bottom: 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
        grid-auto-rows: minmax(200px, auto);
    }
    
    /* Adjust portrait span for smaller screens */
    .gallery-item.portrait {
        grid-row: span 2;
    }
    
    .gallery-section h2 {
        font-size: 2rem;
    }
    
    .gallery-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .gallery-overlay {
        padding: 1rem;
    }
    
    .gallery-overlay h4 {
        font-size: 1rem;
    }
    
    .gallery-overlay p {
        font-size: 0.8rem;
    }
    
    .modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }
    
    .modal-content img {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .modal-content.portrait img {
        max-width: 90vw;
        max-height: 85vh;
    }
    
    .modal-content.landscape img {
        max-width: 95vw;
        max-height: 60vh;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
    
    .modal-nav {
        font-size: 18px;
        padding: 10px 15px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .modal-info h3 {
        font-size: 1.2rem;
    }
    
    .modal-info p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .service-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        grid-auto-rows: minmax(250px, auto);
    }
    
    /* On mobile, all images take single row */
    .gallery-item.portrait {
        grid-row: span 1;
    }
    
    .gallery-item.portrait img {
        aspect-ratio: 3 / 4;
        max-height: 500px;
    }
    
    .modal-content.portrait img,
    .modal-content.landscape img {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .modal-info h3 {
        font-size: 1rem;
    }
    
    .modal-info p {
        font-size: 0.85rem;
    }
}
