/*
 * Catalani Dark Mode — black, white & gold (v2, built against the live ListingHive markup)
 * Every rule starts with html[data-cata-theme="dark"], so light mode is untouched.
 * Colors only: no position / margin / flex / display changes to the header or navbar,
 * nothing inside the min-width:992px block. guard.js catches anything not listed here.
 */
html[data-cata-theme="dark"]{--cd-bg:#0a0a08;--cd-s1:#121210;--cd-s2:#1a1915;--cd-s3:#23221d;--cd-line:rgba(201,165,90,.2);--cd-soft:rgba(255,255,255,.08);--cd-text:#f2ede4;--cd-text2:rgba(242,237,228,.78);--cd-text3:rgba(242,237,228,.55);--cd-gold:#c9a55a;--cd-gold2:#e3c98d;color-scheme:dark;background:var(--cd-bg)}
html.cata-dm-animating,html.cata-dm-animating *{transition:background-color .35s ease,color .35s ease,border-color .35s ease!important}

/* Base */
html[data-cata-theme="dark"] body{background:var(--cd-bg)!important;color:var(--cd-text2)}
:where(html[data-cata-theme="dark"]) :where(h1,h2,h3,h4,h5,h6,.content-title,.widget__title,.hp-page__title,.wp-block-heading){color:#fff}
:where(html[data-cata-theme="dark"]) a{color:var(--cd-gold)}
:where(html[data-cata-theme="dark"]) a:hover{color:var(--cd-gold2)}
:where(html[data-cata-theme="dark"]) :where(strong,b){color:var(--cd-text)}
html[data-cata-theme="dark"] hr,html[data-cata-theme="dark"] .wp-block-separator{border-color:var(--cd-line);background-color:var(--cd-line)}
html[data-cata-theme="dark"] ::selection{background:rgba(201,165,90,.35);color:#fff}
html[data-cata-theme="dark"]{scrollbar-color:#3a372e var(--cd-bg)}

/* Header (colors only) */
html[data-cata-theme="dark"] :is(.site-header,.header-navbar){background-color:var(--cd-bg)!important;border-color:var(--cd-line)}
html[data-cata-theme="dark"] .header-navbar{box-shadow:0 1px 0 var(--cd-line)}
html[data-cata-theme="dark"] .header-navbar :is(.menu>li>a,.hp-menu__item>a){color:var(--cd-text)}
html[data-cata-theme="dark"] .header-navbar :is(.menu>li>a,.hp-menu__item>a):hover,html[data-cata-theme="dark"] .header-navbar .current-menu-item>a{color:var(--cd-gold)}
html[data-cata-theme="dark"] :is(.sub-menu,.hp-menu--user-account,.header-navbar__menu ul ul){background-color:var(--cd-s1)!important;border-color:var(--cd-line)!important}
html[data-cata-theme="dark"] .sub-menu a{color:var(--cd-text2)}
html[data-cata-theme="dark"] .sub-menu a:hover{color:var(--cd-gold)}

/* Theme red → gold */
html[data-cata-theme="dark"] :is(.button-primary,.button--primary,.hp-form__button.button-primary,.hp-menu__item--listing-submit,input[type=submit]){background-color:var(--cd-gold)!important;border-color:var(--cd-gold)!important;color:#0a0a08!important}
html[data-cata-theme="dark"] :is(.button-primary,.button--primary,.hp-menu__item--listing-submit,input[type=submit]):hover{background-color:var(--cd-gold2)!important;border-color:var(--cd-gold2)!important}
html[data-cata-theme="dark"] .hp-listing__featured-badge{background-color:var(--cd-gold)!important;color:#0a0a08!important}
html[data-cata-theme="dark"] .hp-listing--featured{border-color:var(--cd-gold)!important}
html[data-cata-theme="dark"] :is(.slick-arrow,.slick-prev,.slick-next){background-color:var(--cd-gold)!important;color:#0a0a08!important}
html[data-cata-theme="dark"] :is(.fa-map-marker-alt,.fa-location-arrow,.fa-tachometer-alt){color:var(--cd-gold)!important}

/* Search form */
html[data-cata-theme="dark"] .hp-form--primary{background-color:var(--cd-s1)!important;border:1px solid rgba(201,165,90,.35);box-shadow:0 30px 60px rgba(0,0,0,.55)}
html[data-cata-theme="dark"] .hp-form--primary :is(input,select,.select2-selection){background-color:transparent!important;border-color:rgba(255,255,255,.1)!important}

/* Logos: black-on-white artwork flips to white-on-black, keeping its colors */
html[data-cata-theme="dark"] :is(.custom-logo,.site-footer .widget_media_image img){filter:invert(1) hue-rotate(180deg)}
/* "How it works" illustration (red icons on white) → gold icons on black */
html[data-cata-theme="dark"] img.wp-image-10596{filter:invert(1) hue-rotate(180deg) grayscale(1) sepia(1) saturate(1.5) brightness(.95)}

/* Red accents drawn with ::before / ::after (the guard can't reach these) */
html[data-cata-theme="dark"] .widget__title::before{background-color:var(--cd-gold)!important}
html[data-cata-theme="dark"] .hp-menu__item--current::before{background-color:var(--cd-gold)!important}
html[data-cata-theme="dark"] #to_top_scrollup::before{color:var(--cd-gold)!important}
html[data-cata-theme="dark"] .hp-listing--featured{box-shadow:0 0 8px rgba(201,165,90,.35),0 0 16px rgba(201,165,90,.18)!important}

/* Listing / vendor / request cards */
html[data-cata-theme="dark"] :is(.hp-listing--view-block,.hp-vendor--view-block,.hp-request--view-block,.hp-listing-category--view-block){background-color:var(--cd-s1)!important;border-color:var(--cd-line)!important;box-shadow:none}
html[data-cata-theme="dark"] :is(.hp-listing--view-block,.hp-vendor--view-block):hover{border-color:rgba(201,165,90,.45)!important}
html[data-cata-theme="dark"] :is(.hp-listing__title,.hp-vendor__name,.hp-request__title) a{color:#fff}
html[data-cata-theme="dark"] :is(.hp-listing__title,.hp-vendor__name,.hp-request__title) a:hover{color:var(--cd-gold)}
html[data-cata-theme="dark"] :is(.hp-listing__location,.hp-listing__created-date,.hp-listing__details,.hp-listing__categories a,.hp-vendor__registered-date,.hp-rating__count){color:var(--cd-text3)}
html[data-cata-theme="dark"] :is(.hp-listing__footer,.hp-vendor__footer,.hp-listing__header){border-color:var(--cd-soft)!important}
html[data-cata-theme="dark"] .hp-listing__attribute{background-color:var(--cd-s2)!important;border-color:var(--cd-soft)!important;color:var(--cd-text2)}
html[data-cata-theme="dark"] .hp-listing__attribute--price,html[data-cata-theme="dark"] .hp-listing__attribute--price *{color:var(--cd-gold2)!important}
html[data-cata-theme="dark"] :is(.hp-rating-stars,.hp-rating__value){color:var(--cd-gold)}
html[data-cata-theme="dark"] :is(.ccs__label,.cas__label){color:var(--cd-text2)}

/* Forms */
html[data-cata-theme="dark"] :is(input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){background-color:var(--cd-s2)!important;border-color:rgba(255,255,255,.14)!important;color:var(--cd-text)!important;-webkit-text-fill-color:var(--cd-text)!important}
html[data-cata-theme="dark"] :is(input,textarea)::placeholder{-webkit-text-fill-color:var(--cd-text3)!important;color:var(--cd-text3)!important}
html[data-cata-theme="dark"] :is(input,select,textarea):focus{border-color:var(--cd-gold)!important;outline-color:var(--cd-gold)}
html[data-cata-theme="dark"] ::placeholder{color:var(--cd-text3)!important;opacity:1}
html[data-cata-theme="dark"] :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--cd-gold)}
html[data-cata-theme="dark"] :is(.hp-form__field label,.hp-field__label,.hp-form__label){color:var(--cd-text)}
:where(html[data-cata-theme="dark"]) label{color:var(--cd-text)}
html[data-cata-theme="dark"] :is(.hp-field__description,.hp-form__description){color:var(--cd-text3)}
html[data-cata-theme="dark"] :is(.button:not(.button-primary):not(.button--primary):not(.hp-menu__item--listing-submit),.hp-button){background-color:var(--cd-s3);border-color:rgba(255,255,255,.14);color:var(--cd-text)}

/* Select2 */
html[data-cata-theme="dark"] .select2-container--default :is(.select2-selection--single,.select2-selection--multiple){background-color:var(--cd-s2)!important;border-color:rgba(255,255,255,.14)!important}
html[data-cata-theme="dark"] .select2-container--default .select2-selection__rendered{color:var(--cd-text)!important}
html[data-cata-theme="dark"] .select2-container--default .select2-selection__placeholder{color:var(--cd-text3)!important}
html[data-cata-theme="dark"] .select2-dropdown{background-color:var(--cd-s1)!important;border-color:var(--cd-line)!important;color:var(--cd-text2)}
html[data-cata-theme="dark"] .select2-search__field{background-color:var(--cd-s2)!important;color:var(--cd-text)!important}
html[data-cata-theme="dark"] .select2-results__option{color:var(--cd-text2)}
html[data-cata-theme="dark"] .select2-container--default .select2-results__option--highlighted{background-color:rgba(201,165,90,.2)!important;color:#fff!important}
html[data-cata-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true]{background-color:var(--cd-s3)!important;color:var(--cd-gold)!important}

/* Flatpickr */
html[data-cata-theme="dark"] .flatpickr-calendar{background:var(--cd-s1)!important;border:1px solid var(--cd-line);box-shadow:0 12px 40px rgba(0,0,0,.6)!important}
html[data-cata-theme="dark"] .flatpickr-calendar:is(.arrowTop)::after{border-bottom-color:var(--cd-s1)}
html[data-cata-theme="dark"] :is(.flatpickr-month,.flatpickr-monthDropdown-months,.cur-year,.flatpickr-weekday,.flatpickr-weekdays){background:var(--cd-s1)!important;color:var(--cd-text)!important;fill:var(--cd-text)!important}
html[data-cata-theme="dark"] :is(.flatpickr-prev-month,.flatpickr-next-month) svg{fill:var(--cd-gold)!important}
html[data-cata-theme="dark"] .flatpickr-day{color:var(--cd-text2)!important}
html[data-cata-theme="dark"] .flatpickr-day:hover{background:var(--cd-s3)!important;border-color:var(--cd-s3)!important}
html[data-cata-theme="dark"] .flatpickr-day.today{border-color:var(--cd-gold)!important}
html[data-cata-theme="dark"] .flatpickr-day:is(.selected,.startRange,.endRange){background:var(--cd-gold)!important;border-color:var(--cd-gold)!important;color:#0a0a08!important}
html[data-cata-theme="dark"] .flatpickr-day.inRange{background:rgba(201,165,90,.2)!important;border-color:transparent!important;box-shadow:-5px 0 0 rgba(201,165,90,.2),5px 0 0 rgba(201,165,90,.2)!important}
html[data-cata-theme="dark"] .flatpickr-day:is(.flatpickr-disabled,.prevMonthDay,.nextMonthDay){color:rgba(242,237,228,.22)!important}

/* Found on the live site (painted before the safety net runs, so nothing flashes white) */
html[data-cata-theme="dark"] .site-loader{background:var(--cd-bg)!important}
html[data-cata-theme="dark"] :is(.hp-form--message-send,.hp-form--listing-filter){background-color:var(--cd-s1)!important;border-color:var(--cd-line)!important}
html[data-cata-theme="dark"] :is(.ccs__item,.ccs,.hp-menu__item-link){border-color:var(--cd-line)!important}
html[data-cata-theme="dark"] :is(.flatpickr-months,.flatpickr-current-month,.flatpickr-innerContainer,.flatpickr-rContainer,.numInputWrapper,.flatpickr-prev-month,.flatpickr-next-month,.numInputWrapper span){background-color:var(--cd-s1)!important}
html[data-cata-theme="dark"] .ui-slider-range{background:var(--cd-gold)!important;border-color:var(--cd-gold)!important}
html[data-cata-theme="dark"] .ui-slider-handle{background:var(--cd-bg)!important;border-color:var(--cd-gold)!important}
html[data-cata-theme="dark"] #globe-lang-btn{background-color:var(--cd-s2)!important;border-color:var(--cd-line)!important}
html[data-cata-theme="dark"] .instant-booking-button{background-color:var(--cd-s2)!important;color:var(--cd-text)!important}
html[data-cata-theme="dark"] .hp-menu__item--request-submit{color:var(--cd-text)!important;-webkit-text-fill-color:var(--cd-text)!important}

/* Modals, notices, tables, pagination */
html[data-cata-theme="dark"] :is(.hp-modal,.fancybox-content){background-color:var(--cd-s1)!important;color:var(--cd-text2)}
html[data-cata-theme="dark"] .fancybox-bg{background:#000}
html[data-cata-theme="dark"] :is(.hp-form__messages,.hp-notice){background-color:var(--cd-s2)!important;border-color:var(--cd-line)!important;color:var(--cd-text)}
html[data-cata-theme="dark"] :is(table th,.hp-table th){background-color:var(--cd-s2);color:#fff}
html[data-cata-theme="dark"] :is(table td,table th){border-color:var(--cd-soft)!important}
html[data-cata-theme="dark"] :is(.pagination,.nav-links) .page-numbers{background-color:var(--cd-s1);border-color:var(--cd-soft);color:var(--cd-text2)}
html[data-cata-theme="dark"] :is(.pagination,.nav-links) .page-numbers.current{background-color:var(--cd-gold);border-color:var(--cd-gold);color:#0a0a08}

/* Block-editor colors */
html[data-cata-theme="dark"] :is(.has-white-background-color,.has-base-background-color,.has-pale-cyan-blue-background-color,.has-very-light-gray-background-color,.has-cyan-bluish-gray-background-color,.has-light-green-cyan-background-color,.has-luminous-vivid-amber-background-color){background-color:var(--cd-s1)!important}
html[data-cata-theme="dark"] .wp-block-button__link.has-pale-cyan-blue-background-color{background-color:transparent!important;border:1px solid var(--cd-gold);color:var(--cd-gold)!important}
html[data-cata-theme="dark"] :is(.has-black-color,.has-contrast-color,.has-very-dark-gray-color,.has-dark-gray-color){color:var(--cd-text)!important}
html[data-cata-theme="dark"] :is(.has-vivid-red-color){color:var(--cd-gold)!important}
html[data-cata-theme="dark"] .wp-block-pullquote,html[data-cata-theme="dark"] blockquote{border-color:var(--cd-gold)!important}

/* Footer */
html[data-cata-theme="dark"] :is(.site-footer,.footer-widgets,.footer-navbar){background-color:#050504!important;border-color:var(--cd-line)!important;color:var(--cd-text3)}
html[data-cata-theme="dark"] .site-footer .widget__title{color:var(--cd-gold)!important}
html[data-cata-theme="dark"] .site-footer a{color:var(--cd-text2)}
html[data-cata-theme="dark"] .site-footer a:hover{color:var(--cd-gold)}

/* Google Translate widget */
html[data-cata-theme="dark"] :is(.goog-te-gadget,.goog-te-combo){background-color:var(--cd-s2)!important;color:var(--cd-text2)!important}

/* ───────────── The switch (both modes) ───────────── */
.cata-dm-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;font:600 12px/1 'Plus Jakarta Sans',system-ui,sans-serif;letter-spacing:.3px;-webkit-tap-highlight-color:transparent}
.cata-dm-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;flex:0 0 auto}
.cata-dm-toggle svg path:only-child{fill:currentColor;stroke:none}
.cata-dm-toggle--float{position:fixed;z-index:99980;border:1px solid rgba(201,165,90,.55);background:#0a0a08;color:#c9a55a;box-shadow:0 6px 20px rgba(0,0,0,.3);padding:0;margin:0}
.cata-dm-toggle--float:hover{color:#e3c98d;border-color:#c9a55a}
html[data-cata-theme="dark"] .cata-dm-toggle--float{background:#f2ede4;color:#0a0a08;border-color:#f2ede4}
.cata-dm-toggle--right,.cata-dm-toggle--left{top:50%;width:40px;height:46px;transform:translateY(-50%)}
.cata-dm-toggle--right{right:0;border-right:0;border-radius:12px 0 0 12px}
.cata-dm-toggle--left{left:0;border-left:0;border-radius:0 12px 12px 0}
:is(.cata-dm-toggle--right,.cata-dm-toggle--left,.cata-dm-toggle--bottom-right) .cata-dm-toggle__label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cata-dm-toggle--bottom-right{right:22px;bottom:96px;width:44px;height:44px;border-radius:50%}
.cata-dm-toggle--preview::after{content:'Preview';position:absolute;top:-10px;right:2px;font:700 8px/1 'Plus Jakarta Sans',system-ui,sans-serif;letter-spacing:.5px;text-transform:uppercase;background:#c9a55a;color:#0a0a08;padding:3px 5px;border-radius:4px}
.cata-dm-toggle--menu,.cata-dm-toggle--inline{color:inherit;background:none;border:0;padding:0}
.cata-dm-toggle--inline{border:1px solid rgba(201,165,90,.55);border-radius:999px;padding:8px 14px;color:#c9a55a}
@media (max-width:640px){.cata-dm-toggle--right,.cata-dm-toggle--left{width:34px;height:40px}.cata-dm-toggle--bottom-right{right:16px;bottom:84px;width:40px;height:40px}}
@media print{.cata-dm-toggle--float{display:none}}
