/*
Theme Name: Inside Factory
Theme URI: https://insidefactory.jitc-corp.com/
Author: 株式会社日本国際貿易センター
Description: 工場の今を、世界から。Inside Factory のメディア用テーマ。ジャンル別の色、特集、ランキング、Xへの誘導を備える。
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: inside-factory
*/

/* ===== 色と文字 ===== */
:root {
	--ink: #111318;
	--ink-2: #232833;
	--paper: #FFFFFF;
	--soft: #F4F5F7;
	--line: #E3E5EA;
	--muted: #5B606B;
	--lamp: #FFC531;
	--c-robot: #2F3CFF;
	--c-china: #E5484D;
	--c-report: #111318;
	--c-data: #0E9F6E;
	--c-guide: #9A6200;
	--f-logo: "Archivo", "Noto Sans JP", sans-serif;
	--f-body: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
	--wrap: 1180px;
	--r: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding-left: max(16px, env(safe-area-inset-left, 0px));
	padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; top: 0; background: var(--lamp); color: var(--ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ===== ヘッダー ===== */
.site-head { background: var(--ink); color: #fff; }
.site-head__in { display: flex; align-items: center; gap: 24px; padding-top: 24px; padding-bottom: 24px; flex-wrap: wrap; }
.site-logo img { height: 54px; width: auto; }
.site-catch { margin: 0; font-size: 14px; opacity: .75; }
.site-search { margin-left: auto; }
.site-search input {
	font: inherit; font-size: 13px; color: #fff; background: transparent;
	border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 16px; width: 220px;
}
.site-search input::placeholder { color: rgba(255,255,255,.6); }
.site-search input:focus { outline: none; border-color: var(--lamp); }
.btn-follow {
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700; background: #fff; color: var(--ink);
	border-radius: 999px; padding: 7px 16px; white-space: nowrap;
}
.btn-follow:hover { background: var(--lamp); color: var(--ink); }
.btn-follow--lg { font-size: 15px; padding: 12px 24px; }
@media (max-width: 760px) {
	.site-catch { display: none; }
	.site-head__in { padding-top: 16px; padding-bottom: 16px; gap: 16px; }
	.site-logo img { height: 40px; }
	.site-search { order: 3; width: 100%; margin-left: 0; }
	.site-search input { width: 100%; }
	.btn-follow { margin-left: auto; }
}

.genre-nav { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.genre-nav__in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.genre-nav__in::-webkit-scrollbar { display: none; }
.genre-nav a { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; padding: 13px 12px; white-space: nowrap; }
.genre-nav__in > a:first-child { margin-left: auto; }
.genre-nav__in > a:last-child { margin-right: auto; }
.genre-nav a i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.genre-nav a.is-on { box-shadow: inset 0 -3px 0 var(--ink); }
.genre-nav a:hover { color: var(--muted); }
.admin-bar .genre-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .genre-nav { top: 0; } }

.ticker { background: var(--soft); font-size: 13px; }
.ticker__in { display: flex; gap: 12px; align-items: center; padding-top: 9px; padding-bottom: 9px; white-space: nowrap; }
.ticker b { background: var(--ink); color: #fff; font-size: 11px; padding: 2px 10px; border-radius: 999px; flex: none; }
.ticker a { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ticker a:hover { text-decoration: underline; }

.site-main { padding-top: 28px; padding-bottom: 56px; }

/* ===== 部品 ===== */
.chip {
	display: inline-flex; align-items: center; width: fit-content;
	font-size: 11px; font-weight: 700; line-height: 1.6; color: #fff;
	padding: 2px 10px; border-radius: 999px; background: var(--muted);
}
.chip--robot { background: var(--c-robot); }
.chip--china { background: var(--c-china); }
.chip--report { background: var(--c-report); }
.chip--data { background: var(--c-data); }
.chip--guide { background: var(--c-guide); }

.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--ink-2); }
.thumb--lead { aspect-ratio: 16 / 10; }
.thumb__img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.thumb__none { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #232833, #111318); }
.thumb__none img { width: 22%; max-width: 72px; opacity: .9; }
a:hover .thumb__img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .thumb__img { transition: none; } a:hover .thumb__img { transform: none; } }

.byline { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }

/* カード */
.card__link { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.card__title { font-size: 15px; font-weight: 700; line-height: 1.6; }
.card__link:hover .card__title { text-decoration: underline; text-underline-offset: 3px; }
.card__date { font-size: 12px; color: var(--muted); margin-top: auto; }
.card--mini .card__link { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: start; }
.card--mini .thumb { aspect-ratio: 4 / 3; }
.card--mini .card__title { font-size: 14.5px; }
.card--dark .card__title { color: #fff; }
.card--dark .card__date { color: rgba(255,255,255,.6); }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } }
@media (max-width: 480px) { .grid3 { grid-template-columns: 1fr; } }
.grid3--list { margin-top: 32px; }

/* ===== トップ ===== */
.lead { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 900px) { .lead { grid-template-columns: 1fr; } }
.lead__link { display: flex; flex-direction: column; gap: 12px; }
.lead__title { margin: 0; font-size: clamp(22px, 3vw, 32px); font-weight: 900; line-height: 1.4; }
.lead__link:hover .lead__title { text-decoration: underline; text-underline-offset: 4px; }
.lead__ex { margin: 0; color: var(--muted); font-size: 14.5px; }
.lead__side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.about-box { background: var(--soft); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.about-box__pre { margin: 0; font-family: var(--f-logo); font-weight: 900; letter-spacing: .12em; font-size: 12px; color: var(--muted); }
.about-box h2 { margin: 0; font-size: 20px; font-weight: 900; }
.about-box > p { margin: 0; font-size: 14px; color: var(--muted); }
.about-box ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.about-box li { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.about-box li a { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.about-box li a i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.about-box li a:hover { text-decoration: underline; }
.about-box li span { font-size: 13px; color: var(--muted); }
.btn-follow--dark { background: var(--ink); color: #fff; margin-top: 6px; padding: 10px 16px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 48px; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
.cols__side { min-width: 0; }

.blk + .blk { margin-top: 44px; }
.blk__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.blk__h h2 { margin: 0; font-size: 21px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.blk__h h2 i { width: 6px; height: 22px; border-radius: 3px; display: block; }
.blk__h a { font-size: 13px; font-weight: 700; color: var(--muted); }
.blk__h a:hover { color: var(--ink); }
.blk--related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }

.rank { background: var(--soft); border-radius: 12px; padding: 18px 18px 8px; position: sticky; top: 64px; }
.rank__h { margin: 0 0 6px; font-size: 17px; font-weight: 900; }
.rank ol { list-style: none; margin: 0; padding: 0; counter-reset: k; }
.rank li { counter-increment: k; display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 700; line-height: 1.55; }
.rank li:first-child { border-top: 0; }
.rank li::before { content: counter(k); font-family: var(--f-logo); font-weight: 900; font-size: 24px; line-height: 1; color: var(--muted); width: fit-content; }
.rank li:nth-child(-n+3)::before { color: var(--ink); background: linear-gradient(transparent 62%, var(--lamp) 62%); }
.rank li a:hover { text-decoration: underline; }
@media (max-width: 960px) { .rank { position: static; } }

.band { margin-top: 56px; background: var(--ink); color: #fff; border-radius: 16px; padding: 28px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
@media (max-width: 900px) { .band { grid-template-columns: 1fr; padding: 22px; } }
.band__pre { margin: 0; font-family: var(--f-logo); font-weight: 900; letter-spacing: .1em; font-size: 12px; color: var(--lamp); }
.band h2 { margin: 4px 0 8px; font-size: 26px; font-weight: 900; }
.band p { margin: 0; font-size: 14px; opacity: .85; }
.band__more { display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 700; border-bottom: 2px solid var(--lamp); }

.empty { padding: 64px 0; text-align: center; }
.empty h1 { font-size: 24px; margin: 0 0 8px; }
.empty a { text-decoration: underline; }

/* ===== 一覧の見出し ===== */
.arch-head { background: var(--ink); color: #fff; padding: 36px 0 32px; margin-top: -28px; }
.arch-head h1 { margin: 2px 0 0; font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; }
.arch-head__en { margin: 0; font-family: var(--f-logo); font-weight: 900; letter-spacing: .12em; font-size: 12px; color: var(--lamp); }
.arch-head__desc { margin: 8px 0 0; font-size: 14px; opacity: .85; max-width: 60ch; }
.arch-head--robot { background: var(--c-robot); }
.arch-head--china { background: var(--c-china); }
.arch-head--data { background: var(--c-data); }
.arch-head--guide { background: var(--c-guide); }
.arch-head--robot .arch-head__en, .arch-head--china .arch-head__en, .arch-head--data .arch-head__en, .arch-head--guide .arch-head__en { color: #fff; opacity: .8; }
.empty .arch-head__en { color: var(--muted); }

.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--ink); }

/* ===== 記事 ===== */
.article-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
@media (max-width: 960px) { .article-cols { grid-template-columns: 1fr; } .article-cols .cols__side { display: none; } }
.article { min-width: 0; max-width: 760px; }
.article--page { margin: 0 auto; }
.article__head { display: flex; flex-direction: column; gap: 12px; }
.article__title { margin: 0; font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; line-height: 1.45; }
.article__eye { margin: 24px 0 0; }
.article__eye img { width: 100%; border-radius: var(--r); }
.article__eye figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }

.article__body { margin-top: 28px; font-size: 16.5px; line-height: 1.95; overflow-wrap: anywhere; }
.article__body > * { margin-top: 0; margin-bottom: 1.4em; }
.article__body h2 { font-size: 23px; font-weight: 900; line-height: 1.5; margin-top: 2.2em; padding-left: 14px; border-left: 6px solid var(--ink); }
.article__body h3 { font-size: 19px; font-weight: 900; line-height: 1.5; margin-top: 1.8em; }
.article__body h4 { font-size: 17px; font-weight: 700; margin-top: 1.6em; }
.article__body a { color: var(--c-robot); text-decoration: underline; text-underline-offset: 3px; }
.article__body strong { background: linear-gradient(transparent 62%, rgba(255,197,49,.55) 62%); }
.article__body ul, .article__body ol { padding-left: 1.4em; }
.article__body li + li { margin-top: .4em; }
.article__body img { border-radius: 8px; }
.article__body figure { margin-left: 0; margin-right: 0; }
.article__body figcaption, .article__body .wp-element-caption { font-size: 12.5px; color: var(--muted); margin-top: 6px; text-align: left; }
.article__body blockquote { margin-left: 0; margin-right: 0; padding: 14px 18px; background: var(--soft); border-radius: 8px; border-left: 4px solid var(--line); color: var(--muted); }
.article__body blockquote p:last-child { margin-bottom: 0; }
.article__body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.article__body .wp-block-table { overflow-x: auto; }
.article__body th, .article__body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.article__body th { background: var(--soft); }
.article__body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.article__body iframe, .article__body video { max-width: 100%; }
.article__body .twitter-tweet { margin-left: auto !important; margin-right: auto !important; }

.source { margin-top: 36px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13.5px; }
.source__h { margin: 0 0 6px; font-size: 13px; font-weight: 900; color: var(--muted); }
.source ul { margin: 0; padding-left: 1.2em; }
.source a { color: var(--c-robot); text-decoration: underline; overflow-wrap: anywhere; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.share__h { font-size: 13px; font-weight: 700; margin-right: 4px; }
.share__btn { font: inherit; font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.share__btn--x { background: var(--ink); border-color: var(--ink); color: #fff; }
.share__btn:hover { border-color: var(--ink); }

.tags { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: 13px; color: var(--muted); background: var(--soft); padding: 4px 12px; border-radius: 999px; }
.tags a:hover { color: var(--ink); }

/* ===== フッター ===== */
.follow-band { background: var(--soft); }
.follow-band__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 32px; padding-bottom: 32px; flex-wrap: wrap; }
.follow-band__pre { margin: 0; font-weight: 900; font-size: 18px; }
.follow-band__t { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.follow-band .btn-follow { background: var(--ink); color: #fff; }
.follow-band .btn-follow:hover { background: var(--lamp); color: var(--ink); }

.site-foot { background: var(--ink); color: #fff; padding: 44px 0 24px; font-size: 14px; }
.site-foot__in { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; }
@media (max-width: 760px) { .site-foot__in { grid-template-columns: 1fr; } }
.site-foot__brand img { height: 44px; width: auto; }
.site-foot__brand p { margin: 14px 0 0; opacity: .75; font-size: 13px; max-width: 34ch; }
.site-foot__h { margin: 0 0 8px; font-size: 12px; font-weight: 700; opacity: .6; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-foot a:hover { color: var(--lamp); }
.site-foot__copy { margin: 32px auto 0; font-size: 12px; opacity: .55; }

/* ===== WordPress の標準クラス ===== */
.alignwide { margin-left: -40px; margin-right: -40px; max-width: none; }
@media (max-width: 860px) { .alignwide { margin-left: 0; margin-right: 0; } }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.wp-block-image img { height: auto; }
.wp-block-embed { margin-left: 0; margin-right: 0; }
