/**
 * CMS bridge for Template F (Clarity).
 * Panel colors in app.blade.php :root — primary, secondary, dark, light, text.
 * Maps them to Clarity tokens (--accent-color, --background-color, etc.).
 */

/* ── Global Clarity tokens from CMS palette ── */
body.cms-active-template-templateF {
  --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) 25%);
  --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) 40%);
  --nav-dropdown-hover-color: var(--primary);
}

/* Hero: dark band */
body.cms-active-template-templateF #app .main .hero.section {
  --background-color: var(--dark);
  --heading-color: var(--secondary);
  --default-color: color-mix(in srgb, var(--secondary) 75%, var(--text));
  --surface-color: color-mix(in srgb, var(--dark), var(--primary) 22%);
}

/* Section presets (alternating classes from Vue) */
body.cms-active-template-templateF .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-templateF .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);
}

/* Heading tone only (blog matches services without changing surfaces) */
body.cms-active-template-templateF .vf-heading-tone-light {
  --heading-color: var(--dark);
}

body.cms-active-template-templateF .vf-heading-tone-dark {
  --heading-color: var(--secondary);
}

/* Header on scroll */
body.cms-active-template-templateF .header {
  --background-color: color-mix(in srgb, var(--light) 92%, transparent);
}

/* ── Page shell (Template G pattern) ── */
body.cms-active-template-templateF .cms-template-f {
  color: var(--default-color);
  background-color: var(--background-color);
}

body.cms-active-template-templateF .cms-template-f h1,
body.cms-active-template-templateF .cms-template-f h2,
body.cms-active-template-templateF .cms-template-f h3,
body.cms-active-template-templateF .cms-template-f h4,
body.cms-active-template-templateF .cms-template-f h5,
body.cms-active-template-templateF .cms-template-f h6 {
  color: var(--heading-color);
}

body.cms-active-template-templateF .cms-template-f .section-title p,
body.cms-active-template-templateF .cms-template-f p {
  color: var(--default-color);
}

/* ── Header / nav (Clarity navmenu tokens) ── */
body.cms-active-template-templateF .header .navmenu a,
body.cms-active-template-templateF .header .navmenu a:focus {
  color: var(--nav-color) !important;
}

body.cms-active-template-templateF .header .navmenu li:hover > a,
body.cms-active-template-templateF .header .navmenu a:hover,
body.cms-active-template-templateF .header .navmenu .active,
body.cms-active-template-templateF .header .navmenu .active:focus {
  color: var(--nav-hover-color) !important;
}

body.cms-active-template-templateF .header .btn-getstarted,
body.cms-active-template-templateF .header .btn-getstarted:focus {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--secondary) !important;
}

body.cms-active-template-templateF .header .btn-getstarted:hover {
  background-color: color-mix(in srgb, var(--primary), var(--dark) 15%) !important;
  border-color: color-mix(in srgb, var(--primary), var(--dark) 15%) !important;
}

