/**
 * Template C — CMS palette bridge (Template G pattern)
 * Panel sets :root --primary, --secondary, --dark, --light, --text in app.blade.php.
 */

body.cms-active-template-templateC {
  --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-templateC .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-templateC .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);
}

body.cms-active-template-templateC .template-c {
  color: var(--default-color);
  background: var(--background-color);
}

body.cms-active-template-templateC .text-primary { color: var(--primary) !important; }
body.cms-active-template-templateC .text-secondary { color: var(--secondary) !important; }
body.cms-active-template-templateC .text-dark { color: var(--dark) !important; }
body.cms-active-template-templateC .text-body { color: var(--text) !important; }
body.cms-active-template-templateC .bg-primary { background-color: var(--primary) !important; }
body.cms-active-template-templateC .bg-light { background-color: var(--light) !important; }
body.cms-active-template-templateC .border-primary { border-color: var(--primary) !important; }

/* Inner page title bar uses light paper, not dark */
body.cms-active-template-templateC .template-c .container-fluid.bg-dark.p-5.mb-5 {
  background-color: var(--light) !important;
}

body.cms-active-template-templateC .template-c .container-fluid.bg-dark.p-5.mb-5 .text-white,
body.cms-active-template-templateC .template-c .container-fluid.bg-dark.p-5.mb-5 .display-4 {
  color: var(--dark) !important;
}

body.cms-active-template-templateC .template-c .container-fluid.bg-dark.p-5.mb-5 .breadcrumb-item a {
  color: var(--primary) !important;
}

body.cms-active-template-templateC .template-c .container-fluid.bg-dark.p-5.mb-5 .breadcrumb-item.active {
  color: var(--text) !important;
}

/* Hero scrim overlay */
body.cms-active-template-templateC .template-c .tc-hero-scrim {
  background: var(--cms-image-overlay) !important;
}

body.cms-active-template-templateC .template-c .container-fluid.p-0.mb-5 .text-light,
body.cms-active-template-templateC .template-c .tc-hero-slide .text-light {
  color: var(--secondary) !important;
}

body.cms-active-template-templateC .template-c .tc-hero-shell--has-bg,
body.cms-active-template-templateC .template-c .tc-hero-shell.tc-hero-fullbleed {
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: var(--dark) !important;
}

body.cms-active-template-templateC .template-c .tc-hero-shell.tc-hero-fullbleed {
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: unset !important;
  min-height: clamp(420px, 52vh, 640px);
}

body.cms-active-template-templateC .template-c .tc-hero-shell--cms-synced .tc-hero-stage {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 100% !important;
  flex: 1 1 auto !important;
}

body.cms-active-template-templateC .template-c .tc-hero-shell--has-bg.tc-hero-shell--cms-synced {
  background-position: center center !important;
}

body.cms-active-template-templateC .template-c .tc-hero-content-stage {
  align-items: center !important;
  justify-items: center !important;
  text-align: center !important;
}

