/* V3 components — the shared-chrome rules mockup 14 uses across every
 * page: utility bar, nav, buttons, contact-form field styling, footer,
 * and the back-to-top button. Section-scoped rules live in sections.css.
 */

/* -----------------------------------------------------------------
 * CHROME-INCLUDE WRAPPERS
 * chrome.js injects each partial into a <div data-include="…"> wrapper
 * and keeps that wrapper in the DOM. `display: contents` makes the
 * wrapper transparent to layout, so children (e.g. the sticky .nav or
 * the <footer>) participate in body-level flow instead of being sized
 * by the wrapper — which is what makes `position: sticky` on the nav
 * actually stick past its own height.
 * ---------------------------------------------------------------*/
[data-include] {
  display: contents;
}

/* -----------------------------------------------------------------
 * UTILITY BAR
 * ---------------------------------------------------------------*/
.utility-bar {
  background: var(--ink);
  color: #fff;
  font-family: var(--chrome-sans);
  font-size: 12.5px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.utility-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.utility-bar a {
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.utility-bar a:hover {
  color: #fff;
}
.utility-bar .u-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
}
/* bootstrap-icons in the utility bar — match the surrounding text size. */
.utility-bar .bi {
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.35);
}
.lang-switch .lang-globe {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}
.lang-switch .lang-div {
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
}
.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.lang-switch button img {
  height: 20px;
  width: auto;
  display: block;
  border-radius: 2px;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.lang-switch button:hover img {
  opacity: 0.85;
}
.lang-switch button.lang-active img {
  opacity: 1;
}
@media (max-width: 700px) {
  .utility-inner {
    justify-content: center;
    gap: 14px;
    font-size: 12px;
  }
  .utility-bar .u-sep {
    display: none;
  }
}

/* Booking modal (V2's booking.js opens/closes this — markup lives in the
 * utility-bar partial so any Schedule link on any page just works). */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
.modal-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 80%;
  max-width: 95%;
  max-height: 95%;
  background: var(--paper);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}
.modal-container .close-btn {
  float: right;
  cursor: pointer;
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
}
.modal-container .modal-title {
  color: var(--ink);
  font-family: var(--serif);
  margin: 0 0 8px;
}
.modal-container .modal-content {
  width: 100%;
  height: 85%;
  border: none;
}

/* -----------------------------------------------------------------
 * NAV
 * ---------------------------------------------------------------*/
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--chrome-sans);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-logo {
  display: flex;
  align-items: center;
  height: 72px;
  padding: 10px 0;
  box-sizing: border-box;
}
.nav-logo img {
  height: 100%;
  width: auto;
  display: block;
}
.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}
/* Each top-level nav entry — plain link or dropdown parent — is wrapped
 * in a .nav-item so the dropdown panel can position itself relative to
 * its parent, and so hover/click state is scoped correctly. */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-item > a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-item > a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--red);
  transition: width 0.2s ease;
}
.nav-item > a:not(.nav-cta):hover::after,
.nav-item.active > a:not(.nav-cta)::after {
  width: 100%;
}
.nav-item > a.nav-cta {
  background: var(--red);
  color: #fff !important;
  padding: 5px 10px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
}
.nav-item > a.nav-cta:hover {
  background: var(--red-dark);
}
.nav-item.active > a {
  color: var(--red);
}
.nav-chev {
  font-size: 11px;
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.nav-item.has-dropdown:hover .nav-chev,
.nav-item.has-dropdown.open .nav-chev {
  transform: rotate(180deg);
}

/* Dropdown panel. Sits directly under the parent's top-level anchor,
 * hidden by opacity + pointer-events until the .nav-item is hovered
 * (or .open on mobile). A small hover-buffer above keeps it from
 * closing when the cursor crosses the gap between anchor and panel. */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.18);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s;
  z-index: 60;
}
.nav-item.has-dropdown:hover .nav-dropdown,
.nav-item.has-dropdown:focus-within .nav-dropdown,
.nav-item.has-dropdown.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0s;
}
.nav-dropdown::before {
  /* Invisible hit-buffer so the panel doesn't close when the cursor
   * bridges the 6px gap between the parent link and the dropdown top. */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}
.nav-dropdown a {
  display: block;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  white-space: nowrap;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.nav-dropdown a:hover {
  background: var(--paper-2);
  color: var(--red);
}
.nav-dropdown a.nav-dd-all {
  color: var(--red);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}
.nav-dropdown a.nav-dd-all:hover {
  background: transparent;
  color: var(--red-dark);
}
.nav-dropdown .nav-dd-group {
  padding: 12px 14px 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}
/* Anchor the second (Industries) dropdown so it doesn't fall off the
 * right edge of the viewport on narrower desktop widths. */
.nav-item:nth-of-type(2) .nav-dropdown {
  left: auto;
  right: 0;
}

/* Hamburger button — hidden at desktop, revealed by the 1024px block
 * below. The <i class="bi-x"> child stays hidden until .open swaps it
 * with .bi-list so the icon flips between hamburger and close. */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  align-items: center;
  justify-content: center;
}
.nav-toggle .bi {
  display: inline-flex;
}
.nav-toggle .hidden {
  display: none;
}
.nav-toggle:hover {
  color: var(--red);
}

