/**
 * Marthoma Church Theme - Lectionary Widget Styles
 *
 * Accordion-based lectionary display with special occasions
 * and monthly groupings following the theme design system.
 *
 * @package MarthomaChurch
 */

/* ==========================================
   WIDGET CONTAINER
   ========================================== */

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

/* ==========================================
   ACCORDION BASE
   ========================================== */

.lectionary-accordion {
    margin-bottom: 0;
    overflow: hidden;
    border-top: 1px solid #E0E0E0;
}

.lectionary-accordion:last-child {
    border-bottom: 1px solid #E0E0E0;
}

/* ==========================================
   ACCORDION HEADER
   ========================================== */

.lectionary-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    background-color: transparent;
    color: #072538;
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 22px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 0;
}

.lectionary-accordion-header:hover {
    background-color: rgba(7, 37, 56, 0.02);
}

.lectionary-accordion-header.active {
    background-color: transparent;
}

.lectionary-accordion-header .header-title {
    flex: 1;
}

/* Circled Plus/Minus Icon */
.lectionary-accordion-header .header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid #072538;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    margin-left: 20px;
    transition: all 0.3s ease;
    color: #072538;
    flex-shrink: 0;
}

.lectionary-accordion-header.active .header-icon {
    background-color: #072538;
    color: #FFFFFF;
}

.lectionary-accordion-header:hover .header-icon {
    background-color: #072538;
    color: #FFFFFF;
}

/* ==========================================
   ACCORDION CONTENT
   ========================================== */

.lectionary-accordion-content {
    background-color: #F4F3F8;
    border: none;
    padding: 25px;
    overflow: hidden;
}

.lectionary-accordion-content.active {
    display: block;
}

/* ==========================================
   SPECIAL OCCASIONS SECTION
   ========================================== */

.special-occasions .lectionary-accordion-content {
    padding: 20px 25px;
}

.special-occasion-entry {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #E0E0E0;
}

.special-occasion-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.special-occasion-entry:first-child {
    padding-top: 0;
}

.special-occasion-entry .occasion-title {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 14px;
    color: #072538;
    min-width: 180px;
    flex-shrink: 0;
}

.special-occasion-entry .occasion-readings {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    color: #54595F;
    flex: 1;
    line-height: 1.5;
}

/* ==========================================
   LECTIONARY ENTRY
   ========================================== */

.lectionary-entry {
    display: flex;
    flex-direction: row;
    gap: 0;
    margin-bottom: 20px;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.lectionary-entry:last-child {
    margin-bottom: 0;
}

.lectionary-entry:hover {
    box-shadow: 0 4px 12px rgba(4, 20, 30, 0.08);
}

/* ==========================================
   DATE BADGE
   ========================================== */

.lectionary-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 25px 20px;
    background-color: #04141E;
    color: #FFFFFF;
}

.lectionary-date-day {
    font-family: 'Marcellus', serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 5px;
    color: #FFFFFF;
}

.lectionary-date-month {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #FFFFFF;
}

/* ==========================================
   ENTRY CONTENT
   ========================================== */

