/* RKN Accountancy · CTA design refinement · 2026-11-16
   Site-wide, context-aware rules. Kept separate from existing brand styles
   to avoid damaging older layouts or CMS-edited sections. */
:root {
  --rkn-cta-royal: #0A3C31;
  --rkn-cta-royal-hover: #155647;
  --rkn-cta-gold: #E7C98A;
  --rkn-cta-gold-hover: #F1D8A2;
}

/* Rounded button language. This intentionally excludes search fields,
   plain hyperlinks, social icons, pagination, and floating WhatsApp. */
body[data-theme="green"] :is(
  a.button, button.button,
  a.sx-button, button.sx-button,
  .header-cta, .hero-cta,
  .enq-submit, .newsletter-submit,
  .rkn-newsletter-submit, .blog-search-button
) {
  border-radius: 999px !important;
  border-color: transparent !important;
  box-shadow: none;
  overflow: hidden;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
body[data-theme="green"] :is(
  a.button, button.button,
  a.sx-button, button.sx-button,
  .header-cta, .hero-cta,
  .enq-submit, .newsletter-submit,
  .rkn-newsletter-submit, .blog-search-button
):focus-visible { outline: 3px solid #C5A052 !important; outline-offset: 3px; }
body[data-theme="green"] :is(
  a.button, button.button,
  a.sx-button, button.sx-button,
  .header-cta, .hero-cta,
  .enq-submit, .newsletter-submit,
  .rkn-newsletter-submit, .blog-search-button
) :is(svg,.icon,.sx-icon,span,strong) { color: inherit; }

/* Global gold CTA: dark-green writing, never white on champagne gold. */
body[data-theme="green"] :is(
  .button-gold, .sx-button-gold, .header-cta,
  .hero-cta, .enq-submit, .blog-search-button
) {
  background: var(--rkn-cta-gold) !important;
  border-color: transparent !important;
  color: var(--rkn-cta-royal) !important;
  -webkit-text-fill-color: var(--rkn-cta-royal) !important;
}
body[data-theme="green"] :is(
  .button-gold, .sx-button-gold, .header-cta,
  .hero-cta, .enq-submit, .blog-search-button
):is(:hover,:focus-visible,:active) {
  background: var(--rkn-cta-gold-hover) !important;
  color: var(--rkn-cta-royal) !important;
  -webkit-text-fill-color: var(--rkn-cta-royal) !important;
}

/* Hero: the SECONDARY phone/action button should be a solid green pill
   with white text instead of a white outlined pill. Only the hero is affected;
   telephone links elsewhere remain plain, as previously requested. */
body[data-theme="green"] .hero :is(a.button-outline, a.button-white, a[href^="tel:"]):not(.underlined-link) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  background: var(--rkn-cta-royal) !important;
  color: #FFF !important;
  -webkit-text-fill-color: #FFF !important;
  box-shadow: none !important;
  text-decoration: none;
}
body[data-theme="green"] .hero :is(a.button-outline, a.button-white, a[href^="tel:"]):not(.underlined-link):is(:hover,:focus-visible) {
  background: var(--rkn-cta-royal-hover) !important;
  color: #FFF !important;
  -webkit-text-fill-color: #FFF !important;
}

/* Light-background feature blocks: green primary CTA with white type.
   Excludes the gold header CTA and dark panel buttons. */
body[data-theme="green"] :is(
  .packages-section .section-button .button.button-dark,
  .planning-card > .button,
  .digital-copy .inline-actions .button:not([href^="tel:"]),
  .featured-card .button,
  .service-experience .sx-service-card .sx-button,
  .service-experience .sx-category-card .sx-button
) {
  background: var(--rkn-cta-royal) !important;
  color: #FFF !important;
  -webkit-text-fill-color: #FFF !important;
  border-color: transparent !important;
}
body[data-theme="green"] :is(
  .packages-section .section-button .button.button-dark,
  .planning-card > .button,
  .digital-copy .inline-actions .button:not([href^="tel:"]),
  .featured-card .button,
  .service-experience .sx-service-card .sx-button,
  .service-experience .sx-category-card .sx-button
):is(:hover,:focus-visible,:active) {
  background: var(--rkn-cta-royal-hover) !important;
  color: #FFF !important;
  -webkit-text-fill-color: #FFF !important;
}

/* Dark-green panels: champagne-gold action remains readable and visible. */
body[data-theme="green"] :is(
  .enquiry-panel .enquiry-form .button,
  .contact-panel .enquiry-form .button,
  .digital-banner-copy .button,
  .mtd-banner .button,
  .simple-cta .button,
  .sx-closing-actions .sx-button-gold
) {
  background: var(--rkn-cta-gold) !important;
  color: var(--rkn-cta-royal) !important;
  -webkit-text-fill-color: var(--rkn-cta-royal) !important;
  border-color: transparent !important;
}
body[data-theme="green"] :is(
  .enquiry-panel .enquiry-form .button,
  .contact-panel .enquiry-form .button,
  .digital-banner-copy .button,
  .mtd-banner .button,
  .simple-cta .button,
  .sx-closing-actions .sx-button-gold
):is(:hover,:focus-visible,:active) {
  background: var(--rkn-cta-gold-hover) !important;
  color: var(--rkn-cta-royal) !important;
  -webkit-text-fill-color: var(--rkn-cta-royal) !important;
}

/* Other genuine dark-green CTAs retain white text. Plain contact links are
   deliberately untouched outside the hero. */
body[data-theme="green"] :is(.sx-button-green,.button-dark):not(.enq-submit) {
  border-color: transparent !important;
}

@media (max-width: 760px) {
  body[data-theme="green"] :is(a.button,button.button,a.sx-button,button.sx-button) {
    min-height: 44px;
    max-width: 100%;
  }
  body[data-theme="green"] .hero :is(a.button-outline,a.button-white,a[href^="tel:"]) {
    max-width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="green"] :is(a.button,button.button,a.sx-button,button.sx-button) { transition: none; }
}

/* The legacy homepage gold-contrast rule has unusually high specificity.
   Explicitly override it when the CTA is placed on the light packages panel. */
body[data-theme="green"] .packages-section .section-button a.button.button-dark:not([aria-disabled="true"]),
body[data-theme="green"] .packages-section .section-button a.button.button-dark:not([aria-disabled="true"]):is(:hover,:focus-visible,:active) {
  background: var(--rkn-cta-royal) !important;
  color: #FFF !important;
  -webkit-text-fill-color: #FFF !important;
  border-color: transparent !important;
}
body[data-theme="green"] .packages-section .section-button a.button.button-dark:not([aria-disabled="true"]):is(:hover,:focus-visible,:active) {
  background: var(--rkn-cta-royal-hover) !important;
}


/* 2026-11-16 · The digital-accounting phone CTA is a `.phone-link` (not
   `.button`), so earlier global button rounding rules did not reach it.
   Match the adjacent enquiry CTA. Leave footer/contact plain text links alone. */
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.phone-link,
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.rkn-call-button[href^="tel:"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 48px !important;
  padding: 12px 22px !important;
  border: 1px solid transparent !important;
  border-radius: 9999px !important;
  background-color: #0A3C31 !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease !important;
}
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.phone-link:is(:hover,:active,:focus-visible),
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.rkn-call-button[href^="tel:"]:is(:hover,:active,:focus-visible) {
  background-color: #155647 !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.phone-link svg,
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.rkn-call-button[href^="tel:"] svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: currentColor !important;
  stroke: currentColor !important;
}
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.phone-link:focus-visible,
body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.rkn-call-button[href^="tel:"]:focus-visible {
  outline: 3px solid #E7C98A !important;
  outline-offset: 3px;
}
@media (max-width: 480px) {
  body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.phone-link,
  body[data-theme="green"] .digital-section .digital-copy .inline-actions > a.rkn-call-button[href^="tel:"] {
    max-width: 100%;
    min-height: 44px !important;
    padding: 11px 18px !important;
  }
}


/* RKN INNER-PAGE CTA PALETTE — 2026-11-16: design rule, not button-by-button overrides. */
/* The original .sx-button-gold style was used on both dark and light surfaces.
   On inner-page light heroes and other light panels, the appropriate primary
   action is royal green with accessible white type. Dark closing panels remain
   gold with deep-green type, as the existing context rules already specify. */
body[data-theme="green"].inner-page :is(
  .sx-hero, .sx-sector-hero, .ab-hero, .wr-hero,
  .sx-section:not(.sx-cta-section), .rv-show-more-row,
  .page-section, .sp-faq-hero
) :is(a.sx-button.sx-button-gold, button.sx-button.sx-button-gold, a.button.button-gold, a.button.button-outline),
body[data-theme="green"].inner-page :is(
  .sx-hero, .sx-sector-hero, .ab-hero, .wr-hero,
  .sx-section:not(.sx-cta-section), .rv-show-more-row,
  .page-section, .sp-faq-hero
) :is(a.sx-button.sx-button-gold, button.sx-button.sx-button-gold, a.button.button-gold, a.button.button-outline):is(:hover,:focus-visible,:active) {
  background: #0A3C31 !important;
  background-image: none !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border: 1px solid transparent !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
}
/* Keep a clear but restrained hover state and visible focus indicator. */
body[data-theme="green"].inner-page :is(
  .sx-hero, .sx-sector-hero, .ab-hero, .wr-hero,
  .sx-section:not(.sx-cta-section), .rv-show-more-row,
  .page-section, .sp-faq-hero
) :is(a.sx-button.sx-button-gold, button.sx-button.sx-button-gold, a.button.button-gold, a.button.button-outline):is(:hover,:active) {
  background: #155647 !important;
}
body[data-theme="green"].inner-page :is(
  .sx-hero, .sx-sector-hero, .ab-hero, .wr-hero,
  .sx-section:not(.sx-cta-section), .rv-show-more-row,
  .page-section, .sp-faq-hero
) :is(a.sx-button.sx-button-gold, button.sx-button.sx-button-gold, a.button.button-gold, a.button.button-outline) :is(svg,.icon,.sx-icon,span,strong) {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  stroke: currentColor;
}
/* Buttons in other explicitly light inner-page blocks follow the same system.
   The dark closing panels (.sx-cta-section, .sx-sector-closing, etc.) are excluded. */
body[data-theme="green"].inner-page :is(.sx-hero,.sx-sector-hero,.ab-hero,.wr-hero) :is(a.sx-button,a.button) {
  border-radius: 9999px !important;
}
@media (max-width:760px) {
  body[data-theme="green"].inner-page :is(.sx-hero,.sx-sector-hero,.ab-hero,.wr-hero) :is(a.sx-button,a.button) {
    min-height:44px;max-width:100%;
  }
}

/* A secondary phone action beside a light inner-page hero CTA should not be a
   white rectangular button. Footer and normal telephone links are excluded. */
body[data-theme="green"].inner-page .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"],
body[data-theme="green"].inner-page .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"]:is(:focus-visible,:hover,:active) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 9px;
  padding: 11px 20px;
  background: #0A3C31 !important;
  border: 1px solid transparent !important;
  border-radius: 9999px !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  box-shadow: none !important;
  text-decoration: none;
}
body[data-theme="green"].inner-page .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"]:is(:hover,:active) { background: #155647 !important; }
body[data-theme="green"].inner-page .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"] :is(svg,.icon,.sx-icon) {
  color: inherit !important;
  stroke: currentColor !important;
}