@media (max-width: 1199px) {
  body.cms-active-template-templateF #app .header .navmenu {
    flex-shrink: 0;
  }

  body.cms-active-template-templateF:not(.mobile-nav-active) #app .header .navmenu .mobile-nav-toggle {
    position: relative;
    z-index: 10001;
    flex-shrink: 0;
  }

  /* Full-screen overlay (dimmed backdrop) */
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(33, 37, 41, 0.82);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 72px 20px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
  }

  /* Close icon — top-right of overlay, aligned with menu panel */
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu .mobile-nav-toggle {
    position: absolute !important;
    top: 20px;
    right: 20px;
    left: auto;
    margin: 0;
    padding: 0.4rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    color: var(--secondary) !important;
    font-size: 1.75rem;
    line-height: 1;
    z-index: 10002;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  /* Menu panel — height follows links; scroll only when list is long */
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(70vh, calc(100dvh - 120px)) !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 8px 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 8px;
    background-color: var(--nav-mobile-background-color) !important;
    border: 1px solid color-mix(in srgb, var(--secondary), transparent 88%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul > li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--secondary), transparent 88%);
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul > li:last-child {
    border-bottom: 0;
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul a,
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul a.router-link-active,
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul a.router-link-exact-active {
    display: block;
    padding: 14px 20px;
    color: var(--nav-dropdown-color) !important;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    white-space: normal;
    justify-content: flex-start;
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul a:hover,
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul a.active,
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu > ul a.router-link-active {
    color: var(--nav-dropdown-hover-color) !important;
    background: color-mix(in srgb, var(--primary), transparent 92%);
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu .dropdown ul {
    position: static;
    display: none;
    margin: 0;
    padding: 0;
    background-color: color-mix(in srgb, var(--dark), var(--primary) 12%) !important;
    border: 0;
    box-shadow: none;
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu .dropdown > a.active + ul,
  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu .dropdown > ul.dropdown-active {
    display: block !important;
  }

  body.cms-active-template-templateF.mobile-nav-active #app .header .navmenu .dropdown ul a {
    padding-left: 32px;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0;
  }

  body.cms-active-template-templateF .navmenu .dropdown ul {
    background-color: var(--nav-dropdown-background-color) !important;
  }

  body.cms-active-template-templateF .navmenu .dropdown ul a {
    color: var(--nav-dropdown-color) !important;
  }

  body.cms-active-template-templateF .navmenu .dropdown ul a:hover {
    color: var(--nav-dropdown-hover-color) !important;
  }
}

/* Footer */
body.cms-active-template-templateF .footer.dark-background {
  --background-color: var(--dark);
  --default-color: color-mix(in srgb, var(--secondary) 65%, var(--text));
  --heading-color: var(--secondary);
  --surface-color: color-mix(in srgb, var(--dark), var(--primary) 12%);
}

/* Primary / outline buttons */
body.cms-active-template-templateF .btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--secondary) !important;
}

body.cms-active-template-templateF .btn-primary:hover,
body.cms-active-template-templateF .btn-primary:focus {
  background-color: color-mix(in srgb, var(--primary), var(--dark) 18%) !important;
  border-color: color-mix(in srgb, var(--primary), var(--dark) 18%) !important;
  color: var(--secondary) !important;
}

body.cms-active-template-templateF .hero .hero-buttons .btn.btn-outline,
body.cms-active-template-templateF .btn.btn-outline {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  background: transparent !important;
}

body.cms-active-template-templateF .hero .hero-buttons .btn.btn-outline:hover,
body.cms-active-template-templateF .btn.btn-outline:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--secondary) !important;
}

body.cms-active-template-templateF .hero.section .hero-buttons .btn.btn-outline {
  color: var(--secondary) !important;
  border-color: color-mix(in srgb, var(--secondary), var(--primary) 35%) !important;
}

body.cms-active-template-templateF .hero.section .hero-buttons .btn.btn-outline:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--secondary) !important;
}

/* Links & accents */
body.cms-active-template-templateF #app .main a:not(.btn):not(.nav-link) {
  color: var(--primary);
}

body.cms-active-template-templateF #app .main a:not(.btn):not(.nav-link):hover {
  color: color-mix(in srgb, var(--primary), var(--dark) 20%);
}

body.cms-active-template-templateF #app .main .section-title h2,
body.cms-active-template-templateF #app .main h1,
body.cms-active-template-templateF #app .main h2,
body.cms-active-template-templateF #app .main h3,
body.cms-active-template-templateF #app .main h4,
body.cms-active-template-templateF #app .main h5 {
  color: var(--heading-color);
}

body.cms-active-template-templateF #app .main .about .content h2,
body.cms-active-template-templateF #app .main .about .content h2 * {
  color: var(--text) !important;
}

/* Blog headings — match Services (section title, cards, CTA) */
body.cms-active-template-templateF #app .main .portfolio .section-title h2,
body.cms-active-template-templateF #app .main .portfolio .section-title h2 *,
body.cms-active-template-templateF #app .main .portfolio .portfolio-wrapper .portfolio-content h3,
body.cms-active-template-templateF #app .main .portfolio .portfolio-cta h4 {
  color: var(--heading-color) !important;
}

