/*
Theme Name: EDI Media
Description: EDI（電子データ交換）の解説メディア用のテーマ。プラグインに依存しないクラシックテーマ。目的別の入口、目次・よくある質問付きの記事、五十音・英字で引ける用語集、EDIニュース、「PR」と明示した製品紹介枠を備える。サイト名は「設定 > 一般」から表示する。見た目の基準は DESIGN.md。外部の読み込みは、測定IDを設定したときの Google アナリティクス（inc/analytics.php）だけを例外とする。
Author: 株式会社イーポート
Version: 1.2.3
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: edi-media
*/

/* ==========================================================================
   基本値（DESIGN.md §1 色・§4 文字）
   色は白・薄い青・紺・橙の3色（7：2：1）と無彩色だけ。
   ========================================================================== */
:root {
    --base: #e4eef6;       /* ベース：薄い青（見出しの帯・要点の囲み・表の見出し行） */
    --main: #1f3b73;       /* メイン：紺（見出しの文字・リンク・ボタン・フッター） */
    --accent: #b84a0e;     /* アクセント：橙（いちばん伝えたい箇所・注意の見出し） */
    --accent-base: #fbe6d8;/* 注意の囲みの地色 */
    --text: #222222;
    --sub: #555555;
    --rule: #c9ced6;
    --rule-light: #e3e6eb;
    --font: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
    --fs-body: 17px;
    --fs-h3: 22px;
    --fs-h2: 29px;
    --fs-small: 14px;
    --measure: 40em;       /* 一覧の説明文など、短い文の1行：全角40字まで */
    --container: 1080px;
    --gutter: 24px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #fff;
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-body);
    line-height: 1.85;
    overflow-wrap: anywhere;
    line-break: strict;
}

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

a { color: var(--main); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.5; letter-spacing: .02em; color: var(--main); }

