/* color */

:root {
  --background: #f3f3f3;
  --font: #333132;
  --accent: #008db7;
  --grass: #fff;
}

@media (prefers-color-scheme: dark) {
  html {
    transition: 0.5s;
  }

  :root {
    --background: #252525;
    --font: #f7f7f7;
    --accent: #1cadd9;
    --grass: #373737;
  }
}

/* font */

.zen-maru gothic-light {
  font-family: "Zen Maru Gothic", serif;
  font-weight: 300;
  font-style: normal;
}

.zen-maru gothic-regular {
  font-family: "Zen Maru Gothic", serif;
  font-weight: 400;
  font-style: normal;
}

.zen-maru gothic-medium {
  font-family: "Zen Maru Gothic", serif;
  font-weight: 500;
  font-style: normal;
}

.zen-maru gothic-bold {
  font-family: "Zen Maru Gothic", serif;
  font-weight: 700;
  font-style: normal;
}

.zen-maru gothic-black {
  font-family: "Zen Maru Gothic", serif;
  font-weight: 900;
  font-style: normal;
}

/* base layout */

body {
  max-width: 700px;
  height: auto;
  padding: 3rem;
  margin: 0 auto;
  background-color: var(--background);
  color: var(--font);
  font-family:
    "游ゴシック体", "YuGothic", "游ゴシック Medium", "Yu Gothic Medium",
    sans-serif;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: auto;
  padding: 2.5rem 1rem 3rem 1rem;
  box-sizing: border-box;
  z-index: 1000;
}

main {
  margin-top: 5.5rem;
}

footer {
  padding: 1.5rem 0;
}

/* text */

h1 {
  font-family: "Zen Maru Gothic";
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  padding-bottom: 2px;
}

h2,
h3,
a,
em,
strong,
time {
  font-family: "Zen Maru Gothic", serif;
}

h2,
a,
strong,
time,
li::marker,
summary::marker {
  color: var(--accent);
  font-weight: bold;
}

p,
li {
  line-height: 1.6;
}

a {
  word-break: break-all;
}

ul,
ol {
  padding-left: 1rem;
}

/* section */

header button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: var(--grass);
  width: 3rem;
  height: 3rem;
  border-radius: 50px;
  padding: 0;
  cursor: pointer;
}

header button svg {
  width: 95%;
  height: 95%;
  display: block;
}

header a:has(h1) {
  text-align: center;
  background-color: var(--grass);
  border-radius: 50px;
  margin: 0 1.25rem;
  width: 15rem;
  height: 3rem;
  text-decoration: none;
  color: var(--font);
}

rect {
  fill: var(--grass);
}

path {
  stroke: var(--font);
}

section,
.linkcard {
  padding: 1.5rem 2rem;
  border-radius: 15px;
}

header nav ul {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 15px;
  background-color: var(--grass);
  position: absolute;
  top: 30%;
  right: 3%;
  z-index: 1000;
  margin: 0;
}

header nav li {
  list-style: none;
}

header nav a {
  text-decoration: none;
  color: var(--font);
}

header button:hover {
  path {
    stroke: var(--accent);
  }
}

a:has(h1):hover,
header nav a:hover {
  color: var(--accent);
}

header nav span a {
  color: var(--accent);
  font-weight: bold;
  cursor: default;
}

section,
.linkcard {
  position: relative;
  border: var(--accent) 2px solid;
  margin: 2rem 0;
}

section h2,
.linkcard h2 {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-55%) translateX(1.5em);
  background-color: var(--background);
  margin: 0;
  padding: 0.5rem;
  font-size: 1.1rem;
}

.link::after {
  display: block;
  word-break: break-all;
  margin: 10px 0 0 0;
  content: attr(href);
  font-size: 0.9rem;
  color: var(--font);
  font-weight: normal;
}

.link {
  display: block;
  text-decoration: none;
}

/* media */

img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

.images {
  display: flex;
  gap: 5px;
  width: 100%;
  max-height: 350px;
  margin: auto;
  border-radius: 5px;
  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.images img {
  max-width: 80%;
  max-height: 350px;
  height: auto;
  width: auto;
  border-radius: 0;
  flex: 0 0 auto;
  scroll-snap-align: center;
}

figure {
  margin: 0.5rem 0;
}

figcaption,
.caption {
  text-align: center;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

iframe {
  width: 100%;
  aspect-ratio: 16/9;
}

@media (max-width: 430px) {
  body {
    padding: 2rem;
  }

  main {
    margin-top: 7rem;
  }

  header a:has(h1) {
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  header nav span {
    display: none;
  }

  header nav ul {
    position: inherit;
    gap: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50px;
  }

  header nav a {
    padding: auto;
  }

  .images img {
    max-height: 250px;
    max-width: 100%;
  }
}
