/*
Theme Name: CWS Base
Theme URI: https://cws.bz/
Author: 株式会社クリエイティブ・ウェブ・システムズ
Author URI: https://cws.bz/
Description: CWS が WordPress 案件で標準的に使うブロックテーマ。業種ごとの見た目はスタイルバリエーション (styles/*.json) で切り替え、テーマ本体は共通に保つ。ページビルダーに依存しない。
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.1
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cws-base
Tags: full-site-editing, block-patterns, blog, business, translation-ready
*/

/*
 * このテーマの見た目はほぼすべて theme.json で定義している。
 * ここに書くのは theme.json で表現できないものだけに限る
 * (CSS だけが増えていくと、クライアントがエディタから触れる範囲が減っていくため)。
 */

/* ---- 読みやすさ ---- */

/* 日本語は英文より行間を広く取らないと詰まって見える。 */
body {
    line-height: 1.9;
}

/* 見出しは逆に詰める。行間が空くと塊として見えない。 */
h1, h2, h3, h4, h5, h6,
.wp-block-heading {
    line-height: 1.45;
}

/*
 * 日本語の見出しは単語区切りが無いため、ブラウザ任せだと助詞の前で折れて読みにくい。
 * 文節での改行を優先させる。対応外のブラウザでは通常の折り返しに戻るだけ。
 */
h1, h2, h3,
.wp-block-heading {
    word-break: auto-phrase;
}

/* ---- 操作性 ---- */

/* キーボード操作時のフォーカスを必ず見えるようにする (アクセシビリティ) */
:where(a, button, input, select, textarea, .wp-block-button__link):focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}

/* ---- 制作サンプル用の帯 ---- */

/*
 * デモサイトであることを明示する帯。実在の店舗と誤認させないために出す。
 * 実案件では body クラスが付かないので何も起きない。
 */
.cws-sample-notice {
    background: #1f2933;
    color: #fff;
    text-align: center;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    line-height: 1.6;
}

.cws-sample-notice a {
    color: #fff;
    text-underline-offset: 2px;
}
