/* Liberal Democrats brand colours */
:root {
  --ld-yellow: #FF6400;
  --ld-navy: #1D3260;
  --ld-yellow-dark: #cc5000;
  --ld-navy-light: #2a4a8a;
  --white: #ffffff;
  --off-white: #f9f7f2;
  --text: #1a1a1a;
  --muted: #555555;
}

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

body {
  font-family: 'Calibri', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
}

/* ── Header ── */
header {
  background: var(--ld-navy);
  color: var(--white);
  padding: 1rem 5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

header .bird {
  font-size: 2rem;
}

header a {
  display: flex;
  align-self: center;
  line-height: 0;
}

.header-logo {
  height: 128px;
  width: auto;
  display: block;
  align-self: center;
}

header .party-name {
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ld-yellow);
  font-family: 'Calibri', sans-serif;
  font-weight: bold;
}

header .constituency {
  font-size: 1.5rem;
  color: var(--white);
  font-family: 'Calibri', sans-serif;
}

/* ── Hero banner ── */
.hero {
  background: var(--ld-yellow);
  color: var(--ld-navy);
  text-align: center;
  padding: 3rem 2rem;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: bold;
  line-height: 1.2;
}

.hero p {
  margin-top: 0.75rem;
  font-size: 1.15rem;
  font-family: 'Calibri', sans-serif;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transform: scale(1);
  transform-origin: center top;
}

.avatar img.scale-up {
  object-position: center;
  transform: scale(1);
}

/* ── Candidate cards (index page) ── */
.candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  padding: 3rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.card {
  background: var(--white);
  border-top: 6px solid var(--ld-yellow);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  flex: 1 1 340px;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.card .btn {
  margin-top: auto;
}

.card .avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--ld-navy);
  color: var(--white);
  font-size: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  font-family: 'Calibri', sans-serif;
  font-weight: bold;
  overflow: hidden;
}

.card h2 {
  color: var(--ld-navy);
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.card .role {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: 'Calibri', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.card p {
  font-size: 0.97rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  background: var(--ld-navy);
  color: var(--white);
  text-decoration: none;
  padding: 0.65rem 1.6rem;
  border-radius: 3px;
  font-family: 'Calibri', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--ld-navy-light);
}

.btn.btn-yellow {
  background: var(--ld-yellow);
  color: var(--ld-navy);
}

.btn.btn-yellow:hover {
  background: var(--ld-yellow-dark);
}

/* ── Candidate profile page ── */
.profile {
  max-width: 780px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.profile-header .avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--ld-navy);
  color: var(--white);
  font-size: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Calibri', sans-serif;
  font-weight: bold;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-header .profile-name h1 {
  color: var(--ld-navy);
  font-size: 2rem;
}

.profile-header .profile-name .role {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: 'Calibri', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.3rem;
}

.profile section {
  margin-bottom: 2rem;
}

.profile section h2 {
  color: var(--ld-navy);
  font-size: 1.2rem;
  border-bottom: 3px solid var(--ld-yellow);
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
  font-family: 'Calibri', sans-serif;
}

.profile section p,
.profile section li {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.profile section ul {
  padding-left: 1.4rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--ld-navy);
  font-family: 'Calibri', sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ── Footer ── */
footer {
  background: var(--ld-navy);
  color: var(--white);
  text-align: center;
  padding: 1.5rem 2rem;
  font-family: 'Calibri', sans-serif;
  font-size: 0.82rem;
  margin-top: 4rem;
  line-height: 1.8;
}

footer a {
  color: var(--ld-yellow);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── Contact form ── */
.contact-form {
  margin-top: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: 'Calibri', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--ld-navy);
}

.form-group input,
.form-group textarea {
  font-family: 'Calibri', sans-serif;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 100%;
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ld-navy);
}

.form-group textarea {
  resize: vertical;
}

/* ── Error page ── */
.error-page {
  text-align: center;
  padding: 5rem 2rem;
}

.error-page h1 {
  color: var(--ld-navy);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  header {
    font-family: 'Calibri', sans-serif;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-logo {
    height: 56px;
  }

  header .party-name {
    font-size: 1rem;
  }

  header .constituency {
    font-size: 0.9rem;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .candidates {
    padding: 2rem 1rem;
  }
}