/**
 * @file
 * TRS theme: The Restructuring Specialist.
 *
 * Port of the D7 page's <style> block and the inline styles of its header
 * and footer (now classes, as the header and footer are templates). The
 * page's sections keep their inline styles in the page body. Changes:
 * - the element-level rules (*, a, img) are scoped to the TRS header,
 *   footer and the home page's sections (.trs-home), so they cannot reach
 *   the administration bar, forms or other pages;
 * - Lora and DM Sans are served from this module (SIL Open Font License,
 *   see fonts/) instead of Google Fonts, which the site's CSP does not allow;
 * - the sticky header sits below the administration bar for administrators,
 *   and section links stop below the header (scroll-margin);
 * - on phones the section menu opens from a button (the D7 page hid it
 *   below 820px with nothing in its place).
 */

/* ---------- Typefaces ---------- */
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/lora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/lora-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/lora-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/lora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/lora-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/dm-sans-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/dm-sans-latin-600-normal.woff2') format('woff2'); }

/* ---------- Page ---------- */
html { scroll-behavior: smooth; }
body.theme-trs-theme { font-family: 'DM Sans', sans-serif; background: #fff; color: #4A4A4A; }
/* The D7 page left line-height at the browser's normal (core's base.css sets 1.5). */
.trs-header, .trs-footer, .trs-home { line-height: normal; }

/* The D7 page's reset and link colours, for the TRS parts only. */
.trs-header *, .trs-footer *, .trs-home * { box-sizing: border-box; margin: 0; padding: 0; }
.trs-header a, .trs-footer a, .trs-home a { color: #1F4F8E; text-decoration: none; }
.trs-header a:hover, .trs-footer a:hover, .trs-home a:hover { color: #0A3A5B; }
.trs-home img { max-width: 100%; }

/* The finpx wordmark. */
.fx { font-family: "Times New Roman", Times, serif !important; font-style: italic !important; font-weight: 400 !important; text-transform: lowercase !important; letter-spacing: 0 !important; line-height: 1; display: inline-flex; align-items: baseline; }
.fx span { font-family: inherit; font-style: inherit; text-transform: lowercase; }
.fx .f { color: #595959; font-size: calc(1em + 1pt); }
.fx .i { color: #595959; }
.fx .p { color: #760005; }
.fx .x { color: #cc8f00; }

/* Section links stop below the sticky header. */
.trs-home section[id] { scroll-margin-top: 74px; }
body.has-admin-menu .trs-home section[id] { scroll-margin-top: calc(74px + 2rem); }

/* ---------- Header ---------- */
.trs-header { background: #fff; border-bottom: 1px solid #D0D0D0; position: sticky; top: 0; z-index: 100; }
body.has-admin-menu .trs-header { top: 2rem; }
.trs-header__bar { padding: 10px 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.trs-header__left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.trs-header .trs-brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.trs-brand__logo { width: 52px; height: 52px; object-fit: contain; display: block; flex: none; }
.trs-brand__text { display: block; }
.trs-brand__name { display: block; font-family: 'Lora', serif; font-size: 16px; color: #0A3A5B; font-weight: 700; letter-spacing: 0.01em; line-height: 1.1; }
.trs-brand__tag { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.26em; color: #A5A5A5; margin-top: 3px; }
.trs-header__rule { width: 1px; height: 34px; background: #D0D0D0; flex: none; }
.trs-nav { display: flex; gap: 22px; align-items: center; }
.trs-header .trs-nav a { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #737373; }
.trs-header .trs-nav a:hover { color: #0A3A5B; }
.trs-header .trs-nav a.trs-nav__finpx { display: inline-flex; align-items: baseline; }
.trs-nav__finpx .fx { font-size: 15px; }
.trs-header a.trs-header__cta { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; padding: 11px 26px; background: #0A3A5B; color: #fff; white-space: nowrap; }
.trs-header a.trs-header__cta:hover { color: #fff; }
.trs-nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid #D0D0D0; background: #fff; color: #0A3A5B; cursor: pointer; flex: none; }

/* ---------- Footer ---------- */
.trs-footer { background: #EAF2F8; border-top: 1px solid #D0D0D0; padding: 28px 48px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.trs-footer__legal, .trs-footer__powered { font-size: 11px; letter-spacing: 0.08em; color: #0A3A5B; }
.trs-footer__powered { display: inline-flex; align-items: baseline; gap: 4px; }
.trs-footer__powered .fx { font-size: 13px; }

/* ---------- Other pages (site layout: log in, 404, Standard pages) ---------- */
.trs-page { max-width: 1200px; margin: 0 auto; padding: 40px 48px 56px; min-height: 50vh; }
.trs-page__body { display: flex; gap: 2rem; align-items: flex-start; }
.trs-page__main { flex: 1; min-width: 0; }
.trs-page .region-sidebar { flex: 0 0 15rem; min-width: 0; }
.trs-page .page-title { font-family: 'Lora', serif; color: #0A3A5B; font-size: 29px; font-weight: 700; }
.trs-page a { color: #1F4F8E; }
.trs-page a:hover { color: #0A3A5B; }

/* ---------- Phones and narrow windows (the D7 page's rules, plus the menu) ---------- */
@media (max-width: 820px) {
  .trs-home .grid2 { grid-template-columns: 1fr !important; }
  .trs-home .grid3 { grid-template-columns: 1fr !important; }
  .trs-home .grid4 { grid-template-columns: 1fr 1fr !important; }
  .trs-home .teamfeat { grid-template-columns: 1fr !important; }
  .trs-home .trackrec { grid-template-columns: 1fr !important; text-align: center; }
  .trs-home .worksplit { grid-template-columns: 1fr !important; }
  .trs-home section { padding-left: 22px !important; padding-right: 22px !important; }
  .trs-home h2.hero { font-size: 30px !important; }
  .trs-header__bar, .trs-footer { padding-left: 22px; padding-right: 22px; }
  .trs-page { padding-left: 22px; padding-right: 22px; }
  .trs-page__body { flex-direction: column; }

  .trs-header__rule { display: none; }
  .trs-nav-toggle { display: inline-flex; }
  .trs-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid #D0D0D0; box-shadow: 0 8px 20px rgba(10, 58, 91, 0.08); }
  .trs-nav.is-open { display: flex; }
  .trs-header .trs-nav a { padding: 14px 22px; border-top: 1px solid #F0F0F0; }
}
@media (max-width: 48rem) {
  /* The administration bar scrolls with the page here. */
  body.has-admin-menu .trs-header { top: 0; }
  body.has-admin-menu .trs-home section[id] { scroll-margin-top: 74px; }
}
@media (max-width: 520px) {
  .trs-header a.trs-header__cta { display: none; }
  .trs-header__bar { padding-top: 8px; padding-bottom: 8px; }
  .trs-brand__logo { width: 44px; height: 44px; }
}
@media print {
  .trs-header { position: static; }
  .trs-nav-toggle { display: none; }
}
