/*
 * e-nwave — the new-work stylesheet. First occupant: the header wordmark.
 *
 * The wordmark's colour lives inside the two SVGs (assets/wordmark.svg is ink
 * for the light headers; assets/wordmark-light.svg is white for the dark
 * search header), so no colour is declared here.
 *
 * The height matches the lowercase band of the text the drawing replaces in
 * the frozen header. The image is left inline and baseline-aligned, so its
 * bottom sits exactly where the text ink sat and the header's line box still
 * sizes the row — nothing shifts.
 *
 * Change record: openspec/changes/add-header-wordmark/
 */

.site-wordmark img {
  height: 13px;
  width: auto;
  vertical-align: baseline;
}

/* The frozen sheets suppress the browser's focus ring on links, so the
 * wordmark supplies its own — currentColor is the ink on light headers. */
.site-wordmark:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Mobile menu bar — two fixes the frozen export left broken site-wide.
 *
 * 1. The icon. The theme's own rule draws the hamburger as `"\61"` in the
 *    ETmodules font (glyph "a" = three bars), but the shared frozen sheet
 *    styles/style-static.css carries a later override that swaps in the
 *    U+1F9FE receipt emoji instead. Restore the hamburger.
 * 2. The open state. The export's script bundle contains no toggle handler
 *    for the classic header, so a click had nothing to do; assets/site-nav.js
 *    now toggles `.mobile_nav` between closed/opened, and this rule reveals
 *    the menu when opened.
 *
 * Both rules are prefixed with `body` (not `#page-container`): Divi's
 * fixed-nav code clones the whole header — hamburger included — into a
 * `body > .et-fixed-header` element at desktop widths, and when the window
 * is then resized to mobile the CLONE's hamburger is the visible one. The
 * clone sits outside #page-container, so a scoped selector never reached
 * it (receipt emoji kept, and the open state had no rule either). `body`
 * raises specificity over the frozen sheets without excluding the clone. */
body .mobile_menu_bar::before {
  content: "\61";
}

body .mobile_nav.opened .et_mobile_menu {
  display: block;
}

/* Header dropdowns (Services / Solutions).
 *
 * The frozen theme opens submenus by adding an `.et-hover` class with its
 * nav script; that script is not present in this export, so the dropdowns
 * would never open. Pure-CSS hover does the same job; the `.et-hover`
 * selector stays for parity in case the class is ever added. */
#top-menu li.menu-item-has-children:hover > ul.sub-menu,
#top-menu li.et-hover > ul.sub-menu {
  display: block;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Generated service pages — the four stage titles.
 *
 * The template sizes these at 54px in four-up columns that narrow to ~168px
 * before the layout collapses (768px), and the frozen sheets carry
 * `overflow-wrap: break-word`, so any word wider than its column is split
 * mid-word ("Commissi/on", "Modernis/e"). The template's own words respected
 * that budget ("Validate" = 177px); the generated pages' longer words do not.
 * Fit-to-column sizing instead, measured against the longest generated word
 * ("Commission" = 5.06em): ~42px where the columns are widest, tapering to
 * 29px at the narrow end, with mid-word breaking disabled as a backstop.
 * Below 769px the template's own mobile sizes (32px/16px) already fit. */
@media (min-width: 769px) {
  #page-container .site-stage-title {
    font-size: clamp(29px, 3.1vw - 1px, 42px);
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
  }
}

/* The template's own stage titles (/service/, "Capture/Validate/Store/
 * Publish") fit their 54px columns at every width except the 769-860px
 * squeeze, where the demo's longest word ("Validate" = 3.28em) overflows the
 * ~157-177px columns and is split mid-word. Taper only inside that window;
 * the design's full 54px returns once the columns are wide enough. */
@media (min-width: 769px) {
  #page-container .site-stage-title-short {
    font-size: clamp(44px, 3.5vw + 11px, 54px);
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
  }
}

