/* ============================================
   RESPONSIVE FIXES - Mobile & Desktop
   Fix alignment, spacing, and layout issues
   Complete overhaul for all responsive issues
   ============================================ */

/* ============================================
   FAQ TEXT JUSTIFY - Beranda & Daftar Informasi
   ============================================ */

/* FAQ in Beranda (home page) */
.faq-section .faq-answer p,
.faq-section .faq-answer,
.faq-accordion .faq-answer p,
.faq-accordion .faq-answer {
    text-align: justify !important;
    text-justify: inter-word !important;
    line-height: 1.7;
}

/* FAQ in Daftar Informasi */
.faq-section-complete .accordion-body p,
.faq-section-complete .accordion-body,
#faq-lengkap .accordion-body p,
#faq-lengkap .accordion-body {
    text-align: justify !important;
    text-justify: inter-word !important;
    line-height: 1.7;
}

/* FAQ answer complete class (daftar-informasi) */
.faq-answer-complete p,
.faq-answer-complete,
.faq-item-complete .faq-answer-complete p,
.faq-item-complete .faq-answer-complete {
    text-align: justify !important;
    text-justify: inter-word !important;
    line-height: 1.7;
}

/* General accordion body justify */
.accordion-body p,
.accordion-body {
    text-align: justify !important;
    text-justify: inter-word !important;
    line-height: 1.7;
}

/* Ensure all content text is justified for better readability */
.text-muted p {
    text-align: justify;
    line-height: 1.6;
}

/* ============================================
   PIMPINAN PPID - Mobile Alignment
   ============================================ */

/* Fix Pimpinan PPID alignment on mobile */
@media (max-width: 768px) {
    /* Center align team cards on mobile */
    .team-card {
        margin: 0 auto !important;
        max-width: 320px !important;
        width: 100% !important;
    }
    
    .team-card-img {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
    }
    
    .team-card-img img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .team-card-text-2 {
        text-align: center !important;
        padding: 1rem !important;
    }
    
    /* Fix row alignment for team section */
    .row.gy-4.justify-content-center {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .row.gy-4.justify-content-center > [class*="col-"] {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
        max-width: 350px !important;
    }
}

/* Fix banner spacing on mobile */
@media (max-width: 768px) {
    #home {
        margin-bottom: 0 !important;
    }
    
    #home + section,
    #home + .section {
        padding-top: 2rem !important;
        margin-top: 0 !important;
    }
    
    /* Reduce excessive spacing */
    .section {
        padding: 2rem 0 !important;
    }
}

/* Desktop - ensure proper alignment */
@media (min-width: 769px) {
    .team-card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .team-card-img {
        flex-shrink: 0;
    }
    
    .team-card-text-2 {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Fix any misaligned content */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVENESS FIXES
   ============================================ */

@media (max-width: 768px) {
    /* General mobile fixes */
    body {
        overflow-x: hidden !important;
    }
    
    /* Fix sections overflow */
    section,
    .section {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Fix cards on mobile */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Fix feature cards */
    .ppid-feature-card {
        margin-bottom: 1rem !important;
    }
    
    /* Fix news cards */
    .news-card {
        margin-bottom: 1rem !important;
    }
    
    /* Fix headings */
    .heading {
        font-size: 1.5rem !important;
    }
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Fix buttons */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Fix grid gaps */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Fix statistik section */
    .statistik-ppid .stat-card {
        margin-bottom: 1rem !important;
    }
    
    /* Fix footer */
    footer .row > [class*="col-"] {
        margin-bottom: 1.5rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .heading {
        font-size: 1.25rem !important;
    }
    
    /* Fix accordion on very small screens */
    .accordion-button {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .accordion-body {
        padding: 1rem !important;
        font-size: 0.875rem !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Fix card alignment issues */
.ppid-card-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

@media (max-width: 768px) {
    .ppid-card-wrapper {
        margin-bottom: 1rem;
    }
}
