/* Church Worship Schedule - Grid Style v10.2.0 */

/* 전체 폰트 및 기본 레이아웃 설정 */
.worship-schedule-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 15px;
}
/* 위젯 내에서의 마진 조정 */
.widget .worship-schedule-container {
    margin: 0;
    padding: 0;
}

/* 그룹 제목 스타일: 왼쪽 정렬 */
.worship-schedule-container h3 {
    font-weight: 700;
    font-size: 1.5em;
    color: #212529;
    text-align: left;
    margin-bottom: 15px;
    padding-bottom: 0;
    border: none;
}

/* 테이블을 감싸는 반응형 래퍼 */
.cws-table-responsive-wrapper {
    overflow-x: auto;
}

/* 기본 테이블 스타일 */
.worship-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border: 1px solid #dddddd !important;
}

/* 테이블 헤더(th) 및 셀(td) 공통 스타일 */
.worship-schedule-table th,
.worship-schedule-table td {
    padding: 12px 15px;
    vertical-align: middle;
    text-align: center;
    border-right: 1px solid #dddddd !important;
}

.worship-schedule-table th:last-child,
.worship-schedule-table td:last-child {
    border-right: none !important;
}

/* 테이블 헤더(th) 개별 스타일 */
.worship-schedule-table thead th {
    font-weight: 600;
    color: #ffffff;
    background-color: #5f7d8c;
    border-bottom: 1px solid #dddddd !important;
}

/* 테이블 본문(tbody) 행 스타일 */
.worship-schedule-table tbody tr {
    border-bottom: 1px solid #dddddd !important;
}

.worship-schedule-table tbody tr:last-child {
    border-bottom: none !important;
}

.worship-schedule-table tbody td {
    background-color: #f9f9f9;
}

.worship-schedule-table tbody tr:hover td {
    background-color: #f0f0f0;
}

/* 특별 예배 행 스타일 */
.worship-schedule-table tr.cws-special-event td {
    background-color: #fff9e6; /* 연한 노란색 배경 */
}
.worship-schedule-table tr.cws-special-event:hover td {
    background-color: #fff3cf;
}
.cws-special-date {
    font-weight: 600;
    color: #c0392b;
}

/* 예배 제목이 있는 첫번째 셀 스타일 */
.worship-schedule-table .worship-title-cell {
    font-weight: 500;
    color: #212529;
}

/* 예배 내용 스타일 */
.worship-content {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    font-weight: 400;
    color: #6c757d;
}
.worship-content p {
    margin: 0;
}

