/* Forgotten Kids Network — header test
   Deliberately conservative HTML/CSS for broad desktop-browser reliability. */

:root {
  --navy: #062c59;
  --navy-dark: #032143;
  --red: #a30c13;
  --paper: #f6f3ec;
  --ink: #152033;
  --rule: #b8b5ad;
  --site-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-width {
  width: min(calc(100% - 48px), var(--site-width));
  margin-inline: auto;
}

/* Top utility strip */

.utility-bar {
  min-height: 30px;
  background: linear-gradient(#0c3768, var(--navy-dark));
  border-bottom: 1px solid #547392;
  color: #ffffff;
  font-size: 13px;
}

.utility-inner {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.utility-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.utility-nav a {
  text-decoration: none;
}

.utility-nav a:hover,
.utility-nav a:focus-visible {
  text-decoration: underline;
}

/* Masthead */

.masthead {
  background:
    radial-gradient(circle at 28% 10%, rgba(255,255,255,.75), transparent 34%),
    var(--paper);
  border-bottom: 4px solid #ffffff;
}

.masthead-inner {
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-mark {
  width: 126px;
  height: 126px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  color: var(--navy-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.2vw, 50px);
  line-height: .98;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand-tagline {
  margin-top: 12px;
  color: #444444;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .035em;
  white-space: nowrap;
}

.site-search {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 220px 46px;
  align-items: center;
  gap: 10px;
  color: #1f2430;
  font-size: 14px;
}

.site-search label {
  white-space: nowrap;
}

.site-search input {
  width: 220px;
  min-width: 0;
  height: 31px;
  padding: 5px 8px;
  border: 1px solid #909090;
  border-radius: 0;
  background: #ffffff;
  color: #111111;
  font: inherit;
}

.site-search button {
  height: 31px;
  border: 1px solid #001a3c;
  border-radius: 0;
  background: linear-gradient(#17487e, #052c5a);
  color: #ffffff;
  font: 700 14px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

/* Main navigation */

.primary-nav {
  background: linear-gradient(#0b3b70, var(--navy-dark));
  border-top: 1px solid #102d50;
  border-bottom: 2px solid #b0b0aa;
}

.primary-nav-inner {
  display: grid;
  grid-template-columns:
    .75fr 1fr 1.35fr 1.45fr .92fr 1.4fr 1.16fr 1.02fr;
}

.primary-nav a {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-left: 1px solid rgba(255,255,255,.46);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-nav a:last-child {
  border-right: 1px solid rgba(255,255,255,.46);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  background: rgba(255,255,255,.08);
}

.primary-nav a.active {
  background: linear-gradient(#b31b21, #87070d);
}

/* Empty page below the header, only so the header can be tested in isolation. */

.test-space {
  min-height: 520px;
  background: #fbfaf7;
}

/* Narrow-desktop / tablet fallback.
   Desktop remains the priority, but the header should degrade rather than break. */

@media (max-width: 1100px) {
  .masthead-inner {
    min-height: 128px;
    gap: 20px;
  }

  .brand-mark {
    width: 108px;
    height: 108px;
  }

  .brand-name {
    font-size: clamp(27px, 3.4vw, 39px);
  }

  .brand-tagline {
    font-size: 14px;
  }

  .site-search {
    grid-template-columns: auto 170px 44px;
  }

  .site-search input {
    width: 170px;
  }

  .primary-nav a {
    padding-inline: 7px;
    font-size: 12px;
  }
}

@media (max-width: 860px) {
  .site-width {
    width: min(calc(100% - 28px), var(--site-width));
  }

  .masthead-inner {
    padding-block: 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .brand-name,
  .brand-tagline {
    white-space: normal;
  }

  .site-search {
    width: 100%;
    grid-template-columns: auto minmax(120px, 1fr) 46px;
  }

  .site-search input {
    width: 100%;
  }

  .primary-nav-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .primary-nav a {
    border-bottom: 1px solid rgba(255,255,255,.25);
  }
}