/* RKN phone CTA radius — shared across public pages, 2026-11-16. */
/* PublicControls marks standalone tel links as rkn-call-button. Cover the
   original page-specific phone classes too, including cached CMS markup.
   Only round corners: preserve colours, padding, size and normal text links. */
html body[data-theme="green"] a:is(
  .rkn-call-button,
  .ab-cta-phone,
  .sp-cta-phone,
  .sx-hero-phone,
  .sx-sector-phone,
  .wr-cta-phone,
  .rs-phone,
  .enq-phone,
  .phone-button
)[href^="tel:"] {
  border-radius: 9999px !important;
  -webkit-border-radius: 9999px !important;
}


/* 2026-11-16 · Service detail hero: phone action beside the enquiry CTA.
   Same visual height and comfortable icon/number spacing; no impact on
   footer phone links, closing sections, global buttons or page layout. */
html body[data-theme="green"] main .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"],
html body[data-theme="green"] main .sx-hero .sx-actions > a.sx-hero-phone.rkn-call-button[href^="tel:"] {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 48px !important;
  min-width: 174px !important;
  width: auto !important;
  padding: 12px 20px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  line-height: 1.2 !important;
}
html body[data-theme="green"] main .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"] svg {
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
}
@media (max-width: 480px) {
  html body[data-theme="green"] main .sx-hero .sx-actions > a.sx-hero-phone[href^="tel:"] {
    min-width: 0 !important;
    min-height: 46px !important;
    padding: 11px 18px !important;
    max-width: 100% !important;
  }
}


/* Homepage confidence strip: slightly lighter green than the main header.
   This changes the strip background only; no header, layout or CTA changes. */
body[data-theme="green"] .confidence-bar {
  background-color: #175647 !important;
}

/* Desktop accessibility: improve white image-caption legibility on the two
   homepage accounting-photo cards only. No layout or CTA changes. */
@media (min-width: 761px) {
  body.home-page .digital-banner-photo::after {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, .48) 46%,
      rgba(0, 0, 0, .90) 100%
    );
  }
}
