@charset "UTF-8";

:root {
  /* 本文と画像の横幅。ここを変えると .top-img / .entry-visual / 本文が一緒に変わる */
  --content-width: 40rem;

  --color-text: #333333;
  --color-white: #ffffff;
  --color-border: #333333;
  --color-accent-bg: #eeeae0;
}

/*
 * PCの文字はそのままに、スマホだけ小さくする。
 * 文字の大きさは全部 rem で指定してあるので、ここ1か所で釣り合いを保ったまま縮む。
 * 16px → 12.25px。もう少し変えたいときはこの値だけ触ること。
 */
@media screen and (max-width: 768px) {
  html {
    font-size: 76.5625%;
  }
}

* {
  color: var(--color-text);
  font-family: "DotGothic16", sans-serif;
  font-style: normal;
  font-size: 1rem;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}

body {
  display: flex;
  justify-content: center;
  background-image: url("../images/b086.jpg");
  background-repeat: repeat;
  background-attachment: fixed;
}

/* ===== Enterページ ===== */
.enter-body {
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background-image: url("../images/b086.jpg");
  background-repeat: repeat;
  background-attachment: fixed;
}

.enter-main {
  display: flex;
  align-items: stretch;
  gap: 2rem;
  width: 100%;
  max-width: 1024px;
  background-color: transparent;
}

.enter-visual {
  flex: 1 1 50%;
  min-width: 0;
}

.enter-visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-text);
}

.enter-visual-date {
  text-align: right;
}

.enter-info {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
}

.enter-logo img {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
}

.enter-description {
  line-height: 1.5;
  text-align: center;
  font-size: 1.25rem;
}

.last-update-date {
  text-align: center;
  font-size: 1.25rem;
}

.enter-button {
  display: block;
  width: 168px;
  height: 36px;
  background: url("../images/btn027_02.gif") no-repeat center / contain;
}

.enter-button span {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 100%;
  text-indent: 100%;
  white-space: nowrap;
}

/* ===========================================================================
 * コーナーのページ
 *
 * トップと同じ枠（.main）の中に置く。罫線と余白の付け方をトップに揃え、
 * 新しい部品を足しても同じ雰囲気に見えるようにしている。
 * =========================================================================== */

/* --- パンくず --- */
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumb-item {
  font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "＞";
  margin-right: 0.5rem;
}

.breadcrumb-item a {
  text-decoration: underline;
}

/* --- ページの見出し --- */
.page-title {
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed var(--color-border);
  font-size: 1.75rem;
}

/* --- 一覧（画像が主役のコーナー） --- */
.card-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
}

.card-link {
  display: block;
}

.card-link:hover .card-image,
.card-link:focus-visible .card-image {
  opacity: 0.75;
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}

.card-body {
  display: block;
  padding: 0.5rem 0.75rem;
}

.card-title {
  display: block;
  line-height: 1.5;
}

.card-meta {
  display: block;
  font-size: 0.875rem;
}

/* --- 一覧（文字が主役のコーナー） --- */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry-item {
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--color-border);
}

.entry-item-link {
  display: block;
}

.entry-item-title {
  display: block;
  font-size: 1.25rem;
  line-height: 1.6;
  text-decoration: underline;
}

.entry-item-excerpt {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --- 記事そのもの --- */
.entry {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.entry-date {
  font-size: 0.9375rem;
}

.entry-visual {
  display: flex;
  justify-content: center;
}

/* 幅はトップの .top-img と揃える */
.entry-visual img {
  display: block;
  width: var(--content-width);
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
}

/*
 * 管理画面のエディタが作ったHTMLをそのまま流し込む場所。
 * 見出し・箇条書き・表など、エディタで作れるものは全部ここで見た目を決める。
 */
.entry-body {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  line-height: 1.9;
}

.entry-body p {
  margin-block: 1em;
}

.entry-body h1,
.entry-body h2,
.entry-body h3 {
  margin-block: 1.4em 0.5em;
  padding-bottom: 0.2rem;
  border-bottom: 1px dashed var(--color-border);
}

.entry-body h1 {
  font-size: 1.5rem;
}

.entry-body h2 {
  font-size: 1.3rem;
}

.entry-body h3 {
  font-size: 1.15rem;
  border-bottom: none;
}

.entry-body ul,
.entry-body ol {
  margin-block: 1em;
  padding-left: 1.5em;
}

.entry-body ul {
  list-style: disc;
}

.entry-body ol {
  list-style: decimal;
}

.entry-body a {
  text-decoration: underline;
}

.entry-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-block: 1em;
  border: 1px solid var(--color-border);
}

.entry-body blockquote {
  margin-block: 1em;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--color-border);
  background-color: var(--color-accent-bg);
}

.entry-body hr {
  margin-block: 2em;
  border: none;
  border-top: 1px dashed var(--color-border);
}

.entry-body mark {
  background-color: #f5e37a;
}

.entry-body table {
  width: 100%;
  margin-block: 1em;
  border-collapse: collapse;
}

.entry-body th,
.entry-body td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.entry-body th {
  background-color: var(--color-accent-bg);
}

/* --- ミニカーメーカーの索引 --- */
.maker-index {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.maker-initial {
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.375rem;
}

.maker-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.5rem;
  padding-left: 1rem;
}

