/* ============================================================================
   townsquare - the base every QmeLocal front-end page shares: the design's
   tokens, element rules, buttons, the header, section heads, the light zone,
   the footer, the Copilot launcher and panel, and the toast.

   Loaded first by layouts/layout.php; each page then adds its own sheet
   (landing.css, townsquare.css). The master's inner pages use inner.css.
   Every class is `tq-` prefixed and every element rule is scoped to the
   page's own blocks, because platform-wide stylesheets injected into every
   page (a global `.row`, `h5`, `.btn`...) would otherwise reach the design.

   Colours are the design's tokens, on body.tq. The three brand colours can be
   overridden from the Home Page settings (layouts/layout.php prints them).
   The platform's floor is 14px: the design's 10.5-13.5px labels are 14px.
   ============================================================================ */

/* .tq-tokens: the same tokens around a Townsquare block drawn on a page whose
   body is not .tq (the top banner on the master's inner pages). ts-banner.
   body.tq-chrome: a page with its own layout wearing the Townsquare's header
   and footer (partials/ts_shell.php) - the tokens only, none of the page
   styles below, so that page's own body keeps its fonts and colours. ts-shell. */
body.tq,
.tq-tokens,
body.tq-chrome {
    /* brand */
    --tq-white: #FEFEFE;
    --tq-blue: #1326F3;
    --tq-yellow: #FAE621;
    --tq-navy: #080F54;
    /* dark system derived from navy */
    --tq-ink: #02041F;
    --tq-ink-2: #050A36;
    --tq-panel: #0A1149;
    --tq-panel-2: #101A63;
    --tq-text: #FEFEFE;
    --tq-soft: #C9CEF0;
    --tq-muted: #8F97CC;
    --tq-line: rgba(201, 206, 240, .12);
    --tq-line-hi: rgba(250, 230, 33, .55);
    --tq-cyan: #3BE3F2;
    --tq-blue-glow: 0 20px 60px rgba(19, 38, 243, .45);
    --tq-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --tq-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --tq-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
body.tq,
.tq-tokens {
    color-scheme: dark;
    margin: 0;
    padding: 0;
    background: var(--tq-ink);
    color: var(--tq-text);
    font: 16px/1.6 var(--tq-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
html:has(body.tq) { background: #02041F; scroll-behavior: smooth; scroll-padding-top: 96px; }
body.tq [hidden] { display: none !important; }
body.tq-chrome :is(.tq-thead, .tq-main, .tq-footer, .tq-cp-panel) [hidden],
body.tq-chrome :is(.tq-cp-launch, .tq-cp-panel)[hidden] { display: none !important; }
/* A page's own stylesheet may pad every <footer> (the features page's pads
   it 90px): the Townsquare's footer keeps its own spacing. */
body.tq-chrome footer.tq-footer { padding: 0; margin: 0; }

/* Element rules, only inside the page's own blocks. */
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-launch, .tq-cp-panel, .tq-toast),
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-launch, .tq-cp-panel, .tq-toast) *,
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-launch, .tq-cp-panel, .tq-toast) *::before,
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-launch, .tq-cp-panel, .tq-toast) *::after { box-sizing: border-box; }
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-panel) a { color: inherit; text-decoration: none; }
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-panel) :is(img, video) { max-width: 100%; display: block; }
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-launch, .tq-cp-panel) :is(button, input, select, textarea) { font-family: inherit; }
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-panel) :is(h1, h2, h3, h4) { text-wrap: balance; margin: 0; }
:where(.tq-header, .tq-thead, .tq-main, .tq-footer, .tq-scrim, .tq-share-pop, .tq-cp-launch, .tq-cp-panel) :focus-visible { outline: 2px solid var(--tq-yellow); outline-offset: 3px; border-radius: 8px; }

