/* builds.vex.com. Base tokens and the platform bar follow coding.vex.com (vex-coding-site/docs/platform-bar-spec.md);
   the top bar and footer come from vex-chrome.css, which loads after this file. */
/* --accent is the current platform's color (set on <html> by the build). Off a platform page it is the header's
   gray, not the spec's VEX teal: teal is also VEX GO's color, and here it made the home button look like GO. */
/* aktiv-grotesk (Adobe Fonts) replaces Arial once site.js confirms both weights loaded. */
html.brand-font { --font: "aktiv-grotesk", Arial, Helvetica, sans-serif; }
:root { --link: #006bb4; --ink: #172b35; --ink-2: #3c505b; --muted: #52636c; --paper: #f4f7f7; --line: #d6dfe1; --control: #80909a; --accent: #595959; --font: Arial, Helvetica, sans-serif; color-scheme: light; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2 { line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(30px, 3.4vw, 42px); }
h2 { font-size: 26px; }
h3 { font-size: 17px; line-height: 1.25; }
a:focus-visible, button:focus-visible { outline: 3px solid #1c78b3; outline-offset: 4px; border-radius: 4px; }
.container { width: min(1248px, 100%); margin-inline: auto; padding-inline: 28px; }
.skip-link { position: fixed; left: 16px; top: -90px; z-index: 50; padding: 12px 20px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
main { padding-block: 32px 24px; }
main:focus { outline: none; }
.site-header { position: relative; z-index: 20; }

/* Platform bar */
.platform-bar { background: #fff; border-bottom: 3px solid var(--accent); }
.platform-inner { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.home-link { display: flex; align-items: center; justify-content: center; align-self: stretch; width: 44px; flex-shrink: 0; color: var(--ink-2); text-decoration: none; }
.home-link svg { width: 22px; height: 22px; }
.home-link:hover, .home-link[aria-current="page"] { color: #fff; background: var(--accent); }
.platform-links { display: flex; align-self: stretch; align-items: stretch; gap: 4px; flex: 1; }
.platform-link { position: relative; isolation: isolate; flex: 1; min-width: max-content; max-width: 92px; display: flex; align-items: center; justify-content: center; padding: 10px 7px; text-decoration: none; }
.platform-link img { height: 15px; width: auto; max-width: none; }
.platform-link::before { content: ""; position: absolute; inset: 0 -2px; z-index: -1; background: var(--platform-color); transform: skewX(-17deg); opacity: 0; transition: opacity .15s; }
.platform-link:hover::before, .platform-link[aria-current="page"]::before { opacity: 1; }
.platform-link .tab-logo-white, .platform-link:hover .tab-logo, .platform-link[aria-current="page"] .tab-logo { display: none; }
.platform-link:hover .tab-logo-white, .platform-link[aria-current="page"] .tab-logo-white { display: block; }
.platform-bar :is(a, button):focus-visible { outline: 3px solid #1c78b3; outline-offset: 4px; border-radius: 4px; }
.platform-link:focus-visible { z-index: 1; }
.platform-toggle { display: none; }

/* Every page: the title with search beside it. Home: then one card per platform, three across and two down
   (two across on phones). */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.search { position: relative; flex: 0 1 420px; }
html:not(.js) .search { display: none; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 48px; padding: 0 16px 0 48px; background: #fff; border: 1px solid var(--control); border-radius: 8px; color: var(--ink); font: inherit; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus-visible { outline: 3px solid #1c78b3; outline-offset: 2px; }
.search-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.search-results[hidden] { display: none; }
.search-results a { display: flex; align-items: center; gap: 16px; height: 100%; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.search-results a:hover { border-color: var(--accent); }
.search-results img { width: 72px; height: 56px; object-fit: contain; flex-shrink: 0; }
.search-results strong { flex: 1; min-width: 0; line-height: 1.25; }
.search-results .result-logo { width: auto; height: 12px; }
.no-results { padding: 12px 0; color: var(--muted); }
.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 28px 0 0; padding: 0; list-style: none; }
.platform-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; }
.platform-card:hover, .platform-card:focus-visible { border-color: var(--platform-color); }
.platform-card:focus-visible { outline-offset: 3px; border-radius: 12px; }
.platform-card .card-art { display: flex; align-items: center; justify-content: center; flex: 1; padding: 24px 20px; background: var(--tint); }
.platform-card .card-art img { width: 100%; height: clamp(140px, 20vh, 220px); object-fit: contain; }
/* Every wordmark is one size (--k, set per logo, is 1 except for the taller CTE file). The foot is tall enough for
   the CTE logo, and each logo and arrow is centered in it. */
.platform-card .card-foot { --logo: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: calc(var(--logo) * 1.75 + 34px); padding: 16px 20px; border-top: 3px solid var(--platform-color); }
.platform-card .card-logo { height: calc(var(--logo) * var(--k, 1)); width: auto; min-width: 0; object-fit: contain; object-position: left center; }
.platform-card .card-foot svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--platform-color); }

/* Platform page */
.sections { margin-top: 20px; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* A page with grouped sections (VEX GO): one row per group, its name in a fixed column beside its links. */
.section-group { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: baseline; gap: 8px 16px; }
.section-group + .section-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.section-group-label { font-size: 14px; font-weight: 700; line-height: 36px; letter-spacing: 0; color: var(--ink-2); }
.section-nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; background: #fff; border: 1px solid var(--control); border-radius: 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.section-nav a:hover { border-color: var(--accent); color: #fff; background: var(--accent); }
.build-section { margin-top: 40px; scroll-margin-top: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); }
.section-head a { font-size: 14px; color: var(--link); }
.section-note { margin-top: 16px; padding: 12px 16px; background: #fff7df; border: 1px solid #e6c97a; border-radius: 8px; font-size: 16px; }
.section-note a { color: var(--link); }
.build-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 20px 0 0; padding: 0; list-style: none; }
.build-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.build-art { display: block; min-width: 0; padding: 16px 16px 0; overflow: hidden; }
.build-art img { width: 100%; height: 168px; object-fit: contain; }
.build-art:focus-visible { outline-offset: -4px; }
.build-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 12px 16px 16px; }
.build-body h3 a { text-decoration: none; }
.build-body h3 a:hover { text-decoration: underline; }
.build-text p { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.build-text .build-note { color: var(--ink); font-weight: 700; }
.build-text a { color: var(--link); text-underline-offset: 2px; }
.build-text a:hover { color: var(--ink); }
.build-card { scroll-margin-top: 16px; }
.build-card:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.build-links { margin: 16px 0 0; padding: 0; list-style: none; }
.build-links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.3; color: var(--link); text-decoration: none; }
.build-links a:hover { text-decoration: underline; color: var(--ink); }
.build-links svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent); }

/* Curriculum for the build: a tinted strip at the foot of the card, labeled, with plain text links. */
.build-lessons { min-width: 0; margin: 16px -16px -16px; padding: 12px 16px 16px; background: var(--paper); border-top: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.build-lessons p { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.build-lessons svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.build-lessons ul { margin: 4px 0 0; padding: 0; list-style: none; }
.build-lessons li { display: inline; }
.build-lessons li:not(:last-child)::after { content: ", "; }
.build-lessons a { color: var(--link); text-underline-offset: 2px; }
.build-lessons a:hover { color: var(--ink); }

/* Picture, title, description and links each share a row across the cards beside them, so the links
   start on one line however long a neighbor's title or description runs. */
@supports (grid-template-rows: subgrid) {
  .build-card { display: grid; grid-template-rows: subgrid; grid-row: span 5; row-gap: 0; }
  .build-body { display: contents; }
  .build-body h3 { min-width: 0; padding: 12px 16px 0; }
  .build-text { min-width: 0; padding: 0 16px; }
  .build-links { align-self: start; min-width: 0; margin: 16px 16px 16px; }
  .build-lessons { margin: 0; }
}

/* The section bar site.js adds on platform pages: the section links again, fixed to the top of the window once
   the ones under the title have scrolled away. Jumps leave room for it. */
html.has-section-bar { scroll-padding-top: 64px; }
.section-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 25; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 4px 12px #172b351a; }
.section-bar[hidden] { display: none; }
.section-bar-row { position: relative; display: flex; align-items: center; gap: 8px; height: 52px; white-space: nowrap; }
.section-bar a { flex: none; display: flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.section-bar a:hover { background: var(--paper); color: var(--ink); }
.section-bar a.is-current { background: var(--accent); color: #fff; }
/* Menus: one per group of sections, or a single one named for the current section when the window is narrow. */
.bar-menu { position: relative; flex: none; }
.bar-menu.is-wide { position: static; flex: 1; min-width: 0; }
.bar-menu button { display: flex; align-items: center; gap: 8px; max-width: 100%; height: 36px; padding: 0 12px; background: #fff; border: 1px solid var(--control); border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.bar-menu button span { overflow: hidden; text-overflow: ellipsis; }
.bar-menu button svg { width: 14px; height: 14px; flex-shrink: 0; }
.bar-menu button.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }
.bar-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 1; display: flex; flex-direction: column; min-width: 240px; max-height: calc(100dvh - 80px); padding: 8px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 28px #172b3526; }
.bar-panel[hidden] { display: none; }
.bar-menu.is-wide .bar-panel { top: 100%; left: 16px; right: 16px; }
/* Menu items wrap, so a long section name is never cut off; their corners nest inside the panel's. */
.bar-panel a { flex: none; height: auto; min-height: 40px; padding: 8px 12px; border-radius: 4px; white-space: normal; line-height: 1.3; }
.section-bar a.bar-button { border: 1px solid var(--control); }
.section-bar a.bar-button.is-current { border-color: var(--accent); }
.bar-panel-label { padding: 12px 12px 4px; font-size: 14px; font-weight: 700; color: var(--muted); }

/* Long pages: one way back to the section links and the platform bar. site.js shows it after a screen of scrolling. */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 15; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: #fff; border: 1px solid var(--control); border-radius: 8px; color: var(--ink-2); box-shadow: 0 4px 12px #172b3526; }
.to-top[hidden] { display: none; }
.to-top svg { width: 20px; height: 20px; }
.to-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* iubenda's US links below the footer (builds.vex.com only; IUBENDA_SCRIPT in scripts/build.mjs) are <button>s: its
   stylesheet sets their background but not their text color, which then comes from the visitor's browser settings and
   can be white on white. Set both here. iubenda never sets color, so this wins whichever stylesheet loads last. Its
   floating preferences button sits bottom-left (set in the iubenda dashboard), clear of .to-top. The strip they sit
   in is white like the footer above it, not the page's gray. */
.iub__us-widget__link { color: #000; background-color: #fff; }
.iub__us-widget { background-color: #fff; }

.not-found { padding-block: 48px; }
.not-found p { margin-top: 12px; }
.not-found a { color: var(--link); }

@media (max-width: 1100px) {
  .platform-inner { gap: 8px; }
  .platform-links { gap: 2px; }
  .platform-link img { height: 14px; }
  .build-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .container { padding-inline: 24px; }
  .platform-inner { position: relative; flex-wrap: wrap; gap: 0 12px; min-height: 53px; }
  .home-link { min-height: 50px; }
  .platform-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0; padding: 0 12px; border: 1px solid var(--control); border-radius: 8px; background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 700; }
  .platform-toggle { -webkit-user-select: none; user-select: none; }
  .platform-toggle svg { width: 15px; height: 15px; transition: transform .15s; }
  .platform-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  html:not(.js) .platform-toggle { display: none; }
  html:not(.js) .platform-links { display: grid; flex: 0 0 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding-bottom: 8px; }
  html.js .platform-links { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 8px 20px 16px; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 14px 28px #172b3526; max-height: max(160px, calc(100dvh - 160px)); overflow: auto; -webkit-user-select: none; user-select: none; }
  html.js .platform-links.is-open { display: grid; }
  .platform-link { max-width: none; min-height: 48px; padding: 12px 4px; }
  .platform-link img { height: 17px; }
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-card .card-art { padding: 16px; }
  .platform-card .card-art img { height: 140px; }
  .platform-card .card-foot { --logo: 20px; padding: 12px 16px; }
  .search { flex-basis: 100%; }
  .section-group { grid-template-columns: 1fr; gap: 0; }
  .section-group-label { line-height: 1.3; margin-bottom: 8px; }
  .build-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  h2 { font-size: 22px; }
  /* Touch sizes: links are 44px tall. */
  .section-nav a, .build-links a { min-height: 44px; }
  .build-lessons li { display: block; }
  .build-lessons li:not(:last-child)::after { content: none; }
  .build-lessons a { display: inline-block; padding: 8px 0; }
  .section-bar-row > a, .bar-menu button { height: 44px; }
  .bar-panel a { min-height: 44px; }
  .section-bar-row { height: 60px; }
  .section-group-label { font-size: 14px; }
}
@media (max-width: 520px) {
  .container { padding-inline: 16px; }
  main { padding-top: 24px; }
  .build-grid, .search-results { grid-template-columns: 1fr; }
  .platform-grid { gap: 12px; }
  .platform-card .card-art img { height: 104px; }
  .build-section { margin-top: 32px; }
}
@media (max-width: 360px) {
  .platform-links { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .platform-bar { forced-color-adjust: none; background: #fff; }
  .platform-bar a[aria-current="page"] { position: relative; }
  .platform-bar a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: Highlight; }
  .platform-bar :is(a, button):focus-visible { outline-color: Highlight; }
}
@media print {
  .platform-bar, .sections, .section-bar, .search, .to-top, .build-links svg { display: none; }
  body { background: #fff; }
  .build-card { break-inside: avoid; }
  /* On paper a link is its address. */
  .build-links a { display: block; min-height: 0; }
  .build-links a::after { content: " " attr(href); display: block; font-size: 11px; color: #000; word-break: break-all; }
  /* iubenda's cookie banner, its preferences panel, its floating button and the US links it adds below the footer.
     iubenda's stylesheet loads after this one and shows them with !important; an !important declaration in a layer
     outranks every unlayered one. */
  @layer print-overrides {
    #iubenda-cs-banner, #iubenda-iframe, .iubenda-tp-btn, .iubenda-uspr-btn, .iub__us-widget { display: none !important; }
  }
}
