/*
Theme Name: TO Digital
Description: Mobile-first app theme for the TO Digital booking directory (trades, creative, beauty, lessons). Light, Grey and Dark modes.
Version: 0.8.0
Author: TO Digital Tech
Requires PHP: 8.1
Text Domain: tdt
*/

:root {
	--indigo: #4B4DED; --orange: #F06E00; --navy: #191B46; --tint: #EEEEFE;
	--green: #17803D; --green-soft: #E3F6EA; --amber: #A85A00; --amber-soft: #FFF1DC; --red: #B42323; --red-soft: #FDE6E6;
	--bg: #FFFFFF; --surface: #F8F9FE; --card: #FFFFFF; --line: #CBD0F5; --text: #191B46; --muted: #5B618E;
	--link: #4B4DED; --chip: #EEEEFE; --shadow: 0 1px 2px rgba(25, 27, 70, .06), 0 6px 18px rgba(25, 27, 70, .06);
	--h: "Archivo", "Helvetica Neue", Arial, sans-serif; --b: "Jost", "Segoe UI", system-ui, sans-serif;
	--r: 16px; --r-sm: 10px; --tap: 48px; --tabbar: 64px;
	color-scheme: light;
}
:root[data-theme="grey"] { --bg: #F2F3F7; --surface: #E9EAF1; --card: #FFFFFF; --line: #D5D9E2; }
:root[data-theme="dark"] {
	--bg: #0F1024; --surface: #13152F; --card: #171938; --line: #2A2E5D; --text: #F0F2FF; --muted: #9BA2D0;
	--link: #9C9EFF; --chip: #23255A; --tint: #23255A; --green: #5FD48A; --green-soft: #143323; --amber: #FFB85C;
	--amber-soft: #3A2A12; --red: #FF7B7B; --red-soft: #3D1A1D; --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--b);
	-webkit-tap-highlight-color: transparent; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3, h4 { font-family: var(--h); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 6vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: grid; gap: 16px; }
.section { padding-block: 28px; display: grid; gap: 16px; }
.muted { color: var(--muted); }
.eyebrow { font: 700 .72rem/1 var(--b); letter-spacing: .1em; text-transform: uppercase; color: var(--link); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar .wrap { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font: 800 1rem var(--h); letter-spacing: -.01em; white-space: nowrap; flex: none; }
.brand .logo-full { height: 28px; width: auto; }
.brand .logo-mark { height: 28px; width: 28px; }
.brand .logo-dark { display: none; align-items: center; gap: 8px; }
.brand small { font-size: .7em; color: var(--orange); }
:root[data-theme="dark"] .brand .logo-full { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: flex; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg, .tab svg, .tile svg { width: 22px; height: 22px; }
.dot-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font: 700 .7rem/18px var(--b); text-align: center; }
.theme-switch { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.theme-switch button { border: 0; background: transparent; padding: 6px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--indigo); color: #fff; }

/* ── Bottom tab bar (phone) ──────────────────────────── */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 40; height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font: 600 .7rem var(--b); }
.tab[aria-current="page"] { color: var(--link); }
.tab .dot-badge { top: 6px; right: calc(50% - 22px); }

.top-actions .btn { min-height: 40px; padding: 0 14px; font-size: .9rem; white-space: nowrap; }

@media (min-width: 900px) {
	body { padding-bottom: 0; }
	.tabbar { display: none; }
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding-block: 28px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: grid; gap: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }
.site-footer .footer-contact { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }

/* ── Toast ───────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; transition: .25s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] .toast { background: #F0F2FF; color: var(--navy); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
