/* Page frame shared by every page: content on the left, sidebar on the right.
   Colors, fonts and cursors come from style.css. */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 56px;
  min-height: 100vh;
  padding: 24px 28px;
}

.rule { border: 0; border-top: 1px dashed var(--rule); }

/* ─── Left: content ─── */
.main { display: flex; flex-direction: column; }

.mark-link { align-self: flex-start; }
.mark { display: block; width: 40px; height: 40px; margin: 8px 0 24px; }
.mark g { stroke: var(--text); }

.main > section { flex: 1; }

.foot { font-size: 14px; color: var(--muted); padding-bottom: 14px; }

/* ─── Right: sidebar ─── */
.side {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 10px;
}

.side a { color: var(--text); text-underline-offset: 4px; text-decoration-thickness: 1px; }

.side-top { display: flex; justify-content: space-between; align-items: center; }
.name { font-size: 18px; font-weight: 400; }

.tagline { text-align: center; font-weight: 400; font-size: 15px; padding: 8px 0; }

.bio p + p { margin-top: 1.1em; }

/* Page links in the subpage sidebar */
.side-nav { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.side-nav a { text-decoration: none; color: var(--muted); transition: color 0.2s ease; }
.side-nav a:hover,
.side-nav a[aria-current="page"] { color: var(--text); }
.side-nav a[aria-current="page"] { text-decoration: underline; }

.links { display: grid; grid-template-columns: 90px 1fr; font-size: 15px; }
.links ul { list-style: none; }
.links li::before { content: "→ "; }
/* "Based in" row under the links, in the same grid */
.links .based { grid-column: 1 / -1; margin-top: 14px; }


/* ─── Theme toggle ─── */
/* Sun by day, moon by night, both cut from an 18th-century engraving
   (ornaments/nov-2023-prints-00036.webp). The PNGs are masks, so they take
   the text color. */
.theme-toggle {
  align-self: center;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  transition: opacity 0.2s ease;
}
.theme-toggle:hover { opacity: 0.6; }
.sky {
  grid-area: 1 / 1;
  background: currentColor;
  -webkit-mask: var(--img) center / contain no-repeat;
          mask: var(--img) center / contain no-repeat;
}
.sky-sun  { --img: url('../ornaments/sun.png');  width: 35px; height: 35px; }
.sky-moon { --img: url('../ornaments/moon.png'); width: 22px; height: 22px; display: none; }
:root[data-theme="dark"] .sky-sun  { display: none; }
:root[data-theme="dark"] .sky-moon { display: block; }

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; gap: 24px; padding: 16px; }
  .side { order: -1; position: static; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
}

/* Tagline fades between a few lab-notebook lines (js/main.js) */
.tagline .rotate { display: inline-block; transition: opacity .5s ease, transform .5s ease; }
.tagline .rotate.out { opacity: 0; transform: translateY(-6px); }