small { font-size: var(--fs-small); }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.skip-link {
    position: absolute; left: 8px; top: -100px; z-index: 100;
    padding: 8px 16px; background: var(--main); color: #fff;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* 数字を主にして単位を小さく（§4） */
.count { font-weight: 700; }
.count small { margin-left: .1em; font-weight: 400; }

/* ボタン：紺の塗りに白い文字、角は四角（§6） */
.button {
    display: inline-block;
    padding: .7em 1.6em;
    background: var(--main);
    color: #fff;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}
.button:hover { color: #fff; text-decoration: underline; }

/* ==========================================================================
   ヘッダー：サイト名・キャッチフレーズ・検索欄はここに1回だけ（§7）
   ========================================================================== */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    padding-top: 20px; padding-bottom: 16px;
}
.site-brand { min-width: 0; }
.site-brand__name { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.4; }
.site-brand__name a { color: var(--main); text-decoration: none; }
.site-brand__name a:hover { text-decoration: underline; }
.site-brand .custom-logo { display: block; max-height: 48px; width: auto; }
.site-brand__desc { margin: 4px 0 0; color: var(--sub); font-size: var(--fs-small); line-height: 1.7; }
.site-header__search { flex: 0 0 340px; }

.site-nav { border-top: 1px solid var(--rule-light); }
.site-nav__list { display: flex; flex-wrap: wrap; gap: 0 28px; margin: 0; padding: 0; list-style: none; }
.site-nav__list a {
    display: block;
    padding: 10px 0;
    color: var(--main);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a { text-decoration: underline; }

/* 検索欄：四角い線の入力欄と紺の塗りのボタン（§6） */
.search-form { display: flex; width: 100%; }
.search-form__input {
    flex: 1; min-width: 0;
    padding: .5em .75em;
    border: 1px solid var(--rule);
    border-right: 0;
    border-radius: 0;
    background: #fff;
    font: inherit; font-size: 16px; color: var(--text);
    -webkit-appearance: none; appearance: none;
}
.search-form__input:focus { outline: 2px solid var(--main); outline-offset: -1px; }
.search-form__button {
    padding: .5em 1.1em;
    border: 1px solid var(--main);
    border-radius: 0;
    background: var(--main);
    color: #fff;
    font: inherit; font-size: 16px; font-weight: 700;
    cursor: pointer;
}
.search-form__button:hover { text-decoration: underline; }

/* ==========================================================================
   パンくず：小さめの文字と「›」だけ（§6）
   ========================================================================== */
.breadcrumb { margin: 20px 0 24px; font-size: var(--fs-small); color: var(--sub); }
.breadcrumb__list { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.breadcrumb__list li + li::before { content: "›"; margin: 0 .5em; }
.breadcrumb__list a { color: var(--sub); }

/* ==========================================================================
   見出しの型（§5）
   h2：薄い青の帯に紺の文字（塗りだけ）。h3：「■」＋紺の文字＋紺の細い下線。h4：紺の太字だけ。
   ========================================================================== */
.section__title,
.entry-content h2,
.faq__title,
.reviewer__heading,
.glossary-index__head {
    padding: .3em .55em;
    background: var(--base);
    color: var(--main);
    font-size: var(--fs-h2);
    font-weight: 700;
}
.fields__title,
.entry-content h3,
.term__mentions h2 {
    padding-bottom: .2em;
    border-bottom: 1px solid var(--main);
    color: var(--main);
    font-size: var(--fs-h3);
    font-weight: 700;
}
.fields__title::before,
.entry-content h3::before,
.term__mentions h2::before { content: "■"; margin-right: .3em; }
.entry-content h4 { color: var(--main); font-size: var(--fs-body); font-weight: 700; }

/* ==========================================================================
   トップ：目的から探す／分野から探す／用語を引く
   ========================================================================== */
.section { margin: 48px 0 0; }
.section__title { margin-bottom: 24px; }
.section__lead { margin: 0 0 16px; }
.section__more { margin: 24px 0 0; }

/* 入口：枠も色分けもない3つの段（§6） */
.entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.entries__title { font-size: 19px; }
.entries__title a { color: var(--main); }
.entries__text { margin: 8px 0 0; font-size: 16px; line-height: 1.8; }

/* 分野ごとの新着：見出しと罫線区切りの行（2段：左→右→次の行） */
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 48px; }
.fields__title a { color: var(--main); text-decoration: none; }
.fields__title a:hover { text-decoration: underline; }
.fields__desc { margin: 8px 0 0; color: var(--sub); font-size: 15px; line-height: 1.75; }
.fields__list { margin: 8px 0 0; padding: 0; list-style: none; }
.fields__list li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule-light);
}
.fields__list time { flex: none; color: var(--sub); font-size: var(--fs-small); }
.fields__more { margin: 10px 0 0; font-size: 15px; }
.fields__more .count { margin-left: .6em; color: var(--sub); }

/* 用語のリンク：丸いタグにせず、下線付きリンクを余白で区切る（§6） */
.term-links { display: flex; flex-wrap: wrap; gap: 6px 1.4em; margin: 0; padding: 0; list-style: none; }
.term-links--sub { margin-bottom: 24px; }

/* ==========================================================================
   一覧：罫線で区切った行（§6）
   ========================================================================== */
.list-header { max-width: var(--measure); margin: 0 0 24px; }
.list-header__title { font-size: 30px; }
.list-header__desc { margin-top: 8px; }
.list-header__desc p { margin: 0; }
.list-header__count { margin: 8px 0 0; color: var(--sub); }

.rows { max-width: 760px; border-top: 1px solid var(--rule); }
.row { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.row__title { font-size: 19px; line-height: 1.6; }
.row__title a { color: var(--main); }
.row__excerpt { margin: 6px 0 0; font-size: 16px; line-height: 1.8; }
.row__meta { display: flex; flex-wrap: wrap; gap: 0 1.2em; margin: 6px 0 0; color: var(--sub); font-size: var(--fs-small); }

.empty { max-width: var(--measure); padding: 8px 0; }
.empty p { margin: 0 0 .8em; }

.pagination { margin: 32px 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
    display: inline-block; min-width: 2.6em; padding: .3em .7em;
    border: 1px solid var(--rule);
    color: var(--main);
}
.pagination .page-numbers.current { background: var(--main); border-color: var(--main); color: #fff; }
.pagination .page-numbers.dots { border: 0; }

/* ==========================================================================
   記事：幅はトップと同じ枠（.container）いっぱい（§4）
   ========================================================================== */
.article__header { margin-bottom: 32px; }
.article__title { font-size: 32px; line-height: 1.5; }
.article__meta { display: flex; flex-wrap: wrap; gap: 0 1.4em; margin: 12px 0 0; color: var(--sub); font-size: var(--fs-small); }
.article__meta a { color: var(--sub); }
.article__thumb { margin: 24px 0 0; }
.article__thumb img { display: block; width: 100%; }
.article__footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--sub); font-size: 15px; }
.article__footer p { margin: 0 0 .6em; }
.article__footer a { color: var(--sub); }
.article__updated { margin: 40px 0 0; color: var(--sub); font-size: var(--fs-small); }

/* 本文 */
.entry-content > * { margin-top: 0; margin-bottom: 0; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content p { margin: 0; }
.entry-content p + p,
.entry-content > * + p { margin-top: 1.1em; }
/* 見出しは前の段落より次の段落に近づける（§3） */
.entry-content h2 { margin-top: 2.2em; margin-bottom: .9em; }
.entry-content h3 { margin-top: 2em; margin-bottom: .7em; }
.entry-content h4 { margin-top: 1.6em; margin-bottom: .4em; }
.entry-content h2 + *,
.entry-content h3 + *,
.entry-content h4 + * { margin-top: 0; }
.entry-content ul,
.entry-content ol { padding-left: 1.5em; }
.entry-content li + li { margin-top: .3em; }
.entry-content strong { font-weight: 700; }
/* アクセント（橙）：いちばん伝えたい箇所だけ。<mark> で付ける */
.entry-content mark { background: none; color: var(--accent); }
.entry-content blockquote { margin-left: 0; margin-right: 0; padding: .2em 0 .2em 1.2em; border-left: 2px solid var(--rule); color: var(--sub); }
.entry-content blockquote p + p { margin-top: .6em; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { margin-top: .4em; color: var(--sub); font-size: var(--fs-small); }
.entry-content code { font-size: .9em; }
.entry-content pre { overflow-x: auto; padding: 1em 1.25em; background: var(--base); font-size: 15px; line-height: 1.7; }
.entry-content hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--rule); }

/* 表：横罫は見出し行の下と表の最後だけ。縦罫なし。左寄せ（§6） */
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.7; border-bottom: 1px solid var(--main); }
.entry-content > table { display: block; overflow-x: auto; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content .wp-block-table table { border-bottom: 1px solid var(--main); }
.entry-content th,
.entry-content td { padding: .55em .8em; border: 0; vertical-align: top; text-align: left; }
/* 表の中では語の途中で折らない。エディターが付ける固定幅レイアウトも解除し、列幅は中身に合わせる */
.entry-content table.has-fixed-layout { table-layout: auto; }
.entry-content th,
.entry-content td { overflow-wrap: break-word; }
.entry-content th { white-space: nowrap; }
.entry-content thead th { white-space: normal; }
.entry-content td { border-top: 1px solid var(--rule-light); }
.entry-content th { background: var(--base); border-bottom: 1px solid var(--main); color: var(--text); font-weight: 700; }
.entry-content .wp-block-table thead { border-bottom: 0; }
.entry-content .wp-block-table tfoot { border-top: 0; }
.entry-content td.num,
.entry-content th.num,
.entry-content .has-text-align-right { text-align: right; }
.entry-content figure.wp-block-table figcaption { text-align: left; }

/* 囲み（要点・注意）：塗りだけ。先頭に文字で「要点」「注意」（§6） */
.entry-content .is-style-point,
.entry-content .is-style-caution { padding: 1em 1.25em; border: 0; }
.entry-content .is-style-point { background: var(--base); }
.entry-content .is-style-caution { background: var(--accent-base); }
.entry-content .is-style-point::before,
.entry-content .is-style-caution::before { display: block; margin-bottom: .3em; font-weight: 700; }
.entry-content .is-style-point::before { content: "要点"; color: var(--main); }
.entry-content .is-style-caution::before { content: "注意"; color: var(--accent); }
.entry-content .is-style-point > * + *,
.entry-content .is-style-caution > * + * { margin-top: .6em; }

/* 目次：線だけの囲み、番号付きリスト（§6） */
.toc { padding: 1em 1.25em; border: 1px solid var(--rule); }
.entry-content .toc { margin-top: 1.8em; margin-bottom: 1.8em; }
.toc__title { margin: 0; color: var(--main); font-weight: 700; }
.toc__list { margin: .5em 0 0; padding-left: 1.6em; font-size: 16px; line-height: 1.75; }
.toc__list > li { margin-top: .3em; }
.toc__sub { margin: .2em 0 0; padding-left: 1em; list-style: none; font-size: 15px; }
.toc__sub li { margin-top: .15em; }
.toc__sub li::before { content: "– "; color: var(--sub); }

/* よくある質問：「Q.」「A.」は文字。質問同士は余白と細い罫線1本で分ける（§6） */
.faq { margin-top: 2.6em; }
.faq__title { margin-bottom: .6em; }
.faq__list { margin: 0; }
.faq__item { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.faq__item:first-child { padding-top: 4px; }
.faq__q,
.faq__a { display: flex; gap: .5em; margin: 0; }
.faq__q { font-weight: 700; line-height: 1.7; }
.faq__a { margin-top: .4em; line-height: 1.85; }
.faq__a > div { min-width: 0; }
.faq__mark { flex: none; color: var(--main); font-weight: 700; }

/* PR 枠：線だけの囲みに「PR」の文字（§6）。本文の塗りの囲みと見分けるため塗らない */
.edi-pr { margin: 2.6em 0 0; padding: 1em 1.25em; border: 1px solid var(--rule); }
.entry-content .edi-pr { margin: 1.8em 0; }
.edi-pr p { margin: 0; }
.edi-pr__label { color: var(--sub); font-size: var(--fs-small); line-height: 1.7; }
.edi-pr__badge { margin-right: .8em; color: var(--text); font-weight: 700; letter-spacing: .05em; }
.edi-pr .edi-pr__title { margin-top: .4em; color: var(--main); font-weight: 700; line-height: 1.6; }
.edi-pr .edi-pr__text { margin-top: .3em; font-size: 16px; line-height: 1.8; }
.edi-pr .edi-pr__link { margin-top: .5em; font-size: 16px; }

/* 監修者：見出しは h2 の型。写真・名前・プロフィール文・リンク。囲みは付けず余白で分ける */
.reviewer { margin-top: 2.6em; }
.entry-content .reviewer { margin-top: 2.2em; }
.reviewer__heading { margin: 0 0 .8em; }
.reviewer__body { display: flex; gap: 20px; align-items: flex-start; }
.reviewer__avatar { flex: none; display: block; width: 96px; height: 96px; border-radius: 0; }
.reviewer__text { min-width: 0; }
.entry-content .reviewer__text > p { margin: 0; }
.reviewer__name { margin: 0; color: var(--main); font-size: 19px; font-weight: 700; line-height: 1.6; }
.reviewer__desc { margin: .4em 0 0 !important; font-size: 16px; line-height: 1.8; }
.reviewer__links { display: flex; flex-wrap: wrap; gap: 4px 1.4em; margin: .6em 0 0; padding: 0; list-style: none; font-size: 16px; }
.entry-content .reviewer__links { padding-left: 0; }
.entry-content .reviewer__links li + li { margin-top: 0; }

/* 問い合わせフォーム：四角い線の入力欄、紺の塗りのボタン、左揃え（§6） */
.contact { max-width: var(--measure); }
.contact__notice { margin: 0 0 32px; padding: 1em 1.25em; }
.contact__notice p { margin: 0; }
.contact__notice p + p,
.contact__notice ul { margin-top: .5em; }
.contact__notice ul { margin-bottom: 0; padding-left: 1.4em; }
.contact__notice--done { background: var(--base); }
.contact__notice--error { background: var(--accent-base); }
.contact__notice-title { font-weight: 700; color: var(--main); }
.contact__notice--error .contact__notice-title { color: var(--accent); }
.contact__form { margin: 0; }
.contact__field { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
.contact__label { display: block; margin: 0 0 6px; padding: 0; font-weight: 700; }
.contact__req,
.contact__opt { margin-left: .6em; font-size: var(--fs-small); font-weight: 700; }
.contact__opt { color: var(--sub); font-weight: 400; }
.contact__input {
    display: block; width: 100%;
    padding: .55em .75em;
    border: 1px solid var(--rule);
    border-radius: 0;
    background: #fff;
    font: inherit; font-size: 16px; color: var(--text);
    -webkit-appearance: none; appearance: none;
}
.contact__textarea { min-height: 12em; line-height: 1.8; resize: vertical; }
.contact__input:focus { outline: 2px solid var(--main); outline-offset: -1px; }
.is-invalid .contact__input { border: 2px solid var(--accent); }
.contact__choice { display: block; margin: 4px 0 0; }
.contact__choice input { margin: 0 .4em 0 0; vertical-align: -.1em; accent-color: var(--main); }
.contact__error { margin: 0 0 6px !important; color: var(--accent); font-size: 15px; font-weight: 700; }
.contact__submit { margin: 32px 0 0 !important; }
.contact__submit .button { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.contact__hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* 用語の個別ページ */
.term__reading { margin: 8px 0 0; color: var(--sub); font-size: 15px; }
.term__summary { margin: 0 0 2em; padding: 1em 1.25em; background: var(--base); }
.term__summary p { margin: 0; }
.term__summary .term__summary-label { margin-bottom: .2em; color: var(--main); font-weight: 700; }
.term__mentions { margin-top: 2.6em; }
.term__mentions h2 { margin-bottom: .6em; }
.term__mentions ul { margin: 0; padding-left: 1.3em; }
.term__mentions li + li { margin-top: .3em; }
.term__back { margin: 2.4em 0 0; }

/* 用語集の索引 */
.kana-index { margin-bottom: 40px; padding: 1em 1.25em; background: var(--base); }
.kana-index__row { display: flex; align-items: baseline; gap: 16px; }
.kana-index__row + .kana-index__row { margin-top: 8px; }
.kana-index__label { flex: 0 0 3.5em; color: var(--sub); font-size: var(--fs-small); font-weight: 700; }
.kana-index__list { display: flex; flex-wrap: wrap; gap: 4px 1em; margin: 0; padding: 0; list-style: none; }
.kana-index__list a { font-weight: 700; }
.kana-index__list .is-empty { color: var(--sub); }

.glossary-index__group { margin-bottom: 40px; }
.glossary-index__head { margin-bottom: 8px; font-size: var(--fs-h3); }
.glossary-index__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; margin: 0; }
.glossary-index__item { padding: 12px 0; border-bottom: 1px solid var(--rule-light); }
.glossary-index__item dt { font-weight: 700; }
.glossary-index__reading { margin-left: .6em; color: var(--sub); font-size: var(--fs-small); font-weight: 400; }
.glossary-index__item dd { margin: 4px 0 0; font-size: 15px; line-height: 1.75; }
.glossary-index__top { margin: 10px 0 0; font-size: var(--fs-small); }

.page-links { margin-top: 2em; }

/* ==========================================================================
   フッター：紺の地に白い文字
   ========================================================================== */
.site-main { padding-bottom: 64px; }
.site-footer { padding: 40px 0 28px; background: var(--main); color: #fff; font-size: 15px; }
.site-footer a { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.site-footer__name { margin: 0; font-size: 18px; font-weight: 700; }
.site-footer__name a { text-decoration: none; }
.site-footer__operator { margin: 8px 0 0; }
.site-footer__policy { max-width: 38em; margin: 12px 0 0; font-size: var(--fs-small); line-height: 1.8; }
.footer-nav__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; margin: 0; padding: 0; list-style: none; }
.site-footer__copy { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .35); font-size: var(--fs-small); }

/* ==========================================================================
   スマホ・タブレット
   本文：小見出し：見出しの比（1：1.28：1.71）を保ったまま小さくする。
   ========================================================================== */
@media (max-width: 900px) {
    .entries { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 780px) {
    :root { --fs-body: 16px; --fs-h3: 20px; --fs-h2: 27px; --gutter: 16px; }
    .site-header__inner { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 14px; padding-bottom: 12px; }
    .site-header__search { flex: none; }
    .site-brand__name { font-size: 22px; }
    .site-nav__list { gap: 0 20px; }
    .site-nav__list a { padding: 8px 0; font-size: 15px; }

    .section { margin-top: 40px; }
    .section__title { margin-bottom: 16px; }
    .fields,
    .glossary-index__list,
    .site-footer__grid { grid-template-columns: 1fr; }
    .fields { gap: 32px; }

    .article__title { font-size: 26px; }
    .list-header__title { font-size: 26px; }
    .entries__title,
    .row__title { font-size: 18px; }
    .fields__list li { flex-direction: column; gap: 2px; }
    .entry-content th,
    .entry-content td { padding: .5em .5em; font-size: 15px; }

    .kana-index__row { flex-direction: column; gap: 4px; }
    .reviewer__body { flex-direction: column; gap: 12px; }
    .reviewer__avatar { width: 72px; height: 72px; }
    .kana-index__label { flex: none; }
}
