/* faciotech.com public header, redesign f1 (owner-approved 22 Nov 2026).
   Markup: templates/faciotech/includes/header-nav.tpl. Behaviour: assets/js/ftcom-header.js.
   Every selector is scoped under the fth- prefix. No !important: nothing here overrides another
   stylesheet, because the old header rules were removed rather than fought.
   Desktop bar from 1024px; below that the bar is 64px and the menus live in the phone sheet. */

.fth,
.fth-sheet,
.fth-overlay {
  --fth-navy: #041133;
  --fth-blue: #0146C7;
  --fth-yellow: #FFD602;
  --fth-yellow-hover: #F2C800;
  --fth-bar-text: #DCE4F5;
  --fth-panel: #FFFFFF;
  --fth-text: #041133;
  --fth-muted: #526179;
  --fth-line: #D9E0EC;
  --fth-hover: #F4F6FA;
  --fth-tile: #EDF3FF;
  --fth-tile-fg: #0146C7;
  --fth-strip: #F4F6FA;
  --fth-input-line: #718199;
  --fth-focus-panel: #0146C7;
  --fth-shadow: 0 18px 44px rgba(4, 17, 51, .20);
}

/* Dark mode: the bar stays navy; panels and the sheet take the site's dark tokens
   (assets/css/faciotech-brand.css: [data-theme="dark"], html.ft-dark-mode). */
