/**
 * Reservation terms modal — theme isolation (legacy ?theme=dark + modern palettes).
 * Loaded from templates/pwb-footer-reservation-terms.php on every theme.
 */

/* Light default: do not inherit body text color (legacy dark body is #f8f9fa). */
.pwb-terms-modal .modal-content,
.pwb-terms-modal .modal-header,
.pwb-terms-modal .modal-footer,
.pwb-terms-modal .pwb-footer-terms-modal__body {
    background-color: #ffffff;
    color: #111827;
    border-color: rgba(0, 0, 0, 0.12);
}

.pwb-terms-modal .modal-title {
    color: #111827;
}

.pwb-terms-modal .pwb-footer-terms-prose {
    color: #111827;
}

.pwb-terms-modal .pwb-footer-terms-prose a {
    color: #2563eb;
}

.pwb-terms-modal .pwb-footer-terms-modal__placeholder,
.pwb-terms-modal .text-muted {
    color: #6b7280 !important;
}

/* Dark entry points */
body.theme-dark .pwb-terms-modal .modal-content,
body.theme-dark .pwb-terms-modal .modal-header,
body.theme-dark .pwb-terms-modal .modal-footer,
body.theme-dark .pwb-terms-modal .pwb-footer-terms-modal__body,
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-content,
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-header,
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-footer,
html[data-pwb-palette="dark"] .pwb-terms-modal .pwb-footer-terms-modal__body,
html[data-theme="dark"] .pwb-terms-modal .modal-content,
html[data-theme="dark"] .pwb-terms-modal .modal-header,
html[data-theme="dark"] .pwb-terms-modal .modal-footer,
html[data-theme="dark"] .pwb-terms-modal .pwb-footer-terms-modal__body,
html[data-theme="modern-dark"] .pwb-terms-modal .modal-content,
html[data-theme="modern-dark"] .pwb-terms-modal .modal-header,
html[data-theme="modern-dark"] .pwb-terms-modal .modal-footer,
html[data-theme="modern-dark"] .pwb-terms-modal .pwb-footer-terms-modal__body {
    background-color: #1e293b;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark .pwb-terms-modal .modal-title,
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-title,
html[data-theme="dark"] .pwb-terms-modal .modal-title,
html[data-theme="modern-dark"] .pwb-terms-modal .modal-title {
    color: #f1f5f9;
}

body.theme-dark .pwb-terms-modal .btn-close,
html[data-pwb-palette="dark"] .pwb-terms-modal .btn-close,
html[data-theme="dark"] .pwb-terms-modal .btn-close,
html[data-theme="modern-dark"] .pwb-terms-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.theme-dark .pwb-terms-modal .pwb-footer-terms-prose,
html[data-pwb-palette="dark"] .pwb-terms-modal .pwb-footer-terms-prose,
html[data-theme="dark"] .pwb-terms-modal .pwb-footer-terms-prose,
html[data-theme="modern-dark"] .pwb-terms-modal .pwb-footer-terms-prose {
    color: #e5e7eb;
}

body.theme-dark .pwb-terms-modal .pwb-footer-terms-prose a,
html[data-pwb-palette="dark"] .pwb-terms-modal .pwb-footer-terms-prose a,
html[data-theme="dark"] .pwb-terms-modal .pwb-footer-terms-prose a,
html[data-theme="modern-dark"] .pwb-terms-modal .pwb-footer-terms-prose a {
    color: #38bdf8;
}

body.theme-dark .pwb-terms-modal .pwb-footer-terms-modal__placeholder,
body.theme-dark .pwb-terms-modal .text-muted,
html[data-pwb-palette="dark"] .pwb-terms-modal .pwb-footer-terms-modal__placeholder,
html[data-pwb-palette="dark"] .pwb-terms-modal .text-muted,
html[data-theme="dark"] .pwb-terms-modal .pwb-footer-terms-modal__placeholder,
html[data-theme="dark"] .pwb-terms-modal .text-muted,
html[data-theme="modern-dark"] .pwb-terms-modal .pwb-footer-terms-modal__placeholder,
html[data-theme="modern-dark"] .pwb-terms-modal .text-muted {
    color: #94a3b8 !important;
}

/* TinyMCE inline color/background inside modal only */
body.theme-dark #pwbFooterReservationTermsModal .pwb-footer-terms-prose :where(p, li, td, th, span, div, b, strong, h1, h2, h3, h4, h5, h6),
html[data-pwb-palette="dark"] #pwbFooterReservationTermsModal .pwb-footer-terms-prose :where(p, li, td, th, span, div, b, strong, h1, h2, h3, h4, h5, h6),
html[data-theme="dark"] #pwbFooterReservationTermsModal .pwb-footer-terms-prose :where(p, li, td, th, span, div, b, strong, h1, h2, h3, h4, h5, h6),
html[data-theme="modern-dark"] #pwbFooterReservationTermsModal .pwb-footer-terms-prose :where(p, li, td, th, span, div, b, strong, h1, h2, h3, h4, h5, h6) {
    color: #e5e7eb !important;
    background-color: transparent !important;
}

body.theme-dark #pwbFooterReservationTermsModal .pwb-footer-terms-prose a,
html[data-pwb-palette="dark"] #pwbFooterReservationTermsModal .pwb-footer-terms-prose a,
html[data-theme="dark"] #pwbFooterReservationTermsModal .pwb-footer-terms-prose a,
html[data-theme="modern-dark"] #pwbFooterReservationTermsModal .pwb-footer-terms-prose a {
    color: #38bdf8 !important;
}

/* Modern UX tokens when ux.css / pb-palettes are present */
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-content,
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-header,
html[data-pwb-palette="dark"] .pwb-terms-modal .modal-footer,
html[data-pwb-palette="dark"] .pwb-terms-modal .pwb-footer-terms-modal__body {
    background-color: var(--ux-panel, #1e293b);
    color: var(--ux-text, #e5e7eb);
    border-color: var(--ux-border, rgba(255, 255, 255, 0.1));
}
