/**
 * Bishops Widget Styles
 *
 * @package MarthomaChurch
 */

/* ==========================================================================
   Widget Container
   ========================================================================== */

.marthoma-bishops-widget {
    width: 100%;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.bishops-header {
    background-color: #04141E;
    padding: 40px 20px;
    text-align: center;
}

.bishops-header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.bishops-header-subheading {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #FFFFFF;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    opacity: 0.9;
}

/* ==========================================================================
   Main Section (Metropolitan + Suffragan Row)
   ========================================================================== */

.bishops-main-section {
    background-color: #04141E;
    padding: 60px 40px 80px;
}

.bishops-main-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 150px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

/* Metropolitan Section */
.bishops-metropolitan-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    min-width: 240px;
    flex-shrink: 0;
}

.bishops-metropolitan-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Suffragan Section */
.bishops-suffragan-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    flex: 1;
}

.bishops-suffragan-cards {
    display: flex;
    flex-direction: row;
    gap: 50px;
    flex-wrap: nowrap;
    justify-content: center;
    flex: 1;
    align-items: stretch;
}

.bishops-suffragan-cards .bishop-card {
    width: 290px;
    flex-shrink: 0;
    height: 100%;
}

.bishops-metropolitan-card .bishop-card {
    width: 290px;
    height: 100%;
}

/* Section Titles */
.bishops-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 35px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

/* ==========================================================================
   Episcopas Section
   ========================================================================== */

.bishops-episcopas-section {
    background-color: #FFFFFF;
    padding: 80px 40px;
}

.bishops-episcopas-section .bishops-section-title {
    color: #04141E;
    margin-bottom: 50px;
}

.bishops-episcopas-grid {
    display: grid;
    grid-template-columns: repeat(4, 290px);
    gap: 30px;
    max-width: 1280px;
    margin: 0 auto;
    justify-content: center;
}

.bishops-episcopas-grid .bishop-card {
    width: 100%;
    background-color: #F4F3F8;
}

/* ==========================================================================
   Late Lamented Section
   ========================================================================== */

.bishops-late-lamented-section {
    background-color: #F4F3F8;
    padding: 80px 40px;
}

.bishops-late-lamented-section .bishops-section-title {
    color: #04141E;
    margin-bottom: 50px;
}

.bishops-late-lamented-grid {
    display: grid;
    grid-template-columns: repeat(4, 290px);
    gap: 30px;
    max-width: 1280px;
    margin: 0 auto;
    justify-content: center;
}

.bishops-late-lamented-grid .bishop-card {
    width: 100%;
    background-color: #FFFFFF;
}

/* ==========================================================================
   Bishop Card
   ========================================================================== */

.bishop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 290px;
    text-align: center;
    height: 100%;
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
}

/* Photo Container */
.bishop-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    background-color: #E5E7EB;
}

.bishop-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bishop-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #E5E7EB;
    color: #9CA3AF;
}

.bishop-photo-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* Bishop Info */
.bishop-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    flex: 1;
}

.bishop-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #04141E;
    margin: 0 0 10px 0;
    line-height: 1.5;
    text-align: center;
}

.bishop-phone {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #04141E;
    margin: 0;
    line-height: 1.5;
    padding: 12px 0;
    border-top: 1px solid #04141E;
    border-bottom: 1px solid #04141E;
    display: inline-block;
}

/* Social Icons */
.bishop-social {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    padding: 0;
}

.bishop-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #04141E;
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.bishop-social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.bishop-social-link:hover {
    color: #375EFB;
    transform: scale(1.1);
}

/* ==========================================================================
   No Results
   ========================================================================== */

.bishops-no-results {
    padding: 60px 20px;
    text-align: center;
    background-color: #F9FAFB;
}

.bishops-no-results p {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .bishops-header-title {
        font-size: 36px;
    }

    .bishops-main-row {
        gap: 60px;
        flex-wrap: wrap;
    }

    .bishops-section-title {
        font-size: 23px;
    }

    .bishops-episcopas-grid,
    .bishops-late-lamented-grid {
        grid-template-columns: repeat(2, 290px);
        gap: 20px;
    }

    .bishops-late-lamented-section {
        padding: 60px 20px;
    }

    .bishops-main-section {
        padding: 40px 20px 60px;
    }

    .bishops-episcopas-section {
        padding: 60px 20px;
    }

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

    .bishops-metropolitan-section,
    .bishops-suffragan-section {
        flex: none;
        width: auto;
    }

    .bishops-suffragan-cards {
        flex-wrap: wrap;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .bishops-header {
        padding: 30px 16px;
    }

    .bishops-header-title {
        font-size: 28px;
    }

    .bishops-header-subheading {
        font-size: 14px;
    }

    .bishops-main-row {
        flex-direction: column;
        align-items: center;
        gap: 47px;
    }

    .bishops-section-title {
        font-size: 21px;
    }

    .bishops-metropolitan-section,
    .bishops-suffragan-section {
        gap: 22px;
    }

    .bishops-suffragan-cards {
        flex-direction: column;
        gap: 30px;
    }

    .bishops-episcopas-grid,
    .bishops-late-lamented-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bishops-episcopas-grid .bishop-card,
    .bishops-late-lamented-grid .bishop-card {
        max-width: 340px;
        margin: 0 auto;
    }

    .bishops-late-lamented-section {
        padding: 40px 16px;
    }

    .bishops-late-lamented-section .bishops-section-title {
        margin-bottom: 30px;
    }

    .bishops-main-section {
        padding: 30px 16px 50px;
    }

    .bishops-episcopas-section {
        padding: 40px 16px;
    }

    .bishops-episcopas-section .bishops-section-title {
        margin-bottom: 30px;
    }

    .bishop-card {
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }

    .bishops-suffragan-cards .bishop-card,
    .bishops-metropolitan-card .bishop-card {
        width: 100%;
        max-width: 340px;
    }

    .bishop-name {
        font-size: 14px;
        line-height: 1.32;
    }

    .bishop-phone {
        font-size: 14px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bishop-social-link {
        transition: none;
    }

    .bishop-social-link:hover {
        transform: none;
    }
}

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

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

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

/* Modal Overlay */
.bishop-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 */
.bishop-modal {
    position: relative;
    background-color: #F4F3F8;
    max-width: 850px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 50px 60px;
    box-sizing: border-box;
    border-radius: 20px;
}

/* Modal Close Button */
.bishop-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;
}

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

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

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

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

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

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

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

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

.bishop-modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

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

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

/* Address Section */
.bishop-modal-address {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: #04141E;
    line-height: 1.6;
    margin: 0 0 15px 0;
    white-space: pre-line;
}

.bishop-modal-directions-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 600;
    color: #04141E;
    text-decoration: none;
    transition: color 0.2s ease;
}

