/* Hide WordPress default header/menu */
.site-header,
.main-navigation,
#site-navigation,
.navbar,
header.header,
#masthead,
.site-branding,
#wpadminbar {
    display: none !important;
}

/* Reset body margin for full control */
body {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Merriweather', 'Roboto', serif !important;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

/* Header styles */
.xito-header {
    background: #7a110d;
    padding: 8px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
}
.xito-header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 5%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.xito-header-left {
    display: flex;
    gap: 20px;
    align-items: center;
}
.xito-header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}
/* Hide prayer icon in header since we have central menu */
#prayerIcon {
    display: none;
}
.xito-header-center {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
    gap: 15px;
}

/* Desktop header content - visible on desktop */
.desktop-header-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.header-nav-arrow {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    user-select: none;
}
.header-nav-arrow:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.1);
}
.header-nav-arrow:active {
    transform: scale(0.95);
}
.header-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.3s;
}
.header-center-content:hover {
    background: rgba(255,255,255,0.1);
}

/* Calendar month view popup */
.calendar-month-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    display: none;
    min-width: 320px;
    z-index: 2000;
}
.calendar-month-popup.show {
    display: block;
}
.calendar-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #7a110d;
}
.calendar-month-title {
    font-weight: bold;
    color: #7a110d;
    font-size: 16px;
}
.calendar-month-nav {
    display: flex;
    gap: 10px;
}
.calendar-month-nav button {
    width: 30px;
    height: 30px;
    background: #7a110d;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.3s;
}
.calendar-month-nav button:hover {
    opacity: 0.8;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}
.calendar-weekday {
    text-align: center;
    font-weight: bold;
    color: #7a110d;
    font-size: 12px;
    padding: 5px;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    background: #f5f5f5;
    color: #333;
}
.calendar-day:hover {
    background: #7a110d;
    color: #fff;
    transform: scale(1.1);
}
.calendar-day.other-month {
    color: #ccc;
    background: #fafafa;
}
.calendar-day.today {
    background: #5c8db8;
    color: #fff;
    font-weight: bold;
}
.calendar-day.selected {
    background: #7a110d;
    color: #fff;
    font-weight: bold;
}
.header-liturgy-info {
    text-align: center;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}
.header-liturgy-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 3px;
}
.header-liturgy-reading {
    font-size: 12px;
    opacity: 0.9;
}
.header-clock {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
    font-family: monospace;
}
.xito-header-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 24px;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.3s;
    text-decoration: none;
}
.xito-header-icon:hover {
    background: rgba(255,255,255,0.2);
}
.xito-header-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* Mobile calendar icon - hidden on desktop */
.mobile-calendar-icon {
    display: none;
}

/* Mobile calendar navigation container */
.mobile-calendar-nav {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Show the calendar icon inside mobile nav */
.mobile-calendar-nav .mobile-calendar-icon {
    display: flex !important;
    position: relative;
}

/* Mobile navigation arrows */
.mobile-nav-arrow {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}

.mobile-nav-arrow:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.mobile-nav-arrow:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.4);
}

