/**
 * 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".
 */
: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;
}

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: subtitle (h2) = light + secondary outline; title (h1) = secondary + light outline */
.cms-template-d .hero-section h2.td-hero-text,
.cms-template-d .hero-section .td-hero-subheading {
  color: var(--light) !important;
  -webkit-text-fill-color: var(--light);
  -webkit-text-stroke: 1.5px var(--secondary);
  paint-order: stroke fill;
}

.cms-template-d .hero-section h1.td-hero-text,
.cms-template-d .hero-section p.td-hero-text,
.cms-template-d .hero-section .td-hero-heading {
  color: var(--secondary) !important;
  -webkit-text-fill-color: var(--secondary);
  -webkit-text-stroke: 2px var(--light);
  paint-order: stroke fill;
}

.cms-template-d .hero-section .custom-btn-group .link {
  color: var(--light);
}

.cms-template-d .hero-section .custom-btn-group .link:hover {
  color: var(--secondary);
}

/* 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;
}

.cms-template-d .hero-section.hero-inner-page .td-hero-content-panel {
  position: relative;
  z-index: 4;
  max-width: 38rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--border-radius-medium, 20px);
  background: color-mix(in srgb, var(--secondary-color) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--light) 14%, transparent);
  box-shadow: 0 14px 42px color-mix(in srgb, var(--dark-color) 32%, transparent);
}

.cms-template-d .hero-section.hero-inner-page {
  height: auto;
  min-height: clamp(360px, 52vh, 540px);
  margin-top: 0;
  margin-bottom: -56px;
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

body.cms-active-template-templateD .cms-template-d .hero-section.hero-inner-page .section-overlay {
  background: linear-gradient(
    118deg,
    color-mix(in srgb, var(--secondary-color) 92%, transparent) 0%,
    color-mix(in srgb, var(--secondary-color) 78%, transparent) 42%,
    color-mix(in srgb, var(--dark-color) 62%, transparent) 100%
  ) !important;
}

.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;
}

.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: color-mix(in srgb, var(--light) 94%, var(--secondary)) !important;
  -webkit-text-fill-color: unset !important;
}

.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;
  height: 200px;
  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 {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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;
}

@media (max-width: 575.98px) {
  body.cms-active-template-templateD .cms-template-d .td-menu-card-media {
    height: 168px;
  }
}

/* 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 {
  height: 280px;
  border-radius: 0;
}

body.cms-active-template-templateD .cms-template-d .td-team-card-media .member-block-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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: 3;
  -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 {
    height: 240px;
  }
}

/* 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;
  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 */
.cms-template-d main {
  overflow-x: hidden;
}

.cms-template-d .page-title-band {
  background-color: var(--secondary-color);
  padding: 100px 0 48px;
  margin-top: 72px;
}

.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-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-side-image {
  min-height: 280px;
  object-fit: cover;
}

.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 {
  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;
}

body.cms-active-template-templateD .cms-template-d .hero-section:not(.hero-inner-page) .section-overlay {
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--text) 4%, transparent),
    color-mix(in srgb, var(--text) 70%, transparent)
  ) !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: 64px;
  height: 64px;
  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: color-mix(in srgb, var(--dark) 55%, transparent);
}

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-side-image {
    min-height: 220px;
    margin-bottom: 1rem;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section {
    position: relative;
    top: 0;
    height: auto;
    min-height: clamp(420px, 72vh, 620px);
    margin-bottom: -48px;
    padding-top: 88px;
    padding-bottom: 72px;
  }

  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 {
    min-height: 420px;
    margin-bottom: -48px;
    padding-bottom: 4.5rem;
  }

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

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

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

  body.cms-active-template-templateD .cms-template-d .hero-section .ratio {
    margin-top: 1.5rem;
  }

  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,
  body.cms-active-template-templateD .cms-template-d .section-padding {
    overflow-x: hidden;
  }

  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 {
    min-height: clamp(380px, 65vh, 520px);
    padding-top: 72px;
    padding-bottom: 56px;
    margin-bottom: -32px;
  }

  body.cms-active-template-templateD .cms-template-d .hero-section.hero-inner-page {
    min-height: clamp(340px, 58vh, 480px);
    padding-top: 1.75rem;
    padding-bottom: 4rem;
    margin-bottom: -40px;
  }

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

  body.cms-active-template-templateD .cms-template-d .hero-section .custom-btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  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 h1.td-hero-text,
  body.cms-active-template-templateD .cms-template-d .hero-section .td-hero-heading {
    -webkit-text-stroke-width: 1px;
    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;
  }
}
