/* Ganoderma Page Styles */
.section-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
}

/* DXN Ganoderma Introduction Section */
.ganoderma-intro {
    background-image: url('images/background/ganoderma_background.jpg');
    background-size: cover;
    background-position: top center;
    background-blend-mode: overlay;
    height: calc(100vh + 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 80px;
}

/* Soft fade from hero background into white content below */
.ganoderma-intro::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    background: linear-gradient(to bottom, rgba(52,73,94,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
}

.ganoderma-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ganoderma-overlay::before {
    content: '';
    flex: 1;
}

.ganoderma-overlay::after {
    content: '';
    flex: 1;
}

.ganoderma-content {
    text-align: center;
    color: #fff;
}

.ganoderma-content .section-title {
    color: #ff0000;
    margin-bottom: 80px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.ganoderma-types {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.ganoderma-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.ganoderma-item:hover {
    transform: translateY(-10px);
}

.ganoderma-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.ganoderma-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Growing Stages Section */
.growing-stages {
    padding: 80px 0;
    margin-top: -80px;
    position: relative;
}

.growing-stages .section-title {
    color: #2c3e50;
    margin-bottom: 80px;
}

.stages-timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    background-image: url('images/background/Line.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.stage-item {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: 60px auto 60px; /* top label, image, bottom label */
    justify-items: center;
    align-items: center;
}

.stage-image-container {
    position: relative;
    margin: 20px auto;
}

.stage-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stage-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stage-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
    line-height: 1.6;
}

.stage-title span {
    font-weight: 400;
}

/* Default placement: labels below image */
.stage-title,
.stage-image-container { grid-column: 1; }

.stage-image-container { grid-row: 2; }
.stage-title { grid-row: 3; }

/* Place labels above the image for 2nd and 4th items */
.stages-timeline .stage-item:nth-child(2) .stage-title,
.stages-timeline .stage-item:nth-child(4) .stage-title {
    grid-row: 1;
}

/* Organic Cultivation Process Section */
.organic-cultivation {
    background: url('images/background/cultivation_background.jpg');
    background-size: cover;
    background-position: top center;
    background-attachment: fixed;
    padding: 80px 0;
}

.organic-cultivation .section-title {
    color: white;
}

.cultivation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.cultivation-item {
    text-align: center;
    padding: 30px 20px;
    transition: all 0.3s ease;
}

.cultivation-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.cultivation-image:hover {
    transform: scale(1.05);
}

.cultivation-description {
    font-size: 1rem;
    color: white;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

/* Production Technique Section */
.production-technique {
    background: #f8f9fa;
    padding: 80px 0;
}

.production-technique .section-title {
    color: #2c3e50;
}

.production-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr); /* 12-track grid for 4-then-3 layout */
    gap: 30px;
}

.production-item {
    text-align: center;
    padding: 25px 15px;
    transition: all 0.3s ease;
    grid-column: span 3; /* default: 4 items per row (3 tracks each) */
}

.production-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
}

.production-image:hover {
    transform: scale(1.05);
}

.production-description {
    font-size: 0.95rem;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
    background: #E0E2DF; /* light grey caption bar like reference */
    padding: 14px 16px;
    width: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
    min-height: 60px; /* ensure two-line captions align */
}

/* If last row contains exactly 3 items, make them span 4 tracks each */
.production-grid > .production-item:nth-last-child(3):nth-child(4n+1),
.production-grid > .production-item:nth-last-child(2):nth-child(4n+2),
.production-grid > .production-item:nth-last-child(1):nth-child(4n+3) {
    grid-column: span 4;
}

/* Responsive Design */

/* Large Desktop - 1200px and below */
@media (max-width: 1200px) {
    .section-title {
        font-size: 2.8rem;
        margin-bottom: 50px;
    }
    
    .ganoderma-intro {
        height: calc(100vh + 60px);
        padding-bottom: 60px;
    }

    .ganoderma-overlay::after {
        display: none;
    }
    
    .ganoderma-content .section-title {
        margin-bottom: 60px;
    }
    
    .ganoderma-types {
        gap: 40px;
        max-width: 1000px;
    }
    
    .ganoderma-image {
        width: 140px;
        height: 140px;
    }
    
    .ganoderma-label {
        font-size: 1.1rem;
    }
    
    .growing-stages {
        padding: 60px 0;
        margin-top: -60px;
    }
    
    .growing-stages .section-title {
        margin-bottom: 60px;
    }
    
    .stage-image {
        width: 180px;
        height: 180px;
    }
    
    .stage-title {
        font-size: 1.05rem;
    }
    
    .organic-cultivation,
    .production-technique {
        padding: 60px 0;
    }
    
    .cultivation-grid {
        gap: 25px;
    }
    
    .cultivation-item {
        padding: 25px 15px;
    }
    
    .production-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .production-item {
        grid-column: unset !important;
        padding: 20px 12px;
    }
}

/* Desktop - 992px and below */
@media (max-width: 992px) {
    .section-title {
        font-size: 2.5rem;
        margin-bottom: 40px;
    }
    
    .ganoderma-intro {
        height: 100vh;
        padding-bottom: 40px;
    }
    
    .ganoderma-content .section-title {
        margin-bottom: 50px;
    }
    
    .ganoderma-types {
        gap: 30px;
        max-width: 800px;
    }
    
    .ganoderma-image {
        width: 130px;
        height: 130px;
    }
    
    .ganoderma-label {
        font-size: 1rem;
    }
    
    .growing-stages {
        padding: 50px 0;
        margin-top: -40px;
    }
    
    .growing-stages .section-title {
        margin-bottom: 50px;
    }
    
    .stage-image {
        width: 150px;
        height: 150px;
    }
    
    .stage-title {
        font-size: 1rem;
    }
    
    .organic-cultivation,
    .production-technique {
        padding: 50px 0;
    }
    
    .cultivation-grid,
    .production-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .cultivation-item {
        padding: 20px 12px;
    }
    
    .production-item {
        padding: 18px 10px;
    }
    
    .production-description {
        font-size: 0.9rem;
        padding: 12px 14px;
        min-height: 55px;
    }
}

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 35px;
    }
    
    .ganoderma-intro {
        height: 100vh;
        padding-bottom: 30px;
    }

    .ganoderma-overlay::after {
        display: block;
    }
    
    .ganoderma-content .section-title {
        margin-bottom: 40px;
    }
    
    .ganoderma-types {
        gap: 25px;
        max-width: 600px;
    }
    
    .ganoderma-image {
        width: 120px;
        height: 120px;
    }
    
    .ganoderma-label {
        font-size: 0.95rem;
    }
    
    .growing-stages {
        padding: 40px 0;
        margin-top: -30px;
    }
    
    .growing-stages .section-title {
        margin-bottom: 40px;
    }
    
    .stages-timeline {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .stage-image {
        width: 100px;
        height: 100px;
    }
    
    .stage-title {
        font-size: 0.95rem;
    }
    
    .organic-cultivation,
    .production-technique {
        padding: 40px 0;
    }
    
    .cultivation-grid,
    .production-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .cultivation-item {
        padding: 18px 10px;
    }
    
    .cultivation-description {
        font-size: 0.9rem;
    }
    
    .production-item {
        padding: 15px 8px;
    }
    
    .production-description {
        font-size: 0.85rem;
        padding: 10px 12px;
        min-height: 50px;
    }
}