body.cms-active-template-templateF #app .main .services .section-title h2,
body.cms-active-template-templateF #app .main .services .section-title h2 *,
body.cms-active-template-templateF #app .main .services .service-card h4,
body.cms-active-template-templateF #app .main .services .service-card h4 a,
body.cms-active-template-templateF #app .main .services .service-card h4 span {
  color: var(--heading-color) !important;
}

body.cms-active-template-templateF #app .main p,
body.cms-active-template-templateF #app .main .section-title p {
  color: var(--default-color);
}

body.cms-active-template-templateF #app .main .stat-number,
body.cms-active-template-templateF #app .main .purecounter {
  color: var(--primary);
}

/* Cards & surfaces */
body.cms-active-template-templateF #app .main .service-card,
body.cms-active-template-templateF #app .main .portfolio-wrapper,
body.cms-active-template-templateF #app .main .feature-card,
body.cms-active-template-templateF #app .main .leader-card,
body.cms-active-template-templateF #app .main .testimonial-card {
  background: var(--surface-color);
}

body.cms-active-template-templateF #app .main .services .service-icon {
  background-color: color-mix(in srgb, var(--primary), transparent 88%);
}

body.cms-active-template-templateF #app .main .services .service-icon i {
  color: var(--primary);
}

body.cms-active-template-templateF #app .main .services .service-badge {
  background: linear-gradient(
    135deg,
    var(--primary),
    color-mix(in srgb, var(--primary), var(--dark) 25%)
  );
  box-shadow: 0 4px 15px color-mix(in srgb, var(--primary), transparent 65%);
}

/* Swiper — consistent filled dots; active dot scales (no mixed hollow/square bullets) */
body.cms-active-template-templateF #app .main .vf-section-carousel .swiper-pagination,
body.cms-active-template-templateF #app .main .vf-swiper .swiper-pagination {
  position: relative;
  line-height: 0;
}

body.cms-active-template-templateF #app .main .vf-section-carousel .swiper-pagination-bullet,
body.cms-active-template-templateF #app .main .vf-swiper .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50% !important;
  opacity: 1 !important;
  margin: 0 5px !important;
  background: color-mix(in srgb, var(--primary), transparent 70%) !important;
  border: none !important;
  box-shadow: none !important;
  transform: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

body.cms-active-template-templateF #app .main .vf-section-carousel .swiper-pagination-bullet-active,
body.cms-active-template-templateF #app .main .vf-swiper .swiper-pagination-bullet-active,
body.cms-active-template-templateF .swiper-pagination-bullet-active {
  background: var(--primary) !important;
  transform: scale(1.15);
  border-radius: 50% !important;
}

/* Facts carousel — same loop/autoplay as blog (vf-cards-slider) */
body.cms-active-template-templateF #app .main .vf-hero-facts-wrap,
body.cms-active-template-templateF #app .main .vf-hero-facts-wrap .facts-slider,
body.cms-active-template-templateF #app .main .facts-slider.vf-section-carousel {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 576px) {
  body.cms-active-template-templateF #app .main .facts-slider .vf-fact-slide-card {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* AOS visibility (CMS) */
body.cms-active-template-templateF #app .main [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

body.cms-active-template-templateF #app .main .text-center.py-5 {
  color: var(--default-color);
}

body.cms-active-template-templateF #app .main .vf-empty-page {
  color: var(--default-color);
  padding: 4rem 1rem;
  text-align: center;
}

/* Bootstrap Icons vs Font Awesome */
body.cms-active-template-templateF .bi::before,
body.cms-active-template-templateF [class^="bi-"]::before,
body.cms-active-template-templateF [class*=" bi-"]::before {
  font-family: bootstrap-icons !important;
  font-style: normal;
  font-weight: normal !important;
  display: inline-block;
  line-height: 1;
}

body.cms-active-template-templateF #app .main .fa::before,
body.cms-active-template-templateF #app .main .fas::before,
body.cms-active-template-templateF #app .main .far::before,
body.cms-active-template-templateF #app .main .fab::before {
  font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
}

body.cms-active-template-templateF #app .main .fab::before {
  font-family: "Font Awesome 5 Brands" !important;
}

/* Team hex grid: centered on page; staggered 2×2 alignment preserved */
body.cms-active-template-templateF #app .main .team .vf-team-grid-col {
  display: flex;
  justify-content: center;
}

