/* Fumi & Mixo — Shared responsive & interaction polish */

/* Logo — transparent asset; no visible bounding box on tinted surfaces */
.fm-logo,
header a img[src*="logo"],
footer img[src*="logo"] {
  display: block;
  background: transparent;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

section[id],
.service-card[id] {
  scroll-margin-top: 6.5rem;
}

body {
  overflow-x: hidden;
}

/* Sticky header */
header {
  z-index: 50;
}

#mobile-menu {
  z-index: 49;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.fm-menu-open {
  overflow: hidden;
}

#mobile-menu-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#mobile-menu a,
#mobile-menu button {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[data-pillar-card]:focus-visible,
[data-accordion-trigger]:focus-visible,
[data-tab]:focus-visible,
[data-filter-btn]:focus-visible {
  outline: 2px solid #b71032;
  outline-offset: 2px;
}

/* Hero sections — avoid excessive height on mobile */
@media (max-width: 767px) {
  main > section.pt-section-gap:first-of-type,
  main > section.pt-section-gap {
    padding-top: 3rem !important;
  }
}

/* Section spacing — mobile */
@media (max-width: 767px) {
  .py-section-gap {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  .mb-20 {
    margin-bottom: 2.5rem !important;
  }

  .mb-12 {
    margin-bottom: 2rem !important;
  }
}

/* Capability strip — card grid on small screens */
@media (max-width: 767px) {
  .fm-capability-strip {
    overflow-x: visible !important;
  }

  .fm-capability-inner {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0 !important;
    gap: 1rem 1.25rem;
    width: 100%;
  }

  .fm-capability-inner > a {
    white-space: normal;
    line-height: 1.35;
  }
}

/* Process timeline — vertical steps on mobile */
@media (max-width: 1023px) {
  .fm-process-grid {
    grid-template-columns: 1fr !important;
  }

  .fm-process-grid .hidden.lg\:block {
    display: none !important;
  }
}

/* Analytica / home dashboard preview — prevent overflow */
.fm-dashboard-preview {
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 767px) {
  .fm-dashboard-preview {
    height: auto !important;
    min-height: 260px;
  }

  .fm-dashboard-preview .flex-grow {
    min-height: 120px;
  }
}

/* Dashboard tabs — scrollable, tappable */
.fm-dashboard-tabs {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-wrap: nowrap;
}

.fm-dashboard-tabs [data-tab] {
  flex-shrink: 0;
  min-height: 44px;
}

/* Service category tabs */
.fm-service-tabs {
  -webkit-overflow-scrolling: touch;
}

/* Matter filters */
.fm-matter-filters {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fm-matter-filters [data-filter-btn] {
  min-height: 44px;
}

/* Experience environment cards — balanced 2-col on narrow */
.fm-experience-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 480px) {
  .fm-experience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .fm-experience-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Long labels — prevent overflow */
.font-label-md,
.font-label-sm {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Contact form — full width inputs on mobile */
@media (max-width: 767px) {
  #contact-form .fm-input,
  #contact-form .fm-select,
  #contact-form textarea {
    font-size: 16px;
  }

  #contact-form button[type="submit"] {
    width: 100%;
    min-height: 48px;
  }
}

/* Footer columns */
@media (max-width: 767px) {
  footer .grid {
    gap: 2rem;
  }
}

/* Analytics dashboard panels — stack cleanly */
@media (max-width: 767px) {
  .fm-analytics-dashboard [data-tab-panel] .grid {
    grid-template-columns: 1fr !important;
  }

  .fm-analytics-dashboard .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Pillar cards — touch-friendly (hover not required) */
@media (hover: none) {
  [data-pillar-card]:hover {
    transform: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-pillar-card] {
    transition: none;
  }
}