/* Landing-template pages — the hero H1s.
 *
 * The hero is a black hexagon (data-science-055.png, drawn `contain` on the
 * hero row) with the H1, a paragraph and the CTA stacked inside it — and its
 * sides taper, so a text line near the top or bottom has far less room than
 * one in the middle. Two constraints therefore have to hold at every width:
 *   1. the H1's own column (~313-450px on desktop) — long words must not be
 *      split mid-word;
 *   2. the hexagon's taper — between ~981 and ~1300px the hero row collapses
 *      to ~393-473px wide, the hexagon shrinks to ~455-548px tall, and the
 *      template's 80px H1 makes the block taller than the hexagon: text
 *      pokes out top and bottom, and the first/last lines cross the slanted
 *      edges (white text vanishing off the black shape).
 * The curves below were calibrated by probing all four pages at the pinch
 * widths and finding, for each, the largest H1 that keeps every glyph line
 * inside the hexagon (with margin). Piecewise because the required size
 * dips when the desktop grid collapses the row and recovers once the row
 * grows again; below 769px the template's mobile sizes already fit. */
#page-container .site-hero-title {
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

@media (min-width: 769px) {
  #page-container .site-hero-lede {
    font-size: clamp(13px, 1.2vw, 20px);
  }
}

/* On mobile widths the hexagon is height-bound (it draws at ~0.86x the row
 * height), which makes it narrower than the text column: the paragraph's
 * lines used to run the full column width and cross the vertical edges.
 * Cap the hero text width so every line stays inside the shape. */
@media (max-width: 768px) {
  #page-container .site-hero-title,
  #page-container .site-hero-lede {
    max-width: 60vw;
    margin-left: auto;
    margin-right: auto;
  }

  /* The lede ramps with width: 11px at the narrowest supported phones
   * (>=360px), reaching 16px once the hexagon has room. (Below 360px the
   * template is simply not a supported layout; the demo never fitted there
   * either.) */
  #page-container .site-hero-lede {
    font-size: clamp(11px, 2.14vw + 3.1px, 16px);
  }
}

@media (min-width: 769px) and (max-width: 980px) {
  #page-container .site-hero-title {
    font-size: 40px;
  }
}

@media (min-width: 981px) and (max-width: 1080px) {
  #page-container .site-hero-title {
    font-size: 28px;
  }
}

@media (min-width: 1081px) and (max-width: 1150px) {
  #page-container .site-hero-title {
    font-size: clamp(28px, 7.25vw - 50px, 33px);
  }
}

@media (min-width: 1151px) and (max-width: 1300px) {
  #page-container .site-hero-title {
    font-size: clamp(33px, 11.4vw - 98px, 50px);
  }
}

@media (min-width: 1301px) {
  #page-container .site-hero-title {
    font-size: clamp(50px, 13.4vw - 124px, 80px);
  }
}

/* Solution pages — the poster strip ("Collected. Preserved. Documented.").
 *
 * A 20vw Roboto Slab display block: the container is 98.6vw, so the design
 * fits any word up to ~4.93em — the landing page's longest, "Published.",
 * is 4.47em. The generated strips' "Documented." (5.64em) and "Defensible."
 * exceed the budget and were split mid-word. 16.5vw keeps the poster scale
 * while leaving headroom for a 5.64em word; breaking is disabled as a
 * backstop. (The landing page's own strip fits at 20vw and is untouched.) */
#page-container .site-display-strip .et_pb_text_inner {
  font-size: 16.5vw;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

/* Blog subscribe form. The form posts to the FormSubmit relay, which emails
 * every submission to contact@e-nwave.xyz and returns the visitor to
 * /blog/#subscribed — this note appears only when that fragment is targeted
 * (pure CSS, no script). */
.site-subscribe-note {
  display: none;
}

.site-subscribe-note:target {
  display: block;
  margin: 0.85em 0 0;
  color: #2aa88b;
}

/* The frozen export dressed this newsletter module for a dark hero but
 * placed it on the white section — the input drew white-on-white with no
 * border and the Subscribe button white-outlined transparent on white, so
 * both were effectively invisible at every width. Brand them for the light
 * surface instead: bordered input, solid teal button like the site's CTAs. */
/* The theme's script also binds an Enter-key handler to every
 * .et_pb_newsletter_field .input and preventDefaults it unconditionally, so
 * the email field carries a dedicated class too: out of the binding, full
 * styling declared here, and Enter submits normally again. */
#page-container .et_pb_signup_0 .site-subscribe-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 3px;
  color: #333333;
  font-family: inherit;
  font-size: 16px;
}

