/* y-mg.co.jp トップ・運営者情報・プライバシーポリシー・お問い合わせ 共通のスタイル (build.mjs が dist/ にコピーする) */
:root {
  --ink: #14171f;
  --muted: #566070;
  --paper: #ffffff;
  --tint: #f3f5f9;
  --rule: #14171f;
  --accent: #2f63d6;
  --ng: #c4321f;
  --ng-bg: #fff2ef;
  --ok: #1f7a3d;
  --ok-bg: #eef8f1;
  --font: "Archivo", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceff5;
    --muted: #a3acbb;
    --paper: #12151c;
    --tint: #1a1e27;
    --rule: #eceff5;
    --accent: #7fa2ff;
    --ng: #ff8d7a;
    --ng-bg: #2a1a18;
    --ok: #6fd08c;
    --ok-bg: #14261b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 16px; }
.js-only { display: none; }
.js .js-only { display: block; }

header.top { border-bottom: 2px solid var(--rule); }
header.top .wrap { padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--ink); text-decoration: none; }

/* ---- トップページ ---- */
.hero { padding: 56px 0 40px; }
.hero h1 { margin: 0 0 16px; font-size: clamp(1.5rem, 5vw, 2.4rem); line-height: 1.35; letter-spacing: .01em; text-wrap: balance; }
.hero p { margin: 0; max-width: 40rem; color: var(--muted); }

section.group { padding: 8px 0 24px; }
section.group > h2 { margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--rule); font-size: 1.05rem; letter-spacing: .06em; }
/* サービスのカード (上に画像、下に名前・説明・URL。2列、スマホは1列) */
ul.sites { list-style: none; margin: 0; padding: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
ul.sites li { display: flex; }
ul.sites a.card {
  display: flex; flex-direction: column; width: 100%;
  background: var(--paper); color: var(--ink); text-decoration: none;
  border: 2px solid var(--rule);
  transition: transform .12s ease, box-shadow .12s ease;
}
ul.sites a.card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--rule); }
ul.sites .thumb { display: block; aspect-ratio: 1200 / 630; overflow: hidden; border-bottom: 2px solid var(--rule); background: var(--tint); }
ul.sites .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 大きな画像がないサービスは、色つきのタイルに、アイコンを置く */
ul.sites .thumb.tile { display: flex; align-items: center; justify-content: center; }
ul.sites .thumb.tile img { width: auto; height: 62%; aspect-ratio: 1; object-fit: contain; }
ul.sites .body { display: block; padding: 14px 16px 16px; }
ul.sites .name { display: block; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
ul.sites a.card:hover .name { text-decoration: underline; }
ul.sites .desc { display: block; margin-top: 4px; color: var(--ink); }
ul.sites .url { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); word-break: break-all; }
@media (max-width: 640px) { ul.sites { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { ul.sites a.card { transition: none; } ul.sites a.card:hover { transform: none; } }

.about { margin-top: 24px; padding: 24px 20px; background: var(--tint); border-top: 2px solid var(--rule); }
.about h2 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: .06em; }
.about p { margin: 0 0 8px; }
.about p:last-child { margin-bottom: 0; }

/* ---- 運営者情報・プライバシーポリシー・お問い合わせ ---- */
.page { padding: 32px 0 8px; }
.crumbs { margin: 0 0 16px; font-size: .9rem; color: var(--muted); }
.page h1 { margin: 0 0 16px; font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.35; }
.lead { max-width: 44em; margin: 0 0 8px; color: var(--muted); }
.prose { max-width: 44em; margin: 24px 0; }
.prose h2 { margin: 32px 0 12px; padding-top: 12px; border-top: 2px solid var(--rule); font-size: 1.15rem; }
.prose p { margin: 0 0 12px; }
.prose ol, .prose ul { margin: 0 0 12px; padding-left: 1.6em; }
.prose li { margin: 4px 0; }
.prose code { background: var(--tint); padding: 0 5px; font-size: .92em; }
.small { font-size: .9rem; color: var(--muted); }
dl.facts { max-width: 44em; margin: 0; }
dl.facts > div { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 12px; padding: 12px 4px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 25%, transparent); }
dl.facts dt { font-weight: 700; color: var(--muted); font-size: .9rem; }
dl.facts dd { margin: 0; }
dl.facts small { display: block; color: var(--muted); }
dl.facts ul { margin: 0; padding-left: 1.2em; }
.btn { font: inherit; font-weight: 700; min-height: 44px; padding: 4px 14px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn:hover { background: var(--tint); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #12151c; } }
.btn.big { min-height: 52px; padding-inline: 24px; }

/* お問い合わせフォーム (contact/index.php が作る HTML のクラス) */
.cf-sec { margin: 24px 0; }
.cf-form { background: var(--paper); border: 2px solid var(--rule); padding: 20px; display: grid; gap: 16px; max-width: 720px; }
.cf-form p { margin: 0; }
.cf-field label { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.cf-field input[type=text], .cf-field input[type=email], .cf-field select, .cf-field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 2px solid var(--muted); border-radius: 0; padding: 10px; min-height: 48px;
}
.cf-field input:hover, .cf-field select:hover, .cf-field textarea:hover { border-color: var(--ink); }
.cf-field input:focus-visible, .cf-field select:focus-visible, .cf-field textarea:focus-visible { border-color: var(--ink); outline: 3px solid var(--accent); outline-offset: 0; }
.cf-field textarea { resize: vertical; min-height: 9em; line-height: 1.6; }
.cf-field small { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.cf-req, .cf-opt { font-size: .75rem; font-weight: 700; padding: 0 8px; }
.cf-req { background: var(--ink); color: var(--paper); }
.cf-opt { background: var(--tint); color: var(--muted); }
.cf-check label { display: inline-flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.cf-check input { width: 24px; height: 24px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.cf-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cf-error { background: var(--ng-bg); border: 2px solid var(--ng); padding: 12px 16px; margin-bottom: 12px; max-width: 720px; color: var(--ink); }
.cf-error p { margin: 0; }
.cf-error ul { margin: 8px 0 0; padding-left: 1.4em; }
.cf-ok { background: var(--ok-bg); border: 2px solid var(--ok); padding: 16px 20px; max-width: 720px; }
.cf-ok h2 { margin: 0 0 8px; font-size: 1.15rem; border: 0; padding: 0; }

footer.bottom { margin-top: 40px; border-top: 2px solid var(--rule); padding: 24px 0 48px; font-size: .9rem; color: var(--muted); }
footer.bottom ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
footer.bottom p { margin: 0 0 4px; }

/* アクセス解析の同意バナー (EU・英国・スイスと見られる閲覧者にだけ出る。analytics.js が作る) */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
  max-width: 760px; margin: 0 auto; padding: 16px;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--rule); box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  font-size: .9rem; line-height: 1.6;
}
.consent p { flex: 1 1 320px; margin: 0; }
.consent-btns { display: flex; gap: 8px; margin-left: auto; }
.consent-btns .btn { min-width: 104px; }
@media (max-width: 560px) { dl.facts > div { grid-template-columns: 1fr; gap: 2px; } }
@media print { .consent { display: none; } }
