/* Kaharagia Design System - info.kaharagia.org */

/* CSS Variables based on Kaharagia Design System */
:root {
  /* Primary Colours (Kaharagian Red) */
  --red-900: #5C0408;
  --red-800: #8a060d;
  --red-primary: #bd081b;
  --red-500: #d4192b;
  --red-400: #e03a4a;
  --red-300: #eb6b77;
  --red-200: #f5a8af;
  --red-100: #fce8ea;

  /* Secondary Colours (Kaharagian Gold) */
  --gold-900: #7A5A05;
  --gold-800: #9A7206;
  --gold-primary: #FEBC0A;
  --gold-400: #FFD04A;
  --gold-300: #FFE07A;
  --gold-200: #FFEDAB;
  --gold-100: #FFF8E0;

  /* Semantic Colours */
  --success: #00703C;
  --warning: #FEBC0A;
  --error: #D4351C;
  --info: #1D70B8;

  /* Neutral Colours */
  --gray-950: #0B0C0C;
  --gray-900: #1D1D1B;
  --gray-800: #2E2E2C;
  --gray-700: #505A5F;
  --gray-600: #626A6E;
  --gray-500: #8B9196;
  --gray-400: #B1B4B6;
  --gray-300: #D1D3D4;
  --gray-200: #E6E7E8;
  --gray-100: #F3F4F5;
  --gray-50: #F8F9FA;

  /* Background Presets */
  --bg-white: #FFFFFF;
  --bg-page: #F8F9FA;
  --bg-gazette: #F5F6F1;
  --bg-parchment: #F5F3EA;

  /* Typography */
  --font-heading: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Consolas', monospace;

  /* Font Weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;
}

/* Import Noto Sans from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap');

/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  line-height: var(--leading-normal);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  color: var(--gray-950);
  background-color: var(--bg-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1.125rem; /* 18px - Standard body text */
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gray-950);
  color: var(--bg-white);
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--gold-primary);
  outline-offset: 0;
  background: var(--gold-primary);
  color: var(--gray-950);
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background-color: var(--red-primary);
  color: var(--bg-white);
  padding: 1rem 0;
  border-bottom: 4px solid var(--gold-primary);
}

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

.site-title {
  font-size: 1.25rem;
  font-weight: var(--weight-bold);
}

.site-title a {
  color: var(--bg-white);
  text-decoration: none;
}

.site-title a:hover,
.site-title a:focus {
  text-decoration: underline;
}

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

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

.site-nav a:hover,
.site-nav a:focus {
  color: var(--bg-white);
  border-bottom-color: var(--gold-primary);
}

.site-nav a[aria-current="page"] {
  color: var(--bg-white);
  border-bottom-color: var(--gold-primary);
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 0;
}

/* Policy document */
.policy-document {
  max-width: 100%;
}

.policy-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-300);
}

.policy-header h1 {
  margin: 0 0 1rem 0;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: var(--weight-bold);
  color: var(--red-900);
  line-height: var(--leading-tight);
}

@media (min-width: 600px) {
  .policy-header h1 {
    font-size: 2.5rem;
  }
}

.policy-abstract {
  font-size: 1.25rem;
  color: var(--gray-700);
  margin: 0 0 1.5rem 0;
  line-height: var(--leading-normal);
}

.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin: 0;
  font-size: 0.875rem;
}

.policy-meta .meta-item {
  display: flex;
  gap: 0.5rem;
}

.policy-meta dt {
  color: var(--gray-600);
  font-weight: var(--weight-medium);
}

.policy-meta dd {
  margin: 0;
  color: var(--gray-950);
}

/* Policy content */
.policy-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  color: var(--red-900);
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold-primary);
}

@media (min-width: 600px) {
  .policy-content h2 {
    font-size: 1.75rem;
  }
}

.policy-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold);
  color: var(--red-800);
  margin: 1.5rem 0 0.75rem 0;
}

.policy-content h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  color: var(--gray-900);
  margin: 1.25rem 0 0.5rem 0;
}

