/* src/styles/theme.css から移植 */
/*
 * ホワイトベース: 写真を主役にし、文字と操作部を明るい背景で読みやすくする。
 * 各ページはこのトークンと共通クラスだけで組む (独自の明るい配色を持たない)。
 */
:root {
  --bg: #FFFFFF;
  --surface: #F6F6F8;
  --chip: #F0F0F3;
  --line: #DEDEE4;
  --text: #202027;
  --text-2: #41414A;
  --muted: #62626D;
  --faint: #74747F;
  --accent: #C83265;
  --accent-hover: #A92351;
  --on-accent: #FFFFFF;

  --state-waiting: #168044;
  --state-party: #7041A5;
  --state-chat: #9B5A00;
  --state-twoShot: #C32848;
  --state-comingSoon: #62626D;

  --radius: 12px;
  --gutter: 14px;
  --font: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ---------- 共通レイアウト ---------- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: 1160px; }

.page-main { flex: 1; padding-bottom: 40px; }

.breadcrumb { font-size: 12px; color: var(--muted); margin: 16px 0 6px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.page-title { margin: 0 0 6px; font-size: 24px; font-weight: 900; line-height: 1.4; }
@media (min-width: 768px) { .page-title { font-size: 30px; } }
.page-lead { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.section-title { margin: 0 0 10px; font-size: 17px; font-weight: 900; }

.surface { background: var(--surface); border-radius: var(--radius); }

/* ---------- チップ・ボタン ---------- */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chips { flex-wrap: wrap; overflow: visible; } }

.chip {
  flex: none;
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 17px;
  background: var(--chip);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.chip:hover { color: var(--text); background: #E3E3E8; }
.chip[aria-pressed='true'], .chip[aria-current='page'] { background: var(--accent); color: var(--on-accent); }
.chip--square { border-radius: 8px; }
.chip--square[aria-pressed='true'] { background: var(--text); color: var(--bg); }
.chip__count { font-weight: 500; opacity: 0.8; }

.btn {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #E3E3E8; color: var(--text); }
.btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 900; }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--block { width: 100%; }

/* ---------- 写真グリッド ---------- */
/* 元画像はほぼ 4:3（320×240）。スマホは2列、768px からは幅220px以上で自動配置 */
.photo-grid, .portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
@media (min-width: 768px) {
  .photo-grid, .portal-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
}

.photo-card, .portal-card__main {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  color: #fff;
  text-decoration: none;
}
.photo-card:hover, .portal-card__main:hover { color: #fff; }
.photo-card img, .portal-card__main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.photo-card:hover img, .portal-card__main:hover img { transform: scale(1.04); }
.photo-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 32px; }
.photo-card__state {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 11px;
  font-weight: 700;
  /* 右上の「詳細」と重ならないように幅を抑え、長い状態表示は省略する */
  max-width: calc(100% - 64px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.photo-card__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--state-comingSoon); }
.photo-card__dot[data-state='waiting'] { background: var(--state-waiting); }
.photo-card__dot[data-state='party'] { background: var(--state-party); }
.photo-card__dot[data-state='chat'] { background: var(--state-chat); }
.photo-card__dot[data-state='twoShot'] { background: var(--state-twoShot); }
.photo-card__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}
.photo-card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; min-width: 0; }
.photo-card__who { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.photo-card__new { flex: none; padding: 0 5px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 900; line-height: 16px; }
.photo-card__age { flex: none; font-size: 10px; font-weight: 400; color: #E4E4EA; }
.photo-card__name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-card__site { flex: none; font-size: 10px; color: #E4E4EA; }
.photo-card__comment { font-size: 11px; color: #E4E4EA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) {
  .photo-card__name { font-size: 14px; }
  .photo-card__site { font-size: 11px; }
}

.grid-status { padding: 32px 0; text-align: center; color: var(--muted); font-size: 14px; }
.grid-status--inline { margin: 0; padding: 8px 0; text-align: left; }
.grid-more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- 読みもの本文 (記事・FAQ・規約など) ---------- */
.prose { font-size: 15px; line-height: 1.9; color: var(--text-2); }
@media (min-width: 768px) { .prose { font-size: 16px; line-height: 2; } }
.prose h1 { font-size: 23px; font-weight: 900; line-height: 1.45; color: var(--text); margin: 0 0 12px; }
.prose h2 { font-size: 19px; font-weight: 900; line-height: 1.45; color: var(--text); margin: 36px 0 10px; }
.prose h3 { font-size: 16px; font-weight: 900; line-height: 1.5; color: var(--text); margin: 26px 0 8px; }
@media (min-width: 768px) {
  .prose h1 { font-size: 32px; }
  .prose h2 { font-size: 24px; }
  .prose h3 { font-size: 19px; }
}
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: 0.3em 0; }
.prose strong { color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose blockquote { margin: 0 0 1em; padding: 12px 14px; border-radius: 10px; background: var(--surface); color: var(--text-2); }
.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 1.2em;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.prose th, .prose td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.prose th { background: var(--surface); color: var(--muted); font-weight: 700; border-top: 0; }
.prose img { border-radius: 10px; }

/* FAQ などの開閉 */
.disclosure { border-bottom: 1px solid var(--line); }
.disclosure > summary {
  list-style: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: '＋'; margin-left: auto; color: var(--faint); }
.disclosure[open] > summary::after { content: '－'; }
.disclosure__body { padding: 0 0 14px 22px; font-size: 14px; line-height: 1.8; color: var(--text-2); }

/* ---------- 一覧の絞り込み ---------- */
.live-browser { display: flex; flex-direction: column; gap: 10px; }
.live-browser__summary { margin: 0; min-height: 1.5em; font-size: 13px; color: var(--muted); }
.live-browser__summary strong { color: var(--accent); }
.live-browser__filters { margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
.live-browser__favorites { padding: 10px 12px; border: 1px solid #f0c7d2; border-radius: 10px; background: #fff8fa; }
.live-browser__favorites a { color: var(--text); text-decoration: none; font-weight: 700; }
.today-discovery { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.today-discovery > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; padding: 8px 12px; cursor: pointer; font-weight: 700; list-style: none; }
.today-discovery > summary::-webkit-details-marker { display: none; }
.today-discovery > summary::after { content: '＋'; color: var(--text-2); }
.today-discovery[open] > summary::after { content: '－'; }
.today-discovery__content { padding: 0 12px 12px; }
.today-discovery__content > p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.today-discovery__unlinked { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.today-discovery__unlinked span { color: var(--muted); font-size: 12px; }
.photo-card-wrap, .portal-card { position: relative; display: flex; min-width: 0; flex-direction: column; }
.photo-card__fav {
  position: absolute; top: 4px; right: 4px; display: grid; width: 44px; height: 44px; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.photo-card__fav[hidden] { display: none; }
.photo-card__fav:disabled { opacity: 0.5; cursor: not-allowed; }
.photo-card__fav[aria-pressed='true'] { color: #FF7A9C; }
/* 写真の右上に重ねる控えめな「詳細」。見た目は小さく、押せる範囲は ::before で 44px 相当に広げる */
.photo-card__detail {
  position: absolute; top: 5px; right: 5px; display: inline-flex; height: 22px; align-items: center; padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px; background: rgba(0, 0, 0, 0.35);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1; text-decoration: none;
}
.photo-card__detail::before { content: ''; position: absolute; inset: -11px -6px; }
.photo-card__detail:hover { background: rgba(0, 0, 0, 0.6); color: #fff; }

.photo-card__observed { font-size: 10px; color: #eee; }
.portal-card__rank {
  position: absolute; top: 6px; left: 6px; z-index: 1; display: grid; min-width: 28px; height: 28px; place-items: center;
  padding: 0 6px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 900;
}
.portal-card__rank + .photo-card__state { left: 42px; }
.photo-grid > .photo-card-wrap, .portal-grid > .portal-card { min-width: 0; }
.my-komachi { max-width: 1000px; margin: 16px auto 48px; }
.my-komachi > p, .my-komachi section > p { line-height: 1.7; color: var(--text-2); }
.my-komachi section { margin-top: 28px; }
.my-komachi h1 { font-size: 24px; }
.my-komachi h2 { font-size: 18px; margin-bottom: 10px; }
.my-komachi__toggle { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin-right: 8px; }
.my-komachi ol, .my-komachi ul { padding-left: 22px; line-height: 1.9; }
.my-komachi input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--accent); }
@media (min-width: 768px) { .live-browser__filters { margin: 0; padding: 0; } }

/* ---------- 他サイトで待機中 ---------- */
.other-sites { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.other-sites .section-title { margin: 0; font-size: 15px; }
.other-sites__site { display: flex; flex-direction: column; gap: 6px; }
.other-sites__head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--text); text-decoration: none; }
.other-sites__head { align-items: center; }
.other-sites__name { display: inline-flex; align-items: center; gap: 8px; }
.other-sites__count { font-size: 12px; color: var(--accent); }
.other-sites__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.other-sites__grid .photo-card__state, .other-sites__grid .photo-card__info, .other-sites__grid .photo-card__fav, .other-sites__grid .photo-card__detail { display: none; }

/* ---------- サイトロゴ ---------- */
/* 暗い色のファビコンが黒地に埋もれないよう白いタイルに載せる */
.site-logo {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22%;
  background: #FFFFFF;
  object-fit: contain;
  padding: 1px;
}
.site-logo--initial { padding: 0; background: var(--chip); color: var(--text); font-weight: 900; line-height: 1; }
.chip .site-logo { margin-left: -5px; }

/* Layout.astro */
  .layout-banner { display: flex; justify-content: center; }
  .adult-notice { margin: 0; padding: 5px 12px; background: #fff; color: #555; border-bottom: 1px solid #eee; text-align: center; font-size: 11px; }
/* SiteHeader.astro */
  .site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
  .site-header__bar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-right: 4px; }
  .site-header__logo { font-size: 19px; font-weight: 900; color: var(--text); text-decoration: none; margin-right: auto; }
  .site-header__nav { display: none; gap: 14px; font-size: 13px; font-weight: 700; }
  .site-header__nav a { color: var(--text-2); text-decoration: none; }
  .site-header__nav a:hover, .site-header__nav a[aria-current='page'] { color: var(--accent); }
  .site-header__search, .menu__search { display: flex; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
  .site-header__search { width: clamp(126px, 24vw, 250px); }
  .site-header__search input, .menu__search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 12px; border-radius: 999px; color: var(--text); background: transparent; font: inherit; }
  .site-header__search button, .menu__search button { width: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--text); background: transparent; cursor: pointer; }
  .menu__search button { width: auto; flex-basis: auto; padding: 0 14px; border-radius: 999px; font-weight: 700; }
  .site-header__menu {
    width: 44px; height: 44px; border: 0; background: transparent; color: var(--text);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  @media (min-width: 768px) {
    .site-header__bar { min-height: 64px; }
    .site-header__logo { font-size: 22px; margin-right: 0; }
    .site-header__nav { display: flex; margin-right: auto; }
    .site-header__menu { display: none; }
  }
  .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

  .menu {
    width: 100%; max-width: 480px; height: 100%; max-height: none; margin: 0 0 0 auto; padding: 0;
    border: 0; background: var(--bg); color: var(--text);
  }
  .menu::backdrop { background: rgba(0, 0, 0, 0.6); }
  .menu__head { display: flex; align-items: center; min-height: 52px; padding: 0 4px 0 var(--gutter); border-bottom: 1px solid var(--line); }
  .menu__title { flex: 1; font-size: 19px; font-weight: 900; }
  .menu__body { display: flex; flex-direction: column; gap: 22px; padding: 18px var(--gutter); }
  .menu__search { width: 100%; }
  .menu__label { margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; }
  .menu__sites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .menu__site {
    min-height: 52px; padding: 0 12px; border-radius: 10px; background: var(--surface);
    display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 900; color: var(--text); text-decoration: none;
  }
  .menu__site:hover { color: var(--accent); }
  .menu__link {
    min-height: 52px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 700; color: var(--text); text-decoration: none;
  }
  .menu__link span { color: var(--faint); }
/* SiteFooter.astro */
  .site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
  .site-footer__inner { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; padding-bottom: 28px; }
  .site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
  .site-footer__links a { color: var(--muted); }
  .site-footer__links a:hover { color: var(--text); }
  .site-footer__recommend { align-self: flex-start; }
  .site-footer__recommend img { display: block; width: 200px; height: auto; border-radius: 6px; }
  .site-footer__note { margin: 0; font-size: 12px; color: var(--faint); }
  .site-footer__copy { font-size: 12px; color: var(--faint); }
/* AffiBanner（React 版の高さ指定を移植） */
.banner { width: 100%; max-width: 640px; height: 80px; margin: 0 auto; text-align: center; }
.banner__item img { max-width: 100%; height: auto; }
@media (min-width: 1024px) { .banner { height: 140px; } }

/* Laravel 版：絞り込みチップはリンクなので aria-current で選択状態を表す */
.chip[aria-current='true'] { background: var(--accent); color: var(--on-accent); }
.chip--square[aria-current='true'] { background: var(--text); color: var(--bg); }

/* 横スクロールの写真の行（トップの「新人」）。カードは幅 140px 固定でページ自体は横にはみ出さない */
.photo-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.photo-row > .photo-card-wrap { flex: 0 0 140px; scroll-snap-align: start; }
/* 横一列の小さいカードでは状態表示と重なるので「詳細」を出さない（写真から各サイトへ） */
.photo-row .photo-card__detail { display: none; }
.photo-row .photo-card__state { max-width: calc(100% - 12px); }