/* 온라인 예배 바로가기 버튼 */
.cws-online-button {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 10px;
    font-size: 0.8em;
    font-weight: 500;
    color: #fff !important;
    background-color: #e53935; /* 유튜브 레드 색상 */
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.cws-online-button:hover {
    background-color: #c62828;
}

/* 모바일 반응형 스타일 (768px 이하) - 개선된 리스트 스타일 */
@media screen and (max-width: 768px) {
    .worship-schedule-table {
        border: none !important; /* 전체 테이블 테두리 제거 */
        box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* 전체 그림자 추가 */
        border-radius: 8px; /* 전체 둥근 모서리 */
    }
    
    .worship-schedule-table thead {
        display: none; /* 테이블 헤더 숨기기 */
    }

    .worship-schedule-table,
    .worship-schedule-table tbody {
        display: block;
        width: 100%;
    }

    .worship-schedule-table tr {
        display: flex; /* Flexbox를 사용하여 한 줄에 정렬 */
        flex-wrap: wrap; /* 내용이 길어지면 다음 줄로 */
        align-items: center; /* 수직 중앙 정렬 */
        padding: 15px;
        border-bottom: 1px solid #eeeeee !important; /* 각 항목 하단 구분선 */
        background-color: #ffffff; /* 항목 배경색 */
        transition: background-color 0.2s ease;
    }
    
    .worship-schedule-table tr:hover {
        background-color: #f8f8f8; /* 호버 효과 */
    }

    .worship-schedule-table tr:last-child {
        border-bottom: none !important; /* 마지막 항목 하단선 제거 */
    }

    .worship-schedule-table tr.cws-special-event {
        background-color: #fffbee; /* 특별 예배 항목 배경색 */
    }
    .worship-schedule-table tr.cws-special-event:hover {
        background-color: #fff5e0;
    }

    .worship-schedule-table td {
        border: none !important;
        padding: 0;
        text-align: left;
        background-color: transparent;
        line-height: 1.4;
    }
    
    .worship-schedule-table td::before {
        display: none; /* 라벨 숨기기 */
    }

    /* 예배명 셀 (가장 중요한 정보) */
    .worship-schedule-table .worship-title-cell {
        flex: 1 1 60%; /* 너비 60% 차지 (나머지 40%는 시간/장소/대상) */
        font-size: 1.0em;
        font-weight: 600;
        color: #333333;
        margin-right: 10px; /* 오른쪽 정보들과 간격 */
    }
    
    /* 추가 설명과 날짜는 예배명 아래에 작게 */
    .worship-schedule-table .worship-title-cell .worship-content,
    .worship-schedule-table .worship-title-cell .cws-special-date {
        display: block;
        font-size: 0.8em;
        font-weight: 400;
        color: #777777;
        margin-top: 3px;
    }

    /* 시간, 장소, 대상 셀 */
    .worship-schedule-table td:not(.worship-title-cell) {
        flex: 1 1 auto; /* 내용에 따라 너비 조절 */
        min-width: 70px; /* 최소 너비 확보 */
        text-align: right; /* 오른쪽 정렬 */
        font-size: 0.85em;
        color: #555555;
        padding-left: 5px; /* 왼쪽 간격 */
    }
    
    .worship-schedule-table td[data-label="시간"] {
        flex-basis: auto; /* 시간 정보가 길면 더 공간 차지 */
        min-width: 90px; /* "온라인 예배 바로가기" 버튼 때문에 최소 너비 확대 */
    }
    .worship-schedule-table td[data-label="장소"] {
         min-width: 50px;
    }
    .worship-schedule-table td[data-label="대상"] {
         min-width: 50px;
    }


    /* 온라인 예배 바로가기 버튼 */
    .cws-online-button {
        display: block; /* 블록으로 변경하여 한 줄 전체 사용 */
        margin-top: 8px;
        padding: 6px 10px;
        font-size: 0.75em; /* 버튼 글씨 크기 약간 줄임 */
        text-align: center;
        background-color: #e53935;
        border-radius: 4px;
        color: #fff !important;
        text-decoration: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    .cws-online-button:hover {
        background-color: #c62828;
    }

    /* Small mobile adjustments */
    @media screen and (max-width: 480px) {
        .worship-schedule-table .worship-title-cell {
            flex: 1 1 100%; /* 아주 작은 화면에서는 예배명 단독 한 줄 */
            margin-right: 0;
            margin-bottom: 5px;
            text-align: center;
        }
        .worship-schedule-table td:not(.worship-title-cell) {
            flex: 1 1 50%; /* 시간/장소/대상이 2개씩 한 줄에 */
            text-align: center;
            margin-top: 5px;
        }
        .worship-schedule-table td[data-label="시간"] {
            flex: 1 1 100%; /* 시간은 버튼과 함께 단독 한 줄 */
            text-align: center;
        }
        .cws-online-button {
             margin-top: 5px;
        }
    }
}


/* 절기 안내문 스타일 */
.cws-season-notice {
    padding: 15px 20px;
    margin-bottom: 30px;
    border: 1px solid #cce5ff;
    border-left-width: 5px;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #004085;
}

.cws-season-notice h4 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #004085;
    font-weight: 700;
}

.cws-season-notice p {
    margin: 0;
    font-size: 0.95em;
}