.tq-wrap { width: min(1240px, 100% - 40px); margin-inline: auto; position: relative; }
.tq-eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 14px var(--tq-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--tq-yellow); }
.tq-eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* buttons */
.tq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 700 15px var(--tq-body); padding: 14px 24px; border-radius: 14px; border: 0; cursor: pointer; white-space: nowrap; transition: transform .2s, box-shadow .25s, background .2s, border-color .2s; }
.tq-btn:active { transform: scale(.97); }
.tq-btn-y { background: var(--tq-yellow); color: var(--tq-navy); box-shadow: 0 12px 34px rgba(250, 230, 33, .22); }
.tq-btn-y:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(250, 230, 33, .35); }
.tq-btn-g { background: rgba(254, 254, 254, .06); color: var(--tq-white); border: 1px solid var(--tq-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tq-btn-g:hover { border-color: rgba(254, 254, 254, .35); background: rgba(254, 254, 254, .1); }
.tq-btn svg { flex: 0 0 auto; }
.tq-arrow { transition: transform .2s; }
.tq-btn:hover .tq-arrow, .tq-tlink:hover .tq-arrow { transform: translateX(4px); }
.tq-tlink { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tq-yellow); }

/* ---------- header ---------- */
.tq-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 60; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.tq-header.tq-scrolled { background: rgba(2, 4, 31, .82); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); border-bottom-color: var(--tq-line); }
.tq-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.tq-logo { flex: 0 0 auto; display: block; }
.tq-logo img { height: 40px; width: auto; }
.tq-acts { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tq-acts .tq-btn { padding: 11px 18px; border-radius: 12px; font-size: 14.5px; }
@media (max-width: 640px) {
    .tq-logo img { height: 32px; }
    .tq-bar { gap: 12px; height: 68px; }
    .tq-hero { margin-top: -69px; padding-top: 69px; }
    .tq-acts .tq-btn { padding: 10px 14px; }
}

/* ---------- sections ---------- */
.tq-section { padding-block: clamp(80px, 10vw, 128px) 0; }
.tq-sh { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 40px; align-items: end; margin-bottom: 44px; }
.tq-sh h2 { font: 800 clamp(34px, 4.4vw, 60px)/1.02 var(--tq-display); letter-spacing: -.025em; margin-top: 16px; max-width: 18ch; }
.tq-sh h2 em { font-style: normal; color: var(--tq-yellow); }
.tq-sh p { margin: 16px 0 0; color: var(--tq-soft); max-width: 58ch; font-size: 17px; }
@media (max-width: 760px) { .tq-sh { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.tq-footer { border-top: 1px solid var(--tq-line); background: linear-gradient(180deg, var(--tq-ink-2), var(--tq-ink) 60%); }
.tq-foot { display: grid; grid-template-columns: 1.3fr 1fr .8fr 1.2fr .7fr; gap: 36px; padding-block: 64px 48px; font-size: 15px; color: var(--tq-soft); }
.tq-foot h5 { font: 500 14px var(--tq-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--tq-muted); margin: 0 0 16px; }
.tq-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tq-foot ul a:hover, .tq-foot ul button:hover { color: var(--tq-yellow); }
.tq-foot ul button { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.tq-fbrand img { height: 40px; width: auto; margin-bottom: 18px; }
.tq-fbrand p { margin: 0; max-width: 34ch; }
.tq-touch { grid-column: 1/-1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 40px; align-items: center; padding: 28px; border-radius: 22px; border: 1px solid var(--tq-line); background: rgba(254, 254, 254, .03); }
.tq-touch h4 { font: 700 clamp(20px, 2.2vw, 26px)/1.25 var(--tq-display); color: var(--tq-white); margin: 0; }
.tq-touch .tq-book { display: flex; justify-content: flex-end; }
@media (max-width: 520px) { .tq-touch .tq-book .tq-btn { white-space: normal; text-align: center; width: 100%; } }
@media (max-width: 900px) { .tq-touch { grid-template-columns: 1fr; } }
.tq-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 22px 30px; border-top: 1px solid var(--tq-line); font-size: 14px; color: var(--tq-muted); }
.tq-legal nav { display: flex; gap: 20px; }
.tq-legal a:hover { color: var(--tq-white); }
.tq-legal .tq-ai { flex-basis: 100%; font-size: 14px; }
@media (max-width: 1080px) { .tq-foot { grid-template-columns: repeat(4, 1fr); } .tq-fbrand { grid-column: 1/-1; } }
@media (max-width: 560px) { .tq-foot { grid-template-columns: 1fr 1fr; } }

/* ---------- LIGHT ZONE (after the banner) ---------- */
.tq-light {
    --tq-text: #080F54; --tq-soft: #3A4178; --tq-muted: #6D74A6; --tq-line: rgba(8, 15, 84, .1); --tq-line-hi: rgba(19, 38, 243, .45);
    --tq-lift: 0 30px 60px -18px rgba(19, 38, 243, .38), 0 12px 24px -12px rgba(8, 15, 84, .18);
    --tq-rest: 0 1px 2px rgba(8, 15, 84, .06), 0 10px 30px -12px rgba(8, 15, 84, .14);
    --tq-grad-edge: linear-gradient(135deg, #1326F3, #6A5CFF 45%, #FAE621);
    position: relative; isolation: isolate; margin-top: -34px; border-radius: 34px 34px 0 0; color: var(--tq-text);
    background: radial-gradient(90% 60% at 100% 0%, #E6EAFF 0%, transparent 60%), radial-gradient(70% 50% at 0% 55%, #FFF9D6 0%, transparent 60%), linear-gradient(180deg, #F7F8FF, #EEF1FF 60%, #F7F8FF);
    padding-bottom: clamp(80px, 10vw, 128px); box-shadow: 0 -20px 60px rgba(2, 4, 31, .35);
}
.tq-wm { position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; overflow: hidden; pointer-events: none; z-index: -1; border-radius: inherit; }
.tq-wm img { position: absolute; height: auto; max-width: none; }
.tq-wm .tq-wa { right: -6%; top: 4%; width: min(760px, 70vw); opacity: .16; animation: tqWmA 40s ease-in-out infinite alternate; }
.tq-wm .tq-wb { left: -10%; bottom: -6%; width: min(560px, 60vw); opacity: .09; animation: tqWmB 52s ease-in-out infinite alternate; }
.tq-wm canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes tqWmA { from { transform: translate(0, 0) rotate(0) scale(1); } to { transform: translate(-5%, 6%) rotate(-7deg) scale(1.08); } }
@keyframes tqWmB { from { transform: scaleX(-1) translate(0, 0) rotate(0); } to { transform: scaleX(-1) translate(-6%, -8%) rotate(8deg); } }
.tq-light .tq-eyebrow { color: var(--tq-blue); }
.tq-light .tq-sh h2 em { color: var(--tq-blue); background: linear-gradient(transparent 68%, rgba(250, 230, 33, .8) 68%); padding: 0 .05em; }
.tq-light .tq-sh p { color: var(--tq-soft); }
.tq-light .tq-btn-g { background: #fff; color: var(--tq-navy); border: 1px solid var(--tq-line); box-shadow: var(--tq-rest); }
.tq-light .tq-btn-g:hover { border-color: transparent; box-shadow: var(--tq-lift); transform: translateY(-2px); }
.tq-light .tq-btn-y { box-shadow: 0 14px 30px -10px rgba(214, 180, 0, .7); }
.tq-light .tq-btn-y:hover { box-shadow: 0 22px 44px -12px rgba(214, 180, 0, .85), 0 0 0 4px rgba(250, 230, 33, .25); }
.tq-light .tq-tlink { color: var(--tq-blue); }
/* ---------- copilot ---------- */
.tq-cp-launch { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 80; display: flex; align-items: center; gap: 12px; padding: 7px 18px 7px 7px; border-radius: 999px; border: 1px solid rgba(250, 230, 33, .35); background: rgba(8, 15, 84, .88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--tq-white); cursor: pointer; text-align: left; font-family: var(--tq-body); font-size: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5), 0 0 40px rgba(19, 38, 243, .35); transition: transform .25s; }
.tq-cp-launch:hover { transform: translateY(-2px); }
.tq-cp-launch.tq-compact { padding: 7px; }
.tq-cp-launch.tq-compact > span:last-child { display: none; }
.tq-cp-launch b { display: block; font-size: 15px; line-height: 1.2; }
.tq-cp-launch small { display: block; font-size: 14px; color: var(--tq-soft); }
.tq-cp-av { position: relative; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: var(--tq-blue) var(--tq-mark, url("../media/qmelocal-mark.png")) center/100% no-repeat; box-shadow: 0 0 0 2px rgba(250, 230, 33, .5); }
.tq-cp-av::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #3DDC84; border: 2px solid var(--tq-navy); }
.tq-cp-av.tq-sm { width: 36px; height: 36px; }
.tq-cp-panel { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 81; width: min(410px, 100vw - 32px); height: min(620px, 100dvh - 110px); display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: linear-gradient(170deg, var(--tq-panel), var(--tq-ink) 65%); border: 1px solid rgba(250, 230, 33, .25); box-shadow: 0 40px 90px rgba(0, 0, 0, .65); animation: tqPaneIn .28s ease; font: 16px/1.6 var(--tq-body); color: var(--tq-text); }
.tq-cp-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--tq-line); background: rgba(19, 38, 243, .25); }
.tq-cp-head b { display: block; font-size: 15px; line-height: 1.2; }
.tq-cp-head small { color: var(--tq-soft); font-size: 14px; }
.tq-cp-x { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--tq-line); background: none; color: var(--tq-white); display: grid; place-items: center; cursor: pointer; }
.tq-cp-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.tq-cp-msg { max-width: 90%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tq-cp-msg.tq-bot { align-self: flex-start; background: rgba(254, 254, 254, .06); border: 1px solid var(--tq-line); border-bottom-left-radius: 5px; }
.tq-cp-msg.tq-me { align-self: flex-end; background: var(--tq-blue); border-bottom-right-radius: 5px; }
.tq-cp-sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.tq-cp-sugg button { border: 1px solid var(--tq-line); background: rgba(254, 254, 254, .04); color: var(--tq-soft); font: 600 14px var(--tq-body); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.tq-cp-sugg button:hover { border-color: var(--tq-line-hi); color: var(--tq-white); }
.tq-cp-form { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--tq-line); margin: 0; }
.tq-cp-form input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--tq-line); background: rgba(2, 4, 31, .6); color: var(--tq-white); font: 14.5px var(--tq-body); }
.tq-cp-form input:focus { outline: none; border-color: var(--tq-yellow); }
.tq-cp-form .tq-btn { padding: 0 18px; }
.tq-cp-note { margin: 0; padding: 0 16px 10px; font-size: 14px; color: var(--tq-muted); }
@media (max-width: 600px) {
    .tq-cp-launch small { display: none; }
    .tq-cp-panel { left: 8px; right: 8px; width: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}

.tq-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--tq-yellow); color: var(--tq-navy); font: 700 14px/1.6 var(--tq-body); padding: 12px 20px; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, .5); transition: .25s; z-index: 100; max-width: calc(100vw - 32px); }
.tq-toast.tq-show { opacity: 1; transform: translate(-50%, 0); }

