/**
 * Marthoma Church Theme - Council Members Widget Styles
 *
 * @package MarthomaChurch
 */

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

/* Council Grid */
.council-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 70px;
}

/* Council Card */
.council-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 30px;
    background-color: #FFFFFF;
    border: 1.5px solid #B8B8B8;
    border-radius: 17px;
    min-height: 199px;
    gap: 10px;
}

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

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

/* Email */
.council-email {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: #04141E;
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}

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

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

/* ==========================================
   LOAD MORE SECTION
   ========================================== */

/* Hidden Cards */
.council-card-hidden {
    display: none;
}

/* Card Animation */
.council-card-animate-in {
    animation: councilCardFadeIn 0.4s ease-out forwards;
}

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

/* Load More Container - Horizontal layout with line */
.council-load-more {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    width: 100%;
}

/* Separator Line - Flexible, fills remaining space */
.council-load-more-line {
    flex: 1 1 auto;
    min-width: 50px;
    height: 2px;
    background-color: #D0D5DD;
}

/* Load More Button - Text link style */
.council-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: #072538;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: color 0.3s ease;
    flex-shrink: 0;
    box-shadow: none !important;
}

.council-load-more-btn:hover {
    background: transparent !important;
    background-color: transparent !important;
}

.council-load-more-btn:focus {
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
}

.council-load-more-btn:active {
    background: transparent !important;
}

/* Arrow Icon */
.council-load-more-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease, color 0.3s ease;
    color: inherit;
}

.council-load-more-arrow svg {
    width: 9px;
    height: 9px;
}

.council-load-more-btn:hover .council-load-more-arrow {
    transform: translate(2px, -2px);
}

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

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

    .council-position {
        font-size: 16px;
    }

    .council-name {
        font-size: 15px;
    }

    .council-email,
    .council-phone {
        font-size: 14px;
    }

    .council-card {
        padding: 25px;
        min-height: auto;
    }
}

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

    .council-position {
        font-size: 16px;
    }

    .council-card {
        padding: 25px;
        min-height: auto;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .council-card,
    .council-load-more-btn,
    .council-load-more-arrow {
        transition: none;
    }

    .council-load-more-btn:hover .council-load-more-arrow {
        transform: none;
    }

    .council-card-animate-in {
        animation: none;
    }
}

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

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

.council-card.council-modal-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modal Overlay */
.council-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 */
.council-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 */
.council-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;
}

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

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

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

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

.council-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;
}

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

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

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

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

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

.council-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 */
.council-modal-contact-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

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

.council-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;
}

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

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

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

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

.council-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.council-modal-open {
    overflow: hidden;
}

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

.council-modal-overlay.council-modal-closing {
    animation: councilModalFadeOut 0.2s ease-in forwards;
}

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

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

.council-modal-overlay.council-modal-active .council-modal {
    animation: councilModalSlideIn 0.3s ease-out forwards;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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