/* Bothends Farms V31 — global automatic text contrast layer.
   Loaded LAST so every page remains readable in both light and dark modes. */
:root,
html[data-bf-theme="light"]{
  --bf-page-text:#102d1f;
  --bf-muted-text:#284c3a;
  --bf-heading:#082719;
  --bf-surface:rgba(255,255,255,.88);
  --bf-surface-strong:rgba(255,255,255,.96);
  --bf-border:rgba(12,72,42,.20);
  --bf-link:#0b5b32;
  --bf-control-bg:#ffffff;
  --bf-control-text:#102d1f;
}
html[data-bf-theme="dark"]{
  --bf-page-text:#f4fff7;
  --bf-muted-text:#d9eee1;
  --bf-heading:#ffffff;
  --bf-surface:rgba(7,31,20,.88);
  --bf-surface-strong:rgba(7,31,20,.96);
  --bf-border:rgba(238,195,70,.26);
  --bf-link:#f4ce69;
  --bf-control-bg:#f8fff9;
  --bf-control-text:#102d1f;
}

/* Ordinary page copy */
body, main, section, article,
.page-wrapper, .container, .container-fluid{
  color:var(--bf-page-text);
}
body p, body li, body dd, body dt, body label, body small,
body blockquote, body figcaption, body address,
body .text, body .content, body .description,
body [class*="__text"], body [class*="__desc"], body [class*="__content"]{
  color:var(--bf-page-text)!important;
  opacity:1!important;
  visibility:visible!important;
}
body h1,body h2,body h3,body h4,body h5,body h6,
body [class*="__title"],body [class*="__heading"]{
  color:var(--bf-heading)!important;
  opacity:1!important;
  visibility:visible!important;
}
body a:not(.thm-btn):not([class*="btn"]){color:var(--bf-link)}

/* Glass/card areas get a dependable contrast surface without changing layout. */
html[data-bf-theme="light"] :is(.package-card,.service-card,.project-card,.contact-one__form,.contact-three__form,.contact-info,.team-card,.testimonial-card,.blog-card,.why-choose-one__content,.about-one__content),
html[data-bf-theme="dark"] :is(.package-card,.service-card,.project-card,.contact-one__form,.contact-three__form,.contact-info,.team-card,.testimonial-card,.blog-card,.why-choose-one__content,.about-one__content){
  border-color:var(--bf-border)!important;
}

/* Forms: labels/placeholders/selected values always legible. */
body input,body textarea,body select{
  color:var(--bf-control-text)!important;
  caret-color:var(--bf-control-text)!important;
  opacity:1!important;
}
body input::placeholder,body textarea::placeholder{
  color:#496457!important;
  opacity:1!important;
}
body select option{background:#fff!important;color:#102d1f!important}
body label{font-weight:600}

/* Buttons: never allow white-on-white or dark-on-dark text. */
body :is(.thm-btn,button,[type="submit"],[type="button"],[class*="btn"]){
  opacity:1!important;
  visibility:visible!important;
  text-shadow:0 1px 2px rgba(0,0,0,.32)!important;
}
body :is(.thm-btn,button,[type="submit"],[type="button"],[class*="btn"]),
body :is(.thm-btn,button,[type="submit"],[type="button"],[class*="btn"]):hover,
body :is(.thm-btn,button,[type="submit"],[type="button"],[class*="btn"]):focus{
  color:#fff!important;
}

/* Navigation, sliders, page headers and footer sit on imagery/dark branding: keep copy bright in BOTH themes. */
:is(.main-header,.main-menu,.main-menu__wrapper,.mobile-nav__content,.mobile-nav__container,
.main-slider,.main-slider__content,.page-header,.page-header__inner,.page-header__content,
.site-footer,.main-footer,.footer-widget) :is(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,small),
:is(.main-slider,.page-header) [class*="__title"],
:is(.main-slider,.page-header) [class*="__text"]{
  color:#fff!important;
  opacity:1!important;
  visibility:visible!important;
  text-shadow:0 2px 7px rgba(0,0,0,.82)!important;
}
.main-menu a,.mobile-nav__content a{font-weight:700!important}

/* Explicitly prevent animation libraries from leaving text transparent/hidden. */
body .wow,body [data-aos],body .animated{
  visibility:visible!important;
}
body :is(h1,h2,h3,h4,h5,h6,p,a,li,label,span,strong,small,blockquote){
  -webkit-text-fill-color:currentColor;
}

/* Dark mode: content text becomes light; light mode: content text becomes dark. */
html[data-bf-theme="dark"] body :is(.package-card,.service-card,.project-card,.contact-one,.contact-three,.about-one,.about-two,.why-choose-one,.pricing-one,.team-one,.testimonial-one,.blog-one,.service-details,.project-details) :is(p,li,label,span:not(.icon),strong,small){
  color:var(--bf-page-text)!important;
}
html[data-bf-theme="light"] body :is(.package-card,.service-card,.project-card,.contact-one,.contact-three,.about-one,.about-two,.why-choose-one,.pricing-one,.team-one,.testimonial-one,.blog-one,.service-details,.project-details) :is(p,li,label,span:not(.icon),strong,small){
  color:var(--bf-page-text)!important;
}

@media (max-width:1199px){
  .mobile-nav__content,.mobile-nav__container{color:#fff!important}
  .mobile-nav__content :is(a,p,span,li,strong){color:#fff!important;-webkit-text-fill-color:#fff!important;opacity:1!important}
}

/* ============================================================
   V32: DARK-FIRST PAINT + SEARCH POPUP REMOVAL
   Prevents white/light flash during initial page rendering.
   ============================================================ */
html, html[data-bf-theme="dark"] {
  color-scheme: dark;
  background: #061a10 !important;
}
html body,
html[data-bf-theme="dark"] body,
.page-wrapper {
  background-color: #061a10 !important;
}
/* Legacy template search is intentionally disabled site-wide. */
.search-popup,
.search-popup.active,
.search-popup__overlay,
.search-popup__content,
.search-toggler,
a.search-toggler,
button.search-toggler,
.main-header__search,
.main-header__search-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
