/*
Theme Name: ThakWeb
Template: pixeone
Description: ThakWeb child theme of PixeOne. Page bodies are built with free PixeBuilder; the site's header, mobile menu and footer are code, one folder per site in sites/<slug>/ (see README.md).
Version: 1.0.0
Text Domain: thakweb
*/

/* Shared, site-independent bits only. Each site's look lives in sites/<slug>/site.css. */
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link:focus-visible{outline:2px solid #111827;outline-offset:2px}
.skip-link:focus{position:fixed!important;top:8px;left:8px;z-index:100000;width:auto;height:auto;clip:auto;margin:0;padding:12px 18px;background:#fff;color:#000;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,.25)}
body.tw-menu-open{overflow:hidden}
.tw-icon{display:block;flex:none}

/* Owner rule: respect "reduce motion". PixeBuilder 1.2.6 plays its scroll-entrance animations regardless,
   so on visitors who ask for less motion, show animated items in place, with no movement. */
@media (prefers-reduced-motion: reduce){
	.pixe-animation-init{opacity:1!important;animation:none!important;transform:none!important}
	*{scroll-behavior:auto!important}
}

/* PixeBuilder entrance-animation safety net (owner 2026-11-27, docs/pixebuilder-animation-bug-2026-11-27.md): an item whose
   fade has finished stays visible even if PixeBuilder takes .pixe-animated off again (functions.php adds .tw-anim-done). */
.pixe-animation-init.tw-anim-done{opacity:1!important;-webkit-animation:none!important;animation:none!important}

/* Owner 2026-11-19: visible keyboard focus inside PixeBuilder page bodies (the plugin sets a:focus{outline:none}).
   Keyboard only (:focus-visible) — no change for mouse/touch. Two-tone ring: white inner + near-black outer,
   so it reads on light, dark and coloured backgrounds alike. A dark site whose buttons are off-white can swap the
   two colours in its site.css: body.tw-site-<slug>{--tw-focus-outer:#F2F0EC;--tw-focus-inner:#0F1012} (car-care, 2026-11-19). */
/* "body" prefix: the plugin prints .pixe-editor a:focus{outline:none} inline AFTER this file, same weight. */
body .pixe-editor a:focus-visible,
body .pixe-editor button:focus-visible,
body .pixe-editor [role="button"]:focus-visible,
body .pixe-editor [tabindex]:not([tabindex="-1"]):focus-visible{
	outline:3px solid var(--tw-focus-outer,#111827);
	outline-offset:3px;
	box-shadow:0 0 0 3px var(--tw-focus-inner,#fff);
}

/* Sticky header — ON by default for every site (owner 2026-11-19 "sticky ok"); opt out with 'sticky_header' => false in site.php.
   The ThakWeb sample bar above it scrolls away normally; the header then stays at the top. Same height as the canvas
   header (no compact state = no layout shift). Shadow only after scrolling. Anchor jumps and keyboard focus stop below it. */
body.tw-sticky-header .tw-header{position:sticky;top:0;z-index:1000;transition:box-shadow .2s ease}
body.tw-sticky-header.tw-scrolled .tw-header{box-shadow:0 2px 14px rgba(11,43,58,.12)}
html:has(body.tw-sticky-header){scroll-padding-top:calc(var(--tw-header-h,96px) + 16px)}   /* --tw-header-h set by menu.js */
/* logged-in admin bar */
body.admin-bar.tw-sticky-header .tw-header{top:32px}
@media (max-width:782px){body.admin-bar.tw-sticky-header .tw-header{top:46px}}
@media (max-width:600px){body.admin-bar.tw-sticky-header .tw-header{top:0}}
@media (prefers-reduced-motion:reduce){body.tw-sticky-header .tw-header{transition:none}}

/* Mobile menu fade (owner 2026-11-19: opening felt abrupt). Shared for every site; JS toggles .tw-open and the
   `hidden` attribute around it (see assets/menu.js). No movement under reduced motion. */
body .tw-mnav{opacity:0;transform:translateY(-6px);transition:opacity .18s ease-out,transform .18s ease-out}
body .tw-mnav.tw-open{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){body .tw-mnav{transition:none;transform:none}}

/* Map tint — shared (owner 2026-11-19 "ฟิลเตอร์โอเค", trialled on restaurant). A CSS filter on PixeBuilder's
   Google Map iframe only (no overlay: drag/zoom, Google logo, Terms and Report links stay clickable).
   Per site: 'map_filter' in site.php → --tw-map-filter on <body>. No value = no filter. See README. */
.pixe-map iframe{filter:var(--tw-map-filter,none)}