.lectionary-entry-content {
    flex: 1;
    padding: 20px 25px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lectionary-title {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 15px;
    font-weight: 700;
    color: #072538;
    line-height: 1.4;
    margin: 0;
}

.lectionary-description {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    color: #54595F;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================
   SONGS SECTION
   ========================================== */

.lectionary-songs {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: #FFF8E1;
    border-radius: 4px;
    border-left: 3px solid #F5A623;
}

.lectionary-songs .songs-label {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: #072538;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lectionary-songs .songs-value {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #072538;
}

/* ==========================================
   READINGS CONTAINER
   ========================================== */

.lectionary-readings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================
   READING SECTION
   ========================================== */

.reading-section {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
}

.reading-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background-color: #072538;
    color: #FFFFFF;
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 12px;
    font-weight: 600;
    min-width: 140px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reading-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    flex: 1;
}

.reading-ref {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background-color: #F4F3F8;
    color: #072538;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 500;
    border-right: 1px solid #E0E0E0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.reading-ref:last-child {
    border-right: none;
}

.reading-ref:hover {
    background-color: #E8E7EC;
    color: #04141E;
}

/* ==========================================
   NO RESULTS
   ========================================== */

.lectionary-no-results {
    text-align: center;
    padding: 60px 30px;
    color: #707070;
    background-color: #F4F3F8;
    border-radius: 8px;
}

.lectionary-no-results p {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    margin: 0;
}

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

/* Hidden accordion items */
.lectionary-accordion-hidden {
    display: none;
}

/* Show animation for revealed items */
.lectionary-accordion-animate-in {
    animation: lectionaryFadeIn 0.4s ease-out forwards;
}

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

/* Load More Container */
.lectionary-load-more {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

/* Separator Line */
.lectionary-load-more-line {
    flex: 1 1 auto;
    min-width: 50px;
    height: 2px;
    background-color: #D0D5DD;
}

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

.lectionary-load-more-btn:hover {
    color: #375EFB;
    background: transparent !important;
}

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

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

/* Arrow Icon */
.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;
}

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

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

/* ==========================================
   RESPONSIVE STYLES - TABLET
   ========================================== */

@media (max-width: 1024px) {
    .lectionary-accordion-header {
        padding: 22px 18px;
        font-size: 20px;
    }

    .lectionary-accordion-header .header-icon {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .lectionary-accordion-content {
        padding: 20px;
    }

    .lectionary-date-badge {
        min-width: 90px;
        padding: 20px 15px;
    }

    .lectionary-date-day {
        font-size: 36px;
    }

    .lectionary-entry-content {
        padding: 18px 20px;
    }

    .reading-label {
        min-width: 120px;
        padding: 8px 15px;
        font-size: 11px;
    }

    .reading-ref {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* ==========================================
   RESPONSIVE STYLES - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .lectionary-accordion-header {
        padding: 20px 15px;
        font-size: 18px;
    }

    .lectionary-accordion-header .header-icon {
        width: 26px;
        height: 26px;
        font-size: 16px;
        margin-left: 15px;
    }

    .lectionary-accordion-content {
        padding: 18px;
    }

    .lectionary-entry {
        flex-direction: column;
        margin-bottom: 15px;
    }

    .lectionary-date-badge {
        flex-direction: row;
        min-width: auto;
        padding: 15px 18px;
        gap: 12px;
        justify-content: flex-start;
    }

    .lectionary-date-day {
        font-size: 28px;
        margin-bottom: 0;
    }

    .lectionary-date-month {
        font-size: 12px;
    }

    .lectionary-entry-content {
        padding: 18px;
        gap: 12px;
    }

    .lectionary-title {
        font-size: 14px;
    }

    .lectionary-description {
        font-size: 13px;
    }

    .lectionary-readings {
        gap: 10px;
    }

    .reading-section {
        flex-direction: column;
        border-radius: 4px;
    }

    .reading-label {
        min-width: auto;
        width: 100%;
        justify-content: flex-start;
        border-radius: 4px 4px 0 0;
        padding: 10px 15px;
    }

    .reading-refs {
        width: 100%;
        border-radius: 0 0 4px 4px;
        overflow: hidden;
    }

    .reading-ref {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
        border-right: 1px solid #E0E0E0;
        border-bottom: none;
    }

    .reading-ref:last-child {
        border-right: none;
    }

    .special-occasion-entry {
        flex-direction: column;
        gap: 8px;
        padding: 12px 0;
    }

    .special-occasion-entry .occasion-title {
        min-width: auto;
        font-size: 13px;
    }

    .special-occasion-entry .occasion-readings {
        font-size: 13px;
    }
}

/* ==========================================
   RESPONSIVE STYLES - SMALL MOBILE
   ========================================== */

@media (max-width: 480px) {
    .lectionary-accordion-header {
        padding: 18px 12px;
        font-size: 16px;
    }

    .lectionary-accordion-header .header-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
        margin-left: 12px;
        border-width: 1.5px;
    }

    .lectionary-accordion-content {
        padding: 15px;
    }

    .lectionary-date-badge {
        padding: 12px 15px;
    }

    .lectionary-date-day {
        font-size: 24px;
    }

    .lectionary-date-month {
        font-size: 11px;
    }

    .lectionary-entry-content {
        padding: 15px;
    }

    .lectionary-title {
        font-size: 13px;
    }

    .lectionary-description {
        font-size: 12px;
    }

    .reading-label {
        font-size: 10px;
        padding: 8px 12px;
    }

    .reading-ref {
        font-size: 12px;
        padding: 8px 10px;
    }

    .special-occasion-entry .occasion-title {
        font-size: 12px;
    }

    .special-occasion-entry .occasion-readings {
        font-size: 12px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

.lectionary-accordion-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
    .lectionary-accordion-header,
    .lectionary-accordion-header .header-icon,
    .lectionary-accordion-content,
    .lectionary-entry,
    .reading-ref {
        transition: none;
    }
}

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

.elementor-editor-active .marthoma-lectionary-widget {
    min-height: 200px;
}

/* Show all accordions in editor for easier editing */
.elementor-editor-active .lectionary-accordion-content {
    display: block !important;
    opacity: 1 !important;
}

.elementor-editor-active .lectionary-accordion:not(:first-child) .lectionary-accordion-content {
    opacity: 0.7;
    border: 1px dashed rgba(7, 37, 56, 0.2);
}
