/*! kestrel_custom.css - Kestrel Fastening Systems brand overlay (Tier 1)
 * Master (readable source): this file. Not minified.
 * Tier 1 of the re-skin escalation ladder, dw-demo-swift/references/re-skin.md.
 * Loaded by Custom/KestrelHeadInclude.cshtml AFTER default_custom.css, which is
 * the load order styles-assets.md requires.
 * Tier 0 (palette, typography, button shape) lives in the generated Style assets
 * under Files/System/Styles and is NOT duplicated here.
 * Authoring guards inherited from default_custom.css: G1 never type a comment
 * close sequence inside prose, G2 every block opens with an inert marker rule,
 * G3 mark a contested flex or display override important in every tier,
 * G4 never write an id selector that begins with a digit.
 */

/* === Block 1 - Kestrel token overrides.
 * These re-point theme-default's neutral tokens at the Kestrel palette. The
 * important flag is the documented safe form: a custom property declared
 * important beats a same-specificity :root in a template style block whatever
 * the source order, which is what keeps the head-include token copy honest. === */
[data-kfs-block="1"] { --kfs-marker: 1; }
:root {
  --td-ink:          #1B2733 !important;
  --td-ink-soft:     #14324F !important;
  --td-slate:        #2F5C7A !important;
  --td-slate-mid:    #2F5C7A !important;
  --td-slate-light:  #E2E7EB !important;
  --td-grey-light:   #F4F6F8 !important;
  --td-hairline:     #E2E7EB !important;
  --td-white:        #FFFFFF !important;
  --td-accent:       #14324F !important;
  --td-accent-soft:  rgba(20, 50, 79, .07) !important;

  /* Kestrel brand tokens, named for the brand sheet rather than the theme. */
  --kfs-primary:      #14324F;
  --kfs-primary-dark: #0D2237;
  --kfs-secondary:    #2F5C7A;
  --kfs-accent:       #E8B32B;
  --kfs-accent-dark:  #C6941A;
  --kfs-neutral-400:  #8895A1;
  --kfs-ink-on-light: #1B2733;
  --kfs-ink-on-dark:  #F4F6F8;
  --kfs-ink-on-accent:#14324F;
  --kfs-success:      #2E7D5B;
  --kfs-warning:      #B5701A;
  --kfs-danger:       #A33131;
}

/* === Block 2 - accent contrast.
 * The Style-asset generator derives --dw-color-button-primary-contrast itself and
 * emitted #000 over the accent fill. brand.md names ink-on-accent as #14324F.
 * The custom color id charset is letters, digits and underscore only, so a
 * hyphenated -contrast token cannot be authored through save_color_schemes and
 * has to be declared here. Retirement condition: drop this block if the style
 * tools ever accept a hyphenated custom color id or expose the contrast slot. === */
[data-kfs-block="2"] { --kfs-marker: 2; }
.dw-colorscheme-light, [data-dw-colorscheme="light"],
.dw-colorscheme-lightgrey1, [data-dw-colorscheme="lightgrey1"],
.dw-colorscheme-lightgrey2, [data-dw-colorscheme="lightgrey2"],
.dw-colorscheme-dark, [data-dw-colorscheme="dark"],
.dw-colorscheme-darksubtle, [data-dw-colorscheme="darksubtle"],
.dw-colorscheme-primary, [data-dw-colorscheme="primary"],
.dw-colorscheme-secondary, [data-dw-colorscheme="secondary"] {
  --dw-color-button-primary-contrast: #14324F;
  --dw-color-accent-contrast: #14324F;
}

/* === Block 3 - typeface fallback stacks.
 * The Typography Style asset emits a bare family name with no fallback, so a
 * blocked or slow webfont drops the page to the browser default rather than to
 * the stack brand.md specifies. Same selectors as the generated sheet, loaded
 * after it, so these win on source order without an important flag.
 * Retirement condition: drop this block if the typography model gains a
 * fallback-stack field. === */
[data-kfs-block="3"] { --kfs-marker: 3; }
body, .preview {
  --dw-font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6, .dw-h1, .dw-h2, .dw-h3, .dw-h4, .dw-h5, .dw-h6 {
  --dw-font-family: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
}
[data-dw-button], .btn {
  --dw-font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* === Block 4 - specification and price numerals.
 * brand.md: diameters, lengths, box quantities and prices align on the decimal.
 * Tabular figures are a font feature, not a layout change, so this is safe on
 * every surface that renders a number. === */
[data-kfs-block="4"] { --kfs-marker: 4; }
table, .table, .dw-price, [class*="price"], [class*="stock"], .product-specification {
  font-variant-numeric: tabular-nums;
}

/* === Block 5 - drawing numbers.
 * The hero beat. A drawing number renders in the body face, uppercase, with a
 * touch of tracking, and never italic. Applied by the class rather than by a
 * structural selector so it survives a template change. === */
[data-kfs-block="5"] { --kfs-marker: 5; }
.kfs-drawing-no {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

/* === Block 6 - logo overflow guard.
 * brand.md names a hardcoded inline logo width as the known mobile-overflow
 * offender. Measured on the served page, the Swift logo paragraph INLINES the
 * SVG inside a figure carrying style="width:180px" - there is no img element to
 * select on - so the cap goes on the figure and on the inlined svg itself.
 * Retirement condition: drop this block if the logo paragraph stops emitting an
 * inline width. === */
[data-kfs-block="6"] { --kfs-marker: 6; }
[data-dw-itemtype="swift-v2_logo"] figure {
  max-width: 100%;
}
[data-dw-itemtype="swift-v2_logo"] figure svg,
[data-dw-itemtype="swift-v2_logo"] figure img {
  max-width: 100%;
  height: auto;
}
