/* commonplace.css — standalone styling for the Commonplace page */

/* =====================
   THEME VARIABLES
===================== */

/* DARK (default) */
:root{
  --bg: #0e0e0e;
  --panel: #141414;
  --ink: #e6e6e6;
  --muted: #b8b8b8;
  --rule: #2a2a2a;

  --link: #e6e6e6;
  --link-hover-bg: #e6e6e6;
  --link-hover-ink: #0e0e0e;
}

/* LIGHT MODE */
:root.light{
  --bg: #e7d6b6;
  --panel: #f2e7d2;
  --ink: #111;
  --muted: #333;
  --rule: #111;

  --link: #111;
  --link-hover-bg: #111;
  --link-hover-ink: #e7d6b6;
}

/* =====================
   BASE
===================== */

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  padding: 48px 18px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.45;
}

/* =====================
   TOGGLES
===================== */

#toggles{
  display: inline-flex;
  gap: 10px;
  margin-bottom: 16px;
}

#toggles button{
  all: unset;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.2;
}

#toggles button:hover,
#toggles button:focus-visible{
  background: var(--ink);
  color: var(--bg);
  outline: none;
}

/* =====================
   LAYOUT: LEFT LIST COLUMN
===================== */

.center{
  max-width: 560px;
  margin-left: 16%;
  margin-right: auto;
  text-align: left;
}

h2, h3, hr, table{
  margin-left: 0;
  margin-right: 0;
}

/* titles */
h2{
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 22px;
}

h3{
  margin: 18px 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

/* dividers */
hr{
  border: 0;
  border-top: 1px solid var(--rule);
  width: 100%;
  margin: 14px 0;
}

/* lists (tables as lists) */
table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 10px;
}

td{
  padding: 3px 0;
  white-space: normal; /* wrap long titles */
}

/* make each link feel like a full-row list item */
table a{
  display: block;
  width: 100%;
  padding: 2px 0;
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

table a:hover,
table a:focus-visible{
  background: var(--link-hover-bg);
  color: var(--link-hover-ink);
  text-decoration: none;
  outline: none;
}

/* Back link at bottom */
a[href="index.html"]{
  display: inline-block;
  margin-top: 10px;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  text-decoration: none;
}

a[href="index.html"]:hover,
a[href="index.html"]:focus-visible{
  background: var(--ink);
  color: var(--bg);
}


/* =====================
   MONOSPACE MODE
===================== */

:root.mono body{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: 15px;
  line-height: 1.4;
}

/* =====================
   MOBILE
===================== */

@media (max-width: 700px){
  .center{
    margin-left: auto;
    margin-right: auto;
  }
}
/* FORCE back link to match Bookshelf */

a[href="home.html"],
a[href="index.html"]{
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  text-decoration: none;
}

a[href="home.html"]:visited,
a[href="index.html"]:visited{
  color: var(--ink);
}

a[href="home.html"]:hover,
a[href="index.html"]:hover,
a[href="home.html"]:focus-visible,
a[href="index.html"]:focus-visible{
  background: var(--ink);
  color: var(--bg);
  outline: none;
}

/* canonical Back button style */
a.back,
a.back:visited{
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

a.back:hover,
a.back:focus-visible{
  background: var(--ink);
  color: var(--bg);
  outline: none;
}
