/* Hallmark · macrostructure: Index Ledger (写真主体の平らな一覧) · genre: playful-calm · theme: studied-DNA (source: https://babyco.co.jp/)
 * styles.css の上に重ねる層。色は babyco 本体の値だけ。書体は端末標準のみ。
 * 方針：影と入れ子のカードをなくす／見出しは縦並び／コーラルは小さな強調だけ
 */
:root {
  --sand: #efeae7;           /* babyco本体の帯・タグ地 */
  --radius-card: 12px;
  --radius-media: 20px;
  --space-xs: 12px; --space-sm: 16px; --space-md: 24px; --space-lg: 32px; --space-xl: 48px; --space-2xl: 72px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}
html, body { overflow-x: clip; }

/* ヘッダー：ロゴ＋サービス名。下線のアニメは外し、現在地は色だけで示す */
.site-header { background: var(--white); backdrop-filter: none; }
.header-nav a::after { display: none; }
.header-nav a { color: var(--ink); transition: color .15s var(--ease); white-space: nowrap; }
.header-nav a:hover { color: var(--terra-dark); }
.saved-button { white-space: nowrap; transition: border-color .15s var(--ease); }

/* ヒーロー：箱をやめて、紙の上に文字、右に写真 */
.intro { min-height: 0; margin-top: var(--space-md); padding: 0 0 var(--space-lg); color: var(--ink); background: transparent; border-radius: 0; overflow: visible; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-xl); align-items: center; }
.intro-copy { padding: var(--space-md) 0; }
.intro h1 { margin: 0 0 var(--space-xs); color: var(--green); font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.intro h1 span { color: var(--terra-dark); }
.intro h1 small { color: var(--muted); opacity: 1; }
.intro p { max-width: 36em; color: var(--ink); line-height: 1.9; }
.growth-route { flex-wrap: wrap; margin-top: var(--space-sm); gap: 8px; }
.growth-route span { padding: 5px 14px; border: 0; border-radius: 999px; color: #fff; background: var(--terra-dark); font-size: .8rem; font-weight: 700; }
.growth-route span::before { content: "#"; margin-right: 2px; opacity: .85; }
.intro-image { min-height: 0; height: auto; aspect-ratio: 16 / 10; border-radius: var(--radius-media); }

/* 見出し：縦に積む。babyco本体の「ベージュ帯の見出し」 */
.guide-hub { margin: var(--space-xl) 0 var(--space-2xl); }
.section-heading { display: block; margin-bottom: var(--space-md); }
.section-heading h2 { display: block; margin: 0 0 var(--space-xs); padding: 8px 16px; border-radius: 4px; color: var(--green); background: var(--sand); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.section-heading > p { max-width: 42em; color: var(--ink); font-size: .92rem; }
.search-copy { display: block; margin-bottom: var(--space-sm); }
.search-copy h2, .filter-heading-row h2 { display: block; margin: 0 0 4px; padding: 8px 16px; border-radius: 4px; color: var(--green); background: var(--sand); font-size: 1.15rem; line-height: 1.4; }
.search-copy p { margin-top: 8px; color: var(--ink); }
.filter-heading-row > div { display: block; }

/* 注目ガイド：影をなくし、写真を主役に */
.featured-guide-card { border: 0; border-radius: var(--radius-media); box-shadow: none; background: var(--paper); }
.featured-guide-image { border-radius: var(--radius-media); }
.featured-guide-image > span { border-radius: 4px; background: var(--green-dark); }
.featured-guide-copy { padding: var(--space-lg) var(--space-lg) var(--space-lg) var(--space-xl); }

/* ガイド一覧：カードをやめて、サムネ＋文字の一覧 */
.guide-grid { gap: 0 var(--space-lg); margin-top: var(--space-md); }
.guide-card { min-height: 0; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-sm); align-items: start; padding: var(--space-sm) 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; transition: none; }
.guide-card:hover { transform: none; box-shadow: none; }
.guide-card:hover h3 { color: var(--terra-dark); }
.guide-card-visual { min-height: 0; height: 112px; border-radius: var(--radius-card); }
.guide-card-visual::before { display: none; }
.mini-book { box-shadow: none; transform: scale(.8); }
.mini-book:nth-child(1) { transform: scale(.8) rotate(-6deg); }
.mini-book:nth-child(2) { transform: scale(.8) translateY(-4px); }
.mini-book:nth-child(3) { transform: scale(.8) rotate(6deg); }
.guide-card-copy { padding: 0; }
.guide-card-label { color: var(--terra-dark); }
.guide-card-bottom { margin-top: 6px; }

/* ガイドの切り口：「#」付きのタグ */
.guide-meta span, .guide-index-row p span { border-radius: 999px; }
.guide-meta span::before { content: "#"; margin-right: 1px; opacity: .7; }
.guide-index-row { border-top-color: var(--line); border-bottom: 0; padding: var(--space-sm) 0; }

/* 検索：箱の影・赤い上線・ふきだしをやめ、ベージュの地に */
.search-panel { padding: var(--space-lg); border: 0; border-radius: var(--radius-media); box-shadow: none; background: var(--sand); }
.search-panel::before { display: none; }
.semantic-search input { border-color: transparent; background: var(--white); }
.semantic-search input:focus { border-color: var(--terra-dark); }
.quick-tags button { transition: color .15s var(--ease); }

/* 絞り込み・結果：枠をなくし、細い線で区切る */
.filter-panel { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.filter-heading-row { padding: var(--space-sm) 0; border-bottom: 0; }
.result-kicker { color: var(--muted); }
.cover-frame { border: 0; border-radius: var(--radius-card); }
.cover-button:hover .cover-frame { box-shadow: none; outline: 2px solid var(--terra-dark); outline-offset: 2px; }
.match-badge { border-radius: 4px; }
.book-card { animation: none; }

/* 操作の状態：キーボードでも見える枠を、すぐに出す */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; transition: none; }
button:active { opacity: .85; }
button:disabled, input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 860px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
  .intro-image { order: -1; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .featured-guide-copy { padding: var(--space-md) 0 0; }
  .search-panel { padding: var(--space-md) var(--space-sm); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 680px) {
  .intro { margin: var(--space-sm) 0 0; padding-bottom: var(--space-md); }
  .intro-copy { padding: 0; }
  .intro-image { max-height: none; min-height: 0; aspect-ratio: 16 / 10; border-radius: var(--radius-card); }
  .growth-route span { padding: 4px 12px; font-size: .74rem; }
  .guide-hub { margin: var(--space-xl) 0; }
  .guide-grid { display: grid; margin: var(--space-sm) 0 0; padding: 0; overflow: visible; }
  .guide-card { min-width: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); }
  .guide-card-visual { height: 96px; min-height: 0; }
  .guide-card-copy { min-height: 0; padding: 0; }
  .featured-guide-card { border-radius: var(--radius-card); }
  .featured-guide-image { min-height: 0; aspect-ratio: 16 / 10; border-radius: var(--radius-card); }
  .search-panel { margin: 0; border-radius: var(--radius-card); }
}

/* ヘッダー：babyco本体と同じ「アイコンの下にラベル」 */
.header-nav { gap: 4px; }
.header-nav a, .saved-button { position: relative; min-width: 56px; min-height: 56px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: var(--radius-card); background: transparent; color: var(--ink); font-size: .66rem; font-weight: 500; line-height: 1.2; white-space: nowrap; cursor: pointer; transition: color .15s var(--ease); }
.header-nav a:hover, .saved-button:hover { color: var(--terra-dark); border: 0; }
.saved-button > span:first-child { color: inherit; font-size: 0; display: block; height: 22px; }
.saved-button #savedCount { position: absolute; right: 6px; top: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; color: #fff; background: var(--terra-dark); font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center; }
.saved-button #savedCount:empty, .saved-button #savedCount.is-zero { display: none; }
.header-nav > a { display: flex; }
.babyco-service-label { border-left-color: var(--sand); }

/* 絵本の詳細モーダル：枠と影をなくし、ベージュの面で区切る */
.detail-modal, .guide-modal, .story-modal { border-radius: var(--radius-media); box-shadow: none; }
.detail-close { box-shadow: none; background: var(--sand); }
.detail-inner { padding: var(--space-xl) var(--space-xl) var(--space-xl); }
.detail-cover { border: 0; border-radius: var(--radius-card); }
.detail-section h3 { padding: 6px 14px; border-radius: 4px; background: var(--sand); font-size: 1.1rem; }
.detail-card { min-height: 0; padding: var(--space-md); border: 0; border-radius: var(--radius-card); background: var(--sand); }
.detail-card:nth-child(2) { background: var(--sand); }
.detail-card h3 { padding: 0; background: transparent; }
.detail-card h3 span { display: none; }
.book-in-guides { padding: var(--space-md); border: 0; border-radius: var(--radius-card); background: var(--sand); }
.book-in-guides > div { gap: 0; }
.book-in-guides button { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.voice-section { border-radius: var(--radius-card); background: var(--sand); }
.voice-icon { background: var(--white); }
.experience-cta { color: var(--ink); background: var(--sand); border-radius: var(--radius-card); }
.experience-cta h3 { color: var(--green); }
.experience-cta p { opacity: 1; }
.experience-cta button { color: #fff; background: var(--terra-dark); transition: opacity .15s var(--ease); }

/* ガイド記事モーダル：色ブロックのヒーローをやめ、やわらかい色の地に */
.guide-article-hero { min-height: 0; color: var(--ink); background: var(--sand); }
.guide-article-hero.guide-terra { background: var(--soft-terra); }
.guide-article-hero.guide-night { background: var(--plum-soft); }
.guide-article-hero.guide-mustard { background: var(--sun-soft); }
.guide-article-hero.guide-sky { background: var(--sky-soft); }
.guide-article-hero > div:first-child { padding: var(--space-xl); }
.guide-article-hero h2 { color: var(--green); }
.guide-article-hero .guide-card-label { color: var(--terra-dark); }
.guide-article-hero .guide-meta span { color: var(--terra-dark); background: var(--white); border: 0; }
.guide-article-hero img, .article-book-stack { min-height: 0; height: 100%; }
.article-book-stack { background: transparent; }
.guide-article-body { padding: var(--space-lg) var(--space-xl) var(--space-xl); }
.article-summary { border: 0; border-radius: var(--radius-card); background: var(--sand); }
.guide-article-body > section { display: block; margin-top: var(--space-xl); }
.article-number { display: none; }
.guide-article-body section h3 { padding: 6px 14px; border-radius: 4px; background: var(--sand); font-size: 1.2rem; }
.guide-article-body section aside { border-left: 0; border-radius: var(--radius-card); background: var(--sand); }
.article-book-list { gap: 0; }
.article-book-list article { padding: var(--space-md) 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.article-cover { border: 0; border-radius: var(--radius-card); }
.guide-next { color: var(--ink); background: var(--sand); border-radius: var(--radius-card); }
.guide-next > span { color: var(--terra-dark); }
.guide-next h3 { color: var(--green); }
.guide-next button { color: var(--green); border: 0; background: var(--white); transition: color .15s var(--ease); }
.guide-next button:hover { color: var(--terra-dark); }
.guide-next button small { color: var(--muted); }
.story-modal header button { background: var(--sand); }

@media (max-width: 860px) {
  .header-nav > a { display: flex; }
  .detail-inner, .guide-article-body { padding: var(--space-md) var(--space-sm) var(--space-lg); }
  .guide-article-hero > div:first-child { padding: var(--space-md) var(--space-sm); }
}
@media (max-width: 680px) {
  .header-nav a, .saved-button { min-width: 48px; padding: 6px 4px; }
}

.guide-article-hero img { min-height: 280px; height: 100%; }
.article-book-stack { min-height: 280px; }
.section-heading h2::before, .guide-article-body section h3::before, .detail-section h3::before, .search-copy h2::before, .filter-heading-row h2::before, .guide-article-body h3::before, .result-toolbar h2::before { display: none !important; content: none !important; }
.story-modal h2::before, .empty-state h2::before, .experience-cta h3::before, .guide-next h3::before { display: none !important; content: none !important; }

/* 書影：幅をそろえ、天地は画像のまま。トリミングしない */
.book-grid { align-items: start; }
.cover-frame.has-image { aspect-ratio: auto; padding: 0; display: block; background: transparent; border-radius: 4px; overflow: hidden; }
.cover-frame.has-image > .cover-button { position: relative; inset: auto; height: auto; display: block; }
.cover-frame.has-image > .cover-button img { width: 100%; height: auto; object-fit: contain; }
.cover-frame.has-image .match-badge, .cover-frame.has-image .save-book { z-index: 2; }
.detail-cover:has(img) { aspect-ratio: auto; display: block; align-self: start; border-radius: 4px; overflow: hidden; background: transparent; }
.detail-cover img { width: 100%; height: auto; object-fit: contain; display: block; }
.article-book-list article { align-items: start; }
.article-cover:has(img) { aspect-ratio: auto; display: block; border-radius: 4px; background: transparent; overflow: visible; }
.article-cover img { position: static; width: 100%; height: auto; object-fit: contain; display: block; border-radius: 4px; }
.article-cover b { left: -8px; top: -8px; }
