/* ==========================================================
   detail.css: fea.html, cfd.html, cad.html (load after base.css)
   ========================================================== */

body { overflow-x: hidden; }

/* --- Navigation --- */
.back-link { font-size: 0.9rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }

/* --- Page Hero --- */
.page-hero { 
    position: relative;
    background-color: var(--dark); 
    background-image: linear-gradient(rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 0.8));
    background-size: cover;
    background-position: center;
    background-attachment: scroll; 
    color: var(--white); 
    padding: 4rem 0; 
    text-align: center; 
}
.page-hero h1 { font-size: 2.25rem; font-weight: 900; margin-bottom: 0.75rem; letter-spacing: -0.02em; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.page-hero p { color: #d1d5db; max-width: 700px; margin: 0 auto; font-size: 1rem; }

/* --- Intro Section --- */
.intro-section { padding: 3rem 0; background-color: var(--white); border-bottom: 1px solid #e5e7eb; }
.intro-content { width: 100%; text-align: left; }
.intro-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; color: var(--dark); }
.intro-content p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

/* --- Alternating Sections --- */
.feature-section { padding: 3rem 0; }
.feature-section.alt { background-color: var(--section-alt); }

.feature-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 2rem; 
    align-items: center; 
}

.feature-content h2 { font-size: 1.6rem; font-weight: 800; color: var(--dark); margin-bottom: 0.75rem; line-height: 1.2; }
.feature-content p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; }

.feature-list { list-style: none; }
.feature-list li { 
    position: relative; 
    padding-left: 1.5rem; 
    margin-bottom: 0.6rem; 
    font-size: 0.9rem; 
    color: var(--text-main); 
}
.feature-list li::before { 
    content: "→"; 
    position: absolute; 
    left: 0; 
    color: var(--primary); 
    font-weight: 700; 
}

/* --- Capabilities Grid --- */
.capabilities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* --- Gallery Component --- */
.gallery-container {
    position: relative;
    border-radius: 0.75rem; 
    overflow: hidden; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    background: #e5e7eb;
    aspect-ratio: 4 / 3;
    touch-action: pan-y;
}

.gallery-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; 
}

.gallery-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(96, 96, 96, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: rgb(0, 0, 0);
    transform: scale(1.2);
}

/* --- Lightbox Modal Styles --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 100;
    padding-top: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: 0;
    display: block;
    width: auto;
    max-width: 95%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.lightbox-caption {
    margin: 15px 0 0 0;
    display: block;
    width: 90%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 0;
    height: auto;
    min-height: auto;
    font-size: 1rem;
    font-weight: 500;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1000;
    background: rgba(0,0,0,0.3);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
}

.lightbox-close:hover, .lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Lightbox Navigation Arrows */
.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    z-index: 102;
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.lightbox-next { right: 20px; }
.lightbox-prev { left: 20px; }

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Animation for lightbox */
.lightbox-content, .lightbox-caption {  
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

@media only screen and (max-width: 700px){
    .lightbox-content { max-width: 95%; }
    .lightbox-prev, .lightbox-next { padding: 10px; font-size: 24px; }
}

/* --- FAQ Section --- */
.faq-section { background-color: var(--section-alt); padding: 3rem 0; border-top: 1px solid #e5e7eb; }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #e5e7eb; }
.faq-item:last-child { border-bottom: none; }
.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.25rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
    font-family: 'Inter', sans-serif;
}
.faq-question:hover { color: var(--primary); }
.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    transition: transform 0.3s ease;
    color: var(--primary);
}
.faq-question.active::after { transform: rotate(45deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.faq-answer p {
    padding-bottom: 1.5rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- Closing Section --- */
.closing-section { padding: 3.5rem 0; background-color: var(--white); border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }

/* --- Buttons --- */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.btn-outline { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    padding: 0.6rem 1.2rem; 
    border: 2px solid var(--primary); 
    color: var(--primary); 
    border-radius: 0.5rem; 
    font-weight: 700; 
    font-size: 0.85rem; 
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* --- Software Used --- */
.software-section { padding: 3rem 0; background: var(--white); }
.scroll-wrapper { 
    display: flex; 
    overflow-x: auto; 
    gap: 1.25rem; 
    padding: 1rem 0.5rem 1.5rem 0.5rem; 
    scrollbar-width: thin; 
    scrollbar-color: var(--primary) #eef2ff;
    -webkit-overflow-scrolling: touch;
}

.scroll-wrapper::-webkit-scrollbar { height: 6px; }
.scroll-wrapper::-webkit-scrollbar-track { background: #eef2ff; border-radius: 4px; }
.scroll-wrapper::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: 4px; }

.software-card { 
    flex: 0 0 200px; 
    background: var(--section-alt); 
    padding: 1.25rem; 
    border-radius: 0.6rem; 
    border: 1px solid #e5e7eb; 
    text-align: center;
    transition: var(--transition);
}
.software-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.software-name { font-weight: 700; font-size: 0.95rem; color: var(--dark); }

@media (min-width: 768px) {
    .feature-grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
    .feature-section.alt .feature-grid .feature-content { order: 2; }
    .feature-section.alt .feature-grid .gallery-container { order: 1; }
    .page-hero { padding: 5rem 0; }
    .page-hero h1 { font-size: 2.75rem; }
    .capabilities-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Per-page hero banners (add a modifier class to .page-hero) --- */
.page-hero.hero-fea { background-image: linear-gradient(rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 0.8)), url('../assets/fea/fea_banner.png'); }
/* .page-hero.hero-cfd { ... url('../assets/cfd/cfd_banner.png'); }  add once the image exists */
/* .page-hero.hero-cad { ... url('../assets/cad/cad_banner.png'); }  add once the image exists */
