/*
 * Global stylesheet for the GetHeartSmart public‑facing website.
 *
 * This file defines a clean, high‑contrast design suitable for accessibility
 * standards (WCAG AA). Colours use sufficient contrast and text sizes are
 * generous. Layouts are responsive to work on mobile devices.
 */

:root {
  --colour-primary: #a00021; /* Deep crimson for headings and accents */
  --colour-secondary: #f6f6f6; /* Light grey backgrounds */
  --colour-text: #2b2b2b; /* Dark grey body text */
  --colour-background: #ffffff; /* White page background */
  --colour-link: #0039a6; /* NHS‑style blue for links */
  --colour-muted: #666666; /* Muted text */
  --spacing: 1rem;
  --radius: 0.3rem;
  /* Swap to a serif font stack for an editorial feel */
  font-family: 'Georgia', Cambria, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.5;
}

body {
  margin: 0;
  background-color: var(--colour-background);
  color: var(--colour-text);
  font-family: inherit;
}

/* Global typography */
h1, h2, h3, h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: bold;
  color: var(--colour-primary);
}
/* Increase base heading sizes for a more premium look */
h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--colour-link);
  text-decoration: underline;
}
a:hover,
a:focus {
  text-decoration: none;
}

/* Header and navigation */
header {
  background-color: var(--colour-background);
  border-bottom: 1px solid var(--colour-secondary);
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .branding {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--colour-primary);
  text-decoration: none;
}

nav {
  margin-top: 0.5rem;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav li {
  margin: 0;
}

nav a {
  text-decoration: none;
  color: var(--colour-text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
}

nav a:hover,
nav a:focus,
nav a[aria-current="page"] {
  background-color: var(--colour-secondary);
  color: var(--colour-primary);
}

/* Main layout */
main {
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Hero section */
.hero {
  /* Use the hero image with a dark overlay for contrast */
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('hero.png');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 4rem 1rem;
  text-align: center;
}
.hero h1 {
  margin-top: 0;
  font-size: 2.25rem;
}
.hero p {
  max-width: 700px;
  margin: 0.5rem auto 1.5rem auto;
  font-size: 1.1rem;
}
.hero .buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.button {
  background-color: var(--colour-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.button.secondary {
  background-color: transparent;
  color: var(--colour-primary);
  border: 2px solid var(--colour-primary);
}
.button:hover,
.button:focus {
  filter: brightness(1.05);
}

/* Card grid */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 2rem;
}

.card {
  background-color: var(--colour-background);
  border: 1px solid var(--colour-secondary);
  border-radius: var(--radius);
  padding: 1.25rem;
  height: 100%;
  /* Add a subtle shadow for depth */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Icons inside cards */
.card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Emergency number table */
.emergency-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.emergency-table th,
.emergency-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--colour-secondary);
}
.emergency-table th {
  background-color: var(--colour-secondary);
  font-weight: bold;
}

/* Footer */
footer {
  background-color: var(--colour-secondary);
  color: var(--colour-muted);
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}
footer a {
  color: var(--colour-primary);
  margin: 0 0.5rem;
}
footer a:hover,
footer a:focus {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  nav ul {
    flex-direction: column;
  }
  .button {
    width: 100%;
    text-align: center;
  }
}
