/* mptrim.com site styles - replaces w3.css. Also styles the few w3-* classes used in page content. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #e2e6eb;
  --accent: #0d7c72;
  --accent-hover: #0a655d;
  --accent-soft: #e3f4f1;
  --accent-text: #ffffff;
  --date: #c2410c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --radius: 10px;
  --nav-w: 240px;
  --top-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --surface: #181e26;
    --text: #e4e8ee;
    --muted: #9aa5b4;
    --border: #2a323d;
    --accent: #2bb8a8;
    --accent-hover: #4fd0c1;
    --accent-soft: #15302d;
    --accent-text: #0b1512;
    --date: #fb923c;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.brand:hover { color: var(--text); }

.topbar .btn { margin-left: auto; }

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}
.menu-btn:hover { background: var(--accent-soft); }

/* ---------- buttons ---------- */

.btn, .w3-btn {
  display: inline-block;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
}
.btn:hover, .w3-btn:hover { background: var(--accent-hover); color: var(--accent-text); }

/* ---------- layout ---------- */

.layout {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
}

.sidenav {
  flex: 0 0 var(--nav-w);
  position: sticky;
  top: var(--top-h);
  align-self: flex-start;
  max-height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 24px 12px 32px 20px;
}

.sidenav h4 {
  margin: 22px 0 6px 10px;
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.sidenav h4:first-child { margin-top: 0; }

.sidenav a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.sidenav a:hover { background: var(--accent-soft); color: var(--text); }

/* htmlmake marks the current page's link with class "w3-lime" */
.sidenav a.w3-lime {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.downloads {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.downloads h4 { margin: 0 0 8px 0; }
.sidenav .downloads a { padding: 4px 0; color: var(--accent); font-weight: 600; }
.sidenav .downloads a:hover { background: none; text-decoration: underline; }
.downloads small { color: var(--muted); font-weight: 400; }

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 32px 32px 48px;
}

.page-head h2 {
  margin: 0 0 20px;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.content {
  max-width: 780px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-wrap: break-word;
}
.content > :first-child { margin-top: 0; }

.content h1, .content h3, .content h4, .content h5 {
  margin: 1.6em 0 .5em;
  line-height: 1.3;
}
.content h5 { font-size: 1.1rem; }

.content ul, .content ol { padding-left: 1.4em; }
.content li { margin: .25em 0; }

.content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.content img {
  display: block;
  margin: 1.5em 0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .12);
}

/* dates written as <font color=red> in the page sources */
.content font[color] { color: var(--date); font-weight: 600; }

/* ---------- content classes from the old w3.css ---------- */

.w3-panel {
  margin: 16px 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.w3-panel > :first-child { margin-top: 0; }
.w3-panel > :last-child { margin-bottom: 0; }
.w3-panel ol, .w3-panel ul { margin: .4em 0 0; }

/* home page announcement */
.w3-panel.w3-border-top.w3-border-bottom {
  border-color: transparent;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.w3-round-xlarge { border-radius: 14px; }
.w3-border { border: 1px solid var(--border); }

.w3-radio { accent-color: var(--accent); margin-right: 6px; }

/* ---------- tables ---------- */

.content table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  font-size: .95rem;
}
.content th, .content td {
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.content th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.content tr:hover td { background: var(--accent-soft); }
.table-scroll { overflow-x: auto; }

/* ---------- forms ---------- */

.content input[type=text], .content input:not([type]) {
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.content input[type=checkbox] { accent-color: var(--accent); margin-right: 6px; }

/* ---------- footer ---------- */

.site-footer {
  max-width: 780px;
  margin-top: 32px;
  font-size: .875rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .topbar { padding: 0 16px; }

  .sidenav {
    position: fixed;
    top: var(--top-h);
    left: 0;
    bottom: 0;
    z-index: 15;
    width: 280px;
    max-height: none;
    padding: 20px 16px 32px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  body.nav-open .sidenav { transform: none; }

  .main { padding: 20px 16px 40px; }
  .page-head h2 { font-size: 1.6rem; }
  .content { padding: 20px 16px; }
  .content table { display: block; overflow-x: auto; }
}

@media (max-width: 420px) {
  .topbar .btn { padding: 6px 12px; font-size: .9rem; }
}
