/* 物流の未来.jp — レスポンシブ対応 (theme A)
 * Breakpoints:
 *   - >= 1024px : デザイン通り（プロトタイプ）
 *   - 720px〜1023px : タブレット（grid 緩和）
 *   - < 720px : スマートフォン（ハンバーガー、1カラム、比較表はカード化）
 */

/* =========================================================
   FULL-BLEED LAYOUT
   td-styles.css の `.page { max-width: 1280px }` と
   `body { background: #d8dae2 }` はプロトタイプの
   「ページプレビュー枠」演出。本番では
   ・カラー帯（hero / topics border / footer）は画面いっぱい
   ・内側コンテンツのみ 1280px 中央寄せ
   とする。
   ========================================================= */
body { background: #fff; }
.page { max-width: none; overflow: visible; box-shadow: none; }

/* hero/footer は block-level なので .page max-width 解除で自動的に full-width */
/* 内側コンテンツのみ 1280px センター */
.nav,
.hero-inner,
.section.wrap,
.page-hero,
.list-layout,
.detail-layout,
.cmp-tbl-wrap,
.cmp-cards,
.how,
.bm-related-grid,
.footer-top,
.footer-base {
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
}

/* margin で外側余白を持つ要素は max-width のみ */
.cmp-filter,
.leadgen {
	max-width: 1152px;       /* 1280 - 64*2 */
	margin-left: auto;
	margin-right: auto;
}

/* topics: border-bottom を画面いっぱいに伸ばすため自身は full-width。
   コンテンツのみ 1280px センター（edge-padding トリック）。 */
.topics {
	max-width: none;
	padding-left: max(24px, calc((100vw - 1280px) / 2 + 64px));
	padding-right: max(24px, calc((100vw - 1280px) / 2 + 64px));
}

/* footer: navy-900 を画面いっぱい、内側 1280 センター */
.footer {
	padding-top: 60px;
	padding-bottom: 32px;
	padding-left: max(24px, calc((100vw - 1280px) / 2 + 64px));
	padding-right: max(24px, calc((100vw - 1280px) / 2 + 64px));
}
.footer-top,
.footer-base {
	padding-left: 0;
	padding-right: 0;
}

/* nav.solid（下層ページ）の bottom border を画面いっぱいに伸ばす */
.nav.solid {
	max-width: none;
	padding-left: max(24px, calc((100vw - 1280px) / 2 + 64px));
	padding-right: max(24px, calc((100vw - 1280px) / 2 + 64px));
}


/* =========================================================
   ARTICLE DETAIL — 目次を右レール下部に移動
   元: grid 220px / 720px / 240px（左にTOC、中央に本文、右にレール）
   今: grid 720px / 280px      （中央に本文、右にレール＝rank+CTA+TOC）
   ========================================================= */
.detail-layout {
	grid-template-columns: minmax(0, 720px) 280px;
}

/* 右レール内の目次：上に罫線で区切り、左罫線インデントは内蔵スタイル踏襲 */
.rail .toc {
	position: static;          /* rail 自体が sticky なので個別 sticky 不要 */
	margin-top: 4px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}
.rail .toc .lbl { margin-bottom: 12px; }
.rail .toc ul {
	list-style: none;
	margin: 0;
	padding: 0 0 0 14px;
	border-left: 2px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.rail .toc li {
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--ink-soft);
	cursor: pointer;
	transition: color .2s;
}
.rail .toc li a { color: inherit; }
.rail .toc li.on,
.rail .toc li.on a { color: var(--accent-deep); font-weight: 700; }
.rail .toc li:hover,
.rail .toc li a:hover { color: var(--accent-deep); }
.rail .toc .prog-lbl { margin: 16px 0 6px; }


/* =========================================================
   HERO — 背景画像
   配置先: wp-content/themes/gold-media-child/assets/images/hero-bg.jpg
   推奨サイズ: 1920 × 800px 以上（横長）
   被写体は右側に寄せて構図すると、左テキストの可読性が保てる
   ========================================================= */
.hero {
	background-image:
		linear-gradient(95deg,
			rgba(14,21,48,0.92) 0%,
			rgba(14,21,48,0.78) 38%,
			rgba(14,21,48,0.40) 68%,
			rgba(14,21,48,0.15) 100%),
		url('../images/hero-bg.jpg');
	background-color: var(--navy);   /* 画像読込前 / 失敗時のフォールバック */
	background-size: cover, cover;
	background-position: center, center right;
	background-repeat: no-repeat, no-repeat;
}

/* 右側の hero-media（写真ブロック）は背景画像で代替するため非表示。
   stats card もこれと同時に消える。再表示したいときは
   .hero-media { display:block; } で復活し、photo を半透明にすると良い。 */
.hero-media { display: none; }

/* hero-inner は 2 カラム grid のまま運用すると右カラムが空白になり
   テキストが左半分にとどまる（リファレンス画像の構図と一致） */
.hero-inner {
	grid-template-columns: 1fr;       /* 1カラム化 */
	max-width: 1280px;
}
/* テキスト幅を 580px 程度に絞って、右側の画像領域を確保する */
.hero-inner > .reveal:first-child {
	max-width: 580px;
}

/* SP では画像を上下に短めに、左右パディングを詰めて見やすく */
@media (max-width: 719px) {
	.hero {
		background-image:
			linear-gradient(180deg,
				rgba(14,21,48,0.80) 0%,
				rgba(14,21,48,0.92) 100%),
			url('../images/hero-bg.jpg');
		background-position: center, center;
	}
	.hero-inner > .reveal:first-child { max-width: 100%; }
}


/* =========================================================
   PHOTO FALLBACK（アイキャッチ未設定時のプレースホルダー）
   ========================================================= */
.photo-fallback {
	width: 100%; height: 100%; aspect-ratio: inherit;
	background:
		linear-gradient(135deg, rgba(27,37,77,.08) 0%, rgba(240,132,26,.10) 100%),
		repeating-linear-gradient(45deg, var(--mist) 0 12px, var(--mist-2) 12px 24px);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2,.7,.3,1); }