#page-container .et_pb_signup_0 .site-subscribe-input:focus {
  border-color: #41e2ba;
  outline: none;
}

/* The theme's script binds every .et_pb_newsletter_button click (and Enter
 * key in the fields) and swallows it for a Divi AJAX signup this static
 * export cannot run — the button looked dead. A dedicated class keeps the
 * button out of that binding; this rule carries the full styling the Divi
 * classes used to supply (teal, uppercase, like the site's CTAs). */
.site-subscribe-button {
  display: block;
  width: 100%;
  padding: 12px 28px;
  background-color: #41e2ba;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}

.site-subscribe-button:hover {
  background-color: #2fd0a8;
}

.site-subscribe-button:focus-visible {
  outline: 2px solid #1f9e80;
  outline-offset: 2px;
}

/* Contact form — same pure-CSS success-note pattern as the subscribe form.
 * The FormSubmit relay returns the visitor to /contact/#sent, and this note
 * appears only when that fragment is targeted. */
.site-contact-note {
  display: none;
}

.site-contact-note:target {
  display: block;
  margin: 0.85em 0 0;
  color: #2aa88b;
}

/* Mark invalid fields in red once the user has interacted with them
 * (native :user-invalid state), echoing the original Divi export's red
 * field borders — purely on top of the browser validation, no script.
 * :invalid alone would flag fields before any interaction, so only the
 * post-interaction state is styled. */
#page-container .et_pb_signup_0 .site-subscribe-input:user-invalid,
#page-container .et_pb_contact_form_container .input:user-invalid {
  border-color: #d64545;
}

/* Inline validation note. The browser's native validation already blocks a
 * bad send and floats its bubble on the first invalid field — but the bubble
 * vanishes with the next click, and the original export's own text block
 * ("Please, fill in the following fields:" / "Please, fix the following
 * errors:") was rendered by the dead WordPress AJAX. When any field is in
 * the native :user-invalid state, this line appears under the form of its
 * own accord — textual feedback without a script. Pure CSS via :has(); a
 * browser without :has() simply never shows it (the bubble and the red
 * borders still do the job), and it clears the moment the fields are valid
 * again. */
.site-form-error {
  display: none;
}

#page-container .et_pb_signup_0:has(.site-subscribe-input:user-invalid) .site-form-error,
#page-container .et_pb_contact_form_container:has(.input:user-invalid) .site-form-error {
  display: block;
  margin: 0.85em 0 0;
  color: #d64545;
}

/* Form relay chain — see openspec/changes/add-site-form-failover/.
 *
 * The two site forms deliver through an ordered relay chain
 * (assets/modules/site-forms.js). These rules style the module's states:
 *
 * 1. Direct-contact fallback. A hidden paragraph the module un-hides only
 *    when EVERY relay fails, then moves focus to it — so a visitor can
 *    still reach the owner with both relays down. The accent border is the
 *    site's CTA green without shouting "error": the message is "use this
 *    instead", not "you did something wrong".
 * 2. Busy state. While an attempt is in flight the submit control is
 *    disabled and carries `is-loading` (+ aria-busy, both set by the
 *    module). Opacity and cursor only — no animation, so there is nothing
 *    for prefers-reduced-motion to switch off.
 * 3. Focus targets. The confirmation notes and the fallback receive
 *    programmatic focus; the frozen sheets suppress default rings, so
 *    new-work elements supply their own (same pattern as .site-wordmark). */

/* Keep the hCaptcha widget clear of the frozen button rows on both forms
   (measured collision on contact + flush gap on blog). */
#page-container [data-site-form] .h-captcha {
  margin: 0.5em 0 1.25em;
}

.site-form-fallback {
  margin: 0.85em 0 0;
  padding: 0.75em 1em;
  border: 1px solid #41e2ba;
  color: #20292f;
}

.site-form-fallback[hidden] {
  display: none;
}

.site-form-fallback a {
  color: inherit;
}

#page-container [data-site-form] .is-loading {
  opacity: 0.7;
  cursor: progress;
  transition: none; /* the state change is instant — nothing for
                       prefers-reduced-motion to switch off */
}

#page-container .site-contact-note:focus,
#page-container .site-subscribe-note:focus,
#page-container .site-form-fallback:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
