/* peque.jp トップ・404 共通。外部リソースなし。 */
:root {
  --accent: #24507a;
  --accent-dark: #1b3d5e;
  --text: #1c2630;
  --muted: #4a5663;
  --line: #d5dde5;
  --tint: #f4f7fa;
  --bg: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-dark); }
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.4; margin: 0; word-break: auto-phrase; text-wrap: balance; }
p, .quick a { word-break: auto-phrase; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ヘッダー */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; min-height: 56px; }
.brand {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--accent); }
.nav { display: flex; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.nav a:hover { text-decoration: underline; }
/* 狭い幅: サイト名の下の2段目にリンク4つを均等に並べる（横スクロールなし） */
@media (max-width: 479px) {
  .header-row > nav { flex: 1 0 100%; }
  .nav { justify-content: space-between; gap: 0; }
  .nav a { padding: 0 6px; }
  .nav li:first-child a { padding-left: 0; }
  .nav li:last-child a { padding-right: 0; }
}

/* ヒーロー */
.hero-media img { display: block; width: 100%; height: auto; }
.hero-text { padding: 24px 16px 8px; max-width: 1120px; margin: 0 auto; }
.hero-text h1 { font-size: 26px; font-weight: 700; margin-bottom: 12px; }
.hero-text p { margin: 0; color: var(--muted); }

/* セクション */
.section { padding-top: 40px; padding-bottom: 8px; }
.section h2, .about h2 { font-size: 22px; margin-bottom: 20px; padding-left: 12px; border-left: 4px solid var(--accent); }

/* 近道リンク（カード・問いで共通） */
.quick { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.quick a { overflow-wrap: anywhere; }
.quick a {
  display: flex; align-items: center; min-height: 44px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
  text-decoration: none; font-weight: 500;
}
.quick a::after { content: "›"; margin-left: auto; padding-left: 8px; color: var(--muted); }
.quick a:hover { border-color: var(--accent); background: var(--tint); }

/* カード */
.cards { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.card { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.card img.pos-right { object-position: 80% 50%; }
.card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card h3 a { color: var(--text); text-decoration: none; display: inline-block; min-height: 44px; padding-top: 6px; margin-top: -6px; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card-body > p { color: var(--muted); }
.card .quick { margin-top: auto; }

/* 知りたいことから探す */
.asks { display: grid; gap: 16px; grid-template-columns: 1fr; }
.ask { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--tint); }
.ask h3 { font-size: 18px; margin-bottom: 12px; }

/* このサイトについて */
.about { margin-top: 48px; padding: 32px 0 24px; background: var(--tint); border-top: 1px solid var(--line); }
.about p { max-width: 42em; }
.about .operator { color: var(--muted); margin-bottom: 0; }
.about a { display: inline-block; padding: 8px 0; }

/* フッター */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.copy { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* 404 */
.notfound { padding-top: 40px; padding-bottom: 48px; max-width: 640px; }
.notfound h1 { font-size: 26px; margin-bottom: 16px; }

@media (min-width: 640px) {
  .header-row { min-height: 64px; }
  .brand { font-size: 20px; }
  .nav { gap: 8px; }
  .nav a { padding: 0 14px; }
  .asks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-text h1 { font-size: 30px; }
}

@media (min-width: 720px) {
  .asks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { position: relative; width: calc(100% - 32px); max-width: 1120px; margin: 16px auto 0; overflow: hidden; border-radius: 8px; }
  .hero-media { aspect-ratio: 16 / 8; }
  .hero-media picture, .hero-media img { display: block; width: 100%; height: 100%; }
  .hero-media img { object-fit: cover; object-position: right bottom; }
  .hero-text {
    position: absolute; bottom: 16px; left: 16px; width: min(480px, 50%);
    padding: 14px 16px; background: rgba(255, 255, 255, 0.92); border-radius: 8px;
  }
  .hero-text h1 { font-size: 22px; margin-bottom: 8px; }
  .hero-text p { font-size: 16px; }
}

@media (min-width: 1000px) {
  .hero-media { aspect-ratio: 16 / 7; }
  .hero-text { bottom: 28px; left: 28px; width: min(480px, 46%); padding: 22px 24px; }
  .hero-text h1 { font-size: 30px; margin-bottom: 12px; }
}

@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .card h3 { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
