/*
 * Chathello サイト固有のスタイル
 * dads-global.css（デジタル庁デザインシステム）を土台に、白黒のツートーンへ寄せている。
 * フォーカスリング（黒4px＋黄2px）・リンク下線・44pxのタップ領域は DADS の規定を維持すること。
 */

:root {
  --ink: var(--color-neutral-solid-gray-900); /* #1a1a1a 見出し・罫線 */
  --text: var(--color-neutral-solid-gray-800); /* #333 本文 */
  --muted: var(--color-neutral-solid-gray-600); /* #666 補足 */
  --line: var(--color-neutral-solid-gray-200); /* #ccc 薄い区切り */
  --paper: var(--color-neutral-white);
  --gutter: 1rem;
  --content: 60rem;
}

@media (min-width: 48rem) {
  :root {
    --gutter: 2rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

/* リンクは白黒に。下線は残し、hover で太くする（DADSの挙動を踏襲） */
:where(a):any-link {
  color: var(--ink);
}

:where(a):visited {
  color: var(--color-neutral-solid-gray-700);
}

@media (hover: hover) {
  :where(a):hover {
    color: var(--color-neutral-black);
  }
}

:where(a):active {
  color: var(--color-neutral-black);
}

.container {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* スキップリンク：フォーカス時だけ表示 */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* ヘッダー */
.site-header {
  border-bottom: 1px solid var(--ink);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand:any-link,
.brand:visited {
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
}

.site-nav ul {
  display: flex;
  gap: 0.5rem 1.5rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ヒーロー：全幅の白黒写真に、下から暗くするグラデーションを重ねて白文字を載せる */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 26rem;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

.hero picture,
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 40%; /* 狭い画面でも右側の人物を残す */
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(0 0 0 / 0.8) 0%, rgb(0 0 0 / 0.5) 45%, rgb(0 0 0 / 0.15) 100%);
}

.hero__inner {
  padding-block: 3rem;
}

.hero__title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hero__lead {
  max-width: 30em;
  margin-top: 1rem;
  word-break: auto-phrase; /* 文節で折り返す（未対応ブラウザは通常の折り返し） */
  font-size: 1.0625rem; /* std-17N-170 */
}

@media (min-width: 48rem) {
  .hero {
    min-height: min(36rem, 72vh);
  }

  .hero__inner {
    padding-block: 4rem;
  }

  .hero__title {
    font-size: 4rem; /* dsp-64B */
  }

  .hero__lead {
    font-size: 1.25rem; /* std-20N-150 */
    line-height: 1.6;
  }
}

/* セクション：上下の余白は同じ値。デスクトップでは見出しを左列に置く */
.section {
  padding-block: 3rem;
  border-top: 1px solid var(--ink);
}

.hero + .section {
  border-top: 0;
}

@media (min-width: 48rem) {
  .section {
    padding-block: 4rem;
  }

  .section > .container {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 0 2rem;
    align-items: start;
  }

  .section > .container > * {
    grid-column: 2;
  }

  .section > .container > .section__title {
    grid-column: 1;
    grid-row: 1 / span 10;
    margin-bottom: 0;
    line-height: 1.2; /* 右列の1行目と天をそろえる */
  }
}

.section__title {
  margin-bottom: 1.5rem;
  color: var(--ink);
  font-size: 1.5rem; /* std-24B-150 */
  font-weight: 700;
  line-height: 1.5;
}

@media (min-width: 48rem) {
  .section__title {
    font-size: 1.75rem; /* std-28B-150 */
    margin-bottom: 2rem;
  }
}

/* 運営サイト：枠付きカード。カード全体をクリック可能にし、hover で白黒反転 */
.sites {
  display: grid;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .sites {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 0.5rem;
  background: var(--paper);
  transition: background-color 0.15s, color 0.15s;
}

/* 各サイトのロゴ・バナー。比率はOG画像（1200×630）にそろえる */
.site-card__visual {
  position: relative;
  aspect-ratio: 1200 / 630;
  margin: -1.5rem -1.5rem 0.75rem;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  border-radius: 0.4375rem 0.4375rem 0 0;
  background: var(--color-neutral-solid-gray-50);
}

.site-card__visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 比率が 1200:630 でない画像は切らずに収める */
.site-card__visual--contain {
  background: var(--paper);
}

.site-card__visual--contain img {
  object-fit: contain;
}

.group__title {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: 1.125rem; /* std-18B-160 */
  font-weight: 700;
  line-height: 1.6;
}

.sites + .group__title {
  margin-top: 2.5rem;
}

.site-card__name {
  color: var(--ink);
  font-size: 1.25rem; /* std-20B-150 */
  font-weight: 700;
  line-height: 1.5;
}

.site-card__name a {
  /* カード全体をリンク領域にする（stretched link） */
  text-underline-offset: 0.25rem;
}

.site-card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
}

.site-card__url {
  color: var(--muted);
  font-size: 0.875rem; /* dns-14N-130 */
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.site-card__desc {
  margin-top: 0.25rem;
}

.site-card__arrow {
  margin-left: 0.25em;
}

@media (hover: hover) {
  .site-card:hover {
    background: var(--ink);
    color: var(--paper);
  }

  .site-card:hover .site-card__name,
  .site-card:hover .site-card__name a,
  .site-card:hover .site-card__url {
    color: var(--paper);
  }
}

.site-card:has(a:focus-visible) {
  outline: 0.25rem solid var(--color-neutral-black);
  outline-offset: 0.125rem;
  box-shadow: 0 0 0 0.125rem var(--color-primitive-yellow-300);
}

/* 事業者情報 */
.profile {
  display: grid;
}

/* 1行目は見出しと天をそろえる */
.profile__row:first-child {
  padding-top: 0;
}

.profile__row {
  display: grid;
  gap: 0.25rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .profile__row {
    grid-template-columns: 10rem 1fr;
    gap: 2rem;
    padding-block: 1.25rem;
  }
}

.profile__row dt {
  color: var(--ink);
  font-weight: 700;
}

.profile__row dd > * + * {
  margin-top: 0.25rem;
}

.profile__row dd a {
  display: inline-block;
  min-height: 1.75rem;
}

/* フッター：黒地に白 */
.site-footer {
  padding-block: 2rem;
  background: var(--ink);
  color: var(--paper);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer small {
  font-size: 0.875rem;
}

.site-footer a:any-link,
.site-footer a:visited {
  color: var(--paper);
}

.site-footer :focus-visible {
  outline-color: var(--color-primitive-yellow-300);
  box-shadow: 0 0 0 0.125rem var(--color-neutral-black);
}

/* 404 */
.not-found {
  padding-block: 6rem;
}

.not-found p {
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .site-card {
    transition: none;
  }
}

@media (forced-colors: active) {
  .site-card {
    border-color: CanvasText;
  }
}
