/*
 * おシゴトログ 公開画面スタイル。
 * Phase 2でプラグインからテーマへ移設。Phase 3（共通UI）で、ヘッダー・フッター・
 * 固定フッターメニュー・共通メニューまわりを指示書5章の内容に作り直した
 * （分離先：header.css / footer.css。このファイルには残りの共通レイアウトを置く）。
 * カード・会社ページ・フォーム等、個別画面の配色の作り直しはPhase 4以降で行う
 * （4章の推奨構成：company.css/works.css/companies.css/single-work.css/forms.css）。
 * 新ブランドカラーは同ディレクトリのtokens.cssに定義済み。
 */
/*
 * v0.32（Phase 4）：カード・会社ページ・フォーム等で使っていた旧配色（緑の--bws-accent等）を、
 * tokens.cssで確定した新ブランドカラーへ置き換えた。個々のセレクタを書き換える代わりに、
 * この共通トークンの「値」だけをtokens.css側の変数へ差し替えることで、base.css全体の
 * 見た目（カード・いいねボタン以外のボタン・フォーム・ページネーション等）を一括で
 * 新配色へ揃えている（tokens.cssのコメント通り、Phase 3以降少しずつ置き換える想定だった箇所）。
 */
:root {
	--bws-ink: var(--bws-color-heading);
	--bws-muted: var(--bws-color-body);
	--bws-border: #e2e5e9;
	--bws-accent: var(--bws-color-primary-text);
	--bws-bg: #fafaf8;
	--bws-card-bg: #ffffff;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body.bws-page {
	margin: 0;
	overflow-x: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
	color: var(--bws-ink);
	/* 5.1節：PCでは本体の外側に薄い無彩色を敷く。本体（.bws-app）自身の背景は
	   これまで通りvar(--bws-bg)を使うため、480px以下（本体が画面幅いっぱいになる）では
	   実質この色は見えない。 */
	background: var(--bws-app-outside-bg);
	line-height: 1.7;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/*
 * 公開画面の本体（5.1節）。
 * ヘッダー（header.css）と固定フッターメニュー（footer.css）はいずれも
 * position:fixedで画面に固定し、この.bws-appと同じ最大幅・中央配置に揃えてある
 * （html/bodyにoverflow-x:hiddenを掛けている関係で、position:stickyは環境によって
 * 効かないことがあるため、確実に効くfixed+centeringの方式で統一した）。
 * そのため、ヘッダー・固定フッターメニューの高さぶんの余白をこちら側で確保する
 * （上：padding-top、下：.bws-footernav-spacer。それぞれheader.css/footer.css参照）。
 */
.bws-app {
	max-width: var(--bws-app-max-width);
	margin: 0 auto;
	min-height: 100vh;
	background: var(--bws-bg);
	display: flex;
	flex-direction: column;
	padding-top: 53px; /* header.cssの.bws-header__inner min-height(52px) + border(1px) */
}
@media (max-width: 480px) {
	/* 5.1節：480px以下では画面幅いっぱいに表示してよい。 */
	.bws-app { max-width: 100%; }
}

/* WordPress管理者バー対策（header.cssの同名コメント参照）：バーの高さぶん、
   本文側の開始位置も追加でずらす（ヘッダー自体の位置ずれと合わせて必要）。 */
body.admin-bar .bws-app {
	padding-top: calc(53px + 32px);
}
@media (max-width: 782px) {
	body.admin-bar .bws-app {
		padding-top: calc(53px + 46px);
	}
}

.bws-container {
	/* widthを明示指定：実機のSafari/Chrome(iOS)で、指定がない場合に
	   右側だけ余白が残る不具合が報告されたため、幅の計算をブラウザ任せにせず固定する。 */
	width: 100%;
	margin: 0 auto;
	padding: 20px 16px 40px;
	/* .bws-appをflexの縦並びにしたことで、本文が短いページでも法務フッターが
	   画面下端付近まで下がるようにする（本文がこの分だけ伸びる）。 */
	flex: 1 0 auto;
}

.bws-intro {
	width: 100%;
	background: #fff;
	border: 1px solid var(--bws-border);
	border-radius: 8px;
	padding: 20px 24px;
	margin-bottom: 32px;
}
.bws-intro h1 { margin: 0 0 8px; font-size: 1.4rem; }
.bws-intro p { margin: 6px 0; color: var(--bws-muted); font-size: 0.92rem; text-align: justify; text-justify: inter-ideograph; }

/* テーマv1.2.7：法務免責文（.bws-disclaimer）は使う画面ごとにインラインstyleで
   font-sizeがバラバラだった（未指定＝ブラウザ既定の1remになっていた箇所もあった）ため、
   共通クラスとして一箇所にまとめ、0.8remに統一した。会社ページ側のインラインstyleは
   このタイミングで削除している（templates/company-page.php参照）。 */
.bws-disclaimer {
	font-size: 0.8rem;
	color: var(--bws-muted);
}
.bws-intro .bws-disclaimer {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed var(--bws-border);
}

/* Phase 3：本体の最大幅を430px前後に固定したため（5.1節「PC表示はスマートフォンと
   同じ構成でよい」）、画面幅（viewport）に応じて3→4列に増やしていた従来の挙動をやめ、
   常に2列にする。狭い本体の中で列数だけ増えると、かえって窮屈になるため。
   1frではなくminmax(0, 1fr)を使う：Safari（iOS含む）では、カード内の文字量や画像次第で
   単純な1fr指定だと列幅が左右不揃いになることがあるための対策（min-width:0相当を列側にも明示する）。
   注意：このカードグリッドを使うトップページ（front-top.php）には、PC用／スマホ用で
   通知カードの挿入位置を切り替えるコード（.bws-notice-card--desktop-only/mobile-only、
   このすぐ下）が別途あり、常に2列にした今もそのまま残している。実際の挿入位置の見直しは
   Phase 4（既存3画面）で扱う。 */
.bws-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.bws-card {
	background: var(--bws-card-bg);
	border: 1px solid var(--bws-border);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	/* grid/flexアイテムはmin-widthの初期値がauto（コンテンツの最小幅）のため、
	   タイトルや会社名等の文字量次第で列の幅が左右不揃いになることがある。
	   0にして常にトラック幅いっぱいまで縮められるようにし、右側だけ空くのを防ぐ。 */
	min-width: 0;
}
.bws-card__image {
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #eceeec url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7bcb8' stroke-width='1.2'%3E%3Crect x='3' y='5' width='18' height='14' rx='1'/%3E%3Ccircle cx='9' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5-5-4 4-3-3-5 5'/%3E%3C/svg%3E") no-repeat center / 40px;
	background-size: cover;
	background-position: center;
}
.bws-card__body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
/* v0.33.2：カード全般でタイトル・メタ情報を小さめに統一（会社名を外し公開日のみにした分、
   詰まって見えないようにする調整）。 */
/* テーマv1.2.3：日本語の禁則処理（」）！などの行頭禁則文字を避けるための行末での強制改行）を
   解除し、カードの幅いっぱいまで詰めて折り返すようにした（読みやすさ優先の指定。
   プラグイン側の変更を伴わないテーマ単体の修正のため、プラグインのバージョン番号ではなく
   テーマ自身のバージョン（style.css）で記録する）。 */
.bws-card__title { font-size: 0.7rem; font-weight: 700; margin: 0 0 6px; color: var(--bws-ink); overflow-wrap: break-word; word-break: keep-all; line-break: anywhere; }
.bws-card__meta { font-size: 0.7rem; color: var(--bws-muted); margin-bottom: 8px; line-break: anywhere; }
.bws-card__excerpt { font-size: 0.85rem; color: var(--bws-muted); flex: 1; text-align: justify; text-justify: inter-ideograph; }

.bws-notice-card {
	grid-column: 1 / -1;
	/* テーマv1.2.4：トップページでは直前が横スクロールのカード列（.bws-grid--scroll）のため、
	   何もしないとスクロールバー分の余白（6px）しか空かず詰まって見えていた。
	   他のセクション見出し（.bws-section-line）の上マージン28pxに合わせて、
	   前の要素との間を24px空ける（これもテーマ単体の修正）。 */
	margin-top: 24px;
	background: #f2f5f1;
	border: 1px dashed #9db99b;
	border-radius: 8px;
	padding: 18px 20px;
}
.bws-notice-card__label {
	display: inline-block;
	font-size: 0.72rem;
	color: var(--bws-accent);
	border: 1px solid var(--bws-accent);
	border-radius: 999px;
	padding: 2px 10px;
	margin-bottom: 8px;
}
.bws-notice-card__excerpt {
	margin: 0 0 8px;
	font-size: 0.9rem;
	color: var(--bws-ink);
	text-align: justify;
	text-justify: inter-ideograph;
}
.bws-notice-card__links {
	margin: 0;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: 0.85rem;
}
.bws-notice-card__links a { color: var(--bws-accent); }

/* スマホファースト：基本（狭い画面）はスマホ版の挿入位置（カード10個の次）だけを表示し、
   PC版の挿入位置（カード8個の次）は隠す。640px以上ではその逆にする。 */
.bws-notice-card--desktop-only { display: none; }
.bws-notice-card--mobile-only { display: block; }
@media (min-width: 640px) {
	.bws-notice-card--desktop-only { display: block; }
	.bws-notice-card--mobile-only { display: none; }
}

.bws-pagination { margin-top: 32px; display: flex; gap: 8px; justify-content: center; }
.bws-pagination a, .bws-pagination span {
	padding: 6px 12px;
	border: 1px solid var(--bws-border);
	border-radius: 4px;
	text-decoration: none;
	color: var(--bws-ink);
	font-size: 0.85rem;
}
.bws-pagination span.current { background: var(--bws-accent); color: #fff; border-color: var(--bws-accent); }
.bws-pagination .is-disabled { color: var(--bws-muted); opacity: 0.45; cursor: not-allowed; }

.bws-detail__title { font-size: 1.6rem; margin: 0 0 8px; }
.bws-detail__meta { color: var(--bws-muted); font-size: 0.88rem; margin-bottom: 20px; }
.bws-detail__meta a { color: var(--bws-accent); }
.bws-detail__body { font-size: 1rem; }
.bws-detail__body img { max-width: 100%; height: auto; border-radius: 6px; }
.bws-detail__featured { margin: 0 0 20px; }
.bws-detail__featured img { display: block; width: 100%; height: auto; border-radius: 8px; }
.bws-detail__gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 24px; }
.bws-detail__gallery img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }
.bws-lightbox-trigger { cursor: zoom-in; }

