/* Typography & base colours */
:root {
  /* Brand colours */
  --color-primary: #FF5F45;   /* Coral Flame */
  --color-accent: #1C2A39;    /* Midnight Navy (text, headings) */
  --color-secondary: #E0A458; /* Golden Sand */
  --color-tertiary: #2A8C82;  /* Teal Balance (links) */
  --color-highlight: #FF8A70; /* Sunset Glow */
  --color-background: #FAF7F5;/* Soft Pearl */

  .text-primary { color: var(--color-primary); }
  .text-accent { color: var(--color-accent); }
  .text-secondary { color: var(--color-secondary); }
  .text-tertiary { color: var(--color-tertiary); }
  .text-highlight { color: var(--color-highlight); }
  
  --font-heading: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-accent);
  line-height: 1.6;
}

/* Layout */
.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.diagram-wrapper {
  text-align: center;
  margin: 24px 0;
}

.diagram-wrapper img {
  max-width: 100%;
  height: auto;
  width: 600px;
}

/* Header */
.site-header {
  margin-bottom: 32px;
}

.main-heading-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.main-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2.0rem;
  color: var(--color-primary);
  margin: 0;
}

.logo-wrapper {
  flex: 0 0 auto;
}

.logo-image {
  height: 160px;
  width: auto;
  display: block;
}

/* Subheading */
.subheading {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 2.2rem;
  color: var(--color-tertiary);
  margin: 0;
}

/* Content */
.content {
  margin-top: 24px;
  margin-bottom: 40px;
}

.content p {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--color-accent);
}

.content a {
  color: var(--color-tertiary);
  text-decoration: underline;
}

.content a:hover,
.content a:focus {
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid rgba(28, 42, 57, 0.1);
  padding-top: 20px;
  font-size: 0.85rem;
}

.footer-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-primary);
}

.footer-brand-link {
  color: inherit;
  text-decoration: none;
}

.footer-brand-link:hover,
.footer-brand-link:focus {
  text-decoration: none;
}

.footer-tagline {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 10px;
}

.footer-legal {
  text-align: left;
  font-size: 0.75rem;
  opacity: 0.9;
  line-height: 1.4;
}

.footer-links {
  text-align: right;
}

.footer-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-accent);
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus {
  text-decoration: underline;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
  .main-heading-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .logo-wrapper {
    align-self: center;
  }

  .subheading {
    text-align: center;
    width: 100%;
  }

  /* Footer: stack items and control order */
  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-links {
    order: 1;         /* Privacy Policy first on mobile */
    text-align: left;
  }

  .footer-legal {
    order: 2;         /* Legal text second on mobile */
    text-align: left;
  }
}
