/*
Theme Name: Myarium
Theme URI: https://myarium.com/
Description: アクアリウムのデータベース「Myarium DB」用の軽量テーマ。左固定メニュー、機材の比較表、生体・水草・水槽レシピのページを備えます。プラグイン「Myarium DB」と一緒に使ってください。
Version: 1.0.1
Requires at least: 6.1
Requires PHP: 7.4
Author: Myarium
Text Domain: myarium
License: GPL-2.0-or-later
*/

/* ---------- 基本 ---------- */
:root {
	--ink: #1c1917;
	--ink-2: #44403c;
	--muted: #57534e;
	--faint: #78716c;
	--line: #e7e5e4;
	--line-2: #f0efed;
	--bg: #fafaf9;
	--surface: #ffffff;
	--soft: #f5f5f4;
	--accent: #0f766e;
	--accent-ink: #115e59;
	--accent-soft: #ecf5f4;
	--radius: 16px;
	--sidebar: 232px;
	--font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.75; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.35; font-weight: 900; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 全体の配置：左メニュー＋本文 ---------- */
.site { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-inner { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 20px 14px 32px; display: flex; flex-direction: column; gap: 20px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; }
.logo { display: flex; align-items: center; gap: 8px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); flex: none; }
.logo-text { font-weight: 900; font-size: 18px; line-height: 1.3; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-label { margin: 14px 0 4px; padding: 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--faint); }
.side-label:first-child { margin-top: 0; }
.side-nav a { display: block; padding: 6px 8px; border-radius: 6px; text-decoration: none; font-size: 14px; color: #292524; }
.side-nav a:hover { background: var(--soft); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.side-sub ul { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.side-sub a { display: block; padding: 4px 8px; color: var(--muted); text-decoration: none; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-logo, .menu-toggle { display: none; }
.search-box { flex: 0 1 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #d6d3d1; border-radius: 999px; background: var(--bg); color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: none; background: transparent; padding: 9px 0; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.search-box:focus-within { border-color: var(--accent); }
.search-box-inline { margin: 0; max-width: 520px; }
.site-footer { padding: 24px 32px; font-size: 12px; color: var(--faint); }

/* ---------- 共通の部品 ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 32px 64px; }
.wrap-narrow { max-width: 820px; }
.stack-xl > * + * { margin-top: 56px; }
.stack-lg > * + * { margin-top: 28px; }
.stack-sm > * + * { margin-top: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-head h2, .section-title { font-size: 20px; }
.section-title { margin-bottom: 14px; }
.section-head > a { font-size: 13px; }
.page-head h1 .count { font-size: 15px; font-weight: 500; color: var(--faint); }
.page-head .lead { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.pr-notice { margin: 4px 0 0; font-size: 12px; color: var(--faint); }
.empty { color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; color: var(--faint); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #292524; color: #fff; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-center { justify-content: center; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid #d6d3d1; background: var(--surface); color: #292524; text-decoration: none; font-size: 13px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label { font-size: 13px; font-weight: 700; margin-right: 4px; }

.thumb-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-empty { display: block; width: 100%; height: 100%; background: var(--soft); }

.tiles { display: grid; gap: 12px; }
.tiles-5 { grid-template-columns: repeat( 5, minmax( 0, 1fr ) ); }
.tiles-6 { grid-template-columns: repeat( 6, minmax( 0, 1fr ) ); }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: #a8a29e; color: var(--ink); }
.tile-thumb { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #fff; margin-bottom: 4px; }
.tile-brand { font-size: 11px; color: var(--faint); }
.tile-name { font-size: 13px; font-weight: 700; line-height: 1.45; }
.tile-meta { font-size: 12px; color: var(--accent); font-weight: 700; }

.cards { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); }
.cards-4 { grid-template-columns: repeat( 4, minmax( 0, 1fr ) ); }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); text-decoration: none; color: var(--ink); }
.card:hover { border-color: #a8a29e; color: var(--ink); }
.card-thumb { aspect-ratio: 4 / 3; background: #d9e6e4; }
.card-thumb .thumb-img { object-fit: cover; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 700; font-size: 14px; line-height: 1.5; }
.card-meta { font-size: 12px; color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat( 4, minmax( 0, 1fr ) ); gap: 10px; }
.cat-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.cat-card:hover { border-color: var(--ink); color: var(--ink); }
.cat-name { font-weight: 700; font-size: 14px; }
.cat-count { font-size: 12px; color: var(--faint); white-space: nowrap; }
.size-cards { display: grid; grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); gap: 12px; }
.size-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 14px; background: var(--ink); color: #d6d3d1; text-decoration: none; font-size: 13px; }
.size-card:hover { background: #292524; color: #fff; }
.size-num { font-size: 28px; font-weight: 900; color: #fff; }

/* ---------- トップ ---------- */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 32px; }
.kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; color: var(--accent); }
.hero-title { font-size: 44px; line-height: 1.3; }
.hero-lead { margin: 0; color: var(--muted); }
.hero-search { width: 100%; max-width: 620px; display: flex; gap: 8px; padding: 6px 6px 6px 20px; border: 1px solid #d6d3d1; border-radius: 999px; background: var(--surface); }
.hero-search input { flex: 1; min-width: 0; border: none; outline: none; font: inherit; font-size: 15px; background: transparent; }
.hero-search button { border: none; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 700; padding: 10px 22px; cursor: pointer; }
.hero-search:focus-within { border-color: var(--accent); }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; margin: 8px 0 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 12px; color: var(--faint); }
.stats dd { margin: 0; font-size: 26px; font-weight: 900; }

/* ---------- 一覧の比較表 ---------- */
.table-scroll { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.compare-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
.compare-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 12px; white-space: nowrap; }
.compare-table td { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.compare-table td.num { font-weight: 700; white-space: nowrap; }
.product-cell { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.product-thumb { width: 48px; height: 48px; flex: none; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--line-2); }
.product-brand { display: block; font-size: 11px; color: var(--faint); }
.product-name { display: block; font-weight: 700; line-height: 1.45; }

/* ---------- 詳細ページ ---------- */
.detail { display: flex; flex-direction: column; gap: 24px; }
.detail-eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.detail-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.creature-hero { display: flex; flex-wrap: wrap; gap: 28px; }
.creature-photo { flex: 0 1 380px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #d9e6e4; }
.creature-photo .thumb-img { object-fit: cover; }
.creature-body { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.creature-body h1 { font-size: 32px; }
.data-chips { display: grid; grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); gap: 8px; margin: 0; }
.data-chips div { padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.data-chips dt { font-size: 11px; color: var(--faint); }
.data-chips dd { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.4; }
.prose h2 { margin-bottom: 10px; }
.prose p { margin: 0 0 1em; color: var(--ink-2); }
.prose > :last-child { margin-bottom: 0; }

/* プラグイン「Myarium DB」の出力をこのテーマの見た目に合わせる */
.detail .mdb-box { margin: 0; display: flex; flex-direction: column; gap: 20px; }
.detail .mdb-box > * { margin-top: 0; margin-bottom: 0; }
.detail .mdb-pr { margin: 0; }
.detail .mdb-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 0; }
.detail .mdb-hero-body .mdb-price { font-size: 14px; }
.detail .mdb-comment { background: var(--bg); border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; }
.detail .mdb-comment-title { color: var(--accent); font-size: 13px; }
.detail .mdb-spec-layout { margin: 0; }
.detail .mdb-spec-main, .detail .mdb-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.detail .mdb-hero-body .mdb-card { border-radius: 12px; padding: 12px 16px; }
.detail .mdb-heading { font-size: 18px; margin: 0 0 12px; }
.detail .mdb-card h3 { font-size: 18px; }
.detail .mdb-spec th, .detail .mdb-spec td { border: none; border-top: 1px solid var(--line-2); padding: 10px 8px; font-size: 14px; }
.detail .mdb-spec th { background: none; color: var(--muted); font-weight: 500; }
.detail .mdb-spec td { font-weight: 700; }
.detail .mdb-spec tr:first-child th, .detail .mdb-spec tr:first-child td { border-top: none; }
.detail .mdb-related { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0; }
.detail .mdb-btn-amazon { background: #f59e0b; color: var(--ink) !important; }
.detail .mdb-btn-rakuten { background: #be123c; }
.detail .mdb-btn-yahoo { background: #1d4ed8; }
.detail .mdb-btn { border-radius: 10px; }
.detail .mdb-fit-wrap { margin: 0; }
.detail .mdb-box-tank > table.mdb-spec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail .mdb-box-tank .mdb-items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px; }
.detail .mdb-cost { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px 22px; }
.detail .mdb-cost strong { font-size: 24px; }
.detail .mdb-cost span { color: #a8a29e; }

/* ---------- スマホ・タブレット ---------- */
@media ( max-width: 1100px ) {
	.tiles-6 { grid-template-columns: repeat( 4, minmax( 0, 1fr ) ); }
	.cards-4, .cat-grid { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); }
}
@media ( max-width: 1024px ) {
	.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX( -100% ); transition: transform 0.2s ease; box-shadow: none; }
	.sidebar-inner { max-height: 100%; height: 100%; }
	body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba( 0, 0, 0, 0.15 ); }
	.sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba( 28, 25, 23, 0.35 ); }
	.topbar { padding: 10px 16px; }
	.menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
	.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; }
	.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
	.menu-icon::before { top: -6px; }
	.menu-icon::after { top: 6px; }
	.topbar-logo { display: block; font-weight: 900; color: var(--ink); text-decoration: none; }
	.search-box { flex: 1; }
}
@media ( max-width: 720px ) {
	body { font-size: 14px; }
	.wrap { padding: 16px 16px 48px; }
	.topbar-logo { display: none; }
	h1, .creature-body h1 { font-size: 24px; }
	.hero-title { font-size: 30px; }
	.stats { gap: 20px; }
	.tiles-5, .tiles-6 { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
	.cards-3, .cards-4, .cat-grid { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
	.size-cards { grid-template-columns: 1fr; }
	.data-chips { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
	.panel, .detail .mdb-hero, .detail .mdb-spec-main, .detail .mdb-card, .detail .mdb-related { padding: 16px; }
}
@media ( prefers-reduced-motion: reduce ) {
	.sidebar { transition: none; }
}

/* 生体・水草：データ表をカードに、必要な機材は濃色のカードに */
.detail .mdb-box-fish > table.mdb-spec, .detail .mdb-box-plant > table.mdb-spec, .detail .mdb-box-tank > table.mdb-spec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.detail .mdb-box-fish > table.mdb-spec th, .detail .mdb-box-plant > table.mdb-spec th, .detail .mdb-box-tank > table.mdb-spec th { padding-left: 20px; }
.detail .mdb-box > .mdb-heading { margin-bottom: -8px; }
.detail .mdb-card.mdb-needs { background: var(--ink); border-color: var(--ink); color: #fff; }
.detail .mdb-card.mdb-needs h3 { color: #fff; }

/* footer links */
.footer-links ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.site-footer p { margin: 0; }

/* page content: forms (Contact Form 7 etc.) and compat buttons */
.prose .compat-button { margin: 1.2em 0; }
.prose label { display: block; font-weight: 700; font-size: 14px; }
.prose input[type="text"], .prose input[type="email"], .prose input[type="tel"], .prose input[type="url"], .prose textarea, .prose select {
	display: block; width: 100%; max-width: 560px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 15px; color: var(--ink);
}
.prose textarea { min-height: 180px; }
.prose input:focus, .prose textarea:focus, .prose select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.prose input[type="submit"], .prose button[type="submit"] { min-height: 44px; padding: 0 28px; border: none; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.prose .wpcf7-not-valid-tip { color: #b91c1c; font-size: 13px; }
.prose > h1 { margin: 0 0 20px; }
