/* Fit — bespoke mini styles. Ported from the old Craft/Twig page + the legacy
   rules it actually relied on. Scoped under @layer page so the reset frame and
   Tailwind win predictably. */

@font-face {
  font-display: swap;
  font-family: "FitVariable";
  font-style: normal;
  font-weight: 100 900;
  src: url("Fit.woff2") format("woff2");
}

@layer page {
  /* ---- big variable-width display lines ---- */
  .fit figure {
    display: block;
    font-family: "FitVariable", sans-serif;
    font-variation-settings: "wdth" 482;
    font-size: 4.5in;
    line-height: 0.75em;
    margin: 0.75rem 0;
    padding: 0;
    position: relative;
    text-align: center;
    width: 100%;
    overflow: hidden;
  }

  .fit .big {
    font-size: 9in;
    text-shadow:
      -0.003em -0.003em 0, 0.003em -0.003em 0,
      -0.003em 0.003em 0, 0.003em 0.003em 0;
  }

  /* ---- section color frames ---- */
  .fit .gray {
    background: linear-gradient(180deg, #222, #090909);
    color: #fff;
  }
  .fit .gray a { color: #fcc; }
  .fit .gray a:hover,
  .fit .gray figure { color: #fff; }

  .fit .white { background: #fff; color: #000; }
  .fit .white a { color: #c00; }
  .fit .white a:hover { color: #e60000; }

  .fit .red { background: linear-gradient(180deg, #c00, #900); }
  .fit .red div,
  .fit .red figure,
  .fit .red span { color: #fff; }
  .fit .red a { color: #f66; }
  .fit .red a:hover { color: #fff; }

  .fit .black { color: #000; }

  .fit .red-hilite,
  .fit .red-hilite figcaption { color: #c00; }

  /* ---- layout wrappers ---- */
  .fit section {
    border-bottom: 0.5px solid #e8e8e8;
    border-top: 0.5px solid #e8e8e8;
    clear: both;
    overflow: hidden;
    padding: 2.5em 0;
  }
  .fit section:first-child { border-top: none; }
  .fit section:last-child { border-bottom: none; }

  .fit .wrapper {
    margin-left: auto;
    margin-right: auto;
    max-width: 61rem;
    padding-left: 2rem;
    padding-right: 2rem;
    position: relative;
  }
  .fit .wrapper-wide {
    max-width: 100rem !important;
    position: relative;
  }

  /* ---- hero title block ---- */
  .fit #fit-title { padding-bottom: 4em; }
  .fit #fit-title .wrapper { padding: 0.2em; }

  /* ---- resize box (inert; visual chrome only) ---- */
  .fit .resize-box {
    border: 1px solid #c00;
    padding: 0 0.5em;
    position: relative;
  }
  .fit .red .resize-box { border: 1px solid hsla(0, 0%, 100%, 0.7); }
  .fit .resize-box .handle {
    background: transparent;
    border: none;
    box-sizing: border-box;
    font-size: 0.5rem;
    position: absolute;
    z-index: 5;
  }
  .fit .resize-box .handle::after {
    background: #fff;
    border: 1px solid #c00;
    box-sizing: border-box;
    content: "";
    display: block;
    height: 0.5rem;
    position: absolute;
    width: 0.5rem;
  }
  .fit .red .handle::after {
    background: #bd0000;
    border: 1px solid hsla(0, 0%, 100%, 0.7);
  }
  .fit .resize-box .handle-e {
    bottom: 0; cursor: ew-resize; right: -0.5em; top: 0; width: 0.5rem;
  }
  .fit .resize-box .handle-e::after { top: calc(50% - 0.5em); }
  .fit .resize-box .handle-w { display: none !important; }

  /* ---- styles figure (svg + description) ---- */
  .fit #styles .font-desc {
    color: #fff;
    max-width: 27em;
    position: absolute;
    right: 4em;
    top: 1em;
  }
  .fit .fill {
    margin-left: -7.25%;
    max-width: 114.5%;
    width: 114.5%;
  }

  /* ---- language samples grid ---- */
  .fit #samples .lang-sample {
    float: left;
    margin-right: 1rem;
    padding: 0;
    width: calc(50% - 0.5rem);
  }
  .fit #samples .lang-sample:nth-of-type(2n) { margin-right: 0; }
  .fit #samples figure {
    font-size: 2.475in;
    height: 1.85625in;
    margin: 0.75rem 0;
  }
  .fit #charset figure { margin: 1.75rem 0; }
  .fit #charset figure:nth-of-type(2n) { color: #e6e6e6; }
  .fit #charset figure:nth-of-type(odd) { color: #fff; }

  /* ---- tester input ---- */
  .fit input.tester {
    border: 1px solid #000;
    display: block;
    font-family: "InputSansNarrow", sans-serif;
    font-size: 2rem;
    padding: 0.5rem;
    position: relative;
    width: calc(100% - 1rem - 2px);
    z-index: 1;
  }

  /* ---- inert hero CTA buttons ---- */
  .fit .try-buy-pdf a.button {
    -webkit-appearance: none;
    appearance: none;
    background: #c00;
    border: none;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-family: sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    margin: 1em 0.5em;
    padding: 0.6em 1em 0.4em;
    text-transform: uppercase;
  }
  .fit .try-buy-pdf a.button:hover,
  .fit .try-buy-pdf a.button:focus { background: #f33; color: #000; }

  /* ---- foreign-script SVG showings ---- */
  .fit #kannada svg,
  .fit #arabic svg,
  .fit #tamil svg,
  .fit #devanagari svg,
  .fit #armenian svg,
  .fit #hebrew svg { max-width: 100%; height: auto; display: block; }
  .fit #kannada p,
  .fit #arabic p,
  .fit #tamil p,
  .fit #devanagari p,
  .fit #armenian p,
  .fit #hebrew p { color: #fff; }

  /* ---- variable-font / icons two-column footer ---- */
  .fit #variable-font article {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 1rem 2.5rem;
    align-items: start;
  }
  .fit #variable-font .leftcol { margin: 0; }
  .fit #variable-font .leftcol img { max-width: 5rem; width: 100%; }
  .fit #variable-font .rightcol h3 { margin-top: 0; }

  /* ---- mobile ---- */
  @media screen and (max-width: 40rem) {
    .fit figure { font-size: 2.475in; }
    .fit .big { font-size: 4.95in; }
    .fit #styles .font-desc {
      max-width: inherit;
      padding: 2em 0 0;
      position: relative;
      right: inherit;
      top: inherit;
    }
    .fit #samples .lang-sample { float: none; width: inherit; }
    .fit #variable-font article { grid-template-columns: 1fr; }
  }
}
