/* Libra Advisory — shared styles.
   Most of the design lives in style="" attributes on the pages themselves, exactly as it
   was drawn. This file holds what inline styles cannot do: fonts, hover and focus states,
   phone-size adjustments and the contact form's states. */

/* ---- Fonts --------------------------------------------------------------------------
   Self-hosted variable fonts (no Google Fonts request, so no visitor data leaves the site).
   Latin covers English and Dutch; Latin Extended loads only if a rarer character appears.
   Licence: SIL Open Font License 1.1 — see /assets/fonts/LICENSES.txt */
@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/cormorant-garamond-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/cormorant-garamond-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url(../fonts/cormorant-garamond-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url(../fonts/cormorant-garamond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url(../fonts/jost-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url(../fonts/jost-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Colours: white, black & dark navy -----------------------------------------------
   Every colour on the site comes from these variables, so a colour can be adjusted here. */
:root {
  --bg: #ffffff; --bg-alt: #f3f4f6; --ink: #111111; --band: #14284b; --btn-hover: #111111; --on-dark: #ffffff;
  --accent: #14284b; --accent-soft: #b9c4d6; --accent-text: #14284b; --brand-sub: #14284b;
  --border: #d9dce1; --rule: #d9dce1; --muted: #555b65; --sep: #9aa1ab; --error: #b42318; --focus: #3f6db5;
  --line-on-dark: rgba(255, 255, 255, .28); --outline-on-dark: rgba(185, 196, 214, .7);
  --logo-dark: #14284b; --logo-accent: #8aa0c2; --logo-light: #ffffff;
}

/* ---- Base (from the design) --------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-family: 'Jost', sans-serif; }
a { color: var(--ink); text-decoration: none; transition: color .2s, background .2s, border-color .2s; }
@media (hover: hover) { a:hover { color: var(--accent); } }
p, h1, h2, h3 { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.nw { white-space: nowrap; }   /* keeps "AI GOVERNANCE", "ISO/IEC 27001", "TU Delft" on one line */

/* ---- Accessibility ------------------------------------------------------------------ */
.skip { position: absolute; left: 16px; top: -80px; z-index: 10; padding: 12px 18px; background: var(--band); color: var(--on-dark); font-size: 15px; letter-spacing: .08em; }
.skip:focus { top: 12px; color: var(--on-dark); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
main:focus { outline: none; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* The EN | NL letters stay small, but the tappable area around the link is ~44px tall. */
.lang-link { position: relative; }
.lang-link::after { content: ""; position: absolute; inset: -12px -8px; }

/* Hover states from the design. Wrapped in (hover: hover) so a tap on a phone
   does not leave a card stuck in its hover colours. */
@media (hover: hover) {
  .hv1:hover { background:var(--btn-hover) !important;color:var(--on-dark) !important; }
  .hv2:hover { background:var(--band) !important;color:var(--on-dark) !important;border-color:var(--band) !important; }
  .hv3:hover { color:var(--on-dark) !important;border-top-color:var(--accent-soft) !important; }
  .hv4:hover { background:var(--bg) !important;color:var(--ink) !important;border-color:var(--on-dark) !important; }
  .hv5:hover { background:var(--bg) !important;color:var(--ink) !important;border-color:var(--accent) !important; }
  .hv6:hover { background:var(--btn-hover) !important; }
}
/* Keyboard users get the same visual change as mouse users. */
.hv1:focus-visible { background:var(--btn-hover) !important;color:var(--on-dark) !important; }
.hv2:focus-visible { background:var(--band) !important;color:var(--on-dark) !important;border-color:var(--band) !important; }
.hv3:focus-visible { color:var(--on-dark) !important;border-top-color:var(--accent-soft) !important; }
.hv4:focus-visible { background:var(--bg) !important;color:var(--ink) !important;border-color:var(--on-dark) !important; }
.hv5:focus-visible { background:var(--bg) !important;color:var(--ink) !important;border-color:var(--accent) !important; }
.hv6:focus-visible { background:var(--btn-hover) !important; }
.fc1:focus { border-bottom-color:var(--ink) !important; }

/* ---- Phones ------------------------------------------------------------------------- */
/* The logo is wider than it is tall, so on the narrowest phones (under 360px) it steps down a
   little to keep LIBRA ADVISORY on one line. */
@media (max-width: 359px) {
  .brand { gap: 10px !important; }
  .brand-mark { height: 34px !important; }
  html[data-logo="3"] .brand-mark { height: 28px !important; }   /* the wide Keystone arch */
}
/* The menu gets its own full-width row with slightly tighter spacing, so the longer Dutch
   labels and the EN | NL switch still fit on one line on a 360px-wide phone. */
@media (max-width: 480px) {
  .site-nav { width: 100%; justify-content: space-between; column-gap: 10px !important; letter-spacing: .12em !important; }
  .lang-box { padding: 5px 8px !important; gap: 5px !important; }
}
/* Small supporting text gets a little larger on narrow screens; desktop keeps the design sizes. */
@media (max-width: 640px) {
  .m-15 { font-size: 15px !important; }
  .m-155 { font-size: 15.5px !important; }
}

/* ---- Contact form ------------------------------------------------------------------- */
.field::placeholder { color: var(--muted); opacity: 1; }
.field:focus { box-shadow: 0 1px 0 0 var(--ink); }            /* underline thickens on focus */
.field.is-invalid { border-bottom-color: var(--error) !important; }
.field.is-invalid:focus { box-shadow: 0 1px 0 0 var(--error); }
button[disabled] { opacity: .7; cursor: progress; }
#sent:focus { outline: none; }   /* focused only so screen readers announce it */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Without JavaScript the form posts normally and the server sends the visitor back to
   #sent, #send-error or #form-invalid; these rules show the matching panel. */
#sent:target { display: flex !important; }
#contact-form:has(#sent:target) form { display: none; }
#send-error:target, #form-invalid:target { display: block !important; }

/* ---- Logo versions --------------------------------------------------------------------
   Each page carries all three logos, drawn in the --logo-* colours. /assets/js/switch.js sets
   data-logo on <html> from /site-switch.js (or ?logo= while that preview is on). */
.lv { display: none !important; }
html[data-logo="1"] .lv1, html[data-logo="2"] .lv2, html[data-logo="3"] .lv3 { display: block !important; }
html:not([data-logo]) .lv3 { display: block !important; }

/* ---- Preview bar (only while a preview in /site-switch.js is on) ---------------------- */
html[data-preview] body { padding-bottom: 84px; }
.preview-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 16px;
  max-width: calc(100vw - 24px); padding: 8px 12px; background: var(--band); color: var(--on-dark);
  border: 1px solid var(--accent-soft); box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  font: 400 13px/1 Jost, sans-serif; letter-spacing: .12em;
}
.preview-group { display: flex; align-items: center; gap: 6px; }
.preview-label { margin-right: 4px; white-space: nowrap; }
.preview-bar button {
  font: inherit; letter-spacing: .06em; color: var(--on-dark); background: transparent; cursor: pointer;
  border: 1px solid var(--line-on-dark); padding: 10px 12px; min-height: 40px; white-space: nowrap;
}
.preview-bar button[aria-pressed="true"] { background: var(--on-dark); border-color: var(--on-dark); color: var(--band); }
.preview-all { color: var(--accent-soft) !important; padding: 10px 6px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
@media (hover: hover) {
  .preview-bar button:hover { border-color: var(--accent-soft); }
  .preview-all:hover { color: var(--on-dark) !important; }
}
@media (max-width: 600px) { .preview-name { display: none; } }
@media (max-width: 420px) { .preview-label { display: none; } }