html.ft-dark-mode .fth,
html.ft-dark-mode .fth-sheet,
[data-theme="dark"] .fth,
[data-theme="dark"] .fth-sheet {
  --fth-panel: var(--ft-white, #0f1419);
  --fth-text: var(--ft-gray-900, #f0f3f6);
  --fth-muted: var(--ft-gray-700, #c9d1d9);
  --fth-line: var(--ft-gray-200, #2b333d);
  --fth-hover: var(--ft-gray-100, #1c232c);
  --fth-tile: rgba(127, 168, 255, .14);
  --fth-tile-fg: #9DBBFF;
  --fth-strip: var(--ft-gray-50, #161b22);
  --fth-input-line: var(--ft-gray-200, #2b333d);
  --fth-focus-panel: #9DBBFF;
}

/* ── Bar ── */
.fth {
  position: relative;
  z-index: 1040;
  background: var(--fth-navy);
  font-family: inherit;
}
.fth-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}
.fth-logo {
  display: flex;
  align-items: center;
  flex: none;
  height: 44px;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 8px;
}
.fth-logo img {
  display: block;
  height: 40px;
  width: auto;
}
.fth-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
}
.fth-nav {
  display: flex;
  align-items: center;
}
.fth-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fth-item {
  position: static;
}
.fth-tl {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fth-bar-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.fth-tl:hover,
.fth-tl[aria-expanded="true"] {
  background: rgba(255, 255, 255, .12);
  color: #FFFFFF;
}
.fth-chev {
  flex: none;
  transition: transform .18s ease;
}
.fth-tl[aria-expanded="true"] .fth-chev,
.fth-acc[aria-expanded="true"] .fth-chev {
  transform: rotate(180deg);
}
.fth-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.fth-login {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.fth-login:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, .10);
  text-decoration: none;
}
.fth-cta {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--fth-yellow);
  color: var(--fth-navy);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.fth-cta:hover {
  background: var(--fth-yellow-hover);
  color: var(--fth-navy);
  text-decoration: none;
}
.fth-burger,
.fth-sheet-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #FFFFFF;
  cursor: pointer;
}

/* Focus: yellow on navy, blue on the white panels. */
.fth-logo:focus-visible,
.fth-tl:focus-visible,
.fth-login:focus-visible,
.fth-cta:focus-visible,
.fth-burger:focus-visible,
.fth-sheet-head a:focus-visible,
.fth-sheet-close:focus-visible,
.fth-card a:focus-visible {
  outline: 2px solid var(--fth-yellow);
  outline-offset: 2px;
}
.fth-panel a:focus-visible,
.fth-panel input:focus-visible,
.fth-panel button:focus-visible,
.fth-sheet-body a:focus-visible,
.fth-sheet-body button:focus-visible,
.fth-sheet-foot a:focus-visible {
  outline: 2px solid var(--fth-focus-panel);
  outline-offset: 2px;
}
.fth-panel .fth-card a:focus-visible {
  outline-color: var(--fth-yellow);
}

/* ── Panels ── */
.fth-panel {
  position: absolute;
  top: 100%;
  left: 40px;
  right: 40px;
  margin-top: 8px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  box-sizing: border-box;
  background: var(--fth-panel);
  color: var(--fth-text);
  border: 1px solid var(--fth-line);
  border-radius: 14px;
  box-shadow: var(--fth-shadow);
  text-align: left;
}
.fth-panel[hidden] {
  display: none;
}
/* Narrow panels sit under their own button: ftcom-header.js sets --fth-x on open and the clamp
   keeps them inside the bar. Without JS they open at the bar's left padding. */
.fth-panel--grid,
.fth-panel--plain {
  right: auto;
  width: 640px;
  max-width: calc(100% - 48px);
  left: clamp(24px, var(--fth-x, 40px), calc(100% - 640px - 24px));
}
.fth-panel--plain {
  width: 620px;
  left: clamp(24px, var(--fth-x, 40px), calc(100% - 620px - 24px));
}
.fth-cols {
  display: grid;
  gap: 24px;
  padding: 24px 24px 20px;
}
.fth-cols--1 { grid-template-columns: minmax(0, 1fr); }
.fth-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fth-cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fth-cols--2.fth-cols--card { grid-template-columns: repeat(2, minmax(0, 1fr)) 290px; }
.fth-cols--3.fth-cols--card { grid-template-columns: repeat(3, minmax(0, 1fr)) 290px; }
.fth-panel--grid .fth-cols {
  padding: 20px;
}
.fth-panel--grid .fth-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.fth-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fth-col > .fth-h ~ .fth-h {
  margin-top: 12px;
}
.fth-h {
  margin: 0;
  padding: 0 12px 4px;
  color: var(--fth-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}
.fth-rows,
.fth-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fth-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--fth-text);
  text-decoration: none;
}
.fth-row:hover {
  background: var(--fth-hover);
  color: var(--fth-text);
  text-decoration: none;
}
.fth-ico {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--fth-tile);
  color: var(--fth-tile-fg);
}
.fth-ico--sm {
  width: 32px;
  height: 32px;
}
.fth-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fth-name {
  color: var(--fth-text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}
.fth-desc {
  color: var(--fth-muted);
  font-size: 13px;
  line-height: 18px;
}

/* Card (Hosting, Software) */
.fth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 12px;
  background: var(--fth-navy);
  color: #DCE4F5;
}
.fth-card-title {
  margin: 0;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 800;
}
.fth-card-text {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
}
.fth-card-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.fth-btn-yellow,
.fth-btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
}
.fth-btn-yellow {
  background: var(--fth-yellow);
  color: var(--fth-navy);
  font-weight: 800;
}
/* Card links: an arrow and an underline on hover, as the my.faciotech.com header (owner ruling 23 Nov, ee03c39b5). */
.fth-btn-yellow:hover {
  background: var(--fth-yellow-hover);
  color: var(--fth-navy);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.fth-btn-ghost {
  border: 1px solid rgba(255, 255, 255, .32);
  color: #FFFFFF;
  font-weight: 700;
}
.fth-btn-ghost:hover {
  background: rgba(255, 255, 255, .10);
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Strip (Services) */
.fth-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--fth-line);
  background: var(--fth-strip);
  color: var(--fth-muted);
  font-size: 14px;
}
.fth-strip-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--fth-blue);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.fth-strip-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
html.ft-dark-mode .fth-strip-link,
[data-theme="dark"] .fth-strip-link {
  color: var(--fth-tile-fg);
}

