/* Header and footer of the public pages (index.html, resources.html, pricing,
   articles, discussion room, practice-by-subject pages…). Behaviour is in
   site-header.js. The menus are plain links in the page, so search engines
   read them all.
   Class names start with lx- so they don't clash with the pages' own styles. */
:root {
  --lx-navy: #14243d;
  --lx-ink: #1a202c;
  --lx-muted: #4a5568;
  --lx-line: #e2e8f0;
  --lx-gold: #d69e2e;
  --lx-burg: #7c2d3a;
}

/* ---------- Header ---------- */
.lx-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
  background: #fff; border-bottom: 1px solid var(--lx-line);
  box-shadow: 0 1px 3px rgba(15,35,64,.06);
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.lx-header a { text-decoration: none; }
.lx-wrap { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
/* Same widths as Bootstrap's .container, so the logo lines up with the page content */
.lx-wrap, .lx-fwrap { width: 100%; margin: 0 auto; padding: 0 12px; }
@media (min-width: 576px) { .lx-wrap, .lx-fwrap { max-width: 540px; } }
@media (min-width: 768px) { .lx-wrap, .lx-fwrap { max-width: 720px; } }
@media (min-width: 992px) { .lx-wrap, .lx-fwrap { max-width: 960px; } }
@media (min-width: 1200px) { .lx-wrap, .lx-fwrap { max-width: 1140px; } }
@media (min-width: 1400px) { .lx-wrap, .lx-fwrap { max-width: 1320px; } }
.lx-brand { display: flex; align-items: center; gap: 9px; color: var(--lx-navy) !important; flex-shrink: 0; }
.lx-brand svg { width: 38px; height: 38px; }
.lx-brand-name { font: 700 1.45rem/1 'Libre Baskerville', Georgia, 'Times New Roman', serif; letter-spacing: -.5px; display: block; }
.lx-brand-tag { display: flex; align-items: center; gap: 6px; font: 500 .68rem 'Inter', sans-serif; color: var(--lx-muted); letter-spacing: .4px; margin-top: 3px; }
.lx-brand-tag::before, .lx-brand-tag::after { content: ''; width: 10px; height: 1px; background: #87a4c8; }

.lx-panel { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 24px; }
.lx-links { display: flex; align-items: center; justify-content: space-evenly; flex: 1; gap: 6px; }
.lx-top {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer;
  font: 500 16.5px 'Inter', sans-serif; color: var(--lx-ink) !important; padding: 8px 12px; border-radius: 8px;
}
.lx-top:hover, .lx-group.open > .lx-top { color: var(--lx-burg) !important; background: #f7f3f4; }
.lx-top.current { color: var(--lx-burg) !important; box-shadow: inset 0 -2px 0 var(--lx-burg); border-radius: 0; }
.lx-caret { font-size: 10px; opacity: .6; transition: transform .15s ease; }
.lx-group { position: relative; }
.lx-group.open .lx-caret { transform: rotate(180deg); }
.lx-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 320px; background: #fff; border: 1px solid var(--lx-line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15,35,64,.14); padding: 8px;
}
.lx-group.open .lx-menu { display: block; }
.lx-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--lx-navy) !important; }
.lx-menu a:hover, .lx-menu a:focus-visible { background: #f3f6fa; }
.lx-menu b { display: block; font: 600 14px 'Inter', sans-serif; }
.lx-menu small { display: block; font: 400 12.5px 'Inter', sans-serif; color: var(--lx-muted); margin-top: 1px; }
.lx-new { display: inline-block; font: 700 10px 'Inter', sans-serif; background: #f5e6cc; color: #7a520a; border-radius: 20px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }

.lx-account { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lx-account #auth-buttons { align-items: center; gap: 4px; }
.lx-signin { font: 600 14px 'Inter', sans-serif; color: var(--lx-navy) !important; padding: 9px 12px; border-radius: 8px; white-space: nowrap; }
.lx-signin:hover { background: #f3f6fa; }
.lx-cta { display: inline-flex; align-items: center; font: 600 14px 'Inter', sans-serif; color: #fff !important; background: var(--lx-burg); padding: 9px 16px; border-radius: 8px; white-space: nowrap; }
.lx-cta:hover { background: #6a2530; }
/* The account menu keeps each page's own user-menu script (ids unchanged). */
.lx-header .user-menu { position: relative; }
.lx-header .user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--lx-navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font: 600 15px 'Inter', sans-serif; cursor: pointer;
}
.lx-header .user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: #fff;
  border: 1px solid var(--lx-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,35,64,.14);
  padding: 6px; display: none; z-index: 5;
}
.lx-header .user-dropdown.show { display: block; }
.lx-header .user-dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--lx-navy); font: 500 14px 'Inter', sans-serif; }
.lx-header .user-dropdown a:hover { background: #f3f6fa; }
.lx-header .user-dropdown .divider { height: 1px; background: var(--lx-line); margin: 6px 4px; }

.lx-burger { display: none; width: 42px; height: 38px; border: 1px solid var(--lx-line); border-radius: 8px; background: #fff; padding: 0 10px; flex-direction: column; justify-content: center; gap: 5px; cursor: pointer; }
.lx-burger span { display: block; height: 2px; background: var(--lx-navy); border-radius: 2px; }

@media (max-width: 991px) {
  .lx-wrap { height: 62px; }
  .lx-burger { display: flex; }
  .lx-panel {
    display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column-reverse; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--lx-line); box-shadow: 0 12px 24px rgba(15,35,64,.10);
    padding: 12px 16px 18px; max-height: calc(100vh - 62px); overflow-y: auto;
  }
  .lx-header.open .lx-panel { display: flex; }
  .lx-links { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .lx-top { width: 100%; justify-content: space-between; padding: 12px 2px; border-radius: 0; border-bottom: 1px solid #f1f5f9; font-size: 16px; }
  .lx-top:hover, .lx-group.open > .lx-top { background: none; }
  .lx-top.current { box-shadow: none; }
  .lx-menu { position: static; transform: none; width: auto; box-shadow: none; border: 0; padding: 0 0 8px 8px; }
  .lx-menu small { display: none; }
  .lx-account { padding-bottom: 8px; }
  .lx-account #auth-buttons, .lx-account #account-link { width: 100%; }
  .lx-account #auth-buttons { flex-direction: row-reverse; gap: 10px; }
  .lx-account #auth-buttons a, .lx-account #account-link a { flex: 1; justify-content: center; text-align: center; padding: 12px; }
  .lx-signin { border: 1px solid var(--lx-line); }
  .lx-account #auth-buttons { flex-wrap: wrap; }
  .lx-account #auth-buttons a.lx-teacher { order: 5; flex-basis: 100%; border: 0; padding: 4px; font-size: 13px; color: var(--lx-muted) !important; }
  .lx-header .user-dropdown { right: auto; left: 0; }
}
@media (max-width: 400px) {
  .lx-brand-name { font-size: 1.3rem; }
}

/* ---------- Computers (992px and wider) ----------
   Navy strip with sign-in links, then the logo centred, then the menu in
   spaced capitals. The header scrolls away with the page; once it is out of
   view, site-header.js adds .slim and it comes back as a slim bar fixed to
   the top (logo, menu, Start free test). The header sits over .lx-spacer,
   which takes its place in the page: the pages already leave 67px at the
   top (the old fixed header), so the spacer is 266 - 67 = 199px tall. */
.lx-note, .lx-spacer { display: none; }
@media (min-width: 992px) {
  .lx-spacer { display: block; height: 199px; }
  .lx-header { position: absolute; box-shadow: none; }
  .lx-header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 42px; background: var(--lx-navy); }
  /* Warm cream band with an outline sketch of UK law landmarks (our own
     drawing, header-skyline.svg) that fades out behind the logo. */
  .lx-header:not(.slim) { background: linear-gradient(180deg, #fffdf9 0%, #f9f0de 100%); }
  .lx-header:not(.slim)::after {
    content: ''; position: absolute; left: 0; right: 0; top: 42px; bottom: 0; z-index: 0; pointer-events: none;
    background: url(header-skyline.svg) center bottom / 1803px 220px no-repeat;
  }
  .lx-header:not(.slim) .lx-wrap { position: relative; z-index: 1; box-sizing: border-box; height: 265px; flex-direction: column; justify-content: flex-start; gap: 0; padding-top: 72px; }
  .lx-header:not(.slim) .lx-note {
    display: flex; align-items: center; gap: 8px; position: absolute; top: 0; left: 12px; height: 42px; margin: 0;
    font: 600 11.5px 'Inter', sans-serif; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,.88);
  }
  .lx-note a { color: inherit !important; }
  .lx-note a:hover { color: #fff !important; }
  .lx-header:not(.slim) .lx-brand { flex-direction: column; gap: 10px; text-align: center; }
  .lx-header:not(.slim) .lx-brand svg { width: 58px; height: 58px; }
  .lx-header:not(.slim) .lx-brand-name { font-size: 2rem; letter-spacing: 7px; text-transform: uppercase; }
  .lx-header:not(.slim) .lx-brand-tag { justify-content: center; text-transform: uppercase; letter-spacing: 3px; font-size: .72rem; margin-top: 8px; }
  .lx-header:not(.slim) .lx-panel { width: 100%; justify-content: center; margin-top: 22px; }
  .lx-header:not(.slim) .lx-links { flex: 0 1 auto; justify-content: center; gap: 20px; }
  .lx-header .lx-links > .lx-top, .lx-header .lx-group > .lx-top {
    font: 500 15px 'Libre Baskerville', Georgia, serif; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--lx-muted) !important; padding: 12px 10px;
  }
  .lx-header .lx-top:hover, .lx-header .lx-group.open > .lx-top { color: var(--lx-burg) !important; }
  /* Over the skyline drawing: navy text with a soft cream glow so lines behind it don't blur the words */
  .lx-header:not(.slim) .lx-links > .lx-top, .lx-header:not(.slim) .lx-group > .lx-top {
    color: var(--lx-navy) !important; text-shadow: 0 0 4px #fbf3e3, 0 0 8px #fbf3e3, 0 0 12px #fbf3e3;
  }
  .lx-header:not(.slim) .lx-top:hover, .lx-header:not(.slim) .lx-group.open > .lx-top, .lx-header:not(.slim) .lx-top.current { color: var(--lx-burg) !important; }
  .lx-header .lx-top.current { color: var(--lx-burg) !important; }
  .lx-caret { font-size: 8px; }

  /* Sign-in links in the navy strip */
  .lx-header:not(.slim) .lx-account { position: absolute; top: 0; right: 12px; height: 42px; align-items: stretch; }
  .lx-header:not(.slim) #auth-buttons { gap: 0; align-items: stretch; }
  .lx-header:not(.slim) .lx-account .lx-signin,
  .lx-header:not(.slim) .lx-account .lx-cta {
    display: flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 0;
    font: 600 11.5px 'Inter', sans-serif; letter-spacing: 1.2px; text-transform: uppercase;
    color: #fff !important; background: none; border-left: 1px solid rgba(255,255,255,.18);
  }
  .lx-header:not(.slim) .lx-account .lx-signin:hover { background: rgba(255,255,255,.08); }
  .lx-header:not(.slim) .lx-account .lx-cta { background: var(--lx-burg); border-left-color: var(--lx-burg); }
  .lx-header:not(.slim) .lx-account .lx-cta:hover { background: #8e3644; }
  .lx-header:not(.slim) #user-menu { align-items: center; }
  .lx-header:not(.slim) .user-avatar { box-sizing: border-box; margin-top: 6px; width: 30px; height: 30px; font-size: 13px; background: #fff; color: var(--lx-navy); }

  /* Slim bar after scrolling */
  .lx-header.slim { position: fixed; box-shadow: 0 2px 10px rgba(15,35,64,.10); animation: lx-slide .2s ease-out; }
  .lx-header.slim::before { display: none; }
  .lx-header.slim .lx-wrap { height: 60px; }
  .lx-header.slim .lx-brand svg { width: 32px; height: 32px; }
  .lx-header.slim .lx-brand-name { font-size: 1.15rem; letter-spacing: 3px; text-transform: uppercase; }
  .lx-header.slim .lx-brand-tag { display: none; }
  .lx-header.slim .lx-links > .lx-top, .lx-header.slim .lx-group > .lx-top { font-size: 12.5px; letter-spacing: 1.5px; padding: 8px 6px; }
  .lx-header.slim .lx-signin { display: none; }
  .lx-header.slim .lx-cta { padding: 8px 14px; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .lx-header:not(.slim)::after { background-size: 1475px 180px; }
  .lx-header:not(.slim) .lx-links { gap: 6px; }
  .lx-header:not(.slim) .lx-links > .lx-top, .lx-header:not(.slim) .lx-group > .lx-top { font-size: 13.5px; letter-spacing: 1.8px; }
  .lx-header:not(.slim) .lx-account .lx-signin, .lx-header:not(.slim) .lx-account .lx-cta { padding: 0 12px; letter-spacing: .8px; }
  .lx-header:not(.slim) .lx-note { letter-spacing: .8px; }
  .lx-header.slim .lx-wrap { gap: 12px; }
  .lx-header.slim .lx-links { gap: 0; }
  .lx-header.slim .lx-links > .lx-top, .lx-header.slim .lx-group > .lx-top { font-size: 11.5px; letter-spacing: .6px; padding: 8px 4px; }
}
@keyframes lx-slide { from { transform: translateY(-100%); } to { transform: none; } }

/* ---------- Footer ---------- */
.lx-footer { background: var(--lx-navy); color: rgba(255,255,255,.85); font: 400 14px/1.55 'Inter', 'Segoe UI', sans-serif; padding: 48px 0 24px; }
.lx-footer a { text-decoration: none; }
.lx-fgrid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.6fr; gap: 28px; }
.lx-footer h2 { font: 700 15px 'Libre Baskerville', Georgia, serif; color: #fff; margin: 0 0 12px; }
.lx-fcol a { display: block; color: #a9b6c8; padding: 3px 0; }
.lx-fcol a:hover, .lx-fbottom a:hover { color: #fff; }
.lx-fname { font: 700 1.3rem 'Libre Baskerville', Georgia, serif; color: #fff; margin-bottom: 8px; }
.lx-footer p { color: #a9b6c8; margin: 0; }
.lx-social { display: flex; gap: 10px; margin-top: 14px; }
.lx-social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; }
.lx-social a:hover { background: rgba(255,255,255,.18); }
.lx-sub { display: flex; margin-top: 10px; }
.lx-sub input { flex: 1; min-width: 0; border: 0; border-radius: 8px 0 0 8px; padding: 10px 12px; font: 14px 'Inter', sans-serif; color: var(--lx-ink); }
.lx-sub button { border: 0; background: var(--lx-burg); color: #fff; font: 600 14px 'Inter', sans-serif; border-radius: 0 8px 8px 0; padding: 0 14px; cursor: pointer; }
.lx-sub button:disabled { opacity: .7; }
.lx-sub-msg { font-size: 13px; margin-top: 8px; min-height: 1em; }
.lx-fbottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #8796ab; }
.lx-legal { display: flex; gap: 16px; flex-wrap: wrap; }
.lx-legal a { color: #8796ab; }
@media (max-width: 991px) {
  .lx-fgrid { grid-template-columns: 1fr 1fr 1fr; }
  .lx-fabout, .lx-fstay { grid-column: 1 / -1; }
}
@media (max-width: 575px) {
  .lx-fgrid { grid-template-columns: 1fr 1fr; gap: 24px 20px; }
}

/* ---------- Heading sizes on the public pages ----------
   One scale for page content, so section headings never outgrow the page
   title (some pages had 45-56px section headings). Classes are added to the
   oversized headings and numbers only; !important beats the pages' own rules
   and inline styles. */
.lx-title-1 { font-size: clamp(2rem, 1.5rem + 1.4vw, 2.75rem) !important; line-height: 1.2 !important; }
.lx-title-2 { font-size: clamp(1.75rem, 1.25rem + 1.1vw, 2.25rem) !important; line-height: 1.25 !important; }
.lx-title-3 { font-size: clamp(1.35rem, 1.15rem + 0.5vw, 1.75rem) !important; line-height: 1.3 !important; }
.lx-stat-big { font-size: clamp(1.75rem, 1.45rem + 0.7vw, 2.25rem) !important; }