/* ===== HOME OVERLAY (first load only) ===== */
.xito-home-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 12000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.xito-home-overlay.show {
    display: flex;
}
.xito-home-card {
    width: min(540px, 94vw);
    background:
        /* vân giấy mịn */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%230d302b'/%3E%3Crect x='0' y='0' width='1' height='1' fill='rgba(255,255,255,0.015)'/%3E%3Crect x='2' y='2' width='1' height='1' fill='rgba(255,255,255,0.015)'/%3E%3C/svg%3E"),
        linear-gradient(160deg, #10382f 0%, #0a2820 45%, #0e3025 100%);
    border-radius: 16px;
    padding: 32px 28px 36px;
    box-shadow:
        0 28px 70px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.45),
        0 0 0 1px rgba(255,201,20,0.12),
        inset 0 1px 0 rgba(255,255,255,0.06);
    border: 1px solid rgba(255,201,20,0.18);
    text-align: center;
}
.xito-home-subtitle {
    margin: 0 0 4px;
    color: rgba(255,255,255,0.88);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-family: Helvetica, Arial, sans-serif;
}
.xito-home-title {
    margin: 6px 0 0;
    color: #ffc914;
    font-weight: 800;
    font-size: clamp(28px, 7vw, 40px);
    letter-spacing: 2px;
    font-family: Georgia, 'Times New Roman', serif;
    text-shadow: 0 2px 12px rgba(255,201,20,0.35), 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1.15;
}
.xito-home-invitation {
    margin: 18px auto 0;
    max-width: 88%;
    color: #f0e6d3;
    font-style: italic;
    font-size: clamp(13px, 3.4vw, 16px);
    line-height: 1.9;
    font-family: Georgia, 'Palatino Linotype', Palatino, serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
    letter-spacing: 0.15px;
}
.xito-home-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px auto 18px;
    width: 78%;
    max-width: 280px;
}
.xito-home-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,201,20,0.5), transparent);
}
.xito-home-divider-cross {
    color: rgba(255,201,20,0.75);
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}
.xito-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    background: linear-gradient(140deg, #c4030b 0%, #8c0106 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 5px 18px rgba(183,1,2,0.45), 0 2px 6px rgba(0,0,0,0.3);
    text-transform: uppercase;
}
.xito-home-btn:hover,
.xito-home-btn:focus {
    background: linear-gradient(140deg, #d90410 0%, #a00208 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(183,1,2,0.55), 0 3px 8px rgba(0,0,0,0.35);
}
.xito-home-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(183,1,2,0.4);
}
@media (min-width: 641px) {
    .xito-home-card {
        width: min(620px, 90vw);
        padding: 44px 40px 48px;
    }
    .xito-home-subtitle {
        font-size: 16px;
    }
    .xito-home-title {
        font-size: clamp(34px, 5vw, 46px);
    }
    .xito-home-invitation {
        font-size: 16px;
        margin-top: 22px;
        max-width: 82%;
    }
    .xito-home-divider {
        margin: 26px auto 22px;
    }
    .xito-home-btn {
        padding: 15px 36px;
        font-size: 16px;
    }
}
@media (max-width: 640px) {
    .xito-home-card {
        padding: 24px 18px 30px;
    }
    .xito-home-btn {
        width: 100%;
        justify-content: center;
    }
    .xito-home-invitation {
        max-width: 96%;
    }
}

/* Mobile popup overlay */
.mobile-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}
.mobile-popup-overlay.show {
    display: block;
}

/* Hide other back-to-top buttons from theme/plugins */
a[href="#top"],
a[href="#"],
.scroll-to-top,
.scrollup,
.back-top,
#scroll-to-top,
.to-top,
.totop,
.backtotop,
#backtotop,
.scroll-top,
#scroll-top,
.go-top,
#go-top,
[class*="scroll-top"],
[class*="back-top"],
[id*="scroll-top"],
[id*="back-top"] {
    display: none !important;
}

/* Make sure our button is visible */
.back-to-top#backToTop {
    display: none !important;
}
.back-to-top#backToTop.show {
    display: flex !important;
}

