/* ==========================================
   NUEVA ESPERANZA — OUR TEAM
   Colors: #1F0330 primary | #D28BD1 secondary
   ========================================== */

:root {
    --ne-primary:   #1F0330;
    --ne-secondary: #D28BD1;
    --ne-bg:        #f5f5f7;
    --ne-white:     #ffffff;
    --ne-text:      #1F0330;
    --ne-text-light:#6e6e73;
    --ne-border:    #e5e5ea;
    --ne-shadow:    0 4px 20px rgba(31,3,48,0.10);
    --ne-radius:    16px;
    --ne-gap:       16px;
    --ne-max-width: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
    width: 100%;
    overflow-x: hidden;
    background: var(--ne-bg);
    color: var(--ne-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- WEBVIEW HEADER ---------- */
.webview-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--ne-white);
    border-bottom: 1px solid var(--ne-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.btn-cfne-back {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1.5px solid var(--ne-primary);
    color: var(--ne-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.ne-detail-back {
    position: sticky;
    top: 0;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    margin: 12px 16px 0;
    padding: 8px 16px;
    background: var(--ne-white);
    border: 1.5px solid var(--ne-primary);
    border-radius: 20px;
    color: var(--ne-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--ne-shadow);
}
.ne-detail-back:hover {
    background: var(--ne-primary);
    color: var(--ne-white);
}

/* ---------- WEB NAVBAR ---------- */
.about-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--ne-white);
    border-bottom: 1px solid var(--ne-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.logo-wrapper { display: flex; align-items: center; text-decoration: none; }
.logo { height: 36px; width: auto; }
.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    padding: 6px 16px;
    border: 1.5px solid var(--ne-primary);
    color: var(--ne-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-home:hover { background: var(--ne-primary); color: var(--ne-white); }

/* ---------- CONTAINER ---------- */
.ne-container {
    max-width: var(--ne-max-width);
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---------- HERO ---------- */
.ne-hero {
    text-align: center;
    padding: 32px 0 16px;
}
.ne-hero h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--ne-primary);
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.ne-hero p {
    color: var(--ne-text-light);
    font-size: 0.9rem;
}

/* ---------- SECTIONS ---------- */
.ne-section { margin-top: 40px; }
.ne-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ne-primary);
    text-align: center;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------- PASTOR COUPLE CARDS ---------- */
.ne-pastors-grid {
    display: grid;
    gap: var(--ne-gap);
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
}
.ne-pastors-grid--single {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
}
.ne-pastor-card {
    background: var(--ne-white);
    border-radius: var(--ne-radius);
    overflow: hidden;
    box-shadow: var(--ne-shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--ne-border);
    text-align: center;
}
.ne-pastor-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(31,3,48,0.14); }
.ne-pastor-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #1F0330 0%, #3d0a5c 100%);
}
.ne-pastor-body { padding: 20px 24px 26px; }
.ne-pastor-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ne-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}
.ne-role {
    display: block;
    font-size: 0.75rem;
    color: var(--ne-secondary);
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ne-desc {
    font-size: 0.85rem;
    color: var(--ne-text-light);
    margin-bottom: 16px;
    line-height: 1.45;
}

/* ---------- BUTTONS ---------- */
.ne-btn-outline {
    background: transparent;
    border: 1.5px solid var(--ne-primary);
    color: var(--ne-primary);
    padding: 8px 28px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ne-btn-outline:hover { background: var(--ne-primary); color: var(--ne-white); }

/* ---------- MINISTRY CARDS ---------- */
.ne-ministry-grid {
    display: grid;
    gap: var(--ne-gap);
    grid-template-columns: 1fr 1fr;
}

.ne-ministry-grid.ne-ministry-grid--vertical {
    grid-template-columns: 1fr;
}

.ne-ministry-card {
    background: var(--ne-white);
    border-radius: var(--ne-radius);
    overflow: hidden;
    box-shadow: var(--ne-shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid var(--ne-border);

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.ne-ministry-card:hover {
    transform: translateY(-3px);
}

.ne-ministry-img {
    width: 100%;
    height: 140px;

    object-fit: contain;
    object-position: center;

    display: block;

    background: #2b003f;
}
.ne-ministry-body { padding: 14px 12px 18px; }
.ne-ministry-body h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ne-primary);
    margin-bottom: 4px;
}
.ne-ministry-body .ne-role { margin-bottom: 8px; font-size: 0.7rem; }
.ne-ministry-body .ne-desc { font-size: 0.78rem; margin-bottom: 10px; }

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 3, 48, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
    padding: 16px;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-container {
    background: var(--ne-white);
    width: 100%;
    max-width: 480px;
    height: 85vh;
    max-height: 700px;
    border-radius: var(--ne-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(31,3,48,0.25);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(31,3,48,0.7);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.modal-close:hover { background: rgba(31,3,48,0.9); }
#modalFrame {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    display: block;
    min-height: 0;
}

/* ---------- MODAL INTERNAL PAGES ---------- */
.modal-page {
    background: var(--ne-white);
    min-height: 100%;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.profile-modal {
    padding: 0;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
}
.profile-img-top {
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: linear-gradient(135deg, #1F0330 0%, #3d0a5c 100%);
}
.profile-content {
    padding: 24px 24px calc(32px + env(safe-area-inset-bottom));
}
.profile-content h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ne-primary);
    margin-bottom: 4px;
}
.profile-role-inline {
    display: inline-block;
    background: var(--ne-primary);
    color: var(--ne-secondary);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
}
.profile-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--ne-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 24px 0 10px;
    border-bottom: 2px solid var(--ne-secondary);
    display: inline-block;
    padding-bottom: 4px;
}
.profile-content p {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.65;
    margin-bottom: 10px;
}
.contact-block {
    background: var(--ne-bg);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
    border: 1px solid var(--ne-border);
}
.contact-block p {
    margin: 6px 0;
    font-size: 0.85rem;
    color: var(--ne-text-light);
}

/* Ministry modal specific */
.ministry-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--ne-border);
}
.ministry-header img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: var(--ne-shadow);
}
.ministry-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ne-primary);
    margin-bottom: 6px;
}
.ministry-header p {
    font-size: 0.85rem;
    color: var(--ne-text-light);
    line-height: 1.5;
}
.ministry-leader-area {
    padding: 20px 24px 0;
    text-align: center;
}
.ministry-leader-area img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--ne-shadow);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #1F0330 0%, #6f42c1 100%);
}
.ministry-leader-area h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ne-primary);
    margin-bottom: 2px;
}
.ministry-leader-area span {
    font-size: 0.8rem;
    color: var(--ne-secondary);
    font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */
@media (min-width: 640px) {
    .ne-pastors-grid { grid-template-columns: 1fr 1fr; max-width: none; }
    .ne-pastors-grid--single { grid-template-columns: 1fr; max-width: 520px; }
    .ne-ministry-grid { grid-template-columns: 1fr 1fr 1fr; }
    .ne-container { padding: 32px 24px 56px; }
    .ne-hero h1 { font-size: 2.2rem; }
}

@media (min-width: 768px) {
    .profile-page--pastors {
        max-width: 980px;
        margin: 0 auto;
        padding: 0 32px 56px;
    }

    .profile-page--pastors .profile-img-top {
        flex-shrink: 0;
        display: flex;
        height: 100%; 
        width: 300px;
        border-radius: 0 0 var(--ne-radius) var(--ne-radius);
        box-shadow: var(--ne-shadow);
        overflow: hidden;
        object-position: center center!important;
        margin: auto;
        justify-content: center !important;
        align-items: center !important;

    }

    .profile-page--pastors .profile-content {
        max-width: 820px;
        margin: 0 auto;
        padding: 36px 0 0;
    }

    .profile-page--pastors .profile-content h2 {
        font-size: 1.8rem;
        line-height: 1.25;
    }

    .profile-page--pastors .profile-section-title {
        margin-top: 40px;
    }

    .profile-page--pastors .profile-content p {
        font-size: 1rem;
    }
}
