/* martinism.com — modern responsive stylesheet (light + dark)
   Replaces the old frameset/presentational markup. */

:root {
  --bg:        #ffffff;
  --surface:   #f5f2f0;
  --text:      #1c1a19;
  --muted:     #6b6360;
  --accent:    #b00020;   /* the site's classic red */
  --accent-2:  #7a0016;
  --border:    #d9d2ce;
  --link:      #b00020;
  --link-hover:#7a0016;
  /* legacy colour-coding, tuned to work on light + dark */
  --ext:  rgba(214, 158, 0, 0.22);   /* was bgcolor=yellow  → external source */
  --buy:  rgba(140, 40, 90, 0.22);   /* was bgcolor=maroon  → for purchase   */
  --sep:  rgba(120, 120, 120, 0.20); /* was bgcolor=silver  → section header */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #16130f;
    --surface:   #201b16;
    --text:      #ece7e1;
    --muted:     #a89f97;
    --accent:    #ff6b6b;
    --accent-2:  #ff9a9a;
    --border:    #3a322b;
    --link:      #ff8a8a;
    --link-hover:#ffb0b0;
    --ext:  rgba(224, 178, 60, 0.20);
    --buy:  rgba(214, 120, 170, 0.20);
    --sep:  rgba(180, 180, 180, 0.14);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ---------- header + navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
}
.site-header .bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.2rem;
}
.site-title {
  font-size: 1.35rem;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-title span { color: var(--muted); font-weight: normal; font-size: 0.95rem; }

nav.main-nav {
  margin-left: auto;
}
nav.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
}
nav.main-nav a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}
nav.main-nav a:hover { background: var(--accent); color: #fff; }
nav.main-nav a.active { color: var(--accent); font-weight: bold; }

/* ---------- main content ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

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

center { display: block; text-align: center; }

/* legacy <font color="red"> → */
.hl { color: var(--accent); font-weight: bold; }

/* ---------- tables (with horizontal scroll on small screens) ---------- */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
}
table[border] td, table[border] th,
main td, main th {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  vertical-align: top;
  text-align: left;
}
tr.sep td, td.sep { background: var(--sep); font-weight: bold; }
td.ext { background: var(--ext); }
td.buy { background: var(--buy); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
}
.site-footer .bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: space-between;
}
.site-footer a { color: var(--link); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .bar { flex-direction: column; align-items: flex-start; }
  nav.main-nav { margin-left: 0; width: 100%; }
  .site-title { font-size: 1.2rem; }
}
