/*
Theme Name: EX REDESiGN
Description: A minimal, opinionated WordPress block theme inspired by the EX ViSiON design system. Features 1-row / 2-row header layouts, multiple sidebar variants, dark footer, sticky header, back-to-top button, and a comprehensive theme settings UI.
Version: 1.7.15
Theme URI: https://grevia.tech/themes/ex-redesign/
Author: GREViA
Author URI: https://grevia.tech/
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ex-redesign
Domain Path: /languages
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
Update URI: https://grevia.tech/themes/ex-redesign/
Tags: blog, full-site-editing, block-styles, custom-colors, custom-logo, custom-menu, featured-images, sticky-post, threaded-comments, translation-ready
*/

/* Note on cascade architecture:
   We previously experimented with `@layer base, components, layout, blocks, overrides;`
   to make our internal cascade explicit, but found that all 8 component CSS
   files override at least one WordPress-core block-library selector. Layered
   rules ALWAYS lose to un-layered (WP core) rules regardless of specificity,
   so wrapping our component files in @layer broke the override behaviour
   silently (e.g. .ex-header-cta button reverted to WP-core defaults).
   We therefore keep all theme CSS un-layered. The cascade order is enforced
   by the enqueue order in functions.php instead. */

:root {
  /* Palette mapped to theme.json slugs so the Site Editor styles panel and
     EX REDESiGN 設定 → スタイル タブ (which both write to wp_global_styles)
     drive these variables. The literal hex after each var() is the fallback
     used when no global-styles override is present. */
  --color-bg-base:        var(--wp--preset--color--bg-base, #F9FAFB);
  --color-surface:        var(--wp--preset--color--surface, #FFFFFF);
  --color-surface-raised: var(--wp--preset--color--surface-raised, #F3F4F6);
  --color-text-primary:   var(--wp--preset--color--text-primary, #111827);
  --color-text-secondary: var(--wp--preset--color--text-secondary, #6B7280);
  --color-text-muted:     var(--wp--preset--color--text-muted, #9CA3AF);
  --color-border-subtle:  var(--wp--preset--color--border-subtle, #E5E7EB);
  --color-border:         #D1D5DB;
  /* Footer bg tracks palette's text-primary slot (highest-contrast color per
     preset). For Default/Warm/Cool/Mono this gives a dark footer; for Dark
     palette text-primary is light so the footer becomes light — unconventional
     but consistent with the palette's contrast intent. */
  --color-footer-bg:      var(--wp--preset--color--text-primary, #111827);
  --shadow-soft:          0 1px 3px rgba(0,0,0,0.06);
  --shadow-softer:        0 4px 16px rgba(0,0,0,0.08);
  /* CJK font family is locale-driven (v1.4.47+). functions.php loads the matching
     Noto Sans variant per get_locale(); these rules pick the right one in CSS.
     html[lang] is the source of truth so multilingual sites (Polylang など) switch
     fonts automatically when the language changes. */
  --exr-font-family-primary: 'Inter', 'Noto Sans JP', sans-serif;
  --font-sans: var(--exr-font-family-primary);
}
html[lang="zh-TW"], html[lang="zh-HK"], html[lang^="zh-Hant"] {
  --exr-font-family-primary: 'Inter', 'Noto Sans TC', sans-serif;
}
html[lang^="zh"]:not([lang="zh-TW"]):not([lang="zh-HK"]):not([lang^="zh-Hant"]) {
  --exr-font-family-primary: 'Inter', 'Noto Sans SC', sans-serif;
}
html[lang^="ko"] {
  --exr-font-family-primary: 'Inter', 'Noto Sans KR', sans-serif;
}
html[lang^="en"] {
  --exr-font-family-primary: 'Inter', sans-serif;
}

/* ── Base ── */
html {
    scroll-behavior: smooth;
    /* スマホ横スクロール / iOS ラバーバンド防止: html 側もクリップしてオーバースクロールを押さえる */
    overflow-x: clip;
    overscroll-behavior-x: contain;
}
/* Prevent horizontal scrollbar caused by 100vw bleed (e.g., menu bg in stacked
   layout). overflow-x: clip is preferred over 'hidden' because it does not
   create a new containing block / scroll context, so position: sticky on the
   header continues to work. */
body {
    overflow-x: clip;
    overscroll-behavior-x: contain;
}
body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 200ms;
}
a:hover { color: var(--color-text-secondary); }

/* Theme styles are split by responsibility into assets/css/*.css
   See ファイル構成.md for the role-by-file map. functions.php enqueues
   each split file in order; this style.css carries the WordPress theme
   metadata header (above) plus the global :root variables and base typography
   that all other stylesheets depend on. */
