/* rs-header.css v1.1 (18 Nov 2026; v1.0 17 Nov): the page header shared by the GCSE Chemistry home page and every GCSE page.
   v1.1: the small "Last updated" date beside the Key stage button (rs-last-updated; also on the A-level pages).
   Logo centred, bold title, and small rounded buttons (How it works, Key stage, GCSE Chemistry Menu).
   Used only where these classes are on the page (rs-head-logo, rs-head-back, rs-titlebar, rs-head-btns, rs-head-btn),
   so other pages are not affected. The themed-weeks title colours (pride.js) are left to pride.js. */

/* Logo row: centred, clears the fixed navbar. The image has width and height set, so nothing moves when it loads. */

.row.rs-head-logo {
  margin-bottom: 10px;
}

.rs-head-logo > .col {
  display: flex;
  justify-content: center;
  margin-top: 86.5px;
  margin-bottom: 10px;
}

.rs-head-logo img {
  display: block;
  width: 305px;
  max-width: 100%;
  height: auto;
}

/* Back link row (content pages only): "GCSE Chemistry Menu" as a small button */

.row.rs-head-back {
  margin: 0 0 8px;
}

.rs-head-back > .col {
  display: flex;
  justify-content: flex-start;
  padding: 0;
}

/* Title bar: the title on the left, the buttons on the right, the chemistry line underneath */

.row.rs-titlebar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--rs-chem, #d33c16);
}

.rs-titlebar > .rs-titlebar-main, .rs-titlebar > .rs-head-btns {
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.rs-titlebar > .rs-titlebar-main {
  flex: 1 1 18rem;
  min-width: 0;
}

.rs-titlebar h1 {
  margin: 0;
  color: var(--rs-ink, #25242f);
  font-weight: 700;
  text-align: start;
  overflow-wrap: break-word;
}

.rs-titlebar > .rs-head-btns {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 37px;
  margin-left: auto;
  font-size: 1rem;
  text-align: start;
}

/* The buttons: the same look as How it works (rs-cards.js) */

.rs-head-btn, .rs-head-back a.btn.rs-head-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 6px 10px;
  border: 1px solid #7d849a;
  border-radius: 8px;
  background: #fff;
  color: #1d2b4f;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

@media (max-width: 575.98px) {
  .rs-head-btn, .rs-head-back a.btn.rs-head-btn {
    min-height: 40px;
  }
}

.rs-head-btn:hover, .rs-head-back a.btn.rs-head-btn:hover, .rs-head-btn[aria-expanded="true"] {
  background: #eef0f7;
  border-color: #b9bfd3;
  color: #1d2b4f;
}

.rs-head-btn:focus-visible, .rs-head-back a.btn.rs-head-btn:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
  box-shadow: none;
}

.rs-head-btn .bi {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  margin: 0;
  font-size: 1.2em;
  line-height: 1;
  color: #1d2b4f;
}

.rs-head-btns .ct-help-btn {
  font-size: 0.85rem;
}

.rs-head-btns .dropdown-menu {
  font-size: 0.95rem;
}

/* Last updated (v1.1): a small date beside the Key stage button, so it adds no height. Written by patch_cite.py on each content page; the date is the one in its citation tags. */

.rs-last-updated {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.25;
  color: #5a6072;
  white-space: nowrap;
}

#top-row > div:has( > .rs-last-updated) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* Phones and small tablets: where How it works is added (the home page), the buttons get their own line, on the right,
   so nothing moves when it arrives. Elsewhere the Key stage button wraps under the title only when it has to. */

@media (max-width: 767.98px) {
  .rs-titlebar > .rs-head-btns[data-howto-head] {
    flex: 1 0 100%;
  }
}

@media (max-width: 575.98px) {
  .rs-head-logo img {
    width: 260px;
  }
}