body.cms-active-template-templateF #app .main .team .team-grid {
  row-gap: 2rem;
  margin-left: auto;
  margin-right: auto;
  justify-items: center;
  width: fit-content;
  max-width: 100%;
}

body.cms-active-template-templateF #app .main .team .team-grid .member-hexagon {
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.cms-active-template-templateF #app .main .team .team-grid .member-hexagon .hexagon-inner {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

body.cms-active-template-templateF #app .main .team .team-grid .member-hexagon .vf-member-meta {
  width: 100%;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

/* =================================================================
   Responsive — mobile / tablet / desktop (CMS dynamic sections)
   Breakpoints: tablet ≤991.98px, mobile ≤767.98px, small ≤575.98px
================================================================= */

body.cms-active-template-templateF #app .main {
  overflow-x: clip;
}

/* ── Tablet (≤991.98px) ── */
@media (max-width: 991.98px) {
  body.cms-active-template-templateF #app .main section,
  body.cms-active-template-templateF #app .main .section {
    padding: 48px 0;
  }

  body.cms-active-template-templateF #app .main .section-title {
    padding-bottom: 40px;
  }

  body.cms-active-template-templateF #app .main .section-title h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  /* Hero */
  body.cms-active-template-templateF #app .main .hero.section {
    padding: 88px 0 64px;
  }

  body.cms-active-template-templateF #app .main .hero .hero-content h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
  }

  body.cms-active-template-templateF #app .main .hero .hero-content p {
    font-size: 1.05rem;
  }

  body.cms-active-template-templateF #app .main .vf-hero-root {
    position: relative;
    overflow: hidden;
  }

  body.cms-active-template-templateF #app .main .vf-hero-media-backdrop {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
  }

  body.cms-active-template-templateF #app .main .vf-hero-media-backdrop-slide {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center center !important;
    background-color: transparent !important;
  }

  body.cms-active-template-templateF #app .main .vf-hero-media-backdrop-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--cms-image-overlay);
    pointer-events: none;
  }

  body.cms-active-template-templateF #app .main .vf-hero-container {
    position: relative;
    z-index: 2;
  }

  body.cms-active-template-templateF #app .main .vf-hero-root .hero-bg-elements {
    z-index: 0;
    opacity: 0.35;
  }

  body.cms-active-template-templateF #app .main .vf-hero-row {
    row-gap: 0;
  }

  body.cms-active-template-templateF #app .main .vf-hero-visual-col {
    display: none !important;
  }

  body.cms-active-template-templateF #app .main .vf-hero-content-col {
    position: relative;
    z-index: 2;
    margin-bottom: 0;
    text-align: center;
  }

  body.cms-active-template-templateF #app .main .vf-hero-content-col .hero-buttons {
    justify-content: center;
  }

  body.cms-active-template-templateF #app .main .vf-hero-root.vf-hero--stage-synced .vf-hero-content-stage {
    min-height: var(--vf-hero-stage-h);
  }

  /* About */
  body.cms-active-template-templateF #app .main .about .content h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  body.cms-active-template-templateF #app .main .about .image-composition {
    margin-top: 0.5rem;
  }

  /* Offer / Why us */
  body.cms-active-template-templateF #app .main .why-us .feature-content h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  /* Video — hero-sized frame in container */
  body.cms-active-template-templateF #app .main .vf-video-section {
    padding: 0 !important;
  }

  /* Team */
  body.cms-active-template-templateF #app .main .team .team-intro {
    margin-bottom: 1.5rem;
  }

  body.cms-active-template-templateF #app .main .team .join-team-cta {
    text-align: center;
  }

  /* Contact */
  body.cms-active-template-templateF #app .main .contact .row.align-items-center > [class*="col-lg-7"] {
    margin-top: 2rem;
  }
}