/* 画像タップ拡大ポップアップ。JSがhiddenを外すまで非表示。 */
.bws-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.bws-lightbox[hidden] { display: none; }
.bws-lightbox__img {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
}
.bws-lightbox__close,
.bws-lightbox__prev,
.bws-lightbox__next {
	position: absolute;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 1.6rem;
	line-height: 1;
	width: 44px;
	height: 44px;
	border-radius: 999px;
}
.bws-lightbox__close:hover,
.bws-lightbox__prev:hover,
.bws-lightbox__next:hover { background: rgba(255, 255, 255, 0.3); }
.bws-lightbox__close { top: 16px; right: 16px; }
.bws-lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.bws-lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.bws-lightbox__prev[hidden],
.bws-lightbox__next[hidden] { display: none; }
.bws-detail__mypage-link { margin-top: 20px; }
.bws-detail__mypage-link a {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--bws-accent);
	border-radius: 999px;
	color: var(--bws-accent);
	text-decoration: none;
	font-size: 0.88rem;
}
.bws-detail__mypage-link a:hover { background: var(--bws-accent); color: #fff; }

/* v0.32（Phase 4）：承認済みモックアップ（.osh-like）に合わせ、緑系から
   サブカラー（オレンジ）系の淡い塗りつぶしへ変更した。 */
.bws-like { margin: 16px 0 4px; }
.bws-like__button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: #fff8ee;
	border: 1px solid var(--bws-color-sub);
	border-radius: 999px;
	color: var(--bws-color-sub-text);
	font-size: 0.85rem;
	font-weight: 800;
	cursor: pointer;
}
.bws-like__button:hover { background: #fdeecb; }
.bws-like__button.is-liked {
	background: var(--bws-color-sub);
	border-color: var(--bws-color-sub);
	color: #111111;
	cursor: default;
}
.bws-like__icon { font-size: 1.1rem; }

.bws-company-header {
	background: #fff;
	border: 1px solid var(--bws-border);
	border-radius: 8px;
	padding: 24px;
	margin-bottom: 28px;
	display: flex;
	gap: 20px;
	align-items: flex-start;
}
.bws-company-header__logo {
	width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: #eceeec; flex-shrink: 0;
}
.bws-company-header__name { margin: 0 0 8px; font-size: 1.3rem; }
/* v0.32（Phase 4）：会社ページ通常表示の電話・地図・公式サイトは、PC/スマホの出し分け
   （--phone-desktop/--phone-mobile）をやめ、常に同じ「電話する」ボタン1つに統一した
   （5.1節で本体幅自体が常に430px前後になったため、旧来の分岐の前提が既になくなっていた）。
   新しい3ボタン横並び（.bws-contact-actions）と.bws-phone-revealの実際のスタイルは
   pages.css側に置く。.bws-company-header__meta・.bws-meta-item--*は
   trial_expired限定表示（本ファイル上部の.bws-company-header関連）でも会社ページ通常表示
   でも使われなくなったため削除した。 */

.bws-page-content { background: #fff; border: 1px solid var(--bws-border); border-radius: 8px; padding: 28px 32px; }

/* v1.3.5：固定ページ（利用規約・プライバシーポリシー等）の表がスマホ幅で潰れて
   読みにくいとのビオス指摘（2026-09-19）。表をラップして横スクロールできるようにし、
   スマホでは指で横に動かして全体を読めるようにした。表自体の列幅・デザインは変更なし。 */
.bws-page-content table {
	/* v1.3.6：width:100%だと、nowrap指定のセルが入り切らないときに列が押し潰されて
	   重なって見える不具合が出た（ビオス指摘：2026-09-19）。100%は「最低幅」に変え、
	   内容が入り切らない場合は自然な幅まで広がって、外側のoverflow-xで横スクロールさせる。 */
	min-width: 100%;
	border-collapse: collapse;
}
.bws-page-content .wp-block-table,
.bws-page-content figure:has(> table) {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
	margin: 0 0 1.5em;
}
.bws-page-content table th,
.bws-page-content table td {
	padding: 8px 12px;
	border: 1px solid var(--bws-border);
	white-space: nowrap;
	text-align: left;
}

/* v1.3.7：表を「固定幅」スタイルで作った場合、ブロックエディタが自動で
   table.has-fixed-layout要素へ table-layout:fixed; width:100%; を当てる
   （WordPress本体がページに直接埋め込む非表示のCSSで、テーマのCSSファイルには
   存在しないため今まで見つけにくかった）。table-layout:fixedだと列幅が文章量を
   無視して均等割りになり、セルの文章同士が重なって見えていた（ビオス指摘：
   2026-09-19）。ここで明示的に上書きし、内容の長さに応じて列幅が決まる
   table-layout:autoに戻す。 */
.bws-page-content .wp-block-table .has-fixed-layout,
.bws-page-content table.has-fixed-layout {
	table-layout: auto;
	width: auto;
	min-width: 100%;
}

.bws-form {
	background: #fff;
	border: 1px solid var(--bws-border);
	border-radius: 8px;
	padding: 28px 32px;
}
.bws-form__field {
	margin: 0 0 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.bws-form__field label {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--bws-ink);
}
.bws-form__field input,
.bws-form__field select {
	/* テーマv1.2.8：業種セレクター追加（selectはブラウザ既定のフォント・文字サイズに
	   なりがちなため、既存のinputと揃える。7章：スマホ上の文字は16px未満にしない基本に
	   近づける意図もある）。 */
	padding: 10px 12px;
	border: 1px solid var(--bws-border);
	border-radius: 6px;
	font-size: 0.95rem;
	font-family: inherit;
	width: 100%;
	box-sizing: border-box;
	background-color: #fff;
}
.bws-form__field input:focus,
.bws-form__field select:focus {
	outline: none;
	border-color: var(--bws-accent);
}

/* v1.3.5：register.php（体験版申込フォーム）の同意チェックボックス（.bws-form__checkbox）が、
   上の`.bws-form__field input`の共通スタイル（width:100%・padding等）を継承して巨大化し、
   文章の上に単独表示される不具合を修正（ビオス指摘：2026-09-19）。
   このbase.cssが本番で実際に読み込まれるファイルであることを確認し、当初プラグイン側の
   public.css（テーマ有効時は読み込まれない予備CSS）だけを直していたミスを修正した。
   チェックボックス本体は27px固定（18px→ビオス指示で1.5倍）・文章とは横並び（flex）。 */
.bws-form__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
}
.bws-form__checkbox input[type="checkbox"] {
	width: 27px;
	height: 27px;
	min-width: 27px;
	flex: none;
	margin: 2px 0 0;
	padding: 0;
	border: 1px solid var(--bws-border);
	border-radius: 5px;
	box-sizing: border-box;
	accent-color: var(--bws-accent);
}
.bws-form__checkbox a { color: var(--bws-accent); }
/* v1.3.6：register.php v0.37.3で説明文をspan.bws-form__checkbox-textに1つへ
   まとめたのに合わせて、そのspanだけを可変幅のflexアイテムにする。
   これがないと、テキストがまた個別のflexアイテムへ分解されて折り返しが崩れる。 */
.bws-form__checkbox-text {
	flex: 1 1 auto;
	min-width: 0;
}
.bws-form__required { color: #c0392b; font-weight: 700; }
.bws-form__hint { font-size: 0.78rem; color: var(--bws-muted); }
.bws-form__submit {
	background: var(--bws-accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 32px;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
}
.bws-form__submit:hover { opacity: 0.9; }

.bws-form-notice {
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 24px;
	font-size: 0.9rem;
}
.bws-form-notice--success {
	background: #f2f5f1;
	border: 1px solid #9db99b;
	color: var(--bws-accent);
}
.bws-form-notice--error {
	background: #fbecec;
	border: 1px solid #e2a3a3;
	color: #c0392b;
}