/* =========================================================
   ChallengeTheRent – styles.css
   Clear, clean, accessible. Inspired by Citizens Advice / NHS.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@700;800&family=Source+Sans+3:wght@400;600;700&display=swap");

/* ---------- Colours & settings ---------- */
:root {
  --navy: #004b88;          /* brand primary */
  --navy-dark: #012760;     /* link hover */
  --yellow: #fcbb69;        /* brand accent */
  --focus: #ffd250;         /* keyboard focus */
  --text: #161616;          /* main text */
  --text-secondary: #4a4e4f;
  --button: #018176;        /* primary button */
  --button-hover: #006159;
  --button-shadow: #00403a;
  --pale-blue: #f2f8ff;     /* soft section background */
  --light-grey: #f0f4f5;    /* soft section background */
  --border: #d8dde0;
  --white: #ffffff;
  --cream: #fff6e8;         /* warm hero background */
  --heading-font: "Manrope", "Source Sans 3", Arial, sans-serif;

  --container: 960px;
  --radius: 4px;
}

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

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

body {
  margin: 0;
  font-family: "Source Sans 3", Arial, Helvetica, sans-serif;
  font-size: 1.125rem;      /* 18px */
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 56px 0;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 16px;
  font-family: var(--heading-font);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

p {
  margin: 0 0 16px;
}

p:last-child {
  margin-bottom: 0;
}

/* Key phrases: a thick yellow underline */
u {
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 4px;
  text-decoration-skip-ink: none;
  text-underline-offset: 3px;
}

/* ---------- Links & focus ---------- */
a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy-dark);
  text-decoration-thickness: 3px;
}

a:focus-visible {
  outline: 3px solid transparent;
  background: var(--focus);
  color: var(--text);
  box-shadow: 0 -2px var(--focus), 0 4px var(--text);
  text-decoration: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  color: var(--white);
  background: var(--button);
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.btn:hover {
  color: var(--white);
  background: var(--button-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  background: var(--focus);
  color: var(--text);
  border-color: var(--text);
}

/* ---------- Header ---------- */
.header {
  background: var(--white);
  border-bottom: 4px solid var(--yellow);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.header-logo {
  font-family: var(--heading-font);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.header-logo:hover {
  color: var(--navy-dark);
  text-decoration: underline;
}

.header-btn {
  padding: 8px 20px;
  font-size: 1rem;
  color: var(--navy);
  background: transparent;
  border-color: var(--navy);
}

.header-btn:hover {
  color: var(--white);
  background: var(--navy);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--cream);
  padding: 48px 0 64px;
}

.hero-content {
  max-width: 920px;
  margin: 0 auto;
}

/* The tagline is styled as the title... */
.hero-content p {
  margin-bottom: 24px;
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--navy);
}

/* ...and the H1 is styled as a subtitle */
.hero h1 {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-family: "Source Sans 3", Arial, Helvetica, sans-serif;
  font-size: 1.125rem;   /* 18px */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text);
}

/* ---------- Problems ---------- */
.problems {
  background: var(--light-grey);
}

.problems .container {
  display: grid;
  gap: 24px;
  max-width: 800px;
}

.problem-box {
  background: var(--white);
  padding: 28px;
  border-top: 6px solid var(--yellow);
  border-radius: 0 0 var(--radius) var(--radius);
}

.problem-box h2 {
  font-size: 1.375rem;
  color: var(--navy);
}

.problems-cta {
  margin-top: 8px;
  text-align: center;
}

/* ---------- Solution ---------- */
.solution {
  background: var(--pale-blue);
}

.solution .container {
  max-width: 800px;
}

.solution h2 {
  color: var(--navy);
}

.solution p b {
  display: block;
  margin: 8px 0;
  padding-left: 16px;
  border-left: 4px solid var(--navy);
  color: var(--navy);
}

.solution .btn {
  display: block;
  width: fit-content;
  margin: 32px auto 0;
}

/* ---------- Features ---------- */
.features h2 {
  color: var(--navy);
}

.feature-boxes {
  display: grid;
  gap: 24px;
  margin-top: 8px;
}

.feature-box {
  padding: 24px;
  background: var(--light-grey);
  border-left: 6px solid var(--button);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.feature-box h4 {
  margin-bottom: 8px;
  color: var(--navy);
}

.features-cta {
  margin-top: 32px;
  text-align: center;
}

/* ---------- News ---------- */
.news {
  background: var(--light-grey);
}

.news h2 {
  color: var(--navy);
}

.news-cards {
  display: grid;
  gap: 24px;
  margin-top: 8px;
}

.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.news-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--text);
  text-decoration: none;
}

.news-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;   /* the standard og:image shape */
  object-fit: cover;
  background: var(--border);
}

.news-card-body {
  padding: 20px 24px 24px;
}

.news-card-meta {
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.news-card h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  color: var(--navy);
}

.news-card-body p:last-child {
  font-size: 1rem;
}

.news-card-link:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.news-card-link:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: -4px;
  background: transparent;
  box-shadow: none;
}

/* ---------- Larger screens ---------- */
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }

  .hero-content p { font-size: 3rem; }

  section {
    padding: 72px 0;
  }

  .hero {
    padding: 64px 0 80px;
  }

  .feature-boxes {
    grid-template-columns: repeat(2, 1fr);
  }

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