html,
body {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 500;
  font-size: 16px;
}

/* プリローダー（読み込み中の表示） */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent; /* 背景画像を透過 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.preloader-hidden {
  opacity: 0;
  pointer-events: none;
}

/* 読み込み中のアニメーション - より控えめに */
.loading-indicator {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: spin 1.5s ease-in-out infinite;
  backdrop-filter: blur(2px);
}

/* 背景画像は常に表示 */
body {
  background: url(images/eight_horns.png) repeat fixed;
}

/* コンテンツのみフェード制御 */
.body {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

/* フォント読み込み完了後にコンテンツを表示 */
html.font-loaded .body {
  opacity: 1;
}

/* 初期状態でコンテナを透明にして眩しさを軽減 */
.container {
  background-color: rgba(245, 245, 245, 0);
  transition: background-color 0.3s ease-out;
}

html.font-loaded .container {
  background-color: whitesmoke;
}

/* HTML要素は常に表示（背景のため） */
html {
  visibility: visible;
  opacity: 1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* JavaScript無効時のフォールバック: 3秒後にコンテンツ表示 */
html:not(.font-loaded) .body {
  animation: showContentFallback 0.5s ease-out 3s forwards;
}

@keyframes showContentFallback {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: url(images/eight_horns.png) repeat fixed;
}

img {
  display: block;
}

/* 変数を定義 */
:root {
  --container-width: 800px;
  --container-min-height: 800px;
  --menu-gap: 1px;
  --menu-count: 5;

  --menu-width: calc(
    var(--container-width) / var(--menu-count) - var(--menu-gap)
  );
  --menu-height: calc(var(--container-width) / 900 * 30px);
}

.heading {
  font-weight: normal;
  font-size: 1rem;
  line-height: 32px;
  padding-left: 1rem;
  display: block;
  background-image: url(images/kobo_heading_bg.svg);
  background-repeat: repeat;
}

.body {
  width: 100%;
  min-height: 100vh;
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: var(--container-width);
  min-height: var(--container-min-height);
  background-color: rgba(245, 245, 245, 0);
  min-height: 32px;
  max-height: fit-content;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  transition: background-color 0.3s ease-out;
}

header,
footer {
  flex-grow: 0;
  flex-shrink: 1;
}

header img {
  width: var(--container-width);
  height: calc(var(--container-width) / 900 * 150px);
}

header menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--menu-gap);
}

header menu li {
  text-align: center;
  flex-grow: 1;
  list-style: none;
  position: relative;
}

/*    少し暗くする*/
header menu li a:link::before {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: calc(100% + 2px);
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 1s;
}

header menu li a:hover::before {
  background-color: rgba(58, 25, 5, 0.2);
}

header menu li a img {
  width: var(--menu-width);
  /* 高さを計算、下のサイズは150x30 */
  height: var(--menu-height);
}
main {
  display: flex;
  justify-content: space-between;
  flex-grow: 1;
  margin: 1rem;
  gap: 1rem;
}

main .content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.75rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

main .content img {
  max-width: 100%;
  height: auto;
}

main .content .banner {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

main .content .banner img {
  width: calc(100% + 4px);
  height: auto;
}

main .content .information {
}

main .content .information article {
  margin: 0.5rem;
}

main .sidebar {
  width: 240px;
}

main .sidebar .contact {
  padding: 0.5rem;
  font-size: 0.75rem;
  line-height: 2;
}

main .sidebar .sns,
main .sidebar .label {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  margin-bottom: 1rem;
  gap: 1rem;
  align-items: center;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  padding: 0.5rem;
}

.crop {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

ul.menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.menu li a {
  color: #808080;
  text-decoration: none;
}
ul.menu li a:hover {
  text-decoration: underline;
}

.pattern-links > a {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.example {
  margin-top: 1rem;
  margin-bottom: 1rem;
}