/* Calendar dropdown */
.calendar-dropdown {
    position: absolute;
    top: 45px;
    left: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 320px;
    z-index: 1001;
}
.calendar-dropdown.show {
    display: block;
}
.calendar-nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.calendar-nav-btn {
    width: 36px;
    height: 36px;
    background: #7a110d;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: opacity 0.3s;
}
.calendar-nav-btn:hover {
    opacity: 0.8;
}
.calendar-dropdown input[type="date"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
.calendar-current-date {
    text-align: center;
    color: #7a110d;
    font-weight: bold;
    margin-top: 8px;
    font-size: 14px;
}

/* Prayer times dropdown */
.prayer-dropdown {
    position: absolute;
    top: 45px;
    left: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 220px;
    z-index: 1001;
}
.prayer-dropdown.show {
    display: block;
}
.prayer-item {
    padding: 12px 15px;
    cursor: pointer;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.2s;
}
.prayer-item:hover {
    background: #5c8db8;
    color: #fff;
}
.prayer-item.active {
    background: #5c8db8;
    color: #fff;
}

/* Central Prayer Menu Dropdown */
.prayer-menu-container {
    text-align: center;
    padding: 2px 0 4px 0;
    background: #f8f8f8;
    border-bottom: 2px solid #7a110d;
}
.prayer-menu-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.today-button {
    background: #d32f2f !important;
    border: 2px solid #b71c1c !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #fff9c4 !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    transition: all 0.3s !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    white-space: nowrap !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.today-button:hover {
    background: #c62828 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4) !important;
}
.today-button:active {
    transform: translateY(0) !important;
}
.prayer-menu-dropdown {
    position: relative;
    display: inline-block;
}
.prayer-menu-button {
    background: #fff;
    border: 2px solid #ddd;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 250px;
    justify-content: space-between;
}
.prayer-menu-button:hover {
    border-color: #7a110d;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.prayer-menu-button .arrow {
    font-size: 12px;
    transition: transform 0.3s;
}
.prayer-menu-button.open .arrow {
    transform: rotate(180deg);
}
.prayer-menu-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    margin-top: 2px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}
.prayer-menu-list.show {
    display: block;
}
.prayer-menu-item {
    padding: 12px 15px;
    cursor: pointer;
    color: #333;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 18px;
    border-radius: 5px;
    transition: all 0.2s;
    text-align: left;
    background: #f5f5f5;
}
.prayer-menu-item:hover {
    filter: brightness(0.92);
}
.prayer-menu-item.current {
    background: #b70102;
    color: #fff;
}
.prayer-menu-item.past {
    background: #898989;
    color: #fff;
}
.prayer-menu-item.future {
    background: #fbf7df;
    color: #0b2d3c;
}

/* Events dropdown */
.events-dropdown {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbf7df;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 240px;
    max-width: min(340px, calc(100vw - 20px));
    z-index: 1001;
}
.events-dropdown.show {
    display: block;
}
/* Ngoại Lịch menu styles */
.ngoai-lich-menu-title {
    font-weight: bold;
    color: #630703;
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0d0d0;
}
.ngoai-lich-menu {
    list-style: none;
    margin: 10px -15px -15px -15px;
    padding: 0;
}
.ngoai-lich-menu-item {
    border-bottom: 1px solid #e8d8b0;
}
.ngoai-lich-menu-item:last-child {
    border-bottom: none;
}
.ngoai-lich-menu-item a {
    display: block;
    padding: 10px 2px;
    background: #fbf7df;
    color: #630703;
    text-decoration: none;
    font-family: Helvetica, Arial, sans-serif;
    font-weight: bold;
    font-size: 18px;
    transition: background 0.2s, color 0.2s;
    border-radius: 0;
}
.ngoai-lich-menu-item a:hover {
    background: #d0d0d0;
    color: #630703;
}
@media (max-width: 900px) {
    .ngoai-lich-menu-item a {
        font-size: 16px;
    }
}
.events-content {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}
.events-title {
    font-weight: bold;
    color: #7a110d;
    margin-bottom: 8px;
    font-size: 16px;
}
.event-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.event-item:last-child {
    border-bottom: none;
}

