:root {
  --text-color: #333;
  --bg-color: #fff;
  --link-color: #0066cc;
  --table-border: #ddd;
  --table-row-even: #f9f9f9;
  --table-header-bg: #f2f2f2;
  --accent: #005f73;
  --input-bg: #f4f4f9;
  --border: #cccccc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e0e0e0;
    --bg-color: #1a1a1a;
    --link-color: #4da6ff;
    --table-border: #444;
    --table-row-even: #2a2a2a;
    --table-header-bg: #333;
    --accent: #94d2bd;
    --input-bg: #2d2d2d;
    --border: #444444;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  max-width: 65ch;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

nav {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--table-border);
  padding-bottom: 1rem;
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem;
  border: 1px solid var(--table-border);
  text-align: left;
}

th {
  background-color: var(--table-header-bg);
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: var(--table-row-even);
}

/* Details / Accordion */
details {
  border: 1px solid var(--table-border);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
}

summary {
  font-weight: bold;
  cursor: pointer;
  margin: -0.5rem -1rem;
  padding: 0.5rem 1rem;
}

details[open] summary {
  border-bottom: 1px solid var(--table-border);
  margin-bottom: 0.5rem;
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}

/* Print styling */
@media print {
  nav {
    display: none;
  }
  
  body {
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 12pt;
    color: #000;
    background-color: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  /* Ideal checklist printing */
  ul.checklist {
    list-style: none;
    padding-left: 0;
  }
  
  ul.checklist li::before {
    content: "☐ ";
  }
}

/* Calculator Styles */
.calculator-card {
  background-color: var(--input-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

select, input {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--bg-color);
  color: var(--text-color);
  box-sizing: border-box;
}

button {
  width: 100%;
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

#result-box {
  margin-top: 1.5rem;
  padding: 1rem;
  text-align: center;
  background-color: var(--bg-color);
  border: 2px dashed var(--accent);
  border-radius: 4px;
  font-size: 1.2rem;
  font-weight: bold;
  display: none;
}
