:root {
  --topbar-height: 50px;
  --sidebar-width: 180px;
}

html,
body {
  margin: 0;
  background-color: #fff;
}
body {
  min-height: 100vh;
  padding-top: var(--topbar-height);
  box-sizing: border-box;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  box-sizing: border-box;
  display: flex;
  padding: 0 12px;
  background-color: #b28fce;
  z-index: 1001;
}
.site-title {
  position: absolute;
  top: 0;
  right: 12px;
  margin: 0;
  white-space: nowrap;
  color: #000;
  text-decoration: none;
  font-size: 2em;
  font-weight: bold;
}

main {
  min-height: calc(100vh - var(--topbar-height));
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  box-sizing: border-box;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  margin: 10px 0 0 0;
}
.bar {
  height: 4px;
  width: 100%;
  background-color: #000;
  border-radius: 2px;
}

.menu {
  display: flex;
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  box-sizing: border-box;
  flex-direction: column;
  overflow-y: auto;
  background-color: #86c166;
  z-index: 1000;
  border-radius: 0 100px 100px 0;
  padding-bottom: 50px;
}
.menu-list {
  padding: 0;
  margin: 10px 0 0 30px;
  padding-left: 0;
}
.menu-list ul {
  margin: 10px 0 0;
  padding-left: 12px;
}
li {
  margin: 3px 0;
}

.close-btn {
  display: none;
  position: relative;
  width: 30px;
  height: 30px;
  left: 0px;
  border: none;
  background: none;
  cursor: pointer;
  margin: 10px;
}
.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
  top: calc(50% - 2px);
  left: 0;
  height: 4px;
  width: 100%;
  background-color: #000;
  border-radius: 2px;
}
.close-btn::before {
  transform: rotate(45deg);
}
.close-btn::after {
  transform: rotate(-45deg);
}

.work-container {
  padding: 5px 10px;
}
.caption {
  text-align: center;
  margin: 20px 0 50px;
}
#title {
  font-size: 2em;
  margin: 0;
}
#creator {
  font-size: 0.9em;
  margin: 5px;
}
#content {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.work-novel {
  color: #222;
  font-size: 1.1em;
  text-align: left;
  max-width: 800px;
  margin: 20px auto;
  font-family:
    "游明朝", "Yu Mincho", "YuMincho", "ヒラギノ明朝 ProN",
    "Hiragino Mincho ProN", "MS P明朝", "MS Mincho", serif;
}
.work-image {
  width: auto;
  max-width: min(100%, 500px);
  height: auto;
  display: block;
  margin: 20px auto;
}

#works-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
}
#works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}
.work-card {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
}
.work-card-title {
  font-size: 1.2em;
  margin: 10px 0;
}
.work-card-preview {
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.work-card-image {
  width: auto;
  max-width: min(100%, 500px);
  height: auto;
  border-radius: 4px;
}
.work-card-excerpt {
  font-size: 0.9em;
  color: #666;
  text-align: left;
}

@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }
  .close-btn {
    display: block;
  }

  main {
    width: 100%;
    margin-left: 0;
  }

  .hidden {
    display: none;
  }

  .menu {
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 220ms ease,
      visibility 0s linear 220ms;
  }
  .menu.is-open {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform 220ms ease,
      visibility 0s;
  }
}