/* Settings dropdown */
.settings-dropdown {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 280px;
    max-width: min(400px, calc(100vw - 20px));
    z-index: 1001;
    text-align: left;
    box-sizing: border-box;
}
.settings-dropdown.show {
    display: block;
}
/* Căn mọi hàng điều khiển theo lề trái (cùng trục với nhãn), tránh flex cha căn giữa */
.settings-dropdown .font-size-control,
.settings-dropdown .theme-buttons,
.settings-dropdown .bold-toggle,
.settings-dropdown .scroll-speed-control {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.setting-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.setting-group:last-child {
    margin-bottom: 0;
}
.setting-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    margin-left: 0;
    padding-left: 0;
    display: block;
    font-size: 14px;
    text-align: left;
    width: 100%;
}
.theme-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.theme-btn {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}
.theme-btn.active {
    border-color: #7a110d;
    border-width: 3px;
}
.theme-btn:hover {
    border-color: #7a110d;
}
/* Theme color previews */
.theme-btn[data-theme="white"] {
    background: #fff;
    color: #333;
}
.theme-btn[data-theme="dark"] {
    background: #3a3a3a;
    color: #f2f2f2;
}
.theme-btn[data-theme="paper"] {
    background: #f4e8d0;
    color: #2c2416;
}
.scroll-speed-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
    margin-left: 0;
    padding-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.scroll-speed-control input[type="range"] {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.scroll-speed-label {
    font-size: 12px;
    color: #666;
    min-width: 44px;
    flex-shrink: 0;
    text-align: left;
    margin: 0;
    padding: 0;
}
.scroll-speed-label:last-child {
    text-align: right;
    min-width: 44px;
}

/* Main content wrapper to account for fixed header */
.xito-main-wrapper {
    margin-top: 20px;
    min-height: calc(100vh - 20px);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(122, 17, 13, 0.8);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 999;
    transition: all 0.2s;
}
.back-to-top.show {
    display: flex;
}
.back-to-top:hover {
    background: rgba(154, 22, 16, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.back-to-top:active {
    transform: translateY(0);
}

/* Desktop-only background for outer area (not inner content) */
@media (min-width: 769px) {
    body {
        background: #b6b6b6 !important;
    }
}
.font-size-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.font-size-control input[type="range"] {
    flex: 1;
}
.font-size-value {
    font-weight: bold;
    color: #7a110d;
    min-width: 45px;
}
.bold-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    align-content: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.bold-toggle-label {
    font-size: 12px;
    color: #555;
    line-height: 1.2;
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex: 0 0 auto;
    margin: 0;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}
.toggle-switch.active {
    background: #7a110d;
}
.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

/* Theme backgrounds */
body.theme-white .x-box,
body.theme-white .x-body {
    background: #fff;
    color: #000;
}
/* Ban đêm: nền đen nhạt; chữ đen → trắng; gạch đầu dòng trắng; đỏ → đỏ nhạt */
body.theme-dark .x-box,
body.theme-dark .x-body {
    background: #3a3a3a;
    color: #f2f2f2 !important;
}
body.theme-dark .x-body p,
body.theme-dark .x-body li,
body.theme-dark .x-body div,
body.theme-dark .x-body td,
body.theme-dark .x-body th,
body.theme-dark .x-body blockquote,
body.theme-dark .x-body label,
body.theme-dark .x-body h1,
body.theme-dark .x-body h2,
body.theme-dark .x-body h3,
body.theme-dark .x-body h4,
body.theme-dark .x-body h5,
body.theme-dark .x-body h6 {
    color: #f2f2f2 !important;
}
body.theme-dark .x-body a {
    color: #e8e8e8 !important;
    text-decoration: underline;
}
body.theme-dark .x-body a:hover {
    color: #fff !important;
}
/* Gạch đầu dòng dạng "-" (::before trong plugin) */
body.theme-dark .x-body ul li::before {
    color: #f2f2f2 !important;
}
/* Danh sách dùng marker mặc định */
body.theme-dark .x-body ul li::marker,
body.theme-dark .x-body ol li::marker {
    color: #f2f2f2 !important;
}
/* Chữ đen / xám đậm set inline trong editor */
body.theme-dark .x-body [style*="color:#000"],
body.theme-dark .x-body [style*="color: #000"],
body.theme-dark .x-body [style*="color:#000000"],
body.theme-dark .x-body [style*="color: #000000"],
body.theme-dark .x-body [style*="color:black"],
body.theme-dark .x-body [style*="color: black"],
body.theme-dark .x-body [style*="rgb(0, 0, 0)"],
body.theme-dark .x-body [style*="rgb(0,0,0)"],
body.theme-dark .x-body [style*="#333"],
body.theme-dark .x-body [style*="#333333"] {
    color: #f2f2f2 !important;
}
body.theme-dark .x-body font[color="#000000"],
body.theme-dark .x-body font[color="#000"],
body.theme-dark .x-body font[color="black"] {
    color: #f2f2f2 !important;
}
body.theme-dark .x-body font[color="#b70102"],
body.theme-dark .x-body font[color="#d83131"],
body.theme-dark .x-body font[color="#7a110d"] {
    color: #ff9a9a !important;
}
/* Màu đỏ phụng vụ / plugin → đỏ nhạt (ghi đè cả block .x-body strong|span bên dưới) */
body.theme-dark .x-body strong[style*="#b70102"],
body.theme-dark .x-body strong[style*="#B70102"],
body.theme-dark .x-body strong[style*="#d83131"],
body.theme-dark .x-body strong[style*="#D83131"],
body.theme-dark .x-body strong[style*="#7a110d"],
body.theme-dark .x-body strong[style*="#7A110D"],
body.theme-dark .x-body span[style*="#b70102"],
body.theme-dark .x-body span[style*="#B70102"],
body.theme-dark .x-body span[style*="#d83131"],
body.theme-dark .x-body span[style*="#D83131"],
body.theme-dark .x-body span[style*="#7a110d"],
body.theme-dark .x-body span[style*="#7A110D"],
body.theme-dark .x-body p[style*="#b70102"],
body.theme-dark .x-body p[style*="#d83131"],
body.theme-dark .x-body p[style*="#7a110d"],
body.theme-dark .x-body [style*="rgb(183, 1, 2)"],
body.theme-dark .x-body [style*="rgb(216, 49, 49)"],
body.theme-dark .x-body [style*="color: red"],
body.theme-dark .x-body [style*="color:red"],
body.theme-dark .x-body [style*="#c00"],
body.theme-dark .x-body [style*="#C00"],
body.theme-dark .x-body [style*="#d32f2f"],
body.theme-dark .x-body [style*="#dc3545"] {
    color: #ff9a9a !important;
}
body.theme-paper .x-box,
body.theme-paper .x-body {
    background: #f4e8d0;
    color: #2c2416;
}

/* Responsive design - Mobile: Full Width (giống Page - Full Width template) */
@media (max-width: 768px) {
    /* Force full width on mobile - override Default Template để tràn ra viền */
    /* Giống như Page - Full Width template */
    body .container,
    body .site-content,
    body .content-area,
    body .site-main,
    body .elementor-section.elementor-section-boxed > .elementor-container,
    body .entry-content > .alignfull,
    body .wp-block-group.alignfull,
    body article,
    body .post,
    body .page,
    body .page-container,
    body .container-center,
    body .page-wrapper,
    body .content-wrapper,
    body .main-wrapper,
    body .entry-wrapper,
    body .post-content,
    body .entry-content {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Override các wrapper và section để tràn ra viền */
    body .site,
    body #page,
    body #content,
    body .wrapper,
    body .main-content,
    body #main,
    body section,
    body .section,
    body .content-section,
    body .page-content {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Mobile specific styles */
    
    /* Remove any wrapper padding on mobile */
    body .site,
    body #page,
    body #content,
    body .wrapper,
    body .main-content,
    body #main {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .xito-header {
        padding: 8px 10px;
    }
    .xito-header-inner {
        justify-content: space-between;
        gap: 15px;
    }
    
    /* Keep header center for layout but hide desktop content */
    .xito-header-center {
        display: flex !important;
        margin: 0 10px;
    }
    
    /* Hide desktop header content on mobile */
    .desktop-header-content {
        display: none !important;
    }
    
    .xito-header-left #prayerIcon {
        display: none;
    }
    
    /* Show mobile calendar navigation with arrows */
    .mobile-calendar-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    /* Make mobile nav arrows more visible on small screens */
    .mobile-nav-arrow {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 34px;
        height: 34px;
        font-size: 18px;
        background: rgba(255,255,255,0.25) !important;
        border: 2px solid rgba(255,255,255,0.4) !important;
        color: #fff !important;
    }
    
    .mobile-calendar-nav .mobile-calendar-icon {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Arrange icons */
    .xito-header-left,
    .xito-header-right {
        gap: 0;
        flex: 0 0 auto;
    }
    
    .xito-header-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .mobile-calendar-nav .xito-header-icon svg {
        width: 28px;
        height: 28px;
    }
    
    /* Popups centered on mobile */
    .calendar-dropdown,
    .prayer-dropdown,
    .events-dropdown,
    .settings-dropdown,
    .download-dropdown {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        min-width: 280px;
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 9999;
    }
    
    .calendar-month-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        min-width: 280px;
        max-width: 90vw;
        margin-top: 0;
        z-index: 9999;
    }
    
    .prayer-menu-button {
        min-width: 200px;
        padding: 10px 20px;
        font-size: 14px;
    }
    .prayer-menu-container {
        padding: 3px 0;
    }
    .prayer-menu-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    .today-button {
        padding: 10px 20px !important;
        font-size: 14px !important;
        display: inline-block !important;
        min-width: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .xito-main-wrapper {
        margin-top: 5px;
    }
    
    /* Content box full width on mobile */
    .x-box { 
        padding: 0 0 20px 0 !important; 
        box-shadow: none;
        margin: 0;
    }
    .x-box h1 {
        padding: 10px 15px;
    }
    .x-body { 
        padding-left: 15px !important; 
        padding-right: 15px !important; 
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

.x-box { 
    max-width: 100%; 
    margin: 0 auto; 
    background: #fff; 
    padding: 0 20px 20px 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1); 
}
/* Bible popup overlay */
.bible-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.bible-popup-overlay.show {
    display: flex;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.bible-popup-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 100%;
    padding: 40px 30px;
    position: relative;
    text-align: center;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.bible-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    transition: all 0.2s;
}
.bible-popup-close:hover {
    background: #e0e0e0;
    color: #000;
}
.bible-popup-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #b70102 0%, #7a110d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bible-popup-icon svg {
    width: 45px;
    height: 45px;
    fill: #fff;
}
.bible-popup-title {
    font-size: 24px;
    font-weight: bold;
    color: #b70102;
    margin-bottom: 12px;
}
.bible-popup-description {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}
.bible-popup-button {
    display: inline-block;
    background: linear-gradient(135deg, #b70102 0%, #7a110d 100%);
    color: #fff;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(183, 1, 2, 0.3);
    transition: all 0.3s;
}
.bible-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 1, 2, 0.4);
    color: #fff;
}
@media (max-width: 768px) {
    .bible-popup-card {
        padding: 30px 20px;
        max-width: 90%;
    }
    .bible-popup-title {
        font-size: 20px;
    }
    .bible-popup-description {
        font-size: 14px;
    }
}

/* Download dropdown */
.download-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 320px;
    max-width: min(400px, calc(100vw - 20px));
    z-index: 1001;
}
.download-dropdown.show {
    display: block;
}
.download-group {
    margin-bottom: 15px;
}
.download-group:last-child {
    margin-bottom: 0;
}
.download-title {
    font-weight: bold;
    color: #7a110d;
    margin-bottom: 8px;
    font-size: 15px;
}
.download-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}
.download-days-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}
.download-day-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.download-day-btn:hover {
    border-color: #7a110d;
    color: #7a110d;
    background: #fff7f7;
}
.download-day-btn.selected {
    background: #7a110d;
    border-color: #7a110d;
    color: #fff;
    border-width: 3px;
}
.download-action-button {
    width: 100%;
    background: #7a110d;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.download-action-button:hover:not(:disabled) {
    background: #b70102;
}
.download-action-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.cache-status {
    padding: 10px;
    background: #E8F5E9;
    color: #2E7D32;
    border-radius: 5px;
    font-size: 12px;
    margin-bottom: 12px;
    display: none;
}
.cache-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
    border-top: 1px solid #e0e0e0;
}
.cache-item {
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}
.cache-item-info {
    flex: 1;
}
.cache-item-date {
    font-weight: bold;
    color: #333;
}
.cache-item-liturgy {
    color: #999;
    font-size: 11px;
    margin-top: 2px;
}
.cache-item-delete {
    background: #f44336;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}
.cache-item-delete:hover {
    background: #d32f2f;
}
.cache-actions {
    padding: 10px 8px 5px;
    text-align: center;
}
.cache-clear-all {
    background: #666;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.cache-clear-all:hover {
    background: #444;
}

.x-nav { display:flex; justify-content:center; gap:5px; border-bottom:3px solid #b70102; padding-bottom:10px; margin-bottom:20px; flex-wrap:wrap; }
.x-btn { padding:8px 12px; background:#f5f5f5; border:1px solid #ddd; cursor:pointer; font-weight:bold; }
.x-btn.active { background:#b70102; color:#fff; border-color:#b70102; }
/* Tiêu đề Giờ kinh ngoài trang chủ cũng phải Đỏ mận, Đậm, In hoa */
.x-head { 
    display: none; /* Ẩn tiêu đề giờ kinh vì đã có ở Menu */
}
.x-body { 
    color:#000; 
    font-family:'SVN-Georgia', Georgia, serif; 
    font-size: 20px; 
    padding-left: 3%; 
    padding-right: 3%; 
}

/* Khoảng cách giữa các paragraph trong Ca vịnh (có gạch đầu dòng) */
.x-body p {
    margin-bottom: 12pt;
    margin-top: 0;
}

/* CSS MẠNH: Tô đậm và đỏ các ký hiệu đặc biệt */
.x-body strong[style*="color:#b70102"], .x-body strong[style*="color:#d83131"] { color: #d83131 !important; font-weight: bold !important; }
.x-body span[style*="color:#b70102"], .x-body span[style*="color:#d83131"] { color: #d83131 !important; }

/* Đổi bullets thành gạch đầu dòng ngắn đậm (-) */
.x-body ul { list-style-type: none !important; padding-left: 0 !important; margin-left: 3% !important; }
.x-body ul li { position: relative; padding-left: calc(0.5% + 0.5em); margin-bottom: 6pt; margin-left: 0.5%; }
.x-body ul li::before { 
    content: '-'; 
    font-weight: bold; 
    position: absolute; 
    left: 0; 
    color: #000;
}
/* Xóa gạch đầu dòng cho các dòng Tx */
.x-body .no-bullet,
.x-body .no-bullet::before { 
    list-style: none !important;
    list-style-type: none !important;
}
.x-body .no-bullet::before {
    content: '' !important;
    display: none !important;
}
.x-body li.no-bullet {
    padding-left: 0 !important;
    margin-left: 0 !important;
}
/* Ban đêm: ghi đè block “đỏ đậm” phía trên — đặt cuối (browser hay lưu rgb từ #d83131) */
body.theme-dark .x-body strong[style*="color:#b70102"],
body.theme-dark .x-body strong[style*="color:#d83131"],
body.theme-dark .x-body span[style*="color:#b70102"],
body.theme-dark .x-body span[style*="color:#d83131"],
body.theme-dark .x-body strong[style*="rgb(183, 1, 2)"],
body.theme-dark .x-body strong[style*="rgb(216, 49, 49)"],
body.theme-dark .x-body span[style*="rgb(183, 1, 2)"],
body.theme-dark .x-body span[style*="rgb(216, 49, 49)"] {
    color: #ff9a9a !important;
}

