/* === RESET / 共通 === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === ベースレイアウト === */
html {
  font-size: 14px;
  line-height: 1.8;
  font-family: system-ui, sans-serif;
}

body {
  min-height: 100vh;
  padding: 0 .5rem;
  background-color: #fafcff;
  color: #333;
}

/* === 全体レイアウト === */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 2.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2em;
}

.content {
  display: flex;
  flex-direction: column;
  padding: .1rem;
  gap: .6rem;
}

/* === タイポグラフィ === */
h1 {
  color: #2564ad;
  font-size: 1.7rem;
}

h2 {
  margin-top: .5em;
  padding-left: .7em;
  border-bottom: 1px solid #ccd;
  border-left: 4px solid #2564ad;
  border-radius: 4px;
  font-size: 1.5rem;
  color: #2564ad;
}

h3 {
  margin: .5em .2em 0;
  padding: 0 .8em;
  border-left: 4px double #2564ad;
  font-size: 1.2rem;
  color: #495057;
}

p {
  padding: 0 1rem;
}

a {
  color: #005DEA;
}

a:visited {
  color: #8A74A5;
}

/* === コンテンツ内要素 === */
.content ul {
  padding-left: 2.4em;
}

.content li {
  padding-left: .1em;
}

.update-date {
  width: fit-content;
  margin: 0 .5em 0 auto;
  padding: .8em;
  color: #5e666d;
  font-size: .9em;
}

/* ここから iframe関連 */
.video-outer {
  width: 90%;
  max-width: 480px;
  margin: 0 auto;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* === サイト構成要素 === */
/* ここから header */
#site-name {
  display: inline-block;
  flex-shrink: 0;
  padding: 1em .9em;
  border-top: 1.5px solid #ccc;
  border-bottom: 1.5px solid #ccc;
  font-size: 1.1rem;
  font-weight: 550;
  color: #555d65;
  text-decoration: none;
}

/* ここから footer */
footer {
  margin: 2rem 0;
  padding-top: 1rem;
  border-top: 1px solid #ccd;
  text-align: center;
  color: #666;
  font-size: .9rem;
}

/* === メディアクエリ === */
@media (min-width: 600px) and (max-width: 660px) {
  .page-container {
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0;
  }

  .page-container {
    padding: .2rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  h1 {
    line-height: 1.3;
  }

  p {
    padding: 0 .4rem;
  }

  .content ul {
    padding-left: 1.6em;
  }
}

/* === スクリプト連携要素 === */
/* === △トップ === */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  opacity: .8;
  padding: 8px 12px;
  background: #007cba;
  border-radius: 4px;
  font-size: 16px;
  color: white;
  text-decoration: none;
}

#back-to-top.show {
  display: inline-block;
}

/* ======== Global Navigation ======== */
#gnav {
  flex-shrink: 0;
  inline-size: clamp(100px, 50%, 300px);
  background-color: #fefefe;
}

#gnav-ul {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  align-items: stretch;
  gap: 6px;
}

#gnav-ul>.gnav-li {
  flex: 1;
}

.gnav-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 12px 6px;
  box-shadow: 0 0 4px #ccc;
  border-radius: 6px;
  gap: 3px;
}

#gnav-ul :any-link {
  color: #333;
  text-decoration: none;
}

.gnav-item-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1px;
  gap: 2px;
  font-weight: 500;
  font-size: 0.9rem;
}

.gnav-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.gnav-btn:hover {
  background-color: #f0f0f0;
  box-shadow: none;
  text-decoration: none;
}

/* グローバルナビのメディアクエリ */
@media (max-width: 600px) {

  #gnav {
    display: flex;
    justify-content: center;
    width: 90%;
  }

  #gnav-ul {
    gap: 2px;
  }

  .gnav-icon {
    width: 18px;
    height: 18px;
  }

  .gnav-btn {
    min-width: 80px;
    font-size: 0.8rem;
  }
}