@media (max-width: 767.98px) {
  body.cms-active-template-templateC .template-c .tc-hero-wrap,
  body.cms-active-template-templateC .template-c .tc-hero-shell {
    overflow-x: clip !important;
    max-width: 100% !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-stage {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding-left: 2.75rem !important;
    padding-right: 2.75rem !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-slide,
  body.cms-active-template-templateC .template-c .tc-hero-slide .display-2,
  body.cms-active-template-templateC .template-c .tc-hero-slide h5,
  body.cms-active-template-templateC .template-c .tc-hero-slide p {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-cta-row {
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-stage {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  body.cms-active-template-templateC .template-c .tc-hero-shell--cms-synced .tc-hero-stage {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 100% !important;
    flex: 1 1 auto !important;
  }

}

/* Contact section on light background */
body.cms-active-template-templateC .template-c .tc-contact-section {
  background-color: var(--light) !important;
}

body.cms-active-template-templateC .template-c .tc-contact-section .tc-contact-heading,
body.cms-active-template-templateC .template-c .tc-contact-section .tc-contact-kicker {
  color: var(--dark) !important;
}

body.cms-active-template-templateC .template-c .tc-contact-section .tc-contact-info-text {
  color: var(--text) !important;
}

/* Contact form fields — light background (CMS palette) */
body.cms-active-template-templateC .template-c .tc-contact-section .form-floating .form-control,
body.cms-active-template-templateC .template-c .tc-contact-section .form-floating .form-control.bg-dark {
  background-color: var(--light) !important;
  color: var(--dark) !important;
  border: 1px solid color-mix(in srgb, var(--dark) 22%, transparent) !important;
}

body.cms-active-template-templateC .template-c .tc-contact-section .form-floating > label {
  color: color-mix(in srgb, var(--text) 70%, var(--dark)) !important;
}

body.cms-active-template-templateC .template-c .tc-contact-section .form-floating > .form-control:focus,
body.cms-active-template-templateC .template-c .tc-contact-section .form-floating > .form-control:not(:placeholder-shown) {
  background-color: var(--light) !important;
  color: var(--dark) !important;
  border-color: var(--dark) !important;
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary) 28%, transparent);
}

body.cms-active-template-templateC .template-c .tc-contact-section .form-floating > .form-control:focus ~ label,
body.cms-active-template-templateC .template-c .tc-contact-section .form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--dark) !important;
}

body.cms-active-template-templateC .template-c .tc-contact-section .form-floating > .form-control::placeholder {
  color: transparent;
}

/* Offer card — image inside card, copy on dark scrim */
body.cms-active-template-templateC .template-c .tc-offer-kicker,
body.cms-active-template-templateC .template-c .tc-offer-title,
body.cms-active-template-templateC .template-c .tc-offer-desc {
  color: var(--secondary) !important;
}

body.cms-active-template-templateC .template-c .tc-offer-kicker {
  color: color-mix(in srgb, var(--secondary) 65%, transparent) !important;
}

body.cms-active-template-templateC .template-c .tc-offer-desc {
  color: color-mix(in srgb, var(--secondary) 82%, transparent) !important;
}

/* Offer — compact centered background frame */
body.cms-active-template-templateC .template-c .tc-offer-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

body.cms-active-template-templateC .template-c .tc-cms-bg-frame.tc-offer-cms-frame {
  position: relative;
  width: min(100%, 1200px);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  border-radius: 0.25rem;
  background-color: var(--dark);
}

body.cms-active-template-templateC .template-c .tc-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-templateC .template-c .tc-offer-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--cms-image-overlay);
}

body.cms-active-template-templateC .template-c .tc-offer-cms-frame .tc-offer-card__content {
  position: relative;
  z-index: 2;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

body.cms-active-template-templateC .template-c .tc-offer-inner {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.cms-active-template-templateC .template-c .tc-offer-heading {
  border-left: none !important;
  border-top: 4px solid var(--primary) !important;
  padding-left: 0 !important;
  padding-top: 1rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 767.98px) {
  body.cms-active-template-templateC .template-c .tc-offer-section {
    overflow-x: clip !important;
    max-width: 100% !important;
    align-items: flex-start !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0 !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1rem !important;
  }

  body.cms-active-template-templateC .template-c .tc-offer-cms-frame,
  body.cms-active-template-templateC .template-c .tc-offer-cms-frame--has-bg {
    overflow-x: clip !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    height: auto !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
  }

  body.cms-active-template-templateC .template-c .tc-offer-cms-frame .tc-offer-card__content {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 1.25rem 1rem 0.75rem !important;
  }

  body.cms-active-template-templateC .template-c .tc-offer-inner {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.cms-active-template-templateC .template-c .tc-offer-kicker,
  body.cms-active-template-templateC .template-c .tc-offer-title,
  body.cms-active-template-templateC .template-c .tc-offer-desc {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-wrap: break-word !important;
  }

  body.cms-active-template-templateC .template-c .tc-offer-inner .btn {
    max-width: 100% !important;
    white-space: normal !important;
  }
}

/* Section surfaces alternate from CMS light tone */
body.cms-active-template-templateC .template-c .dynamic-section-gap {
  background: linear-gradient(
    180deg,
    var(--light) 0%,
    color-mix(in srgb, var(--light) 97%, var(--secondary)) 100%
  );
}

body.cms-active-template-templateC .template-c .tc-svc-v2-section,
body.cms-active-template-templateC .template-c .tc-menu-section,
body.cms-active-template-templateC .template-c .tc-team-v2-section,
body.cms-active-template-templateC .template-c .tc-video-v2-section,
body.cms-active-template-templateC .template-c .tc-blog-section {
  background: var(--light);
}

body.cms-active-template-templateC .template-c .tc-facts-section {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--light) 90%, var(--primary)) 0%,
    var(--light) 55%
  ) !important;
}