.maker-item a {
  text-decoration: underline;
  line-height: 1.7;
}

.maker-name-ja {
  font-size: 0.9375rem;
}

@media screen and (max-width: 768px) {
  .enter-main {
    flex-direction: column;
    padding: 1.5rem;
  }

  .enter-visual,
  .enter-info {
    flex: 1 1 auto;
  }

  .enter-description,
  .last-update-date {
    font-size: 1rem;
  }
}

/* ===== Homeページ ===== */
.main {
  /* 左右の余白は、格言エリアを端まで伸ばすために変数で持たせる */
  --main-padding-inline: 1rem;

  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  width: 1024px;
  max-width: 100%;
  border: var(--color-text) 1px solid;
  padding: 2rem var(--main-padding-inline);
  background-color: var(--color-white);
}

.header {
  display: flex;
  justify-content: center;
}

.header-logo img {
  display: block;
  width: 20rem;
  max-width: 100%;
  height: auto;
}

/*
 * コーナーごとの絵を出すとき（Header に image を渡したとき）は横幅いっぱいに広げる。
 * 格言エリアと同じく、左右の余白を打ち消して main の端まで伸ばす。
 */
.header-logo-wide {
  flex: 1;
  width: auto;
  margin-inline: calc(var(--main-padding-inline) * -1);
}

.header-logo-wide img {
  width: 100%;
}

.top-img {
  display: flex;
  justify-content: center;
}

.top-img img {
  display: block;
  width: var(--content-width);
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
}

/* --- 格言（流れる文字） --- */
.kakugen-area {
  position: relative;
  overflow: hidden;
  width: auto;
  margin-inline: calc(var(--main-padding-inline) * -1);
  height: 3.5rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-accent-bg);
}

.kakugen-area-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kakugen-title {
  text-align: center;
  font-size: 1.25rem;
}

.kakugen-text {
  position: absolute;
  top: 50%;
  left: 0;
  white-space: nowrap;
  font-size: 1.75rem;
  line-height: 1;
  /* 初期位置は JS が決めるので、計測前は画面外に置いておく */
  transform: translate(100vw, -50%);
  will-change: transform;
}

/* JS が動かないときやアニメーションを好まない環境では中央に静止表示する */
.kakugen-area.is-static {
  display: flex;
  align-items: center;
  justify-content: center;
}

.kakugen-area.is-static .kakugen-text {
  position: static;
  overflow: hidden;
  max-width: 100%;
  transform: none;
  text-overflow: ellipsis;
}

/* --- 来訪者カウンタ --- */
.counter-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.counter-label {
  padding: 0.125rem 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-accent-bg);
  font-size: 1.125rem;
}

.counter-number {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-text);
  color: var(--color-white);
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  /* letter-spacing の分だけ右に寄るので相殺する */
  text-indent: 0.4em;
}

.counter-info {
  font-size: 0.85rem;
}

/* --- 目次 --- */
.mokujin-area {
  border: 1px solid var(--color-border);
}

.mokuji-title {
  padding: 0.375rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-accent-bg);
  text-align: center;
  font-size: 1.25rem;
}

.mokuji-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  padding: 1rem;
}

.mokuji-items a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 1.125rem;
  text-decoration: underline;
}

.mokuji-items a:hover,
.mokuji-items a:focus-visible {
  background-color: var(--color-accent-bg);
}

/* --- 各セクション --- */
.section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
}

.section-title {
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed var(--color-border);
  font-size: 1.5rem;
}

.section-text {
  line-height: 1.8;
  font-size: 1.125rem;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
}

.about-list-top {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-inline: auto;
}

.about-row {
  display: flex;
  gap: 1rem;
}

/* 全称セレクタの font-size が継承より強いので、子要素に直接指定する */
.about-term,
.about-desc {
  line-height: 1.6;
  font-size: 1.125rem;
}

.about-term {
  flex-shrink: 0;
}

.about-term::before {
  content: "【";
}

.about-term::after {
  content: "】";
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-item {
  display: flex;
  gap: 1rem;
}

.news-date,
.news-text {
  line-height: 1.6;
  font-size: 1.125rem;
}

.news-date {
  flex-shrink: 0;
}

/* --- ギャラリー --- */
.gallery-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-accent-bg);
}

.gallery-link {
  display: block;
  background-color: var(--color-white);
}

.gallery-link img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-border);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-link:hover img,
.gallery-link:focus-visible img {
  opacity: 0.75;
}

/* --- 読み込み失敗時の表示 --- */
.load-error {
  grid-column: 1 / -1;
  line-height: 1.6;
  font-size: 1rem;
}

/* --- フッター --- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.footer-banner img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
}

.copyright {
  font-size: 0.875rem;
}

@media screen and (max-width: 768px) {
  .main {
    --main-padding-inline: 0.75rem;

    margin: 0;
    padding: 1.5rem var(--main-padding-inline);
  }

  .kakugen-text {
    font-size: 1.25rem;
  }

  .about-row {
    flex-direction: column;
    gap: 0.125rem;
  }

  .about-term {
    width: auto;
  }

  .gallery-list,
  .card-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