/* ── Mobile (≤767.98px) ── */
@media (max-width: 767.98px) {
  body.cms-active-template-templateF #app .main section,
  body.cms-active-template-templateF #app .main .section {
    padding: 40px 0;
  }

  body.cms-active-template-templateF #app .main .section-title {
    padding-bottom: 32px;
  }

  body.cms-active-template-templateF #app .main .section-title h2 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  body.cms-active-template-templateF #app .main .section-title p {
    font-size: 0.95rem;
  }

  /* Hero */
  body.cms-active-template-templateF #app .main .hero.section {
    padding: 72px 0 48px;
  }

  body.cms-active-template-templateF #app .main .hero .hero-content h1 {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    margin-bottom: 1rem;
  }

  body.cms-active-template-templateF #app .main .hero .hero-content p {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }

  body.cms-active-template-templateF #app .main .hero .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  body.cms-active-template-templateF #app .main .hero .hero-buttons .btn {
    width: 100%;
    text-align: center;
    padding: 12px 24px;
  }

  body.cms-active-template-templateF #app .main .vf-hero-carousel-nav {
    justify-content: center;
  }

  body.cms-active-template-templateF #app .main .vf-hero-facts-wrap {
    margin-top: 1.5rem !important;
  }

  /* About */
  body.cms-active-template-templateF #app .main .about .content {
    text-align: center;
  }

  body.cms-active-template-templateF #app .main .about .content .features-list li {
    justify-content: center;
    text-align: left;
  }

  body.cms-active-template-templateF #app .main .about .image-composition {
    padding: 0.5rem 0 0;
    margin-top: 1rem;
  }

  body.cms-active-template-templateF #app .main .about .image-composition .image-secondary {
    position: relative;
    width: 72%;
    margin: -1.5rem auto 0 0;
    left: auto;
    bottom: auto;
  }

  body.cms-active-template-templateF #app .main .about .image-composition .stats-card {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-top: 1.25rem;
    justify-content: center;
  }

  /* Services & Menu carousels */
  body.cms-active-template-templateF #app .main .services .services-cta {
    padding: 32px 20px;
  }

  body.cms-active-template-templateF #app .main #menu .nav-pills {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  body.cms-active-template-templateF #app .main #menu .nav-pills .nav-item {
    width: 100%;
  }

  body.cms-active-template-templateF #app .main #menu .nav-pills .nav-link {
    width: 100%;
    text-align: center;
  }

  /* Portfolio / Blog */
  body.cms-active-template-templateF #app .main .portfolio .portfolio-cta {
    margin-top: 40px;
    padding: 28px 20px;
  }

  body.cms-active-template-templateF #app .main .portfolio .portfolio-cta .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  body.cms-active-template-templateF #app .main .portfolio .portfolio-cta .cta-buttons .btn {
    width: 100%;
  }

  /* Offer / Why us */
  body.cms-active-template-templateF #app .main .why-us .feature-showcase {
    margin-bottom: 1.5rem;
  }

  body.cms-active-template-templateF #app .main .why-us .feature-content .cta-wrapper {
    flex-direction: column;
  }

  body.cms-active-template-templateF #app .main .why-us .feature-content .cta-wrapper .btn {
    width: 100%;
    text-align: center;
  }

  /* Video */
  body.cms-active-template-templateF #app .main .vf-video-media .vf-video-title,
  body.cms-active-template-templateF #app .main .vf-video-media h2 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    margin-bottom: 0.875rem !important;
  }

  /* Facts */
  body.cms-active-template-templateF #app .main .vf-fact-slide-card .stat-number {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  /* Team */
  body.cms-active-template-templateF #app .main .team .team-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 100%;
    padding-bottom: 0.5rem;
  }

  body.cms-active-template-templateF #app .main .team .team-grid .member-hexagon {
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  body.cms-active-template-templateF #app .main .team .team-grid .member-hexagon:nth-child(even) {
    margin-top: 0;
  }

  body.cms-active-template-templateF #app .main .team .team-grid .member-hexagon .hexagon-inner {
    width: clamp(160px, 42vw, 200px);
    height: clamp(160px, 42vw, 200px);
  }

  body.cms-active-template-templateF #app .main .team .vf-member-meta {
    margin-top: 1rem;
    padding-bottom: 0.25rem;
  }

  body.cms-active-template-templateF #app .main .team .team-carousel-wrapper {
    margin-top: 2.5rem;
    padding-top: 0.5rem;
  }

  body.cms-active-template-templateF #app .main .team .team-carousel-wrapper .carousel-title {
    margin-top: 0;
    margin-bottom: 1.25rem;
  }

  body.cms-active-template-templateF #app .main .team .team-carousel-wrapper .leadership-slider .swiper-slide {
    padding: 8px;
  }

  body.cms-active-template-templateF #app .main .team .join-team-cta .cta-content .cta-actions .btn {
    width: 100%;
    max-width: 280px;
  }

  /* Testimonials */
  body.cms-active-template-templateF #app .main .testimonials .testimonial-card {
    min-height: 0;
  }

  /* Newsletter */
  body.cms-active-template-templateF #app .main #newsletter form.row {
    flex-direction: column;
    align-items: stretch !important;
  }

  body.cms-active-template-templateF #app .main #newsletter form .col-md-6,
  body.cms-active-template-templateF #app .main #newsletter form .col-auto {
    width: 100%;
    max-width: 100%;
  }

  body.cms-active-template-templateF #app .main #newsletter form .btn {
    width: 100%;
  }

  /* Contact */
  body.cms-active-template-templateF #app .main .contact .contact-form-card {
    padding: 28px 20px;
  }

  body.cms-active-template-templateF #app .main .contact .contact-info-area .method-card {
    flex-direction: row;
    align-items: flex-start;
  }

  body.cms-active-template-templateF #app .main .contact .contact-info-area .method-card .card-content p,
  body.cms-active-template-templateF #app .main .contact .contact-info-area .method-card .card-content a {
    word-break: break-word;
  }

  body.cms-active-template-templateF #app .main .contact iframe,
  body.cms-active-template-templateF #app .main .contact .mt-4 iframe {
    width: 100% !important;
    max-width: 100%;
    min-height: 220px;
  }

  /* Swiper pagination tap targets */
  body.cms-active-template-templateF #app .main .vf-section-carousel .swiper-pagination-bullet,
  body.cms-active-template-templateF #app .main .vf-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    margin: 0 6px !important;
  }
}

