/**
 * Marthoma Church Theme - Executive Body Widget Styles
 *
 * @package MarthomaChurch
 */

/* Main Container */
.marthoma-executive-widget {
    width: 100%;
}

/* Executive Grid */
.executive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Executive Card */
.executive-card {
    display: flex;
    flex-direction: column;
}

/* Executive Image */
.executive-image {
    width: 100%;
    overflow: hidden;
}

.executive-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

/* Placeholder for no image */
.executive-no-image {
    width: 100%;
    height: 260px;
    background-color: #E8E8E8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999999'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60px;
}

/* Executive Info Box */
.executive-info {
    margin-top: 10px;
    padding: 10px 0 10px 15px;
    border-left: 1.5px solid #04141E;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Position/Role */
.executive-position {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: #04141E;
    margin: 0;
    line-height: 1.4;
}

/* Name */
.executive-name {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    color: #04141E;
    margin: 0;
    line-height: 1.4;
}

/* Phone */
.executive-phone {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    color: #04141E;
    margin: 0;
    line-height: 1.4;
}

/* No Posts Message */
.executive-no-posts {
    padding: 40px;
    text-align: center;
    color: #707070;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .executive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .executive-position {
        font-size: 15px;
    }

    .executive-name,
    .executive-phone {
        font-size: 13px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .executive-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .executive-image img,
    .executive-no-image {
        height: 220px;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .executive-card,
    .executive-image img {
        transition: none;
    }
}

/* ==========================================
   MODAL STYLES
   ========================================== */

/* Make cards clickable */
.executive-card.executive-modal-trigger {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.executive-card.executive-modal-trigger:hover {
    transform: translateY(-3px);
}

.executive-card.executive-modal-trigger:hover .executive-image img {
    opacity: 0.9;
}

/* Modal Overlay */
.executive-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 20, 30, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Modal Container */
.executive-modal {
    position: relative;
    background-color: #F4F3F8;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 50px 60px;
    box-sizing: border-box;
    border-radius: 20px;
}

/* Modal Close Button */
.executive-modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #04141E;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 10;
    outline: none;
}

.executive-modal-close:hover {
    color: #375EFB;
    transform: scale(1.05);
}

.executive-modal-close:focus,
.executive-modal-close:focus-visible,
.executive-modal-close:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.executive-modal-close svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* Modal Header */
.executive-modal-header {
    margin-bottom: 40px;
}

.executive-modal-title {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 35px;
    font-weight: 700;
    color: #04141E;
    margin: 0 0 15px 0;
    line-height: 1.2;
    padding-right: 40px;
}

.executive-modal-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #04141E 0%, transparent 100%);
}

/* Modal Body - Two Column Layout */
.executive-modal-body {
    display: flex;
    flex-direction: row;
    gap: 60px;
}

.executive-modal-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.executive-modal-right {
    flex: 0 0 auto;
    min-width: 150px;
}

/* Modal Sections */
.executive-modal-section {
    display: flex;
    flex-direction: column;
}

.executive-modal-label {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #04141E;
    margin: 0 0 15px 0;
}

/* Contact Section */
.executive-modal-contact-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.executive-modal-contact-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
}

.executive-modal-contact-item svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: #04141E;
}

.executive-modal-contact-item span {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: #04141E;
    line-height: 1.5;
    word-break: break-word;
}

.executive-modal-phone-text {
    white-space: pre-line;
}

/* Member Section (Right Column) */
.executive-modal-member-section {
    text-align: left;
}

.executive-modal-member-photo {
    width: 100px;
    height: 110px;
    overflow: hidden;
    margin-bottom: 14px;
}

.executive-modal-member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.executive-modal-member-name {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: #04141E;
    line-height: 1.5;
    margin: 0;
}

/* Body scroll lock when modal open */
body.executive-modal-open {
    overflow: hidden;
}

/* Modal Animation */
.executive-modal-overlay.executive-modal-active {
    animation: executiveModalFadeIn 0.3s ease-out forwards;
}

.executive-modal-overlay.executive-modal-closing {
    animation: executiveModalFadeOut 0.2s ease-in forwards;
}

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

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

.executive-modal-overlay.executive-modal-active .executive-modal {
    animation: executiveModalSlideIn 0.3s ease-out forwards;
}

@keyframes executiveModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   MODAL RESPONSIVE STYLES
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .executive-modal {
        padding: 40px 35px;
    }

    .executive-modal-title {
        font-size: 26px;
    }

    .executive-modal-body {
        gap: 40px;
    }

    .executive-modal-label {
        font-size: 16px;
    }

    .executive-modal-contact-item span,
    .executive-modal-member-name {
        font-size: 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .executive-modal {
        padding: 30px 25px;
        max-height: 85vh;
    }

    .executive-modal-close {
        top: 15px;
        right: 15px;
    }

    .executive-modal-header {
        margin-bottom: 30px;
    }

    .executive-modal-title {
        font-size: 21px;
        padding-right: 30px;
    }

    .executive-modal-body {
        flex-direction: column;
        gap: 30px;
    }

    .executive-modal-right {
        min-width: auto;
    }

    .executive-modal-label {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .executive-modal-contact-item span,
    .executive-modal-member-name {
        font-size: 14px;
    }

    .executive-modal-contact-list {
        gap: 13px;
    }

    .executive-modal-contact-item {
        gap: 12px;
    }
}

/* ==========================================
   MODAL REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .executive-card.executive-modal-trigger {
        transition: none;
    }

    .executive-card.executive-modal-trigger:hover {
        transform: none;
    }

    .executive-modal-overlay.executive-modal-active,
    .executive-modal-overlay.executive-modal-closing,
    .executive-modal-overlay.executive-modal-active .executive-modal {
        animation: none;
    }
}

/* ==========================================
   ELEMENTOR EDITOR
   ========================================== */

.elementor-editor-active .marthoma-executive-widget {
    min-height: 150px;
}

/* Hide modal in editor */
.elementor-editor-active .executive-modal-overlay {
    display: none !important;
}