body.cms-active-template-templateC .template-c .tc-facts-grid {
  justify-content: center !important;
}

body.cms-active-template-templateC .template-c .tc-fact-card {
  background: color-mix(in srgb, var(--light) 78%, var(--primary)) !important;
  border-color: color-mix(in srgb, var(--primary) 22%, var(--light)) !important;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 12%, transparent) !important;
}

@media (max-width: 767.98px) {
  body.cms-active-template-templateC .template-c .tc-facts-section {
    overflow: visible !important;
  }

  body.cms-active-template-templateC .template-c .tc-facts-section__content {
    padding-top: 2.5rem !important;
    padding-bottom: 2.75rem !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  body.cms-active-template-templateC .template-c .tc-facts-grid {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 1.25rem !important;
  }

  body.cms-active-template-templateC .template-c .tc-fact-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  body.cms-active-template-templateC .template-c .tc-fact-figure {
    min-height: 112px !important;
    background: color-mix(in srgb, var(--text) 12%, var(--light)) !important;
  }
}

@media (min-width: 992px) {
  body.cms-active-template-templateC .template-c .tc-fact-card {
    flex: 0 0 calc((100% - (1.25rem * 3)) / 4) !important;
    max-width: calc((100% - (1.25rem * 3)) / 4) !important;
    width: calc((100% - (1.25rem * 3)) / 4) !important;
  }
}

body.cms-active-template-templateC .template-c .tc-testimonial-section {
  background: linear-gradient(
    165deg,
    var(--dark) 0%,
    var(--primary) 42%,
    color-mix(in srgb, var(--primary) 70%, var(--dark)) 100%
  );
  color: var(--secondary);
}

body.cms-active-template-templateC .template-c .tc-testimonial-section .tc-testimonial-title,
body.cms-active-template-templateC .template-c .tc-testimonial-section .tc-testimonial-kicker,
body.cms-active-template-templateC .template-c .tc-testimonial-section .tc-testimonial-lead {
  color: var(--secondary);
}

body.cms-active-template-templateC .template-c .tc-testimonial-section .tc-testimonial-kicker {
  color: color-mix(in srgb, var(--secondary) 65%, transparent);
}

body.cms-active-template-templateC .template-c .tc-testimonial-section .tc-testimonial-lead {
  color: color-mix(in srgb, var(--secondary) 82%, transparent);
}

/* Footer obeys CMS palette */
body.cms-active-template-templateC .footer,
body.cms-active-template-templateC .template-c .footer {
  background-color: var(--light) !important;
  color: var(--text) !important;
}

/* Navbar — Template G nav token pattern */
body.cms-active-template-templateC .tc-classic-navbar {
  background-color: var(--surface-color) !important;
}

body.cms-active-template-templateC .tc-nav-link {
  color: var(--nav-color) !important;
}

body.cms-active-template-templateC .tc-nav-link:hover,
body.cms-active-template-templateC .tc-nav-link:focus,
body.cms-active-template-templateC .tc-nav-link.active {
  color: var(--nav-hover-color) !important;
}

body.cms-active-template-templateC .navbar .dropdown-menu {
  background-color: var(--nav-dropdown-background-color) !important;
}

body.cms-active-template-templateC .navbar .dropdown-item {
  color: var(--nav-dropdown-color) !important;
}

body.cms-active-template-templateC .navbar .dropdown-item:hover,
body.cms-active-template-templateC .navbar .dropdown-item:focus {
  color: var(--nav-dropdown-hover-color) !important;
}