/* -----------------------------------------------------------------
 * BUTTONS
 * ---------------------------------------------------------------*/
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s ease;
  line-height: 1;
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(237, 28, 36, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn-ghost:hover {
  border-color: var(--ink);
}

/* -----------------------------------------------------------------
 * CONTACT FORM (field styling — the form markup itself lives in
 * v3/components/contact-form.html; the section wrapper is in
 * sections.css § .contact)
 * ---------------------------------------------------------------*/
.contact-form {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 40px;
}
.contact-form h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  font-style: italic;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--sans);
  border: 1.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--red);
}
.field textarea {
  min-height: 110px;
  resize: vertical;
}
.contact-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
.field .req {
  color: var(--red);
  margin-left: 2px;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236b6b70' stroke-width='1.75'><path d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.form-consent {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 6px 0 14px;
}

/* Form success state — swapped in by site.js after intercepting submit. */
.form-thanks {
  padding: 24px;
  background: var(--red-soft);
  border: 1px solid rgba(237, 28, 36, 0.3);
  border-radius: 12px;
  text-align: center;
}
.form-thanks h3 {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  margin: 0 0 8px;
}
.form-thanks p {
  color: var(--muted);
  margin: 0;
}

/* -----------------------------------------------------------------
 * FOOTER
 * ---------------------------------------------------------------*/
footer {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 64px 0 32px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.foot-brand img {
  height: 65px;
  /* Force width to derive from height so the logo keeps its natural aspect
     ratio. Without this, some browsers fall back to the HTML `width="956"`
     attribute as a literal pixel width when CSS only sets height — the
     logo renders ~14.7:1 instead of its natural ~4.57:1 and looks stretched
     horizontally. Same class of bug as the about-band img fix. */
  width: auto;
  margin-bottom: 18px;
}
.foot-brand p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.6;
}
.foot-col h5 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000;
  font-weight: 800;
  margin: 0 0 14px;
}
/* Second sub-heading inside the same .foot-col (About Us + Resources
 * stacked). Gets an extra top spacer so it doesn't crowd the list above. */
.foot-col h5 + ul + h5 {
  margin-top: 22px;
}
.foot-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.foot-col li {
  margin-bottom: 8px;
}
.foot-col a,
.foot-col .foot-line {
  font-size: 14px;
  color: var(--muted);
}
.foot-col a:hover {
  color: var(--red);
}
.foot-col a strong {
  color: var(--ink);
  font-weight: 700;
  transition: color 0.15s ease;
}
.foot-col a:hover strong {
  color: var(--red);
}
.foot-col .foot-line {
  display: block;
}
.foot-social-row {
  margin-top: 12px;
  text-align: center;
}
.foot-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}
.foot-social svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  display: block;
}
.foot-social:hover {
  color: var(--red);
  transform: translateY(-1px);
}
.foot-legal {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  gap: 12px;
  flex-wrap: wrap;
}
.foot-legal a {
  margin-left: 18px;
}
.foot-legal a:hover {
  color: var(--red);
}

@media (max-width: 1024px) {
  .foot-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Mobile / narrow-tablet nav: reveal the hamburger toggle; drop the
   * inline links into a stacked panel that slides down from the nav
   * baseline. .nav-open (site.js sets this on click) reveals it. */
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 72px; /* matches .nav-inner height */
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.12);
    transition:
      max-height 0.3s ease,
      padding 0.3s ease;
  }
  .nav-links.nav-open {
    max-height: min(85vh, 900px);
    overflow-y: auto;
    padding: 8px 24px 20px;
  }
  .nav-item {
    display: block;
  }
  .nav-item > a,
  .nav-item > a.nav-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--rule);
    /* Kill pill styling on mobile — nav-cta reads as a plain link
     * inside the drawer so the taxonomy is flat and consistent. */
    background: transparent !important;
    color: var(--ink) !important;
    border-radius: 0;
  }
  .nav-item:last-child > a {
    border-bottom: none;
  }
  .nav-item > a:not(.nav-cta)::after {
    display: none;
  }
  .nav-item > a.nav-cta:hover {
    background: transparent;
    color: var(--red) !important;
  }
  .nav-item > a:hover {
    color: var(--red) !important;
  }

  /* Dropdowns become accordion sub-lists in the drawer.
   * Static (not absolute) so they push siblings down; hidden until
   * site.js adds .open on the parent .nav-item via a chevron tap. */
  .nav-item.has-dropdown .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 8px 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
  }
  .nav-item.has-dropdown.open .nav-dropdown {
    max-height: 720px;
  }
  .nav-item.has-dropdown .nav-dropdown::before {
    display: none;
  }
  .nav-item.has-dropdown .nav-dropdown a {
    padding: 10px 6px;
    font-size: 14px;
    color: var(--ink-2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0;
  }
  .nav-item.has-dropdown .nav-dropdown a:hover {
    background: transparent;
  }
  .nav-item.has-dropdown .nav-dropdown a.nav-dd-all {
    padding: 8px 6px 10px;
    margin-bottom: 2px;
  }
  .nav-item.has-dropdown .nav-dropdown .nav-dd-group {
    padding: 12px 6px 4px;
    margin-top: 4px;
  }
}
@media (max-width: 640px) {
  .foot-grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------
 * BACK TO TOP
 * ---------------------------------------------------------------*/
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background 0.15s ease;
}
.to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.to-top:hover {
  background: #000;
  transform: translateY(-2px);
}
.to-top svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 600px) {
  .to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

/* Skip link — first focusable element in the injected chrome, so keyboard and
   screen-reader users can jump past the nav to <main id="main"> (WCAG 2.4.1).
   Visually hidden until focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--color-surface, #fff);
  color: var(--color-text, #111);
  border: 2px solid currentColor;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* <main> takes tabindex="-1" so following the skip link moves focus, not just
   the viewport. It must never show a focus ring from that programmatic focus. */
main:focus {
  outline: none;
}
