/* General Styles */
html,
body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-feature-settings: "zero";
  background-color: #f4f4f4;
  color: #333;
  overflow-y: scroll;
  overflow-x: hidden;
}

.print-hide {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

sup {
  font-size: 0.6em; /* adjust as needed */
  vertical-align: super; /* ensures it's raised properly */
}

/* Table */
.table {
  width: 100%;
  max-width: 800px;
  border-collapse: collapse;
  margin: 2rem auto;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.table caption {
  caption-side: top;
  font-size: 1em;
  margin-bottom: 1rem;
  font-weight: bold;
  color: #333;
}

.table th,
.table td {
  border: 1px solid #ddd;
  padding: 12px 16px;
  text-align: center;
}

.table th {
  background-color: #61a7ed;
  color: white;
}

.table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.table tr:hover {
  background-color: #e0f7fa;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  background-color: #fff;
}

header {
  padding: 20px 0;
  text-align: center;
}

.logo {
  max-width: 100%;
  height: auto;
}

/* Navigation */
.navbar {
  background-color: #333;
  position: relative;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: left;
  flex-wrap: wrap;
}

.nav-list a.active {
  background-color: #007acc; /* or any color you prefer */
  color: white;
}

.nav-list li {
  margin: 0;
}

.nav-list a {
  display: block;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  transition: background 0.3s;
}

.nav-list a:hover {
  background-color: #555;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 15px;
}

.menu-toggle .bar {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 4px 0;
}

figcaption {
  font-style: italic;
  font-weight: bold;
  font-size: 1em;
  text-align: center;
  color: #085dee;
  margin-top: 0.5em;
}

/* Main Content */
main {
  padding: 20px;
  flex: 1;
  max-width: 100%;
  overflow-x: hidden;
}

.content-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: #333;
  color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .results-table {
    overflow-x: auto;
  }
  .results-table table {
    min-width: 500px;
  }
  .menu-toggle {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    display: none;
    width: 100%;
  }

  .nav-list.active {
    display: flex;
  }

  .nav-list a {
    text-align: center;
    padding: 10px;
    border-top: 1px solid #444;
  }
}

/* Submenu Base Style */
.nav-list li ul {
  display: none;
  position: absolute;
  background-color: #444;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 1000;
  min-width: 200px;
}

.nav-list li:hover > ul {
  display: block;
}

.nav-list li ul li a {
  padding: 10px 15px;
  color: white;
  text-decoration: none;
  display: block;
}

.nav-list li ul li a:hover {
  background-color: #666;
}

/* Ensure submenu appears below parent item */
.nav-list li {
  position: relative;
}

@media (max-width: 768px) {
  .results-table {
    overflow-x: auto;
  }
  .results-table table {
    min-width: 500px;
  }
  .nav-list li ul {
    position: static;
    display: none;
    background-color: #333;
  }

  .nav-list li.active ul {
    display: flex;
    flex-direction: column;
  }

  .nav-list li ul li a {
    border-top: 1px solid #444;
    text-align: center !important;
    display: block;
    width: 100%;
  }
}

/* Optional hover effect for consistency */
.menu-label:hover {
  background-color: #555;
}

.has-submenu {
  position: relative;
}

.has-submenu .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #444;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 200px;
  z-index: 1000;
}

.has-submenu:hover .submenu {
  display: block;
}

.has-submenu .submenu li a {
  padding: 10px 15px;
  color: white;
  text-decoration: none;
  display: block;
}

.has-submenu .submenu li a:hover {
  background-color: #666;
}

.menu-label {
  display: block;
  padding: 15px 20px;
  color: white;
  background-color: #333;
  user-select: none;
  cursor: default;
}

.has-submenu.active > .menu-label {
  background-color: #007acc;
  color: white;
}

ol li,
ul li {
  margin-bottom: 0.5em; /* Adjust as needed */
}

/* Moxon Calculator Specific Styles */

.form-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: left;
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
  min-width: 100px;
}

.form-group input,
.form-group select {
  padding: 8px;
  font-size: 1em;
  margin-top: 5px;
  height: 38px;
  box-sizing: border-box;
}

button {
  background: #0078d7;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1em;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 22px;
}

button:hover {
  background: #005fa3;
}

.results-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
  align-items: center; /* NEW: Center children horizontally */
}

.results-table {
  display: flex;
  justify-content: center; /* Ensures table itself is centered */
  width: 100%;
}

.results-table table {
  font-size: 0.9em;
  margin: auto; /* Ensures the table inside is centered */
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
}

th {
  background: #0078d7;
  color: white;
}

.diagram img {
  width: 100%;
  height: auto;
  max-width: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (min-width: 768px) {
  .results-container {
    flex-direction: row;
  }

.diagram {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
#diagram {
  border: 1px solid #ccc;
  margin-top: 15px;
  display: none;
  max-width: 100%;
  height: auto;
}

.diagram-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.diagram-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.diagram-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.diagram-form .form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagram-form label {
  flex: 0 0 200px; /* Fixed label width */
  font-weight: bold;
  text-align: right;
}

.diagram-form input {
  flex: 1;
  padding: 6px;
  box-sizing: border-box;
}