/* ==========================================================================
   Base Theme Variables
   Change these variables to update the entire site's colours and typography.
   ========================================================================== */
:root {
  --brand: #1a56db;
  --accent: #d97706;
  --text: #1f2937;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Supporting surface & neutral tokens */
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text-muted: #4b5563;
  --brand-contrast: #ffffff;
  --accent-contrast: #ffffff;
}

/* ==========================================================================
   CSS Reset & Box Sizing
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ensure images never cause sideways scrolling */
img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Accessible focus styling */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Skip link for screen reader / keyboard accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand);
  color: var(--brand-contrast);
  padding: 0.5rem 1rem;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 4px;
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Layout Containers & Common Elements
   ========================================================================== */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex: 1 0 auto;
  padding: 2rem 0;
}

/* Headings in logical scale */
h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.25;
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}

a {
  color: var(--brand);
  text-decoration: underline;
}

a:hover, a:focus {
  color: var(--accent);
}

/* Buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  line-height: 1.25;
}

.button-primary {
  background-color: var(--brand);
  color: var(--brand-contrast);
  border: 2px solid var(--brand);
}

.button-primary:hover, .button-primary:focus {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.button-secondary {
  background-color: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.button-secondary:hover, .button-secondary:focus {
  background-color: var(--surface-alt);
  color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   Shared Header
   ========================================================================== */
.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem 1.25rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ==========================================================================
   Page Sections & Components
   ========================================================================== */
.hero {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2.25rem;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.card h3 {
  margin-top: 0;
  color: var(--brand);
}

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

/* Contact information block */
.contact-details {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.contact-item {
  margin-bottom: 1rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   Shared Footer
   ========================================================================== */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.footer-col h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

.footer-col p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 0;
}

/* ==========================================================================
   Responsive Adaptations (360px mobile friendly)
   ========================================================================== */
@media (max-width: 600px) {
  .hero {
    padding: 1.5rem 1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav ul {
    gap: 0.75rem 1rem;
  }
}
