/*
 * site.css: styles shared by every page.
 * Each page also loads one page-type file (painting.css, animation.css or
 * info.css) after this one, which adds or overrides a few rules.
 */

/* Page frame */

#container {
  width: 960px;
  margin: 0 auto;
  position: relative;
  height: auto;
  text-decoration: none;
}

#titlebox {
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 40px;
  letter-spacing: -3px;
  word-spacing: -2px;
  color: #333;
  text-align: left;
  margin-top: 15px;
  margin-left: 220px;
}

#contentbox {
  width: 960px;
}

#paintingbox {
  float: left;
  width: 780px;
  margin-top: 33px;
  text-align: center;
}

#footer {
  width: 450px;
  margin-top: 1300px;
  margin-left: 157px;
  text-align: right;
  color: #888;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: 14px;
}

/* Menu: Painting, Animation, Info */

#menubox {
  width: auto;
  margin-top: 20px;
  font-family: "Lucida Console", Monaco, monospace;
  letter-spacing: -1px;
  color: #333;
  margin-left: 687px;
  font-size: 18px;
}

#menuitem {
  width: auto;
  text-align: center;
  display: inline;
  margin-right: 10px;
}

#menubox a:link,
#menubox a:visited {
  color: #777;
  text-decoration: none;
}

#menubox a:hover {
  color: #444;
}

#menubox a:active {
  color: #111;
}

/* Sidebar with thumbnails of other works */

#sidebar {
  float: right;
  width: 170px;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 30px;
  margin-bottom: 100px;
  text-align: left;
}

#paintingmenu {
  width: 170px;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 0px;
  margin-bottom: 0px;
  text-align: left;
}

#paintingmenu a:link,
#paintingmenu a:visited {
  color: #fff;
}

#paintingmenu a:hover {
  color: #f00;
}

#paintingmenu a:active {
  color: #603;
}

#sidebarEntry1 {
  margin-left: 5px;
  margin-top: 182px;
  font-family: "Lucida Console", Monaco, monospace;
  letter-spacing: -1px;
  color: #666;
  font-size: 16px;
}

#sidebarEntry2 {
  margin-left: 3px;
  margin-top: 5px;
  font-family: "Lucida Console", Monaco, monospace;
  letter-spacing: -1px;
  color: #666;
  font-size: 13px;
}

/*
 * Caption under the artwork: title and size on the left, medium and year on
 * the right. The caption is 390px wide unless a page sets its own width on
 * #infobox (to match the width of that painting).
 */

#infobox {
  margin: 0 auto;
  position: relative;
  width: 390px;
  margin-top: 5px;
  margin-bottom: 10px;
}

#infoleft,
#inforight {
  width: 50%;
}

#infoleft {
  float: left;
  text-align: left;
}

#inforight {
  float: right;
  text-align: right;
}

#texttopleft,
#textbottomleft,
#texttopright,
#textbottomright {
  width: 100%;
  height: auto;
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 13px;
  letter-spacing: -1px;
  word-spacing: -2px;
  color: #666;
}

#texttopleft,
#textbottomleft {
  float: left;
  text-align: left;
}

#texttopright,
#textbottomright {
  float: right;
  text-align: right;
}

/* Detail images below the caption */

#detailbox {
  width: 780px;
  margin-top: 100px;
  color: #fff;
  text-align: center;
}

/*
 * Phone and tablet menu (the ☰ button and the slide-in panel).
 * The button is hidden on desktop, and the panel only shows when opened,
 * so none of this affects the desktop layout.
 */

.menu-button {
  display: none;
  border: 0;
  background: none;
  padding: 10px 8px;
  color: #555;
  cursor: pointer;
}

.menu-button svg {
  display: block;
}

#site-menu {
  margin: 0 0 0 auto;
  width: min(300px, 82vw);
  height: 100%;
  max-height: none;
  border: 0;
  padding: 12px 0 24px;
  background: #fff;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  font-family: "Lucida Console", Monaco, monospace;
  letter-spacing: -1px;
  transition:
    transform 0.25s ease,
    display 0.25s allow-discrete,
    overlay 0.25s allow-discrete;
}

#site-menu:not(:popover-open) {
  transform: translateX(100%);
}

@starting-style {
  #site-menu:popover-open {
    transform: translateX(100%);
  }
}

#site-menu::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.menu-close {
  display: block;
  margin: 0 8px 4px auto;
  border: 0;
  background: none;
  padding: 6px 10px;
  font-size: 28px;
  line-height: 1;
  color: #777;
  cursor: pointer;
}

.menu-section > summary,
.menu-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid #eee;
  font-size: 18px;
  color: #777;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}

.menu-section > summary::-webkit-details-marker {
  display: none;
}

.menu-section > summary::after {
  content: "\203A";
  font-size: 22px;
  transition: transform 0.2s;
}

.menu-section[open] > summary {
  color: #111;
}

.menu-section[open] > summary::after {
  transform: rotate(90deg);
}

.menu-link {
  border-bottom: 1px solid #eee;
}

.menu-section ul {
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
}

.menu-section li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 20px 7px 32px;
  font-size: 15px;
  color: #666;
  text-decoration: none;
}

.menu-section li img {
  flex: none;
  object-fit: cover;
}

.menu-section li a[aria-current="page"] {
  color: #111;
}

.menu-section li a[aria-current="page"] img,
.menu-section li a:hover img,
.menu-section li a:focus-visible img {
  outline: 2px solid #f00;
  outline-offset: 1px;
}

.menu-section li a:active img {
  outline: 2px solid #603;
  outline-offset: 1px;
}

/*
 * Phones and tablets (narrower than the 960px desktop layout):
 * one column, ☰ button instead of the top menu and thumbnail sidebar.
 */

@media (max-width: 979px) {
  #container {
    width: auto;
    padding: 0 16px;
  }

  /* name centred on the screen; slightly smaller on 320px-wide phones so it
     stays on one line */
  #titlebox {
    margin: 14px 0 0;
    text-align: center;
    font-size: min(28px, 7.5vw);
    line-height: 1.2;
    letter-spacing: -2px;
  }

  /* ☰ vertically centred on the name: the name's line is 1.2 x its font
     size and starts at the top of #container; the button is 40px tall */
  .menu-button {
    display: block;
    position: absolute;
    top: calc(0.6 * min(28px, 7.5vw) - 20px);
    right: 8px;
  }

  #menubox,
  #sidebar {
    display: none;
  }

  #contentbox,
  #paintingbox,
  #detailbox {
    float: none;
    width: auto;
  }

  #paintingbox {
    margin-top: 16px;
  }

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

  #infobox {
    max-width: 100%;
    overflow: hidden;
  }

  #detailbox {
    margin-top: 40px;
  }

  #detailleft,
  #detailright {
    float: none;
  }

  #footer {
    clear: both;
    width: auto;
    margin: 40px 0 24px;
    text-align: center;
    font-size: 12px;
  }
}
