/* Nelson House — visual design replicated from qualitycarehome.co.uk */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #f7f5f1;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ---- Page shell ---------------------------------------------------- */

.page {
  --blue: #373266;
  --blue-deep: #373266;
  --gold: #ffc83d;
  --coral: #ff5a36;
  --cream: #fff6ec;
  --ink: #1b1430;
  --card: #ffffff;
  --font-body: "Nunito Sans", "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

.page h1,
.page h2,
.mark,
.call a,
.quote p {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

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

/* ---- Masthead ------------------------------------------------------- */

.mast {
  background: var(--blue);
  color: white;
  padding: 18px 0 0;
}

.mastRow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: white;
  font-size: 32px;
  line-height: 1;
  text-decoration: none;
}

.logo {
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
}

.footerLogo {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 12px;
}

.co {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.nav a {
  padding: 10px 14px;
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.nav a[aria-current="page"] {
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px 999px 0 0;
}

.nav .phone {
  margin-left: auto;
  color: var(--gold);
}

/* ---- Poster (home) -------------------------------------------------- */

.poster {
  padding: 48px 0 32px;
  background:
    radial-gradient(circle at 90% 0%, #ffe08a 0, transparent 42%),
    var(--cream);
}

.kicker {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.poster h1,
.sheet h1 {
  margin: 0 0 14px;
  max-width: 28ch;
  font-size: clamp(36px, 3.4vw, 48px);
  line-height: 1.05;
}

.poster p,
.lede {
  max-width: none;
  margin: 0 0 18px;
}

.cta {
  display: inline-block;
  padding: 12px 18px;
  background: var(--coral);
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
}

/* ---- Imagery -------------------------------------------------------- */

.hero {
  margin: 0 auto;
}

.hero img {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center 40%;
}

.mosaic {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 10px;
  padding: 10px;
  background: var(--blue-deep);
}

.mosaic img,
.stack img,
.split img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.mosaic figcaption,
.stack figcaption,
.split figcaption {
  padding: 8px 2px 4px;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.stack figcaption,
.split figcaption {
  color: #5c5168;
}

/* ---- Quote band ----------------------------------------------------- */

.quote {
  padding: 32px 0;
  background: var(--gold);
}

.quoteRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.quote p {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.08;
}

.quote a {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Interior sheets ------------------------------------------------ */

.sheet {
  padding: 48px 0 64px;
}

.stack,
.split {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
  margin-top: 8px;
}

.stack {
  grid-template-columns: repeat(3, 1fr);
}

.split {
  grid-template-columns: 1.1fr 0.9fr;
  margin-bottom: 18px;
}

.stack figure,
.split figure,
.mosaic figure {
  margin: 0;
}

/* ---- Call block ----------------------------------------------------- */

.call {
  margin: 0 0 18px;
}

.call a {
  color: var(--blue);
  font-size: 42px;
  line-height: 1;
  text-decoration: none;
}

.call a[href^="mailto:"] {
  display: inline-block;
  margin-top: 8px;
  font-size: 18px;
}

/* ---- Jobs ----------------------------------------------------------- */

.roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.roles li {
  padding: 18px;
  background: white;
  border-top: 8px solid var(--blue);
}

.roles h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.roles a {
  color: var(--coral);
  font-weight: 600;
}

.openingFacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 8px;
  font-size: 15px;
}

.vacancyCount {
  color: var(--blue);
  font-weight: 700;
}

.deadline {
  color: #5c6170;
}

/* ---- Forms ---------------------------------------------------------- */

.receipt h2 {
  margin: 0 0 8px;
  font-size: 36px;
}

.reference {
  font-weight: 600;
}

.form {
  max-width: 44rem;
  padding: 18px;
  background: white;
  border-left: 8px solid var(--gold);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #eadfce;
  background: var(--cream);
  color: inherit;
}

.field em {
  color: #b42318;
  font-style: normal;
  font-size: 14px;
}

.send {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.send:disabled {
  opacity: 0.7;
}

/* ---- Footer --------------------------------------------------------- */

.footer {
  padding: 28px 0;
  background: var(--ink);
  color: #f3e7d4;
  font-size: 14px;
}

.footerGrid {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.4fr 1.2fr;
  gap: 18px;
}

.footer strong {
  color: white;
}

.footer a {
  color: var(--gold);
}

.footer p {
  margin: 0;
}

.footerGrid > div strong {
  display: block;
  margin-top: 12px;
}

.footerGrid > div strong:first-child {
  margin-top: 0;
}

.footerGrid > div p {
  margin-bottom: 10px;
}

/* ---- Admin portal ---------------------------------------------------- */

.loginWrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.loginCard {
  width: min(400px, 100%);
  padding: 28px;
  background: white;
  border-left: 8px solid var(--gold);
}

.loginCard .logo {
  width: 52px;
  height: 52px;
}

.loginCard h1 {
  margin: 14px 0 2px;
  font-size: 36px;
}

.loginQuiet {
  margin: 0 0 18px;
  color: #5c5168;
}

.loginError {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 4px solid #b42318;
  background: #fff1ef;
  color: #b42318;
  font-size: 14px;
  font-weight: 600;
}

.loginForm .send {
  width: 100%;
  margin-top: 4px;
}

.loginBack {
  margin: 18px 0 0;
  font-size: 14px;
}

.loginBack a {
  color: var(--blue);
}

.adminMain {
  min-height: 40vh;
}

.adminNav .logoutForm {
  margin-left: auto;
  padding: 0;
}

.adminNav .logoutForm button {
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.adminNav .logoutForm button:hover {
  text-decoration: underline;
}

.flash {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 6px solid var(--blue);
  background: white;
  font-weight: 600;
  list-style: none;
}

.flash li {
  margin: 0;
}

.adminTools {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.adminTools h1 {
  margin: 0;
}

.adminTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.adminTable th,
.adminTable td {
  padding: 12px;
  border-bottom: 1px solid #eadfce;
  text-align: left;
  vertical-align: top;
  font-size: 15px;
}

.adminTable th {
  color: #5c5168;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.adminTable small {
  display: inline-block;
  max-width: 46ch;
  color: #5c5168;
  line-height: 1.4;
}

.adminTable tr:last-child td {
  border-bottom: 0;
}

.adminActions {
  white-space: nowrap;
  text-align: right;
}

.adminActions form {
  display: inline;
  margin-left: 14px;
}

.editLink {
  color: var(--blue);
  font-weight: 600;
}

.deleteBtn {
  padding: 0;
  border: 0;
  background: none;
  color: #b42318;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.deleteBtn:hover {
  text-decoration: underline;
}

.adminEmpty {
  padding: 24px;
  background: white;
  border-left: 8px solid var(--gold);
}

.adminForm {
  max-width: 44rem;
}

.adminForm .field em.quiet {
  color: #5c5168;
}

.save {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.save:hover {
  background: #2c2854;
}

.ghostBtn {
  padding: 12px 18px;
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

.ghostBtn:hover {
  background: var(--cream);
}

.navBadge {
  display: inline-block;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.adminCard {
  display: block;
  margin-bottom: 24px;
  padding: 18px 22px;
  background: white;
  border-left: 8px solid var(--coral);
  color: inherit;
  text-decoration: none;
}

.adminCard strong {
  display: block;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
}

.adminCard span {
  display: block;
  font-weight: 600;
}

.adminCard em {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-style: normal;
  font-weight: 600;
}

.adminCard:hover em {
  text-decoration: underline;
}

.adminHint {
  margin: 6px 0 0;
  color: #5c5168;
  font-size: 14px;
}

.reference {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.statusPill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.statusPill[data-status="new"] {
  background: #ffe9c2;
  color: #7b4d0b;
}

.statusPill[data-status="handled"] {
  background: #e6e4f2;
  color: var(--blue);
}

.statusPill[data-status="sent"] {
  background: #d8f0dc;
  color: #1f6b35;
}

.statusPill[data-status="failed"] {
  background: #ffdcd2;
  color: #a33217;
}

.emailLogTitle {
  margin: 34px 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
}

.emailLog {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 44rem;
}

.emailLog li {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: white;
  border-left: 4px solid var(--blue);
}

.emailLogHead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.emailLogHead strong {
  flex: 1 1 auto;
  min-width: 12rem;
}

.emailLogHead time {
  color: #5c5168;
  font-size: 14px;
  white-space: nowrap;
}

.emailLogMeta {
  margin: 8px 0 0;
  color: #5c5168;
  font-size: 14px;
}

.emailLog details {
  margin-top: 8px;
}

.emailLog summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}

.emailLogBody {
  margin: 10px 0 0;
  padding: 12px;
  background: var(--cream);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.adminPairs {
  width: 100%;
  max-width: 44rem;
  margin-bottom: 22px;
  border-collapse: collapse;
  background: white;
}

.adminPairs th,
.adminPairs td {
  padding: 12px;
  border-bottom: 1px solid #eadfce;
  text-align: left;
  vertical-align: top;
  font-size: 15px;
}

.adminPairs th {
  width: 34%;
  color: #5c5168;
  font-weight: 600;
}

.adminPairs tr:last-child th,
.adminPairs tr:last-child td {
  border-bottom: 0;
}

.adminPairs .notes {
  white-space: pre-wrap;
}

.adminActionsRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.adminActionsRow form {
  margin: 0;
}

@media (max-width: 800px) {
  .adminTools {
    display: block;
  }

  .adminTools .cta {
    display: inline-block;
    margin-top: 12px;
  }

  .adminTable thead {
    display: none;
  }

  .adminTable tr {
    display: block;
    margin-bottom: 12px;
    border-top: 4px solid var(--blue);
  }

  .adminTable td {
    display: block;
    padding: 8px 12px;
    border-bottom: 0;
  }

  .adminTable td:first-child {
    padding-top: 12px;
  }

  .adminActions {
    text-align: left;
    padding-bottom: 12px !important;
  }
}

/* ---- Responsive ------------------------------------------------------ */

@media (max-width: 800px) {
  .mastRow,
  .quoteRow,
  .footerGrid,
  .mosaic,
  .stack,
  .split,
  .roles,
  .pair {
    display: block;
  }

  .nav .phone {
    margin-left: 0;
  }

  .poster h1,
  .sheet h1 {
    font-size: 36px;
  }

  .hero img,
  .mosaic img,
  .stack img,
  .split img {
    height: 240px;
  }

  .quote p {
    margin-bottom: 12px;
  }

  .roles li,
  .stack figure,
  .split figure,
  .mosaic figure {
    margin-bottom: 12px;
  }

  .field {
    margin-bottom: 14px;
  }
}