/* ── Small mobile (≤575.98px) ── */
@media (max-width: 575.98px) {
  body.cms-active-template-templateF #app .main section,
  body.cms-active-template-templateF #app .main .section {
    padding: 32px 0;
  }

  body.cms-active-template-templateF #app .main .hero.section {
    padding: 64px 0 40px;
  }

  body.cms-active-template-templateF #app .main .hero .hero-bg-elements .bg-shape.shape-1 {
    width: 180px;
    height: 180px;
    top: -90px;
    right: -90px;
  }

  body.cms-active-template-templateF #app .main .hero .hero-bg-elements .bg-shape.shape-2 {
    width: 120px;
    height: 120px;
    bottom: -60px;
    left: -60px;
  }

  body.cms-active-template-templateF #app .main .about .content .btn-primary {
    display: block;
    width: 100%;
    text-align: center;
  }

  body.cms-active-template-templateF #app .main .services .service-card,
  body.cms-active-template-templateF #app .main .why-us .feature-card {
    padding: 24px 18px;
  }

  body.cms-active-template-templateF #app .main .vf-hero-nav-btn {
    width: 44px;
    height: 44px;
  }

  body.cms-active-template-templateF #app .main .vf-video-modal-backdrop {
    padding: 12px;
  }

  body.cms-active-template-templateF #app .main .contact .contact-form-card .php-email-form .row > [class*="col-md-6"] {
    width: 100%;
  }
}

/* ── Desktop refinements (≥992px) ── */
@media (min-width: 992px) {
  body.cms-active-template-templateF #app .main .vf-hero-row {
    min-height: 0;
  }

  body.cms-active-template-templateF #app .main .vf-hero-content-col,
  body.cms-active-template-templateF #app .main .vf-hero-visual-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  body.cms-active-template-templateF #app .main .vf-hero-root.vf-hero--stage-synced .vf-hero-visual-stage {
    min-height: var(--vf-hero-stage-h);
  }

  body.cms-active-template-templateF #app .main .vf-hero-root.vf-hero--stage-synced .vf-hero-visual-stage .vf-hero-image-fixed:not(.vf-hero-image-empty) {
    height: var(--vf-hero-stage-h);
    min-height: var(--vf-hero-stage-h);
  }
}