.policy-content p {
  margin: 0 0 1rem 0;
  line-height: var(--leading-relaxed);
}

.policy-content ul,
.policy-content ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
  line-height: var(--leading-relaxed);
}

.policy-content li {
  margin-bottom: 0.5rem;
}

.policy-content strong {
  font-weight: var(--weight-semibold);
}

.policy-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1rem;
}

.policy-content th,
.policy-content td {
  border: 1px solid var(--gray-300);
  padding: 0.75rem;
  text-align: left;
}

.policy-content th {
  background-color: var(--gray-100);
  font-weight: var(--weight-semibold);
  color: var(--gray-900);
}

.policy-content a {
  color: var(--red-primary);
  text-decoration: underline;
}

.policy-content a:hover,
.policy-content a:focus {
  color: var(--red-800);
}

/* Footer */
.site-footer {
  background-color: var(--red-primary);
  color: var(--red-100);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.9375rem;
  border-top: 4px solid var(--gold-primary);
}

.site-footer p {
  margin: 0 0 0.75rem 0;
}

.footer-authority {
  font-weight: var(--weight-medium);
  color: var(--bg-white);
}

.footer-statement {
  font-style: italic;
  color: var(--red-200);
}

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

.footer-nav a {
  color: var(--gold-300);
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: var(--gold-primary);
  text-decoration: underline;
}

.footer-copyright {
  color: var(--bg-white);
  font-size: 0.875rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--red-800);
}

/* Focus styles - Yellow background with black outline per design system */
a:focus,
button:focus {
  outline: 3px solid var(--gold-primary);
  outline-offset: 2px;
  background-color: var(--gold-primary);
  color: var(--gray-950);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .policy-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  body {
    font-size: 1rem;
  }
}

/* Print styles */
@media print {
  .skip-link,
  .site-header,
  .site-footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000000;
  }

  a {
    text-decoration: none;
    color: #000000;
  }

  .policy-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  .policy-header h1 {
    color: #000000;
  }

  .policy-content h2 {
    border-bottom-color: #000000;
  }
}

/* Home page styles */
.home-hero {
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gold-primary);
}

.home-hero h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: var(--weight-bold);
  color: var(--red-900);
  margin: 0 0 1rem 0;
}

@media (min-width: 600px) {
  .home-hero h1 {
    font-size: 2.5rem;
  }
}

.home-intro {
  font-size: 1.25rem;
  color: var(--gray-700);
  max-width: 600px;
  margin: 0;
  line-height: var(--leading-normal);
}

.home-policies h2,
.home-about h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  color: var(--red-900);
  margin: 0 0 1rem 0;
}

.policy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.policy-list li {
  margin-bottom: 0.75rem;
}

.policy-list a {
  display: block;
  padding: 1rem;
  background-color: var(--bg-page);
  border: 1px solid var(--gray-300);
  border-left: 4px solid var(--red-primary);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background-color 0.15s;
}

.policy-list a:hover,
.policy-list a:focus {
  background-color: var(--red-100);
  border-left-color: var(--gold-primary);
  outline: none;
}

.policy-list strong {
  display: block;
  color: var(--red-primary);
  font-size: 1.0625rem;
  font-weight: var(--weight-semibold);
  margin-bottom: 0.25rem;
}

.policy-list span {
  font-size: 0.9375rem;
  color: var(--gray-700);
}

.home-about {
  padding: 1.5rem 0;
}

.home-about p {
  margin: 0 0 1rem 0;
  color: var(--gray-700);
}

/* Error page styles */
.error-page {
  padding: 3rem 0;
  text-align: center;
}

.error-page h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: var(--weight-bold);
  color: var(--red-900);
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.error-page h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold);
  color: var(--red-900);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.error-page ul {
  list-style: none;
  padding: 0;
}

.error-page li {
  margin-bottom: 0.5rem;
}

.error-page a {
  color: var(--red-primary);
  text-decoration: underline;
}

.error-page a:hover,
.error-page a:focus {
  color: var(--red-800);
}