/* Domain search (Domains) */
.fth-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 24px 0;
}
.fth-search-label {
  margin: 0;
  color: var(--fth-text);
  font-size: 15px;
  font-weight: 800;
}
.fth-search-row {
  display: flex;
  gap: 8px;
}
.fth-search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--fth-input-line);
  border-radius: 8px;
  background: var(--fth-panel);
  color: var(--fth-text);
  font: inherit;
  font-size: 15px;
}
.fth-search-btn {
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--fth-blue);
  color: #FFFFFF;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* Plain links (Company) */
.fth-plain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 24px 28px;
}
.fth-plain .fth-h {
  padding: 0 0 4px;
}
.fth-plain .fth-links {
  gap: 0;
}
.fth-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--fth-text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.fth-link:hover {
  color: var(--fth-blue);
  text-decoration: none;
}
html.ft-dark-mode .fth-link:hover,
[data-theme="dark"] .fth-link:hover {
  color: var(--fth-tile-fg);
}

/* Overlay under the open panel */
.fth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(4, 17, 51, .36);
}
.fth-overlay[hidden] {
  display: none;
}

/* ── Phone sheet ── */
/* A modal dialog: above every floating widget, incl. the AI chat button (chat-widget.css, up to 10000 on
   phones), which otherwise covers the sheet's Get Started. tests/ftcom-header.test.cjs holds this. */
.fth-sheet {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  background: var(--fth-panel);
  color: var(--fth-text);
  font-family: inherit;
}
.fth-sheet[hidden] {
  display: none;
}
.fth-sheet-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 12px 0 16px;
  background: var(--fth-navy);
}
.fth-sheet-head .fth-cta {
  margin-left: auto;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
}
.fth-sheet-close {
  display: flex;
}
.fth-sheet-body {
  flex: 1;
  overflow: auto;
  padding: 8px 16px 16px;
  overscroll-behavior: contain;
}
.fth-acc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--fth-line);
  background: transparent;
  color: var(--fth-text);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.fth-acc-panel {
  margin: 0;
  padding: 8px 0 12px;
  list-style: none;
}
.fth-acc-panel[hidden] {
  display: none;
}
.fth-acc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--fth-text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.fth-acc-link:hover {
  color: var(--fth-text);
  background: var(--fth-hover);
  text-decoration: none;
}
.fth-sheet-foot {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--fth-line);
}
.fth-sheet-login,
.fth-sheet-cta {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.fth-sheet-login {
  border: 1px solid var(--fth-blue);
  color: var(--fth-blue);
}
html.ft-dark-mode .fth-sheet-login,
[data-theme="dark"] .fth-sheet-login {
  border-color: var(--fth-tile-fg);
  color: var(--fth-tile-fg);
}
.fth-sheet-cta {
  background: var(--fth-yellow);
  color: var(--fth-navy);
}
.fth-sheet-login:hover,
.fth-sheet-cta:hover {
  text-decoration: none;
}
html.fth-locked,
html.fth-locked body {
  overflow: hidden;
}

/* ── Widths ── */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .fth-bar { gap: 16px; padding: 0 24px; }
  .fth-tl { padding: 0 10px; }
  .fth-panel { left: 24px; right: 24px; }
  .fth-cols--3.fth-cols--card { grid-template-columns: repeat(3, minmax(0, 1fr)) 240px; }
  .fth-cols--2.fth-cols--card { grid-template-columns: repeat(2, minmax(0, 1fr)) 240px; }
}
@media (max-width: 1023.98px) {
  .fth-bar { height: 64px; gap: 8px; padding: 0 12px 0 16px; }
  .fth-nav,
  .fth-login { display: none; }
  .fth-actions { gap: 8px; }
  .fth-actions .fth-cta { padding: 0 14px; font-size: 14px; }
  .fth-burger { display: flex; }
  .fth-overlay { display: none; }
}
@media (max-width: 359.98px) {
  .fth-logo img { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .fth-chev { transition: none; }
}
@media print {
  .fth-overlay,
  .fth-sheet,
  .fth-burger,
  .fth-panel { display: none; }
}