.tq-rise { animation: tqRise 1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes tqRise { from { transform: translateY(28px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    body.tq *, body.tq *::before, body.tq *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* The platform's own Copilot bubble, when the hook drew one: its pill steps
   aside and the launcher above opens its panel (theme.js). */
body.tq.tq-has-bubble .qme-vw-launcher,
body.tq.tq-has-bubble .qme-sw-launcher,
body.tq-chrome.tq-has-bubble .qme-vw-launcher,
body.tq-chrome.tq-has-bubble .qme-sw-launcher { opacity: 0 !important; pointer-events: none !important; }

/* The admin's Edit control (Theme_engine::edit_button(), admins only): a small
   pill, bottom-left, over the page but below the Copilot's layer, clear of
   the launcher (bottom-right). */
:is(body.tq, body.tq-chrome) .ig-edit-btn { position: fixed; left: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 79; }
:is(body.tq, body.tq-chrome) .ig-edit-btn .ig-edit-btn__main { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--tq-navy); color: var(--tq-white); font: 700 14px/1.2 var(--tq-body); text-decoration: none; border: 1px solid rgba(250, 230, 33, .45); box-shadow: 0 14px 30px -10px rgba(8, 15, 84, .6); transition: transform .2s, box-shadow .2s, background .2s; }
:is(body.tq, body.tq-chrome) .ig-edit-btn .ig-edit-btn__main:hover { transform: translateY(-2px); background: var(--tq-blue); color: var(--tq-white); box-shadow: 0 18px 34px -10px rgba(19, 38, 243, .7); }
:is(body.tq, body.tq-chrome) .ig-edit-btn .ig-edit-btn__main i { color: var(--tq-yellow); font-size: 14px; }
/* Several settings screens behind one page: the button opens a short list (Theme_engine::edit_button). */
:is(body.tq, body.tq-chrome) .ig-edit-btn--menu details { position: relative; }
:is(body.tq, body.tq-chrome) .ig-edit-btn--menu summary { list-style: none; cursor: pointer; }
:is(body.tq, body.tq-chrome) .ig-edit-btn--menu summary::-webkit-details-marker { display: none; }
:is(body.tq, body.tq-chrome) .ig-edit-btn__list { position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 210px; display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: var(--tq-white); border: 1px solid rgba(8, 15, 84, .1); box-shadow: 0 20px 40px -12px rgba(8, 15, 84, .45); }
:is(body.tq, body.tq-chrome) .ig-edit-btn__list a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--tq-navy); font: 600 14px/1.2 var(--tq-body); text-decoration: none; }
:is(body.tq, body.tq-chrome) .ig-edit-btn__list a:hover, :is(body.tq, body.tq-chrome) .ig-edit-btn__list a:focus-visible { background: rgba(19, 38, 243, .08); color: var(--tq-blue); }
@media (max-width: 600px) { :is(body.tq, body.tq-chrome) .ig-edit-btn { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } :is(body.tq, body.tq-chrome) .ig-edit-btn .ig-edit-btn__main { padding: 10px 12px; } }
