/*===============================================
  Design Tokens
===============================================*/

:root {
  /* Colors */
  --color-bg: #f5f7fa;
  --color-primary: #1a73e8;
  --color-secondary: #202124;
  --color-accent: #ff6d01;
  --color-text: #3c4043;

  /* Layout */
  --spacing: 1rem;
  --max-width: 88%;

  /* Typography */
  --font-sans: 'Helvetica Neue', Arial, sans-serif;

  /* Effects */
  --radius: 0.5rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: 0.3s ease;
}

html {
  overflow-y: scroll;                /* even when content fits */
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
}

/*===============================================
  Scrollbar Styling
===============================================*/

body {
  scrollbar-width: thin;            /* make it thinner */
  scrollbar-color: #888 #f1f1f1;    /* thumb color / track color */
}

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
  border: 2px solid #f1f1f1;       /* gives it some padding */
}

::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/*===============================================
  Reset & Base Styles
===============================================*/

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/*===============================================
  Typography
===============================================*/

h1, h2, h3, h4, h5, h6 {
  color: var(--color-secondary);
  line-height: 1.2;
  margin-bottom: calc(var(--spacing) * 1.5);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover, a:focus {
  color: var(--color-accent);
}
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/*===============================================
  Layout Utilities
===============================================*/

.container, header, section, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--spacing) * 2);
}
.u-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.u-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing);
}

/*===============================================
  Navigation
===============================================*/

nav ul {
  list-style: none;
  display: flex;
  gap: var(--spacing);
}
.nav-link {
  padding: calc(var(--spacing) / 2) var(--spacing);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link:focus {
  background-color: var(--color-primary);
  color: #fff;
}
.nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/*===============================================
  Buttons
===============================================*/

button, .btn {
  font-family: var(--font-sans);
  display: inline-block;
  padding: var(--spacing) calc(var(--spacing) * 1.5);
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-align: center;
}
button:hover, .btn:hover {
  background-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}


/*===============================================
  Header & Footer
===============================================*/
header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 10;
}
main {
  padding: var(--spacing) 0;
  padding-bottom: var(--spacing) 0;
}
footer {
  text-align: center;
  font-size: 0.875rem;
  color: #777;
  padding: var(--spacing) 0;
}

/* ==================
dropdown containers 
=====================*/

/* dropdown container */
.nav-item {
  position: relative;
}

/* hidden by default */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;                /* just below the nav bar */
  left: 0;
  background: #fff;
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  min-width: 200px;
  z-index: 20;
}

/* show on hover or when focused */
.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  display: block;
}

/* style the inner links */
.dropdown-menu li + li {
  border-top: 1px solid rgba(0,0,0,0.05);
}

.dropdown-menu a {
  display: block;
  padding: var(--spacing) var(--spacing);
  color: var(--color-text);
  transition: background var(--transition), color var(--transition);
}
.dropdown-menu {
  border-radius: var(--radius);
  overflow: hidden; /* clip any child backgrounds to those rounded corners */
}

/* Reset any rounding on every link */
.dropdown-menu a {
  border-radius: 0;
}

/* Top menu item: round top corners */
.dropdown-menu li:first-child a {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

/* Bottom menu item: round bottom corners */
.dropdown-menu li:last-child a {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
  background: var(--color-primary);
  color: #fff;
}