/* =================================================================
   CMS image fit — all dynamic sections (gap-free frames)
================================================================= */

body.cms-active-template-templateF #app .main .cms-template-f .vf-cms-media {
  display: block;
  overflow: hidden;
  line-height: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body.cms-active-template-templateF #app .main .cms-template-f .vf-cms-media img[data-cms-field] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent !important;
}

/* Hero right image — 840 × 420 */
body.cms-active-template-templateF #app .main .vf-hero-image-fixed.vf-cms-media[data-cms-aspect="hero.items.image"] {
  aspect-ratio: 840 / 420;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  background: transparent !important;
  overflow: hidden !important;
  line-height: 0 !important;
}

body.cms-active-template-templateF #app .main .vf-hero-root.vf-hero--stage-synced .vf-hero-visual-stage .vf-hero-image-fixed.vf-cms-media[data-cms-aspect="hero.items.image"]:not(.vf-hero-image-empty) {
  aspect-ratio: auto;
  height: var(--vf-hero-stage-h, 420px) !important;
  min-height: var(--vf-hero-stage-h, 420px) !important;
}

body.cms-active-template-templateF #app .main .vf-hero-image-fixed .vf-hero-image-cover,
body.cms-active-template-templateF #app .main .vf-hero-image-fixed img[data-cms-field="hero.items.image"] {
  position: absolute !important;
  inset: 0 !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: transparent !important;
}

/* About — 800 × 400 main (cover fills frame width; no side letterbox) */
body.cms-active-template-templateF #app .main .about .image-main.vf-about-main-media.vf-cms-media[data-cms-aspect="about.image"] {
  aspect-ratio: 800 / 400;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden;
  background: transparent !important;
  border-radius: 8px;
}

body.cms-active-template-templateF #app .main .about .image-main .vf-about-main-img,
body.cms-active-template-templateF #app .main .about .image-composition .image-main img.vf-about-main-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

body.cms-active-template-templateF #app .main .about .image-secondary img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain !important;
  background: transparent !important;
}

body.cms-active-template-templateF #app .main .about .vf-about-feature-icon.vf-cms-media[data-cms-aspect="about.features.icon_image"] {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

/* Services icons — 60 × 60 */
body.cms-active-template-templateF #app .main .services .service-icon.vf-cms-card-media.vf-cms-media[data-cms-aspect="services.items.icon_image"] {
  width: 80px;
  height: 80px;
  min-height: 80px;
  aspect-ratio: 1 / 1;
}

/* Menu listing cards — 840 × 280 landscape, fit without crop */
body.cms-active-template-templateF #app .main .services .service-icon.vf-cms-card-media.vf-cms-media[data-cms-aspect="menu.tabs.items.image"] {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 840 / 280;
}

body.cms-active-template-templateF #app .main .services .service-icon.vf-cms-card-media.vf-cms-media[data-cms-aspect="services.items.icon_image"] img.vf-cms-card-img,
body.cms-active-template-templateF #app .main .services .service-icon.vf-cms-card-media.vf-cms-media[data-cms-aspect="services.items.icon_image"] img[data-cms-field] {
  max-width: 100% !important;
  max-height: 64px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
}

body.cms-active-template-templateF #app .main .services .service-icon.vf-cms-card-media.vf-cms-media[data-cms-aspect="menu.tabs.items.image"] img.vf-cms-card-img,
body.cms-active-template-templateF #app .main .services .service-icon.vf-cms-card-media.vf-cms-media[data-cms-aspect="menu.tabs.items.image"] img[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: transparent !important;
}

/* Blog / portfolio — full width, natural height (840 × 280 spec) */
body.cms-active-template-templateF #app .main .portfolio .vf-blog-card-media.vf-blog-image-fixed {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: unset !important;
  overflow: hidden !important;
  background: transparent !important;
}

body.cms-active-template-templateF #app .main .portfolio .vf-blog-card-media img.vf-blog-card-image,
body.cms-active-template-templateF #app .main .portfolio .vf-blog-image-fixed img.vf-blog-card-image {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: unset !important;
  object-position: center center !important;
  background: transparent !important;
  display: block !important;
}

