/* Shared dark palette for both languages. Light mode keeps its existing colors. */
html[data-bs-theme="dark"],
html[lang="fa"][data-bs-theme="dark"] {
    --bs-body-color: #d8dde5;
    --bs-body-color-rgb: 216, 221, 229;
    --bs-heading-color: #f3f4f6;
    --bs-secondary-color: #b8c1ce;
    --bs-secondary-color-rgb: 184, 193, 206;
    --bs-body-bg-rgb: 34, 37, 41;
    --bs-border-color: #454b55;
    --site-text: #d8dde5;
    --site-heading: #f3f4f6;
    --site-muted: #b8c1ce;
    --site-border: #454b55;
    --site-surface: #2b3037;
    --site-surface-soft: #262a31;
    --site-accent-text: #c4b5fd;
    --site-accent-soft: rgb(164 143 232 / 14%);
    --site-accent-hover: rgb(164 143 232 / 23%);
    --site-accent-border: rgb(196 181 253 / 38%);
    --site-success-text: #83d6b1;
    --site-danger-text: #f5a3a9;
}

html[data-bs-theme="dark"] :is(main.english-content-page, .english-content-region) {
    --english-body-color: var(--site-text);
    --english-heading-color: var(--site-heading);
    --bs-body-color-rgb: 216, 221, 229;
}

/* Content from the editor may contain inline colors and white backgrounds. */
html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content, .persian-page-description, .persian-blog-description) {
    color: var(--site-text) !important;
}

html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content, .persian-page-description, .persian-blog-description) :is(p, li, div, span, strong, b, blockquote, td, th, font) {
    color: inherit !important;
}

html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content, .persian-page-description, .persian-blog-description) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--site-heading) !important;
}

html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content, .persian-page-description, .persian-blog-description) :is([style*="background"], [bgcolor]) {
    background-color: transparent !important;
}

html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content) table {
    background-color: var(--site-surface-soft) !important;
}

html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content) :is(th, td) {
    border-color: var(--site-border);
}

html[data-bs-theme="dark"] :is(.page-dsc, .english-rich-text, .blog-detail__content, .guide-detail__content) th {
    background-color: var(--site-accent-soft) !important;
}

html[data-bs-theme="dark"] .home-view-all {
    --bs-btn-color: var(--site-accent-text);
    --bs-btn-bg: var(--site-surface);
    --bs-btn-border-color: var(--site-accent-border);
}

html[data-bs-theme="dark"] .home-view-all i {
    color: var(--site-accent-text);
    background: var(--site-accent-soft);
}

html[data-bs-theme="dark"] .home-view-all:hover i {
    color: #fff;
}

html[data-bs-theme="dark"] :is(.home-feature-card, .home-top-tour-card, .blog-card) {
    border-color: var(--site-border);
}

html[data-bs-theme="dark"] .home-top-tour-price {
    color: var(--site-success-text);
}

html[data-bs-theme="dark"] .quick-contact-nav {
    --quick-contact-color: var(--site-accent-text);
    border-color: var(--site-accent-border);
}

html[data-bs-theme="dark"] .quick-contact-nav a:is(:hover, :focus-visible) {
    color: #e4d9ff;
    background: var(--site-accent-soft);
}

html[data-bs-theme="dark"] .quick-contact-nav li + li {
    border-color: var(--site-border);
}

html[data-bs-theme="dark"] :is(.language-switcher-toggle:hover, .language-switcher-toggle[aria-expanded="true"], .language-switcher-menu .dropdown-item.active) {
    color: var(--site-accent-text);
    background: var(--site-accent-soft);
    border-color: var(--site-accent-border);
}

html[data-bs-theme="dark"] .tour-departures {
    --departure-accent: var(--site-accent-text);
}

/* Keep the booking CTA dark purple with white text, distinct from accent text. */
html[data-bs-theme="dark"] .departure-card__book {
    background: #571183;
    border-color: #571183;
}

html[data-bs-theme="dark"] .departure-card__book:hover {
    background: #6e2698;
}

html[data-bs-theme="dark"] .departure-card__calendar {
    background: var(--site-accent-soft);
    border-color: var(--site-accent-border);
}

html[data-bs-theme="dark"] :is(.departure-card__expanded, .departure-card__price-list dd, .departure-card__details:hover, .departure-card__details[aria-expanded="true"]) {
    background: var(--site-accent-soft);
}

html[data-bs-theme="dark"] .tour-request-price-option {
    border-color: var(--site-accent-border) !important;
}

/* White button labels need a deeper fill than the theme's pale link color. */
html[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #5e46b8;
    --bs-btn-border-color: #5e46b8;
    --bs-btn-hover-bg: #6b52c9;
    --bs-btn-hover-border-color: #6b52c9;
    --bs-btn-active-bg: #533da6;
    --bs-btn-active-border-color: #533da6;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}

html[data-bs-theme="dark"] .nav-pills {
    --bs-nav-pills-link-active-bg: #5e46b8;
    --bs-nav-pills-link-active-color: #fff;
}

html[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-hover-bg: #5e46b8;
    --bs-btn-hover-border-color: #5e46b8;
    --bs-btn-active-bg: #533da6;
    --bs-btn-active-border-color: #533da6;
}

html[data-bs-theme="dark"] .btn-primary-soft:is(:hover, :focus-visible) {
    color: #fff;
    background-color: #5e46b8;
}

html[data-bs-theme="dark"] .badge.text-bg-success {
    background-color: #176b50 !important;
    color: #fff !important;
}

html[data-bs-theme="dark"] .tour-booking-book:disabled {
    color: var(--site-muted);
    background-color: var(--site-surface);
    border-color: var(--site-border);
}
