/* RESET + BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

/* LINKS */
a {
  color: #0071e3;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* HEADER */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  border-bottom: 1px solid #ddd;
  background: #fff;
  position: sticky;   /* changed to sticky */
  top: 0;
  z-index: 1000;
}
.site-header .logo {
  font-weight: 600;
  font-size: 1.5rem;
}
.site-header .menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.site-header .menu a {
  font-weight: 500;
  color: #333;
}
.site-header .menu a:hover {
  color: #0071e3;
}
.site-header .menu a {
  font-weight: bold;
}

/* FOOTER */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
  background: #f9f9f9;
}
.site-footer a {
  margin: 0 1rem;
  font-weight: 500;
}
.site-footer a:hover {
  color: #0071e3;
}

/* DROPDOWN MENU */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 8px;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* HAMBURGER MENU */
.hamburger-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

/* TABLET / MOBILE (UP TO 768px) */
@media (max-width: 768px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;

    /* keep sticky even in this layout */
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .site-header .menu-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    padding: 1rem 0;
  }

  .site-header .menu-links a,
  .site-header .menu-links .dropdown {
    margin: 0;
    padding: 10px 20px;
  }

  .hamburger-menu-btn {
    display: block;
  }

  .site-header .menu-links.is-active {
    display: flex;
  }

  .dropdown-content {
    position: static;
    width: 100%;
    box-shadow: none;
    background-color: #eee;
  }
}

/* MAIN CONTENT */
.main-content {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
}

/* GENERIC CARD STYLE */
.card {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* CHART STYLES */
.chart-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 2rem auto;
}
.chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

/* CALCULATOR STYLES */
.calculator {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.calculator label {
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.calculator input, 
.calculator select, 
.calculator button {
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}
.calculator input:focus, 
.calculator select:focus {
  border-color: #0071e3;
  outline: none;
}
.calculator button {
  background: #0071e3;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}
.calculator button:hover {
  background: #005bb5;
}

/* TILE GRID FOR CALCULATORS */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tile {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 180px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.tile h3 {
  margin-bottom: 0.3rem;
  color: #111;
  font-size: 1.1rem;
}
.tile p {
  color: #555;
  font-size: 0.9rem;
}

/* EXTRA SMALL (UP TO 600px) */
@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;

    /* Keep sticky here too */
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .site-header .menu {
    margin-top: 0.5rem;
  }

  .main-content {
    padding: 1rem;
  }
}