body.cms-active-template-templateF #app .main .portfolio .portfolio-wrapper:hover .vf-blog-card-media img.vf-blog-card-image {
  transform: none !important;
}

/* Offer showcase — 1920 × 1080 */
body.cms-active-template-templateF #app .main .why-us .feature-showcase.vf-cms-media[data-cms-aspect="offer.background"] {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
}

body.cms-active-template-templateF #app .main .why-us .feature-showcase img.vf-offer-showcase-img,
body.cms-active-template-templateF #app .main .why-us .feature-showcase img[data-cms-field="offer.background"] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block;
  background: transparent !important;
}

body.cms-active-template-templateF #app .main .why-us .vf-offer-feature-img {
  width: 40px;
  height: 40px;
  object-fit: contain !important;
  background: transparent !important;
}

/* Video — hero-sized media frame (840 × 420, same as hero image) */
body.cms-active-template-templateF #app .main .vf-video-section {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  background: transparent !important;
}

body.cms-active-template-templateF #app .main .vf-video-media.vf-video-media--hero-size,
body.cms-active-template-templateF #app .main .vf-video-media.vf-cms-media[data-cms-aspect="video.thumbnail"] {
  width: 100%;
  aspect-ratio: 840 / 420;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 20px;
  overflow: hidden;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.cms-active-template-templateF #app .main .vf-video-media--empty {
  background: color-mix(in srgb, var(--accent-color), transparent 88%) !important;
}

body.cms-active-template-templateF #app .main .vf-video-media .vf-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--cms-image-overlay);
  pointer-events: none;
}

body.cms-active-template-templateF #app .main .vf-video-media .vf-video-content {
  position: relative;
  z-index: 2;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  max-width: none;
  margin: 0 auto !important;
  padding: 1.5rem;
  text-align: center !important;
}

body.cms-active-template-templateF #app .main .vf-video-media .vf-video-title,
body.cms-active-template-templateF #app .main .vf-video-media h2 {
  margin-bottom: 1rem !important;
}

body.cms-active-template-templateF #app .main .vf-video-media .btn {
  margin-left: auto;
  margin-right: auto;
}

/* Team hex — cover faces in hex clip */
body.cms-active-template-templateF #app .main .team .hexagon-inner img[data-cms-field="team.items.image"],
body.cms-active-template-templateF #app .main .team .hexagon-inner img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background: transparent !important;
}

/* Team leader carousel — 400 × 400 */
body.cms-active-template-templateF #app .main .vf-leader-image-fixed.vf-cms-media[data-cms-aspect="team.items.image"] {
  aspect-ratio: 1 / 1;
  height: auto !important;
  min-height: 0 !important;
  width: 100%;
}

body.cms-active-template-templateF #app .main .vf-leader-image-fixed img.vf-cms-card-img-cover,
body.cms-active-template-templateF #app .main .vf-leader-image-fixed img[data-cms-field="team.items.image"] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  background: transparent !important;
}

/* Testimonials — 60 × 60 avatar */
body.cms-active-template-templateF #app .main .vf-testimonial-avatar.vf-cms-media[data-cms-aspect="testimonials.items.image"] {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

body.cms-active-template-templateF #app .main .vf-testimonial-avatar img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: inherit;
}

/* Facts carousel thumbs */
body.cms-active-template-templateF #app .main .vf-fact-thumb {
  max-height: 56px;
  width: auto;
  object-fit: contain !important;
  background: transparent !important;
}

/* Social icons in team */
body.cms-active-template-templateF #app .main .vf-social-icon-img {
  object-fit: contain !important;
  background: transparent !important;
}

@media (max-width: 767.98px) {
  /* Leadership carousel — match desktop square frame; cover fills card on narrow slides */
  body.cms-active-template-templateF #app .main .vf-leader-image-fixed.vf-cms-media[data-cms-aspect="team.items.image"] {
    aspect-ratio: 1 / 1;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
  }

  body.cms-active-template-templateF #app .main .vf-leader-image-fixed img.vf-cms-card-img-cover,
  body.cms-active-template-templateF #app .main .vf-leader-image-fixed img[data-cms-field="team.items.image"] {
    object-fit: cover !important;
    object-position: center center !important;
  }
}
