:root {
  --color-bg: #ffffff;
  --color-text: #16202b;
  --color-muted: #57626e;
  --color-primary: #1c3f66;
  --color-primary-dark: #0f2843;
  --color-accent: #c8102e;
  --color-accent-dark: #a50d25;
  --color-border: #dbe1e8;
  --color-surface: #f4f6f9;
  --max-width: 1080px;
  --nav-breakpoint: 760px;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--color-primary-dark);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- Header / Nav ---------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--color-text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Hamburger button: hidden on wide screens, shown on narrow */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger {
  display: block;
  width: 22px;
  height: 16px;
  position: relative;
}
.hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; }
.hamburger span:nth-child(3) { top: 14px; }

.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

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

.site-nav a {
  display: inline-block;
  padding: 0.4rem 0.1rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.is-open {
    max-height: 320px;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav li {
    border-top: 1px solid var(--color-border);
  }

  .site-nav li:first-child {
    border-top: none;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0.1rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  padding: 3.5rem 0;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero p {
  margin: 0 0 1.5rem;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ---------- Sections / cards ---------- */

.section {
  padding: 2.75rem 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

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

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.card .meta {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin: 0 0 0.6rem;
}

.card p {
  margin: 0 0 0.75rem;
}

.card a.card-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-accent);
}

.card a.card-link:hover {
  color: var(--color-accent-dark);
}

.empty-state {
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  color: var(--color-muted);
  background: var(--color-surface);
}

.page-header {
  padding: 2.5rem 0 0.5rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--color-muted);
  max-width: 65ch;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- Month archive ---------- */

.month-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.month-index-grid a {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}

.month-index-grid a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.month-index-grid .count {
  display: block;
  font-weight: 400;
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.month-nav {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0 2.5rem;
}

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

.month-nav-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-primary-dark);
}

.month-nav-link:hover {
  color: var(--color-accent);
}

.month-nav-archive {
  font-weight: 600;
  color: var(--color-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

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