.hov:hover .photo img { transform: scale(1.05); }

/* nav-toggle (default: hidden on PC) */
.nav-toggle {
	display: none;
	width: 40px; height: 40px;
	background: transparent; border: 1.5px solid var(--line);
	border-radius: 10px; padding: 0;
	flex-direction: column; justify-content: center; align-items: center; gap: 4px;
	cursor: pointer;
}
.nav-toggle span {
	width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
	transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
/* hero 内（白テキスト）の nav-toggle */
.hero .nav-toggle { border-color: rgba(255,255,255,.35); }
.hero .nav-toggle span { background: #fff; }

/* lock body scroll when nav open */
.bm-nav-open { overflow: hidden; }


/* =========================================================
   TABLET （〜1023px）
   ========================================================= */
@media (max-width: 1023px) {
	.wrap { padding-left: 32px; padding-right: 32px; }
	.nav { padding: 18px 32px; }
	.hero-inner { padding: 24px 32px 64px; gap: 32px; grid-template-columns: 1fr; }
	.hero h1 { font-size: 44px; }
	.hero-stat { left: 0; bottom: -20px; padding: 14px 18px; }

	.topics { padding: 16px 32px; }
	.theme-a .section { padding-top: 64px; padding-bottom: 64px; }

	.latest-grid { grid-template-columns: 1fr; gap: 36px; }
	.kadai-grid { grid-template-columns: repeat(3, 1fr); }
	.cat-grid { grid-template-columns: repeat(3, 1fr); }
	.rank-wrap { grid-template-columns: 1fr; }

	/* archive */
	.page-hero { padding: 28px 32px 0; }
	.page-hero h1 { font-size: 30px; }
	.list-layout { grid-template-columns: 1fr; gap: 32px; padding: 32px 32px 0; }
	.list-feature { grid-template-columns: 220px 1fr; padding: 18px; }

	/* single */
	.detail-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; padding: 32px 32px 0; }
	/* 目次は右レール下部にあるので tablet でも表示する（display:none は外す） */
	.cover { aspect-ratio: 16/9; }

	/* comparison */
	.cmp-filter, .cmp-tbl-wrap, .cmp-cards { padding-left: 32px; padding-right: 32px; }
	.cmp-filter { margin: 24px 32px 0; }
	.how { grid-template-columns: 1fr; padding: 24px 32px 0; gap: 16px; }
	.leadgen { margin: 48px 32px 0; padding: 32px; flex-direction: column; align-items: flex-start; gap: 18px; }
	.leadgen h2 { font-size: 24px; }

	.cmp-card-body { grid-template-columns: 180px 1fr; gap: 20px; padding: 20px; }
	.cmp-cta-col { grid-column: 1 / -1; flex-direction: row; }
	.cmp-cta-col .btn { flex: 1; }

	.footer { padding: 48px 32px 28px; }
	.footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
	.bm-related-grid { grid-template-columns: 1fr 1fr !important; }
}


/* =========================================================
   SMARTPHONE （〜719px）
   ========================================================= */
@media (max-width: 719px) {
	.wrap { padding-left: 20px; padding-right: 20px; }

	/* ---- nav: ハンバーガー化 ---- */
	.nav { padding: 14px 20px; position: relative; }
	.nav-toggle { display: flex; }
	.nav-links {
		display: none;
		position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
		flex-direction: column; align-items: stretch; gap: 0;
		background: #fff; border-top: 1px solid var(--line);
		padding: 12px 20px 20px;
		box-shadow: 0 14px 30px -18px rgba(0,0,0,.3);
	}
	.nav-links.open { display: flex; }
	.nav-link { padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; }
	.nav-link::after { display: none; }
	.nav-search { align-self: flex-start; margin-top: 8px; }
	.hero .nav-links { background: var(--navy-700); border-top-color: rgba(255,255,255,.1); }
	.hero .nav-link { color: #fff; border-bottom-color: rgba(255,255,255,.1); }

	.brand-name { font-size: 17px; }
	.brand-mark { width: 32px; height: 32px; font-size: 16px; }
	.brand-name .tld { font-size: 13px; }

	/* ---- hero ---- */
	.hero-inner { padding: 16px 20px 56px; gap: 28px; }
	.hero h1 { font-size: 32px; line-height: 1.25; }
	.hero .lead { font-size: 14px; line-height: 1.85; }
	.hero-cta { gap: 10px; }
	.hero-cta .btn { padding: 12px 20px; font-size: 14px; width: 100%; justify-content: center; }
	.hero-stat { left: 0; right: auto; bottom: -16px; padding: 12px 16px; }
	.hero-stat .n { font-size: 28px; }

	.topics { padding: 14px 20px; gap: 8px; }
	.topic-pill { font-size: 12px; padding: 6px 12px; }

	.theme-a .section { padding-top: 48px; padding-bottom: 48px; }
	.section-head { flex-direction: column; align-items: flex-start; gap: 14px; padding-bottom: 18px; }
	.h-sec { font-size: 24px; }
	.display { font-size: 36px; }

	/* ---- latest ---- */
	.latest-grid { gap: 28px; }
	.feature h3 { font-size: 22px; }
	.mini { grid-template-columns: 100px 1fr; gap: 12px; padding: 14px 0; }

	/* ---- kadai / cat ---- */
	.kadai-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.kadai-card { padding: 20px 14px; }
	.kadai-card h4 { font-size: 14px; min-height: 36px; }
	.cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.cat-tile { padding: 14px 12px; gap: 10px; }
	.cat-tile .nm { font-size: 13.5px; }

	/* ---- rank / diag ---- */
	.rank-row { padding: 16px; gap: 12px; }
	.rank-row h4 { font-size: 14.5px; }
	.rank-pv { display: none; }
	.diag { padding: 24px; }
	.diag h3 { font-size: 22px; }

	/* ---- footer ---- */
	.footer { padding: 40px 20px 24px; }
	.footer-top { grid-template-columns: 1fr; gap: 28px; }

	/* ---- archive ---- */
	.page-hero { padding: 24px 20px 0; }
	.page-hero h1 { font-size: 24px; line-height: 1.4; }
	.page-hero .desc { font-size: 14px; }
	.list-layout { padding: 24px 20px 0; gap: 28px; }
	.list-feature { grid-template-columns: 1fr; padding: 16px; }
	.list-feature h3 { font-size: 19px; }
	.art-row { grid-template-columns: 1fr; gap: 12px; padding: 18px 0; }
	.art-row h3 { font-size: 17px; }

	/* ---- single ---- */
	.detail-layout { grid-template-columns: 1fr; gap: 28px; padding: 24px 20px 0; }
	.detail-layout .rail { position: static; }
	.article-head h1 { font-size: 24px; line-height: 1.5; }
	.byline { flex-wrap: wrap; gap: 10px; }
	.byline .share { margin-left: 0; width: 100%; }
	.cover { aspect-ratio: 16/10; margin-top: 20px; }
	.prose { font-size: 15px; line-height: 1.95; }
	.prose h2 { font-size: 20px; margin: 32px 0 16px; }
	.prose blockquote { font-size: 16px; padding: 14px 18px; }
	.prose .callout { flex-direction: column; padding: 18px; gap: 12px; }
	.inline-cta { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
	.inline-cta .photo { width: 100%; height: auto; aspect-ratio: 16/9; }
	.author-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
	.bm-related-grid { grid-template-columns: 1fr !important; }

	/* ---- comparison: 比較表は SP でカード化 ---- */
	.cmp-filter { margin: 24px 20px 0; padding: 18px; }
	.cmp-filter h3 { font-size: 16px; }
	.cmp-tbl-wrap { padding: 20px 20px 0; }

	.cmp-tbl { display: block; border-radius: 0; border: none; }
	.cmp-tbl thead { display: none; }
	.cmp-tbl tbody, .cmp-tbl tr { display: block; }
	.cmp-tbl tr {
		border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px;
		display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
	}
	.cmp-tbl tr.top { background: #fff8ef; border-color: var(--accent); }
	.cmp-tbl td {
		display: flex; justify-content: space-between; align-items: center;
		padding: 6px 0; border: none; font-size: 13px;
	}
	.cmp-tbl td::before {
		content: attr(data-label); font-size: 11px; color: var(--ink-mute);
		font-family: var(--grotesk); letter-spacing: .04em; text-transform: uppercase;
		margin-right: 8px;
	}
	.cmp-tbl td[data-label="サービス名"] { grid-column: 1 / -1; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; flex-direction: column; align-items: flex-start; }
	.cmp-tbl td[data-label="サービス名"]::before { display: none; }
	.cmp-tbl td[data-label="サービス名"] .svc { font-size: 15px; }
	.cmp-tbl td[data-label="順位"] { grid-column: 1 / -1; order: -1; padding-bottom: 8px; }
	.cmp-tbl td[data-label="順位"]::before { content: "順位"; }
	.cmp-tbl td[data-label=""] { grid-column: 1 / -1; padding-top: 10px; }
	.cmp-tbl td[data-label=""]::before { display: none; }
	.cmp-tbl .dlbtn { width: 100%; padding: 12px 16px; text-align: center; }

	.cmp-cards { padding: 24px 20px 0; gap: 18px; }
	.cmp-card-head { padding: 16px 18px; flex-wrap: wrap; gap: 10px; }
	.cmp-card-head h3 { font-size: 18px; white-space: normal; }
	.cmp-card-head .score { margin-left: 0; width: 100%; order: 2; }
	.cmp-card-body { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
	.cmp-card-body .photo { aspect-ratio: 16/9.5; }
	.cmp-specs { gap: 18px; flex-wrap: wrap; }
	.cmp-pros { grid-template-columns: 1fr; gap: 14px; }
	.cmp-cta-col { flex-direction: column; }

	.how { padding: 24px 20px 0; }
	.leadgen { margin: 48px 20px 0; padding: 24px; }
	.leadgen h2 { font-size: 20px; line-height: 1.45; }
	.leadgen .btn { width: 100%; justify-content: center; }
}


/* =========================================================
   タブレット〜PC: 比較表は overflow-x で予備対応
   ========================================================= */
@media (min-width: 720px) and (max-width: 1023px) {
	.cmp-tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.cmp-tbl { min-width: 720px; }
}


/* =========================================================
   ナビ詳細（追加調整）
   ========================================================= */
.brand { white-space: nowrap; }
.nav { gap: 12px; }


/* =========================================================
   diag セクション: SP でCTA幅を100%に
   ========================================================= */
@media (max-width: 719px) {
	.diag .btn { width: 100%; justify-content: center; }
}


/* =========================================================
   sortpills を a タグでも動くように（archive.php）
   ========================================================= */
.sortpills a {
	font-family: var(--sans); font-size: 12.5px; font-weight: 600;
	background: transparent; color: var(--ink-soft);
	padding: 7px 14px; border-radius: 999px;
	transition: .2s; cursor: pointer; text-decoration: none;
}
.sortpills a.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px -3px rgba(0,0,0,.2); }


/* =========================================================
   page wrapper: SP でフチを詰める
   ========================================================= */
@media (max-width: 719px) {
	body { background: #fff; }
	.page { box-shadow: none; }
}


/* =========================================================
   footer リンクはaタグでも見た目を維持
   ========================================================= */
.footer ul a { color: inherit; }
.footer ul a:hover { color: #fff; }
.footer-sns a { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.2); display: grid; place-items: center; font-family: var(--grotesk); font-size: 12px; color: #fff; text-decoration: none; }


/* =========================================================
   side-cat 件数=0で非表示にしない（archive.phpではすべて表示）
   ========================================================= */
.side-cat a > .n:empty { display: none; }


/* =========================================================
   tags 内の chip がリンクのとき
   ========================================================= */
.tags a.chip:hover { background: var(--mist); transition: background .2s; }


/* =========================================================
   prose 内のWPコアブロックの軽い調整
   ========================================================= */
.prose figure img { border-radius: 12px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul li, .prose ol li { margin-bottom: 8px; }