/* Mobile - 576px and below */
@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .ganoderma-intro {
        height: 100vh;
        padding-bottom: 20px;
    }
    
    .ganoderma-content .section-title {
        margin-bottom: 30px;
    }
    
    .ganoderma-types {
        gap: 20px;
        max-width: 400px;
    }
    
    .ganoderma-image {
        width: 100px;
        height: 100px;
    }
    
    .ganoderma-label {
        font-size: 0.9rem;
    }
    
    .growing-stages {
        padding: 30px 0;
        margin-top: -20px;
    }
    
    .growing-stages .section-title {
        margin-bottom: 30px;
    }
    
    .stages-timeline {
        background-image: none;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .stage-item {
        grid-template-rows: auto;
        width: 100%;
        max-width: 300px;
    }
    
    .stage-title, .stage-image-container {
        grid-row: unset !important;
    }
    
    .stage-image {
        width: 150px;
        height: 150px;
    }
    
    .stage-title {
        font-size: 0.9rem;
        margin-top: 10px;
    }
    
    .organic-cultivation,
    .production-technique {
        padding: 30px 0;
    }
    
    .cultivation-grid,
    .production-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cultivation-item {
        padding: 15px 8px;
    }
    
    .cultivation-description {
        font-size: 0.85rem;
    }
    
    .production-item {
        padding: 12px 6px;
    }
    
    .production-description {
        font-size: 0.8rem;
        padding: 8px 10px;
        min-height: 45px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }
    
    .ganoderma-intro {
        height: 100vh;
    }
    
    .ganoderma-types {
        gap: 20px;
    }
    
    .ganoderma-image {
        width: 100px;
        height: 100px;
    }
    
    .ganoderma-label {
        font-size: 1rem;
    }
    
    .growing-stages,
    .organic-cultivation,
    .production-technique {
        padding: 60px 0;
    }

    .stages-timeline {
        flex-direction: column;
        align-items: center;
    }
    
    .stage-image {
        width: 150px;
        height: 150px;
    }
    
    .stage-title {
        font-size: 1rem;
    }
    
    .stage-duration {
        font-size: 0.8rem;
    }
    
    .cultivation-item,
    .production-item {
        padding: 20px 15px;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ganoderma-item,
.stage-item,
.cultivation-item,
.production-item {
    animation: fadeInUp 0.6s ease-out;
}

.ganoderma-item:nth-child(2) { animation-delay: 0.1s; }
.ganoderma-item:nth-child(3) { animation-delay: 0.2s; }
.ganoderma-item:nth-child(4) { animation-delay: 0.3s; }
.ganoderma-item:nth-child(5) { animation-delay: 0.4s; }
.ganoderma-item:nth-child(6) { animation-delay: 0.5s; }

.stage-item:nth-child(1) { animation-delay: 0.1s; }
.stage-item:nth-child(3) { animation-delay: 0.2s; }
.stage-item:nth-child(5) { animation-delay: 0.3s; }
.stage-item:nth-child(7) { animation-delay: 0.4s; }

/* Animation classes for JavaScript intersection observer */
.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}
