/**
 * Template D: map CMS admin palette (--primary … --text) to Tiya Golf Club tokens.
 *
 * Admin labels: primary, secondary, heading (dark), background (light), text.
 * Tiya naming: --secondary-color is the dark band (nav/footer/tables), not CMS "secondary".
 */
body.cms-active-template-templateD {
  --accent-color: var(--primary);
  --background-color: var(--light);
  --default-color: var(--text);
  --heading-color: var(--dark);
  --surface-color: color-mix(in srgb, var(--light), var(--dark) 14%);
  --contrast-color: var(--secondary);

  --nav-color: color-mix(in srgb, var(--text), var(--dark) 20%);
  --nav-hover-color: var(--primary);
  --nav-mobile-background-color: var(--dark);
  --nav-dropdown-background-color: color-mix(in srgb, var(--dark), var(--primary) 18%);
  --nav-dropdown-color: color-mix(in srgb, var(--secondary), var(--text) 35%);
  --nav-dropdown-hover-color: var(--primary);
}

body.cms-active-template-templateD .light-background {
  --background-color: color-mix(in srgb, var(--light), var(--dark) 6%);
  --default-color: var(--text);
  --heading-color: var(--dark);
  --surface-color: color-mix(in srgb, var(--light), var(--dark) 12%);
  --contrast-color: var(--secondary);
}

body.cms-active-template-templateD .dark-background {
  --background-color: var(--dark);
  --default-color: color-mix(in srgb, var(--secondary) 75%, var(--text));
  --heading-color: var(--secondary);
  --surface-color: color-mix(in srgb, var(--dark), var(--primary) 16%);
  --contrast-color: var(--secondary);
}

