/* Shared layout for "A Clash between Game and Narrative" */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: #111;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: #1a4f8b; }
a:visited { color: #5a3d8a; }
img { max-width: 100%; height: auto; }

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- Left menu ---- */
#menu {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 1.25rem 1rem 2rem 1.25rem;
  border-right: 1px solid #e3e3e3;
  background: #fafafa;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
#menu p, #menu ol, #menu li, #menu b { font-family: inherit; font-size: inherit; }
#menu p, #menu li, #menu ol { font-family: Arial, Helvetica, sans-serif; }
#menu a { text-decoration: none; color: #111; }
#menu a:hover, #menu a:focus { text-decoration: underline; }
#menu .site-title {
  font-family: Eurostile, Arial, Helvetica, sans-serif;
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 .75rem;
}
#menu .byline { margin: 0 0 .75rem; }
#menu hr { border: 0; border-top: 1px solid #ddd; margin: .75rem 0; }
#menu ol { padding-left: 1.4em; margin: .75rem 0; }
#menu li { margin: .2rem 0; }
#menu a[aria-current="page"] { font-weight: bold; color: #1a4f8b; }

/* ---- Text area ---- */
main {
  width: 100%;
  max-width: 44rem;          /* about 70-80 characters per line */
  padding: 1.5rem 2rem 4rem;
  overflow-wrap: break-word;
}
main h1, main h2, main h3 { font-family: Arial, Helvetica, sans-serif; line-height: 1.2; }
main h1 { font-size: 1.7rem; margin: 2rem 0 .75rem; }
main h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
main h1 font, main h2 font, main h3 font { font-size: inherit !important; }
/* Block quotations in the thesis are marked up as h5/h6 */
main h5, main h6 {
  font-size: .92rem;
  font-weight: normal;
  line-height: 1.5;
  margin: 1rem 0 1rem 1.5rem;
}
main dir, main blockquote { margin-left: 1.5rem; padding-left: 0; }
main table { max-width: 100%; border-collapse: collapse; }
main td { vertical-align: top; }
main pre, main code { white-space: pre-wrap; }
main a { overflow-wrap: anywhere; }
main a[name]:not([href]), main a[id]:not([href]) { color: inherit; text-decoration: none; }

/* Top bar (only shown on narrow screens) */
.topbar { display: none; }

/* ---- Narrow screens: menu becomes a dropdown ---- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .layout { display: block; }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: .6rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #ddd;
    font-family: Arial, Helvetica, sans-serif;
  }
  .topbar-title { color: #111; text-decoration: none; font-weight: bold; font-size: 15px;
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-toggle {
    flex: none;
    font: inherit;
    font-size: 14px;
    padding: .4rem .75rem;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
  }
  .menu-toggle::after { content: " \25BE"; }
  .menu-toggle[aria-expanded="true"]::after { content: " \25B4"; }
  #menu {
    display: none;
    position: fixed;
    top: var(--topbar-h, 49px);
    left: 0;
    right: 0;
    z-index: 15;
    height: auto;
    max-height: calc(100vh - var(--topbar-h, 49px));
    overscroll-behavior: contain;
    border-right: 0;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 6px 12px rgba(0,0,0,.08);
  }
  #menu.open { display: block; }
  #menu .site-title { display: none; }
  main { padding: 1rem 1rem 3rem; }
  main h1 { font-size: 1.45rem; }
  main dir, main blockquote, main h5, main h6 { margin-left: .75rem; }
}

@media print {
  #menu, .topbar { display: none !important; }
  .layout { display: block; }
  main { max-width: none; padding: 0; }
}
