/* base.css for amk.ca
 *
 * Modern rewrite of the original site's unassuming look:
 * a header bar with title and breadcrumb, an optional left sidebar
 * (used by section pages such as QEL), a main column, and a small
 * footer.  Mobile-first; no framework.
 */

/* --- HTML baseline ------------------------------------------------ */

:root {
  /* Palette borrowed from the site's long-time plain-HTML colours. */
  --bg: #ffffff;
  --fg: #1a1a1a;
  --link: #0645ad;        /* familiar browser blue */
  --link-visited: #0b0080;
  --muted: #6e6e6e;
  --rule: #cccccc;
  --accent-bg: #f7f7f7;
  --max-width: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --fg: #dfdfdf;
    --link: #8ab4f8;
    --link-visited: #c58af9;
    --muted: #9aa0a6;
    --rule: #3c4043;
    --accent-bg: #1f2128;
  }
}

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

html {
  font-size: calc(0.875em + 0.25vw);      /* fluid type scale */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.55;
}

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

pre, code, kbd, samp {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95em;
}

pre {
  overflow-x: auto;
  padding: 0.75rem;
  background: var(--accent-bg);
  border-radius: 4px;
}

code {
  overflow-wrap: break-word;
}

/* Visible keyboard focus everywhere. */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Page structure ------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}

.skip-link:focus {
  left: 0;
  top: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 2px solid var(--fg);
  color: var(--fg);
}

.site-header {
  padding: 0.6rem 1rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.navbar {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Breadcrumb links inside the navbar. */
.navbar > a,
.navbar > nav a {
  color: var(--link);
}

.breadcrumb-sep {               /* the ">" between crumb links */
  margin: 0 0.35em;
  color: var(--muted);
}

.title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: normal;
  letter-spacing: 0.02em;
}

.page-body {
  display: grid;
  gap: 0 2.5rem;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 0 1rem;

  /* Single content column by default; pages WITH a sidebar opt in
     to a two-column layout at desktop sizes via .has-sidebar. */
  grid-template-columns: minmax(0, 1fr);
}

.content {
  padding-block: 1rem;
  overflow-wrap: break-word;
}

/* Two-column layout only when a sidebar is actually present.
   Sidebar: content 2.5 : 1. */
@media (min-width: 50rem) {
  .page-body.has-sidebar {
    grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  }
}

.sidebar {
  order: 2;
  font-size: 0.92rem;
  padding-top: 1rem;
}

@media (min-width: 50rem) {
  .sidebar { order: 0; }
}

/* Rule under page title, echoing the old design */
.content hr:first-child { display: none; }   /* theme puts spacing instead */

.meta-line {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88rem;
}

/* --- Talk slide decks ---------------------------------------------- */

/* S5 decks pass through untouched as static files; these rules never
   apply to them because they carry their own stylesheets. */