.bishop-modal-directions-link:hover {
    color: #375EFB;
}

.bishop-modal-directions-link svg {
    flex-shrink: 0;
}

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

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

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

.bishop-modal-contact-item a,
.bishop-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;
    text-decoration: none;
}

.bishop-modal-contact-item a:hover {
    color: #375EFB;
}

/* Biography Section */
.bishop-modal-bio-section {
    border-top: 1px solid #D0D5DD;
    padding-top: 30px;
}

.bishop-modal-bio-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
}

.bishop-modal-bio-photo {
    flex-shrink: 0;
    width: 180px;
    height: 220px;
    overflow: hidden;
    border-radius: 8px;
}

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

.bishop-modal-bio-text {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: #04141E;
    line-height: 1.7;
    margin: 0;
    flex: 1;
}

/* Details/Ordination Section */
.bishop-modal-details-section {
    border-top: 1px solid #D0D5DD;
    padding-top: 30px;
    margin-top: 10px;
}

.bishop-modal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 40px;
}

.bishop-modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bishop-modal-detail-label {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667085;
}

.bishop-modal-detail-value {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 15px;
    font-weight: 400;
    color: #04141E;
    line-height: 1.5;
}

/* Parents takes full width */
.bishop-modal-parents {
    grid-column: 1 / -1;
}

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

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

.bishop-modal-overlay.bishop-modal-closing {
    animation: bishopModalFadeOut 0.2s ease-in forwards;
}

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

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

.bishop-modal-overlay.bishop-modal-active .bishop-modal {
    animation: bishopModalSlideIn 0.3s ease-out forwards;
}

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

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

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

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

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

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

    .bishop-modal-address,
    .bishop-modal-contact-item a,
    .bishop-modal-contact-item span,
    .bishop-modal-bio-text {
        font-size: 15px;
    }

    .bishop-modal-bio-photo {
        width: 150px;
        height: 180px;
    }
}

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

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

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

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

    .bishop-modal-body {
        flex-direction: column;
        gap: 30px;
        margin-bottom: 30px;
    }

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

    .bishop-modal-address,
    .bishop-modal-contact-item a,
    .bishop-modal-contact-item span,
    .bishop-modal-bio-text {
        font-size: 14px;
    }

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

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

    .bishop-modal-bio-content {
        flex-direction: column;
        gap: 20px;
    }

    .bishop-modal-bio-photo {
        width: 120px;
        height: 150px;
    }

    .bishop-modal-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bishop-modal-detail-value {
        font-size: 14px;
    }
}

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

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

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

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

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

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

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

/* ==========================================================================
   LATE LAMENTED WIDGET STYLES
   ========================================================================== */

.marthoma-late-lamented-widget {
    width: 100%;
}

.late-lamented-header {
    background-color: #04141E;
    padding: 40px 20px;
    text-align: center;
}

.late-lamented-header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.late-lamented-header-subheading {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #FFFFFF;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    opacity: 0.9;
}

.late-lamented-content {
    background-color: #F4F3F8;
    padding: 80px 40px;
}

.late-lamented-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1280px;
    margin: 0 auto;
}

.late-lamented-grid .bishop-card {
    width: 100%;
    background-color: #FFFFFF;
}

/* Make late lamented cards clickable for modal */
.late-lamented-grid .bishop-card.bishop-modal-trigger {
    cursor: pointer;
}

.late-lamented-grid .bishop-card.bishop-modal-trigger:hover {
    transform: translateY(-3px);
}

.late-lamented-no-results {
    padding: 60px 20px;
    text-align: center;
    background-color: #F9FAFB;
}

.late-lamented-no-results p {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

/* Late Lamented Responsive - Tablet */
@media (max-width: 1024px) {
    .late-lamented-header-title {
        font-size: 36px;
    }

    .late-lamented-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .late-lamented-content {
        padding: 60px 20px;
    }
}

/* Late Lamented Responsive - Mobile */
@media (max-width: 768px) {
    .late-lamented-header {
        padding: 30px 16px;
    }

    .late-lamented-header-title {
        font-size: 28px;
    }

    .late-lamented-header-subheading {
        font-size: 14px;
    }

    .late-lamented-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .late-lamented-grid .bishop-card {
        max-width: 340px;
        margin: 0 auto;
    }

    .late-lamented-content {
        padding: 40px 16px;
    }
}
