:root {
  --bg-dark: #111827;
  --bg-light: #ffffff;
  --accent: #2563eb;
  --text-main: #111827;
  --text-muted: #4b5563;
  --border-subtle: #e5e7eb;
  --card-bg: #f9fafb;
  --max-width: 1100px;
  --radius: 8px;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
}

/* Header */
.site-header {
  background: var(--bg-dark);
  color: #ffffff;
  position: relative; /* needed for absolute dropdown option */
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 0.05rem;
}

.logo-img {
  height: 120px;
  width: auto;
}

.logo-text {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Navigation */
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
}

.main-nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.main-nav a:hover {
  color: #ffffff;
}

/* Burger button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
  position: relative;
  z-index: 3;
}

/* Hero */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.hero {
  margin: 1.5rem 0 2rem;
}

.hero h1 {
  font-size: 1.9rem;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 40rem;
}

/* Top grid: What's New + Learning & Events */
.top-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.view-all-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.view-all-link:hover {
  text-decoration: underline;
}

.whats-new,
.learning-events {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list li + li {
  margin-top: 0.5rem;
}

.item-list a {
  text-decoration: none;
  color: var(--text-main);
}

.item-list a:hover {
  text-decoration: underline;
}

.item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Events cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.event-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 0.9rem;
}

.event-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.event-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.event-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Featured */
.featured {
  margin-bottom: 2.5rem;
}

.featured h2 {
  margin-bottom: 0.75rem;
}

.featured-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
}

.featured-card h3 {
  margin-top: 0;
}

.primary-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: #ffffff;
  background: var(--accent);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
}

.primary-link:hover {
  background: #1d4ed8;
}

/* Newsletter & Portals */
.newsletter,
.portals {
  margin-bottom: 2rem;
}

.secondary-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.secondary-link:hover {
  text-decoration: underline;
}

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

/* Footer */
.site-footer {
  background: #f3f4f6;
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.seal-img {
  height: 60px;
  width: auto;
}

.footer-right p {
  margin: 0.1rem 0;
  font-size: 0.85rem;
}

copyright {
  font-size: 0.8rem;
}

/* ============================================================
   RESPONSIVE / MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;               /* allow nav to drop under logo + burger */
    align-items: center;
  }

  .menu-toggle {
    display: block;
  }

  /* Hide navigation by default on mobile */
  .main-nav {
    display: none;
    width: 100%;
    order: 3;                      /* force under logo + burger */
  }

  /* Show navigation when .open class is added by JS */
  .main-nav.open {
    display: block;
  }

  /* Vertical menu list */
  .main-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-dark);
    padding: 1rem;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .main-nav ul li a {
    color: #ffffff;
    padding: 0.45rem 0;
    display: block;
  }

  /* Mobile logo size */
  .logo-img {
    height: 48px;
  }

  .logo-text {
    font-size: 0.85rem;
  }

  /* Layout adjustments */
  .top-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

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