:root {
  --primary-color: var(--primary, #81b29a);
  --secondary-color: var(--dark, #3d405b);
  --section-bg-color: var(--light, #f4f1de);
  --events-section-bg-color: var(--light, #f4f1de);
  --custom-btn-bg-color: var(--primary, #f2cc8f);
  --custom-btn-bg-hover-color: var(--secondary, #e07a5f);
  --dark-color: var(--dark, #3d405b);
  --p-color: var(--text, #717275);
  --link-hover-color: var(--secondary, #f2cc8f);
  --td-accent-color: var(--secondary);
  --white-color: var(--light);
  --td-wave-primary: var(--primary-color);
  --td-wave-dark: var(--secondary-color);
  --td-ink-on-dark: var(--light);
  --td-ink-muted-on-dark: color-mix(in srgb, var(--text) 60%, var(--light));
  /* Navbar text on light/transparent bar */
  --td-nav-link: var(--dark-color);
}

body.cms-active-template-templateD {
  overflow-x: hidden;
  max-width: 100%;
}

body.cms-active-template-templateD,
body.cms-active-template-templateD .cms-template-d {
  color: var(--p-color);
}

body.cms-active-template-templateD h1,
body.cms-active-template-templateD h2,
body.cms-active-template-templateD h3,
body.cms-active-template-templateD h4,
body.cms-active-template-templateD h5,
body.cms-active-template-templateD h6,
body.cms-active-template-templateD .cms-template-d h1,
body.cms-active-template-templateD .cms-template-d h2,
body.cms-active-template-templateD .cms-template-d h3,
body.cms-active-template-templateD .cms-template-d h4,
body.cms-active-template-templateD .cms-template-d h5,
body.cms-active-template-templateD .cms-template-d h6 {
  color: var(--dark-color);
}

body.cms-active-template-templateD p,
body.cms-active-template-templateD .cms-template-d p {
  color: var(--p-color);
}

body.cms-active-template-templateD a:not(.nav-link):not(.btn):not(.custom-btn):not(.dropdown-item),
body.cms-active-template-templateD .cms-template-d a:not(.nav-link):not(.btn):not(.custom-btn):not(.dropdown-item) {
  color: var(--secondary);
}

body.cms-active-template-templateD a:not(.nav-link):not(.btn):not(.custom-btn):not(.dropdown-item):hover,
body.cms-active-template-templateD .cms-template-d a:not(.nav-link):not(.btn):not(.custom-btn):not(.dropdown-item):hover {
  color: var(--primary);
}

/* Navbar layout (logo position + image logo) */
body.cms-active-template-templateD .template-d-nav .td-nav-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

body.cms-active-template-templateD .template-d-nav .navbar-brand.td-brand--has-image {
  max-width: none;
}

/* Footer logo: prevent shrink + match navbar sizes */
body.cms-active-template-templateD .template-d-footer .navbar-brand,
body.cms-active-template-templateD .template-d-footer .navbar-brand:hover {
  max-width: none;
}

body.cms-active-template-templateD .template-d-footer .navbar-brand-image.td-logo-small {
  width: auto;
  height: 40px;
  max-height: 40px;
}

body.cms-active-template-templateD .template-d-footer .navbar-brand-image.td-logo-medium {
  width: auto;
  height: 56px;
  max-height: 56px;
}

body.cms-active-template-templateD .template-d-footer .navbar-brand-image.td-logo-large {
  width: auto;
  height: 72px;
  max-height: 72px;
}

body.cms-active-template-templateD .template-d-footer .navbar-brand-image {
  filter: none;
  object-fit: contain;
}

body.cms-active-template-templateD .template-d-nav .navbar-brand-image.td-logo-small {
  width: auto;
  height: 40px;
  max-height: 40px;
}

body.cms-active-template-templateD .template-d-nav .navbar-brand-image.td-logo-medium {
  width: auto;
  height: 56px;
  max-height: 56px;
}

body.cms-active-template-templateD .template-d-nav .navbar-brand-image.td-logo-large {
  width: auto;
  height: 72px;
  max-height: 72px;
}

/* Navbar — always CMS dark background (not transparent / light bleed-through) */
body.cms-active-template-templateD .template-d-nav .navbar,
body.cms-active-template-templateD .sticky-wrapper.is-sticky .navbar {
  background-color: var(--dark) !important;
}

body.cms-active-template-templateD .template-d-nav .navbar .navbar-brand-image {
  filter: none;
  object-fit: contain;
}

body.cms-active-template-templateD .template-d-nav .navbar .navbar-brand,
body.cms-active-template-templateD .template-d-nav .navbar .navbar-brand:hover,
body.cms-active-template-templateD .template-d-nav .navbar .navbar-brand-text,
body.cms-active-template-templateD .template-d-nav .navbar .navbar-brand-text small,
body.cms-active-template-templateD .template-d-nav .navbar-nav .nav-link {
  color: var(--light) !important;
}

body.cms-active-template-templateD .template-d-nav .navbar-nav .nav-link.active,
body.cms-active-template-templateD .template-d-nav .navbar-nav .nav-link:hover {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .template-d-nav .navbar-toggler .navbar-toggler-icon,
body.cms-active-template-templateD .template-d-nav .navbar-toggler .navbar-toggler-icon::before,
body.cms-active-template-templateD .template-d-nav .navbar-toggler .navbar-toggler-icon::after {
  background: var(--light) !important;
}

/* Keep all three bars inside the button hit area (theme CSS draws ::before/::after outside a 2px span) */
@media (max-width: 991.98px) {
  body.cms-active-template-templateD .template-d-nav .navbar-toggler {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 2.75rem;
    height: auto !important;
    min-height: 2.75rem;
    padding: 0.5rem !important;
    position: relative;
    z-index: 10001;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-toggler .navbar-toggler-icon {
    pointer-events: none;
    margin: 0;
  }
}

body.cms-active-template-templateD .template-d-nav .custom-border-btn {
  border-color: var(--light);
  color: var(--light);
}

body.cms-active-template-templateD .template-d-nav .custom-border-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--light);
}

@media (max-width: 991.98px) {
  body.cms-active-template-templateD .template-d-nav .navbar-collapse {
    background-color: var(--dark);
    border-radius: var(--border-radius-medium, 20px);
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem 1rem;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-expand-lg .navbar-collapse:not(.show) {
    display: none !important;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-expand-lg .navbar-collapse.show {
    display: block !important;
  }

  body.cms-active-template-templateD.td-mobile-nav-open {
    overflow: hidden;
  }

  /* Mobile: hide decorative arrow; toggle submenu with .show (not always open) */
  body.cms-active-template-templateD .template-d-nav .navbar .dropdown-menu::before {
    display: none !important;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-nav .dropdown-menu {
    position: static !important;
    left: 0 !important;
    display: none !important;
    opacity: 0;
    pointer-events: none;
    max-width: 100% !important;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    box-shadow: none;
    background-color: color-mix(in srgb, var(--light) 92%, transparent) !important;
    border-radius: var(--border-radius-small, 12px);
  }

  body.cms-active-template-templateD .template-d-nav .navbar-nav .dropdown-menu.show {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-nav .dropdown-menu .dropdown-item {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.cms-active-template-templateD .template-d-nav .navbar .dropdown-toggle.show::after {
    transform: rotate(180deg);
  }
}

body.cms-active-template-templateD .navbar .dropdown-menu,
body.cms-active-template-templateD .navbar .dropdown-menu.dropdown-menu-light {
  background-color: var(--section-bg-color) !important;
}

body.cms-active-template-templateD .navbar .dropdown-menu::before {
  border-bottom-color: var(--section-bg-color) !important;
}

/* Make dropdown items readable against section background */
body.cms-active-template-templateD .navbar .dropdown-menu .dropdown-item {
  color: var(--dark-color);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
  text-align: left;
  max-width: min(22rem, calc(100vw - 2rem));
}

body.cms-active-template-templateD .navbar .dropdown-menu {
  max-width: min(22rem, calc(100vw - 2rem));
}

body.cms-active-template-templateD .navbar .dropdown-menu .dropdown-item:hover,
body.cms-active-template-templateD .navbar .dropdown-menu .dropdown-item:focus,
body.cms-active-template-templateD .navbar .dropdown-menu .dropdown-item.active {
  color: var(--secondary);
}

body.cms-active-template-templateD .offcanvas {
  background-color: var(--primary-color);
  color: var(--td-ink-on-dark);
}

body.cms-active-template-templateD .offcanvas .offcanvas-title,
body.cms-active-template-templateD .offcanvas .form-label,
body.cms-active-template-templateD .offcanvas .form-check-label,
body.cms-active-template-templateD .offcanvas .member-login-form a,
body.cms-active-template-templateD .offcanvas .contact-link,
body.cms-active-template-templateD .offcanvas .td-ink-on-dark {
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .offcanvas .form-control {
  color: var(--text);
  background-color: var(--light);
  border-color: color-mix(in srgb, var(--dark-color) 15%, transparent);
}

body.cms-active-template-templateD .offcanvas .form-control::placeholder {
  color: color-mix(in srgb, var(--text) 55%, transparent);
}

body.cms-active-template-templateD .offcanvas .btn-close {
  filter: none;
  opacity: 0.85;
}

body.cms-active-template-templateD .offcanvas .custom-btn {
  background: var(--custom-btn-bg-color);
  color: var(--td-ink-on-dark);
}

body.cms-active-template-templateD .offcanvas .custom-btn:hover {
  background: var(--custom-btn-bg-hover-color);
  color: var(--td-ink-on-dark);
}

body.cms-active-template-templateD .offcanvas .custom-border-btn {
  border-color: var(--td-ink-on-dark);
  color: var(--td-ink-on-dark);
}

body.cms-active-template-templateD .offcanvas .custom-border-btn:hover {
  background: var(--custom-btn-bg-color);
  color: var(--td-ink-on-dark);
}

/* Footer */
body.cms-active-template-templateD .site-footer {
  color: var(--p-color);
}

body.cms-active-template-templateD .site-footer-title {
  color: var(--td-nav-link);
}

body.cms-active-template-templateD .site-footer a {
  color: var(--secondary);
}

body.cms-active-template-templateD .site-footer a:hover {
  color: var(--primary);
}

body.cms-active-template-templateD .template-d-footer .copyright-text,
body.cms-active-template-templateD .template-d-footer .navbar-brand-text,
body.cms-active-template-templateD .template-d-footer .navbar-brand-text small {
  color: var(--p-color);
}

body.cms-active-template-templateD .template-d-footer .site-footer-title {
  color: var(--dark-color);
}

/* Footer social + quick links spacing */
body.cms-active-template-templateD .template-d-footer .td-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem !important;
}

body.cms-active-template-templateD .template-d-footer .td-footer-social .social-icon-item {
  display: block;
  margin: 0;
}

body.cms-active-template-templateD .template-d-footer .td-footer-social .social-icon-link {
  margin-right: 0;
}

body.cms-active-template-templateD .template-d-footer .td-footer-links-wrap {
  max-height: 10.5rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

body.cms-active-template-templateD .template-d-footer .td-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body.cms-active-template-templateD .template-d-footer .td-footer-links li {
  margin: 0;
}

body.cms-active-template-templateD .template-d-footer .td-footer-links .contact-link {
  display: inline-block;
  font-size: 0.9rem;
  line-height: 1.35;
}

body.cms-active-template-templateD .template-d-footer .td-footer-hours-time {
  white-space: nowrap;
}

/* Bootstrap utilities — use CMS primary (not CDN default blue) */
body.cms-active-template-templateD .text-primary,
body.cms-active-template-templateD .cms-template-d .text-primary,
body.cms-active-template-templateD .cms-template-d .td-text-primary {
  color: var(--primary-color) !important;
}

body.cms-active-template-templateD .cms-template-d .td-text-secondary {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .btn-primary,
body.cms-active-template-templateD .back-to-top.btn-primary {
  --bs-btn-bg: var(--primary-color);
  --bs-btn-border-color: var(--primary-color);
  --bs-btn-hover-bg: var(--custom-btn-bg-hover-color);
  --bs-btn-hover-border-color: var(--custom-btn-bg-hover-color);
  --bs-btn-active-bg: var(--custom-btn-bg-hover-color);
  --bs-btn-active-border-color: var(--custom-btn-bg-hover-color);
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: var(--white-color, #fff) !important;
}

body.cms-active-template-templateD .btn-primary:hover,
body.cms-active-template-templateD .btn-primary:focus,
body.cms-active-template-templateD .back-to-top.btn-primary:hover,
body.cms-active-template-templateD .back-to-top.btn-primary:focus,
body.cms-active-template-templateD .cms-template-d .custom-btn:hover,
body.cms-active-template-templateD .custom-btn:hover {
  background-color: var(--secondary) !important;
  border-color: var(--secondary) !important;
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .cms-template-d .nav-pills .nav-link {
  color: var(--dark-color);
}

body.cms-active-template-templateD .cms-template-d .nav-pills .nav-link:hover {
  color: var(--secondary);
}

body.cms-active-template-templateD .cms-template-d .nav-pills .nav-link.active,
body.cms-active-template-templateD .cms-template-d .nav-pills .show > .nav-link {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: var(--white-color, #fff) !important;
}

/* Section eyebrow (CMS Subtitle) + main title */
.cms-template-d .td-section-heading {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.cms-template-d .td-section-eyebrow {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background-color: var(--primary);
  line-height: 1.45;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.cms-template-d .td-section-eyebrow--light {
  color: var(--text);
  background-color: var(--primary);
}

.cms-template-d .td-section-desc {
  color: var(--p-color);
}

.cms-template-d .td-section-heading h2 {
  color: var(--dark-color);
}

/* Blog / events — labels & titles use CMS secondary accent */
body.cms-active-template-templateD .cms-template-d .custom-block-span {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .cms-template-d a.events-title,
body.cms-active-template-templateD .cms-template-d .events-title {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .cms-template-d a.events-title:hover,
body.cms-active-template-templateD .cms-template-d .events-title:hover {
  color: var(--primary) !important;
}

/* Hero — home: clean white copy, pill CTA, rounded video (Tiya reference) */
body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home {
  height: 100vh;
  min-height: 670px;
  margin-bottom: -90px;
  padding-top: clamp(100px, 12vh, 140px);
  padding-bottom: clamp(80px, 10vh, 120px);
}

@media (max-width: 767.98px) {
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home.td-hero-has-bg {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0.75rem !important;
  }
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home h2.td-hero-text,
body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-subheading {
  color: var(--light) !important;
  -webkit-text-fill-color: var(--light);
  -webkit-text-stroke: 0 !important;
  paint-order: unset;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home h1.td-hero-text,
body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home p.td-hero-text,
body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-heading {
  color: var(--light) !important;
  -webkit-text-fill-color: var(--light);
  -webkit-text-stroke: 0 !important;
  paint-order: unset;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 1.5rem !important;
  padding-bottom: 0 !important;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .custom-btn {
  background: var(--custom-btn-bg-color);
  color: var(--light) !important;
  border-radius: var(--border-radius-large, 100px);
  padding: 12px 28px;
  font-weight: 700;
  border: 2px solid transparent;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .custom-btn:hover {
  background: var(--custom-btn-bg-hover-color);
  color: var(--light) !important;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .link {
  color: var(--light) !important;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .link:hover {
  color: var(--custom-btn-bg-color) !important;
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-video {
  border-radius: var(--border-radius-medium, 20px);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-video iframe {
  border: 0;
  border-radius: var(--border-radius-medium, 20px);
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-container {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Hero: keep copy above waves/background (inner pages especially) */
.cms-template-d .hero-section .section-overlay {
  z-index: 1;
}

.cms-template-d .hero-section .td-wave-top,
.cms-template-d .hero-section .td-wave-bottom {
  z-index: 2;
  pointer-events: none;
}

.cms-template-d .hero-section .td-hero-container {
  position: relative;
  z-index: 3;
}

/* Hero — inner pages: floating card over light wave + background image */
.cms-template-d .page-title-band + .td-dynamic-section .hero-section.hero-inner-page {
  margin-top: 0;
}

.cms-template-d .hero-section.hero-inner-page .td-wave-inner {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  display: block;
  width: 100%;
  height: auto;
}

.cms-template-d .hero-section.hero-inner-page .td-wave-bottom {
  transform: none;
}

.cms-template-d .hero-section.hero-inner-page,
body.cms-active-template-templateD .cms-template-d .hero-section.hero-50 {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: clamp(380px, 46vh, 500px);
  margin-top: 0;
  margin-bottom: -56px;
  padding-top: clamp(5rem, 10vw, 7rem);
  padding-bottom: clamp(3.5rem, 8vw, 5rem);
  align-items: flex-end;
}

body.cms-active-template-templateD .cms-template-d .hero-section.hero-inner-page .section-overlay {
  background: var(--cms-image-overlay) !important;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-inner-row {
  justify-content: flex-start;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-content-panel {
  position: relative;
  z-index: 4;
  max-width: 34rem;
  margin-top: clamp(-3.5rem, -6vw, -2rem);
  padding: clamp(1.5rem, 3vw, 2rem) clamp(1.35rem, 3vw, 2rem) clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: var(--border-radius-medium, 20px);
  background: color-mix(in srgb, var(--secondary-color) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--light) 12%, transparent);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--dark-color) 36%, transparent);
}

.cms-template-d .hero-section.hero-inner-page .td-hero-subheading,
.cms-template-d .hero-section.hero-inner-page h2.td-hero-text {
  -webkit-text-stroke: 0 !important;
  color: var(--light) !important;
  -webkit-text-fill-color: var(--light) !important;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 400;
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-heading,
.cms-template-d .hero-section.hero-inner-page h1.td-hero-text,
.cms-template-d .hero-section.hero-inner-page p.td-hero-text {
  -webkit-text-stroke: 0 !important;
  color: var(--light) !important;
  -webkit-text-fill-color: var(--light) !important;
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.25rem !important;
  padding-bottom: 0 !important;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.25rem;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-cta-group .custom-btn {
  background: var(--primary-color);
  color: var(--light) !important;
  border-radius: var(--border-radius-large, 100px);
  padding: 10px 24px;
  font-weight: 700;
  border: 2px solid transparent;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-cta-group .custom-btn:hover {
  background: var(--custom-btn-bg-hover-color);
  color: var(--light) !important;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-cta-group .link {
  color: var(--light) !important;
  font-weight: 600;
  text-decoration: none;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-cta-group .link:hover {
  color: var(--custom-btn-bg-color) !important;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-inner-carousel {
  justify-content: flex-start;
  gap: 0.65rem;
  margin-top: 1rem !important;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-inner-carousel .btn {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95rem;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-video {
  border-radius: var(--border-radius-medium, 20px);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.cms-template-d .hero-section .td-carousel-nav {
  margin-bottom: 0.25rem;
}

/* Back to top button positioning (Template D doesn't load default style.css) */
body.cms-active-template-templateD .back-to-top {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0 !important;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

@media (max-width: 575.98px) {
  body.cms-active-template-templateD .back-to-top {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
}

/* -----------------------------
   Services, menu, team, testimonials
   (Tiya-style cards: shadow, hover, alignment)
------------------------------*/

/* Shared card lift */
body.cms-active-template-templateD .cms-template-d .td-service-card,
body.cms-active-template-templateD .cms-template-d .td-menu-card,
body.cms-active-template-templateD .cms-template-d .td-team-card,
body.cms-active-template-templateD .cms-template-d .td-testimonial-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  border: 1px solid color-mix(in srgb, var(--dark-color) 8%, transparent);
}

body.cms-active-template-templateD .cms-template-d .td-service-card:hover,
body.cms-active-template-templateD .cms-template-d .td-menu-card:hover,
body.cms-active-template-templateD .cms-template-d .td-team-card:hover,
body.cms-active-template-templateD .cms-template-d .td-testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

/* SERVICES */
body.cms-active-template-templateD .cms-template-d .td-service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

body.cms-active-template-templateD .cms-template-d .td-service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--custom-btn-bg-hover-color));
}

body.cms-active-template-templateD .cms-template-d .td-service-card-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--primary-color) 18%, var(--white-color));
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cms-active-template-templateD .cms-template-d .td-service-card-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

body.cms-active-template-templateD .cms-template-d .td-service-card-icon .bi,
body.cms-active-template-templateD .cms-template-d .td-service-card-icon .fa {
  font-size: 1.75rem;
  color: var(--primary-color);
  line-height: 1;
}

body.cms-active-template-templateD .cms-template-d .td-service-card-title {
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

body.cms-active-template-templateD .cms-template-d .td-service-desc {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

body.cms-active-template-templateD .cms-template-d .td-service-card .custom-btn,
body.cms-active-template-templateD .cms-template-d .td-service-card .btn {
  margin-top: auto;
}

/* MENU tabs */
body.cms-active-template-templateD .cms-template-d .td-menu-tabs .nav-link {
  border-radius: var(--border-radius-large, 100px);
  padding: 0.5rem 1.25rem;
  font-weight: var(--font-weight-semibold, 600);
  border: 1px solid color-mix(in srgb, var(--dark-color) 12%, transparent);
  background-color: var(--white-color);
}

body.cms-active-template-templateD .cms-template-d .td-menu-tabs .nav-link.active {
  border-color: var(--secondary);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--secondary) 35%, transparent);
}

body.cms-active-template-templateD .cms-template-d .menu-tab-select {
  border-radius: var(--border-radius-medium, 20px);
  border-color: color-mix(in srgb, var(--dark-color) 15%, transparent);
}

/* MENU cards */
body.cms-active-template-templateD .cms-template-d .td-menu-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-media {
  position: relative;
  aspect-ratio: 840 / 280;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--border-radius-medium) var(--border-radius-medium) 0 0;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-media--placeholder {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 22%, var(--white-color)), var(--section-bg-color));
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-placeholder {
  font-size: 2.5rem;
  color: var(--secondary);
  opacity: 0.85;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-media .custom-block-image,
body.cms-active-template-templateD .cms-template-d .td-menu-card-media .td-menu-card-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  background-color: transparent !important;
}

body.cms-active-template-templateD .cms-template-d .td-menu-price-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 0.35rem 0.85rem;
  border-radius: var(--border-radius-large, 100px);
  background-color: var(--secondary);
  color: var(--white-color, #fff);
  font-size: 0.875rem;
  font-weight: var(--font-weight-bold, 700);
  line-height: 1.3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-title {
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-desc {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.cms-active-template-templateD .cms-template-d .td-menu-card-body .custom-btn,
body.cms-active-template-templateD .cms-template-d .td-menu-card-body .btn {
  margin-top: auto;
  align-self: flex-start;
}


/* TEAM */
body.cms-active-template-templateD .cms-template-d .td-team-card {
  display: flex;
  flex-direction: column;
  background: var(--white-color);
  border-radius: var(--border-radius-medium, 20px);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

body.cms-active-template-templateD .cms-template-d .td-team-card-media,
body.cms-active-template-templateD .cms-template-d .td-team-photo {
  aspect-ratio: 1 / 1;
  height: auto !important;
  border-radius: 0;
}

body.cms-active-template-templateD .cms-template-d .td-team-card-media .member-block-image,
body.cms-active-template-templateD .cms-template-d .td-team-card-media .td-team-card-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background-color: transparent !important;
}

body.cms-active-template-templateD .cms-template-d .td-team-card-footer {
  padding: 1rem 1.25rem 0.5rem;
  min-height: auto;
}

body.cms-active-template-templateD .cms-template-d .td-team-card-footer h4 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

body.cms-active-template-templateD .cms-template-d .td-team-role {
  color: var(--secondary);
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold, 600);
  letter-spacing: 0.02em;
}

body.cms-active-template-templateD .cms-template-d .td-team-card-desc {
  padding: 0 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9375rem;
  color: var(--p-color);
}

body.cms-active-template-templateD .cms-template-d .td-team-card-btn {
  margin: 0.75rem 1.25rem 1.25rem;
  align-self: flex-start;
}

body.cms-active-template-templateD .cms-template-d .social-icon-link .td-team-social-icon-img {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  object-fit: contain;
  display: block;
}

body.cms-active-template-templateD .cms-template-d .social-icon-link i {
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 575.98px) {
  body.cms-active-template-templateD .cms-template-d .td-team-card-media,
  body.cms-active-template-templateD .cms-template-d .td-team-photo {
    height: auto !important;
  }
}

/* TESTIMONIALS */
body.cms-active-template-templateD .cms-template-d .td-testimonial-card {
  display: flex;
  flex-direction: column;
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-card-body {
  flex: 1;
  border-bottom: 1px solid color-mix(in srgb, var(--dark-color) 8%, transparent);
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-quote {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-message {
  font-size: 1.05rem;
  line-height: 1.65;
  font-style: italic;
  color: var(--p-color);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-card-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: color-mix(in srgb, var(--section-bg-color) 55%, var(--white-color));
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-avatar-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-color), var(--custom-btn-bg-hover-color));
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  background-color: transparent;
  display: block;
  border: 2px solid var(--white-color);
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-name {
  color: var(--dark-color);
  font-size: 1rem;
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-role {
  font-size: 0.875rem;
  color: var(--secondary);
  font-weight: var(--font-weight-semibold, 600);
}

body.cms-active-template-templateD .cms-template-d .td-testimonial-card-footer .btn {
  align-self: flex-start;
  margin-top: 0;
}

/* SVG waves — replace hardcoded fills in Vue */
body.cms-active-template-templateD .td-wave-fill-primary,
body.cms-active-template-templateD .site-footer svg path.td-wave-fill-primary {
  fill: var(--td-wave-primary) !important;
}

body.cms-active-template-templateD .td-wave-fill-dark,
body.cms-active-template-templateD .offcanvas svg path.td-wave-fill-dark,
body.cms-active-template-templateD .cms-template-d .td-wave-fill-dark {
  fill: var(--td-wave-dark) !important;
}

body.cms-active-template-templateD .td-wave-fill-light,
body.cms-active-template-templateD .cms-template-d .td-wave-fill-light {
  fill: var(--section-bg-color) !important;
}

/* Page content — clip (not hidden) so overflow-y stays visible and avoids nested hero scrollbars */
.cms-template-d main {
  overflow-x: clip;
}

.cms-template-d .page-title-band {
  background-color: var(--secondary-color);
  padding: clamp(5.5rem, 10vw, 6.5rem) 0 clamp(2.75rem, 5vw, 3.5rem);
  margin-top: 72px;
  margin-bottom: 0;
}

.cms-template-d .page-title-band h1 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0;
}

.cms-template-d .page-title-band h1,
.cms-template-d .page-title-band .breadcrumb-item,
.cms-template-d .page-title-band .breadcrumb-item a,
.cms-template-d .page-title-band .td-ink-on-dark {
  color: var(--td-ink-on-dark) !important;
}

.cms-template-d .page-title-band .breadcrumb {
  font-size: 0.9rem;
}

.cms-template-d .page-title-band .breadcrumb-item + .breadcrumb-item::before {
  color: var(--td-ink-muted-on-dark) !important;
}

.cms-template-d .section-padding {
  background-color: transparent;
}

.cms-template-d .about-section,
.cms-template-d .events-section {
  background-color: var(--section-bg-color);
}

.cms-template-d .events-detail-info {
  background-color: var(--section-bg-color);
}

.cms-template-d .td-wave-top,
.cms-template-d .td-wave-bottom {
  display: block;
  width: 100%;
  height: auto;
}

.cms-template-d .membership-tier-card {
  background: var(--white-color);
  border-radius: var(--border-radius-medium, 20px);
  padding: 1.5rem;
  height: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.cms-template-d .td-carousel-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.cms-template-d .td-about-feature-item {
  margin-bottom: 1rem;
}

.cms-template-d .td-about-feature-item:last-child {
  margin-bottom: 0;
}

.cms-template-d .td-about-feature-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cms-template-d .td-about-feature-icon-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  display: block;
}

.cms-template-d .td-about-feature-icon .bi,
.cms-template-d .td-about-feature-icon .fa {
  font-size: 1.5rem;
  color: var(--secondary);
  line-height: 1;
}

.cms-template-d .td-about-feature-title {
  color: var(--dark-color);
  font-weight: var(--font-weight-bold, 700);
  font-size: 1.05rem;
}

.cms-template-d .td-about-feature-desc {
  color: var(--p-color);
  font-size: var(--p-font-size, 18px);
  line-height: 1.55;
}

.cms-template-d .td-about-main-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background-color: transparent !important;
  border-radius: 0;
}

.cms-template-d .td-about-main-media {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 400;
  overflow: hidden;
  border-radius: var(--border-radius-medium, 12px);
  background: transparent;
  line-height: 0;
}

.cms-template-d .table-responsive thead tr {
  background-color: var(--secondary-color);
  color: var(--td-ink-on-dark);
}

.cms-template-d .table-responsive thead th {
  color: var(--td-ink-on-dark) !important;
}

.cms-template-d .membership-section .bi-check-circle-fill {
  color: var(--primary-color) !important;
}

.cms-template-d .membership-section .bi-x-circle-fill {
  color: var(--secondary) !important;
}

.cms-template-d .membership-form {
  background-color: var(--secondary-color);
}

.cms-template-d .membership-form .td-ink-on-dark,
.cms-template-d .membership-form .td-ink-muted-on-dark,
.cms-template-d .membership-form h4 {
  color: var(--td-ink-on-dark) !important;
}

.cms-template-d .membership-form .td-ink-muted-on-dark {
  color: var(--td-ink-muted-on-dark) !important;
}

.cms-template-d .contact-info-item {
  background: var(--secondary-color);
  color: var(--td-ink-on-dark);
}

.cms-template-d .contact-info-item,
.cms-template-d .contact-info-item a {
  color: var(--td-ink-on-dark);
}

.cms-template-d .contact-section .container {
  max-width: 100%;
}

.cms-template-d .contact-info {
  max-width: 100%;
}

/* Contact card overlays only the decorative map — not the Google embed below */
.cms-template-d .td-contact-map-stage {
  position: relative;
  margin-bottom: 0;
}

.cms-template-d .td-contact-map-stage .td-contact-map-graphic {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.cms-template-d .contact-info > .contact-info-item.td-contact-info-card--stacked {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
  text-align: center;
}

@media (min-width: 992px) {
  body.cms-active-template-templateD .cms-template-d .contact-info > .contact-info-item {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-contact-map-stage .contact-info-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(88%, 360px);
    max-width: 360px;
    z-index: 2;
    margin: 0;
  }
}

.cms-template-d .contact-info img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.cms-template-d .td-map-embed {
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--border-radius-medium, 20px);
}

.cms-template-d .td-map-embed iframe,
.cms-template-d .contact-info iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-height: 220px;
  border: 0;
}

/* Ink on dark / photo bands (offer, menu form, blog dates) */
body.cms-active-template-templateD .cms-template-d .td-ink-on-dark,
body.cms-active-template-templateD .cms-template-d .text-white {
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .cms-template-d .td-ink-muted-on-dark,
body.cms-active-template-templateD .cms-template-d .text-white-50 {
  color: var(--td-ink-muted-on-dark) !important;
}

body.cms-active-template-templateD .cms-template-d .section-bg-image .td-ink-on-dark,
body.cms-active-template-templateD .cms-template-d .section-bg-image h2,
body.cms-active-template-templateD .cms-template-d .section-bg-image p,
body.cms-active-template-templateD .cms-template-d .td-offer-section .td-ink-on-dark,
body.cms-active-template-templateD .cms-template-d .td-offer-section h2,
body.cms-active-template-templateD .cms-template-d .td-offer-section p {
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .cms-template-d .section-bg-image-block {
  background-color: color-mix(in srgb, var(--light) 90%, transparent) !important;
  border-color: color-mix(in srgb, var(--dark-color) 10%, transparent) !important;
}

/* Offer — compact centered background frame */
body.cms-active-template-templateD .cms-template-d .td-offer-section {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  margin-bottom: 0;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-cms-frame,
body.cms-active-template-templateD .cms-template-d .td-offer-section .td-cms-bg-frame.td-offer-cms-frame,
body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-cms-frame,
body.cms-active-template-templateD .cms-template-d .td-facts-section .td-cms-bg-frame.td-facts-cms-frame {
  position: relative;
  width: min(100%, 1200px);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  border-radius: var(--border-radius-medium, 12px);
  background-color: var(--dark, #212529);
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg .td-offer-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--cms-image-overlay);
}

body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg .td-offer-cms-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg .td-offer-cms-frame .td-offer-section__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-inner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  text-align: center;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-title,
body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-desc-line,
body.cms-active-template-templateD .cms-template-d .td-offer-section .td-section-eyebrow {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  max-width: 100%;
  width: 100%;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-section-eyebrow {
  display: block;
  white-space: normal;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-desc-line {
  line-height: 1.55;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-desc-line + .td-offer-desc-line {
  margin-top: 0.35rem;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-action {
  margin-top: 0.5rem;
}

body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-action .custom-btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

@media (min-width: 992px) {
  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-copy {
    max-width: min(480px, 92%);
    gap: 0.5rem;
    align-items: center;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-title {
    margin-bottom: 0.1rem;
    line-height: 1.15;
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
    text-align: center;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-desc-line {
    display: block;
    line-height: 1.45;
    font-size: 0.95rem;
    text-align: center;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-section-eyebrow {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-action {
    margin-top: 0.85rem;
    text-align: center;
  }
}

@media (max-width: 991.98px) {
  body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg,
  body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg.td-offer-section--cms-synced {
    align-items: center !important;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section--has-bg .td-offer-cms-frame .td-offer-section__content {
    padding: 1.25rem 1rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-copy {
    align-items: center;
    max-width: 100%;
  }

  body.cms-active-template-templateD .cms-template-d .td-offer-section .td-offer-action {
    text-align: center;
  }
}

body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .section-overlay {
  background: var(--cms-image-overlay) !important;
}

/* Facts — title + counts: secondary; labels + eyebrow on image: light */
body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-title,
body.cms-active-template-templateD .cms-template-d .td-facts-section .td-section-heading h2 {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-count,
body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-count span {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-icon {
  color: var(--secondary) !important;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-label,
body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-eyebrow {
  color: var(--light) !important;
  background-color: transparent;
}

/* Facts — compact centered background frame */
body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: visible;
  background: transparent;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--cms-image-overlay);
}

body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-cms-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg > .td-facts-cms-frame > .td-facts-section__content,
body.cms-active-template-templateD .cms-template-d .td-facts-cms-frame .td-facts-section__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1.85rem 1.65rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-section-heading {
  margin-bottom: 1rem !important;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-count {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-label {
  font-size: 0.9rem;
  line-height: 1.35;
}

body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .row {
  justify-content: center;
  align-items: center;
  width: 100%;
  --bs-gutter-y: 1rem;
}

@media (min-width: 992px) {
  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-cms-frame .td-facts-section__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-section-heading {
    width: 100%;
    text-align: center;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .row {
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-item {
    text-align: center;
  }
}

@media (max-width: 991.98px) {
  body.cms-active-template-templateD .cms-template-d .td-facts-section.section-padding,
  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg {
    overflow: visible !important;
    height: auto !important;
    min-height: 0;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-bg,
  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg.td-facts-section--cms-synced .td-facts-bg,
  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-bg[data-cms-bg="1"],
  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg.td-facts-section--cms-synced .td-facts-bg[data-cms-bg="1"] {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    align-self: stretch;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .td-facts-cms-frame .td-facts-section__content {
    padding-top: 1.25rem;
    padding-bottom: 1.35rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-eyebrow {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-section-heading {
    margin-bottom: 1.5rem !important;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section--has-bg .row > [class*="col-"] {
    flex: 0 0 auto !important;
    max-width: 420px !important;
    width: 100% !important;
    padding-left: 0;
    padding-right: 0;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-item {
    background: color-mix(in srgb, var(--dark) 52%, transparent);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-label {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    padding: 0.4rem 0.75rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-count {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
    line-height: 1.1;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-icon-img {
    width: 56px;
    height: 56px;
  }
}

body.cms-active-template-templateD .cms-template-d .custom-block-date-wrap {
  background-color: var(--primary-color) !important;
}

body.cms-active-template-templateD .cms-template-d .custom-block-date-wrap .custom-block-date,
body.cms-active-template-templateD .cms-template-d .custom-block-date-wrap strong,
body.cms-active-template-templateD .cms-template-d .custom-block-date-wrap .td-ink-on-dark {
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .cms-template-d .custom-btn,
body.cms-active-template-templateD .cms-template-d .custom-form button[type="submit"] {
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .site-footer .social-icon-link {
  background-color: var(--secondary-color);
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .site-footer .social-icon-link:hover {
  background-color: var(--primary-color);
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .member-block-image-wrap .social-icon {
  background-color: var(--light);
}

body.cms-active-template-templateD .member-block-image-wrap .social-icon-link {
  color: var(--dark-color) !important;
}

body.cms-active-template-templateD .member-block-image-wrap .social-icon-link:hover {
  color: var(--secondary) !important;
}

/* Shared detail page (/detail/...) */
body.cms-active-template-templateD .hero-header .display-3,
body.cms-active-template-templateD .hero-header .text-white {
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .hero-header .text-primary {
  color: var(--primary-color) !important;
}

body.cms-active-template-templateD .hero-header + .container-fluid .text-primary {
  color: var(--primary-color) !important;
}

body.cms-active-template-templateD .hero-header + .container-fluid p {
  color: var(--p-color);
}

body.cms-active-template-templateD .hero-header + .container-fluid .badge.bg-primary {
  background-color: var(--primary-color) !important;
  color: var(--td-ink-on-dark) !important;
}

body.cms-active-template-templateD .hero-header + .container-fluid .text-muted {
  color: var(--p-color) !important;
}

/* =================================================================
   Responsive — mobile / tablet / desktop
================================================================= */

body.cms-active-template-templateD .cms-template-d .hero-section {
  opacity: 1 !important;
}

/* Tablet (≤991.98px) */
@media (max-width: 991.98px) {
  body.cms-active-template-templateD .sticky-wrapper {
    position: relative;
  }

  body.cms-active-template-templateD .sticky-wrapper .navbar {
    position: relative;
  }

  .cms-template-d .page-title-band {
    margin-top: 0;
    padding-top: 72px;
    padding-bottom: 40px;
  }

  .cms-template-d .td-about-feature-item {
    margin-bottom: 1rem;
  }

  .cms-template-d .td-about-main-media {
    margin-bottom: 1rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home:not(.td-hero-has-bg) {
    position: relative;
    top: 0;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    padding-top: 88px;
    padding-bottom: 2rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.hero-inner-page:not(.td-hero-has-bg),
  body.cms-active-template-templateD .cms-template-d .hero-section.hero-50:not(.td-hero-has-bg) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    min-height: 380px;
    margin-bottom: -48px;
    padding-top: 4.5rem;
    padding-bottom: 4rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-dynamic-section:has(.hero-section) {
    overflow: visible !important;
  }

  .cms-template-d .hero-section.hero-inner-page .td-hero-content-panel {
    max-width: 100%;
    margin-top: -2rem;
    padding: 1.35rem 1.15rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home h1.td-hero-text,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-heading {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home h2.td-hero-text,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-subheading {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
  }

  body.cms-active-template-templateD .cms-template-d .hero-section .td-hero-video-col {
    display: none !important;
  }

  body.cms-active-template-templateD .template-d-nav .td-nav-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-brand-image.td-logo-large {
    max-height: 52px;
  }

  body.cms-active-template-templateD .cms-template-d .contact-section {
    overflow-x: hidden;
  }

  body.cms-active-template-templateD .cms-template-d .contact-info {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }

  body.cms-active-template-templateD .cms-template-d .td-contact-map-stage .contact-info-item,
  body.cms-active-template-templateD .cms-template-d .contact-info-item,
  body.cms-active-template-templateD .cms-template-d .events-detail-section .contact-info-item {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100% !important;
    max-width: 100%;
    margin: 0 0 1rem;
  }

  body.cms-active-template-templateD .cms-template-d .contact-info-body {
    padding: 1rem 1.25rem;
    word-break: break-word;
  }

  body.cms-active-template-templateD .template-d-footer .site-footer {
    padding-bottom: 100px;
    text-align: center;
  }

  body.cms-active-template-templateD .template-d-footer .site-footer .col-lg-3,
  body.cms-active-template-templateD .template-d-footer .site-footer .col-lg-4,
  body.cms-active-template-templateD .template-d-footer .site-footer .col-md-6 {
    margin-bottom: 1.5rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-section-heading {
    max-width: 100%;
  }

  body.cms-active-template-templateD .cms-template-d .events-section .custom-block {
    padding: 1.25rem;
  }

  body.cms-active-template-templateD .cms-template-d .events-section .custom-block-image-wrap {
    margin-bottom: 0.75rem;
  }
}

/* Mobile (≤767.98px) */
@media (max-width: 767.98px) {
  body.cms-active-template-templateD .cms-template-d .td-dynamic-section:not(:has(.events-section)):not(:has(.hero-section)),
  body.cms-active-template-templateD .cms-template-d .section-padding:not(.td-facts-section):not(.events-section) {
    overflow-x: clip;
  }

  body.cms-active-template-templateD .cms-template-d .td-dynamic-section:has(.hero-section) {
    overflow: visible !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.hero-inner-page,
  body.cms-active-template-templateD .cms-template-d .hero-section.hero-50 {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    align-items: flex-start;
  }

  body.cms-active-template-templateD .cms-template-d .custom-block,
  body.cms-active-template-templateD .cms-template-d .custom-block-image-wrap,
  body.cms-active-template-templateD .cms-template-d .custom-block-image {
    max-width: 100%;
  }

  .cms-template-d .page-title-band {
    padding-top: 64px;
    padding-bottom: 32px;
  }

  .cms-template-d .page-title-band h1 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home:not(.td-hero-has-bg) {
    min-height: 0;
    padding-top: 72px;
    padding-bottom: 1.5rem;
    margin-bottom: 0;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home:not(.td-hero-has-bg) .td-wave-bottom {
    display: none !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home.td-hero-has-bg {
    margin-bottom: 0 !important;
    padding-bottom: 0.75rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg .td-hero-container .mb-5 {
    margin-bottom: 0.75rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg .td-hero-content-stage {
    min-height: 0 !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg .td-hero-container {
    padding-bottom: 0.25rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg .td-hero-cta-group {
    margin-bottom: 0.5rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg .td-hero-cta-anchor {
    margin-top: 0 !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg .td-hero-cta-group {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0.75rem !important;
    overflow: visible !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-container {
    padding-bottom: 0.25rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group {
    margin-bottom: 0.5rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-anchor {
    margin-top: 0 !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-dynamic-section:has(.hero-section) {
    overflow: visible !important;
    margin-bottom: 1rem;
    padding-bottom: 0;
    position: relative;
    z-index: auto;
  }

  body.cms-active-template-templateD .cms-template-d .td-dynamic-section:has(.events-section) {
    position: relative;
    z-index: auto;
    overflow: visible !important;
    margin-top: 0;
  }

  body.cms-active-template-templateD .cms-template-d .events-section.section-padding {
    position: relative;
    z-index: auto;
    overflow: visible !important;
    padding-top: 1.25rem !important;
    padding-bottom: 2.5rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .events-section .td-section-heading {
    overflow: visible;
    margin-bottom: 1.25rem !important;
    padding-top: 0.15rem;
  }

  body.cms-active-template-templateD .cms-template-d .events-section .td-section-eyebrow {
    display: block;
    margin-top: 0;
    padding: 0.65rem 0.85rem;
    line-height: 1.6;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    box-decoration-break: slice;
    -webkit-box-decoration-break: initial;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section .td-hero-content-stage {
    display: block;
    position: relative;
    min-height: 0 !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section .td-hero-slide-panel {
    display: none;
    min-height: 0;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section .td-hero-slide-panel--active {
    display: flex;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.hero-inner-page:not(.td-hero-has-bg) {
    min-height: clamp(340px, 58vh, 460px);
    padding-top: 3.75rem;
    padding-bottom: 3.5rem;
    margin-bottom: -40px;
  }

  .cms-template-d .hero-section.hero-inner-page .td-hero-content-panel {
    margin-top: -1.5rem;
    padding: 1.15rem 1rem;
  }

  .cms-template-d .page-title-band {
    padding-bottom: 2.25rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group {
    gap: 0.5rem 1rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .td-hero-play-btn {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--light) !important;
    border: 2px solid transparent;
    line-height: 1;
    font-size: 1.35rem;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--dark-color) 18%, transparent);
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .td-hero-play-btn:hover,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-cta-group .td-hero-play-btn:focus-visible {
    background: var(--secondary);
    color: var(--light) !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section .td-hero-cta-group .td-hero-carousel-btn {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.95rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg.td-hero-home .td-hero-subheading,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg.td-hero-home h2.td-hero-text {
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
    background-color: transparent !important;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg.td-hero-home .td-hero-heading,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg.td-hero-home h1.td-hero-text,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-has-bg.td-hero-home p.td-hero-text {
    color: var(--dark) !important;
    -webkit-text-fill-color: var(--dark) !important;
    background-color: transparent !important;
  }

  body.cms-active-template-templateD .cms-template-d .td-menu-tabs {
    flex-direction: column;
    align-items: stretch !important;
    width: 100%;
  }

  body.cms-active-template-templateD .cms-template-d .td-menu-tabs .nav-item {
    width: 100%;
  }

  body.cms-active-template-templateD .cms-template-d .td-menu-tabs .nav-link {
    text-align: center;
    width: 100%;
  }

  body.cms-active-template-templateD .cms-template-d .td-facts-section .td-facts-count {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  body.cms-active-template-templateD .cms-template-d .membership-form {
    padding: 1.5rem !important;
  }

  body.cms-active-template-templateD .cms-template-d .td-carousel-nav .btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Small mobile (≤575.98px) */
@media (max-width: 575.98px) {
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home h1.td-hero-text,
  body.cms-active-template-templateD .cms-template-d .hero-section.td-hero-home .td-hero-heading {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  body.cms-active-template-templateD .cms-template-d .section-bg-image-block {
    padding: 1.25rem;
  }

  body.cms-active-template-templateD .cms-template-d .td-service-card-icon {
    width: 60px;
    height: 60px;
  }

  body.cms-active-template-templateD .template-d-nav .navbar-brand-image.td-logo-medium,
  body.cms-active-template-templateD .template-d-nav .navbar-brand-image.td-logo-large {
    max-height: 44px;
  }
}

/* Desktop (≥992px) */
@media (min-width: 992px) {
  body.cms-active-template-templateD .cms-template-d .td-section-heading {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── CMS section images (gap-free frames) ── */
body.cms-active-template-templateD #app .main .cms-template-d .td-cms-media {
  position: relative;
  overflow: hidden;
  background-color: transparent;
}

body.cms-active-template-templateD #app .main .cms-template-d .hero-section.td-hero-fullbleed,
body.cms-active-template-templateD #app .main .cms-template-d .hero-section[data-cms-bg="1"] {
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: unset !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .hero-section.td-hero-fullbleed .td-wave-top,
body.cms-active-template-templateD #app .main .cms-template-d .hero-section.td-hero-fullbleed .td-wave-bottom,
body.cms-active-template-templateD #app .main .cms-template-d .hero-section.td-hero-fullbleed .td-wave-inner {
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-about-main-media.td-cms-media[data-cms-aspect="about.image"] {
  position: relative;
  aspect-ratio: 800 / 400;
  width: 100%;
  height: auto;
  overflow: hidden;
  background: transparent;
  line-height: 0;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-about-main-media .td-about-main-img[data-cms-field="about.image"] {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
  background-color: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-menu-card-media.td-cms-media[data-cms-aspect="menu.tabs.items.image"] {
  aspect-ratio: 840 / 280;
  width: 100%;
  height: auto;
  background: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-menu-card-media .td-menu-card-image[data-cms-field="menu.tabs.items.image"] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  background-color: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-team-photo.td-cms-media[data-cms-aspect="team.items.image"] {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-team-photo .td-team-card-img[data-cms-field="team.items.image"] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background-color: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .events-section .td-blog-card-media {
  display: block;
  width: 100%;
  height: auto !important;
  overflow: hidden;
  line-height: 0;
  background: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .events-section .td-blog-card-image {
  display: block;
  width: 100%;
  height: auto !important;
  max-width: 100%;
  max-height: none !important;
  object-fit: unset !important;
  object-position: center center !important;
  background: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-video-media.td-cms-media[data-cms-aspect="video.thumbnail"],
body.cms-active-template-templateD #app .main .cms-template-d .td-video-media.td-video-media--hero-size {
  width: 100%;
  aspect-ratio: 960 / 480;
  height: auto;
  overflow: hidden;
  background: #e9ecef;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-video-media .td-video-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-testimonial-avatar-wrap.td-cms-media[data-cms-aspect="testimonials.items.image"] {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-testimonial-avatar[data-cms-field="testimonials.items.image"] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background-color: transparent !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-offer-section--has-bg[data-cms-bg="1"] {
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Shared compact CMS background frame (offer + facts) */
body.cms-active-template-templateD #app .main .cms-template-d .td-cms-bg-frame {
  position: relative;
  width: min(100%, 1200px);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  border-radius: var(--border-radius-medium, 12px);
  background-color: var(--dark, #212529);
}

body.cms-active-template-templateD #app .main .cms-template-d .td-cms-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-offer-section--has-bg .td-offer-section__content {
  position: relative;
  z-index: 2;
  padding: 2rem 1.75rem;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-facts-cms-frame .td-facts-section__content {
  position: relative;
  z-index: 2;
}

body.cms-active-template-templateD #app .main .cms-template-d .td-service-card-icon.td-cms-media[data-cms-aspect="services.items.icon_image"] img[data-cms-field],
body.cms-active-template-templateD #app .main .cms-template-d .td-about-feature-icon.td-cms-media img[data-cms-field],
body.cms-active-template-templateD #app .main .cms-template-d .td-facts-icon-img[data-cms-field] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

body.cms-active-template-templateD #app .main .cms-template-d .member-block-image-wrap:hover .td-team-card-img,
body.cms-active-template-templateD #app .main .cms-template-d .custom-block-image-wrap:hover .td-menu-card-image,
body.cms-active-template-templateD #app .main .cms-template-d .custom-block-image-wrap:hover .td-blog-card-image {
  transform: scale(1.2);
}
