/* ===========================================================
   ASM 3150/5150 Tools — shared theme
   Palette from University of Idaho brand style guide:
   Pride Gold #F1B300, Silver #808080, Black #191919, White #FFFFFF
   Primary typeface: Public Sans
   =========================================================== */

:root {
  --ui-gold: #F1B300;
  --ui-gold-dark: #B38600;
  --ui-silver: #808080;
  --ui-silver-light: #E8E8E8;
  --ui-black: #191919;
  --ui-white: #FFFFFF;

  --bg: #F7F7F5;
  --surface: var(--ui-white);
  --border: #D9D9D6;
  --text: var(--ui-black);
  --text-muted: #55585c;
  --focus: #2b6cb0;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(25,25,25,0.08), 0 1px 2px rgba(25,25,25,0.06);
  --shadow-hover: 0 6px 16px rgba(25,25,25,0.12);

  --max-width: 1080px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Public Sans", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a { color: var(--ui-black); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--ui-black);
  color: var(--ui-white);
  border-bottom: 5px solid var(--ui-gold);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--ui-white);
}

.brand__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ui-gold);
  font-weight: 700;
}

.brand__title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand__subtitle {
  font-size: 0.85rem;
  color: #cfcfcf;
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ui-white);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--ui-gold);
  color: var(--ui-gold);
}

/* ---------- Layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page-intro {
  margin-bottom: 1.75rem;
}

.page-intro h1 {
  font-size: 1.7rem;
  margin: 0 0 0.35rem;
}

.page-intro p {
  color: var(--text-muted);
  margin: 0;
  max-width: 65ch;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a { color: var(--text-muted); }

/* ---------- Tool cards (home page) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--ui-gold);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.tool-card__icon {
  font-size: 1.6rem;
}

.tool-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.tool-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.tool-card--soon {
  opacity: 0.6;
  border-top-color: var(--ui-silver);
  cursor: default;
}

.tool-card--soon:hover {
  box-shadow: var(--shadow);
  transform: none;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--ui-silver-light);
  color: var(--text-muted);
  width: fit-content;
}

/* ---------- Panels / forms ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.15rem;
  border-bottom: 2px solid var(--ui-gold);
  padding-bottom: 0.5rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

select, input[type="number"], input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--ui-white);
  color: var(--text);
  font-family: inherit;
}

select:hover, input:hover { border-color: var(--ui-silver); }

.field { margin-bottom: 1rem; }
.field--hidden { display: none !important; }

.totalizer-row {
  display: flex;
  gap: 0.5rem;
}

.value-unit-pair {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 560px) {
  .value-unit-pair { grid-template-columns: 1fr; }
}

.solve-for {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.solve-for input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.solve-for label {
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--ui-white);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}

.solve-for input[type="radio"]:checked + label {
  background: var(--ui-black);
  border-color: var(--ui-black);
  color: var(--ui-white);
}

.solve-for input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}

.toggle-row input[type="checkbox"] {
  width: auto;
}

.toggle-row label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ui-gold);
  height: 1.4rem;
}

.slider-readout {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ui-black);
  margin-bottom: 0.2rem;
}

.slider-number-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.slider-number-row input[type="number"] {
  width: 6.5rem;
  flex: 0 0 auto;
}

.slider-number-row .unit-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.tool-purpose {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ui-black);
  border-left: 4px solid var(--ui-gold);
  padding: 0.6rem 1rem;
  margin: 0.75rem 0 0;
  max-width: 65ch;
  line-height: 1.4;
}

.formula-box {
  font-size: 0.95rem;
  background: var(--ui-silver-light);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.example-box {
  border-left: 4px solid var(--ui-gold);
  background: #FFFDF5;
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.example-box strong { color: var(--text); }

.converter-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 640px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
  .swap-btn { justify-self: center; }
}

.swap-btn {
  background: var(--ui-black);
  color: var(--ui-white);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
}

.swap-btn:hover { background: var(--ui-gold-dark); }

.result-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #FFF9E8;
  border: 1px solid var(--ui-gold);
  border-radius: var(--radius);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-box__value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ui-black);
}

.result-box__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-box__factor {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Reference tables ---------- */
.table-wrap {
  overflow-x: auto;
}

table.ref-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}

table.ref-table caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

table.ref-table th, table.ref-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

table.ref-table thead th {
  background: var(--ui-black);
  color: var(--ui-white);
}

table.ref-table tbody tr:nth-child(even) {
  background: #FAFAF8;
}

table.ref-table tr.section-row td {
  background: var(--ui-silver-light);
  font-weight: 700;
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
