/* ============================================================================
   townsquare — QmeLocal's 2026 front page.

   THE DESIGN IS THE MOCKUP ("QmeLocal 2026 home page"), which takes its
   structure from dealmaker.tech: a full-bleed film banner with the headline
   set top-left and the wordmark ghosted across its floor, an audience bar
   riding the banner's bottom edge, a black band cut by a pale diagonal
   carrying the platform pitch, then the features, the five verbs, and one
   call to action.

   Values are measured off the mockup rather than guessed: mint #7fe6ce,
   pale diagonal #cfe8ec, navy #16305c, the deep pill #12213f.

   Bands never carry outer margins. Each sets its own ground and its own
   padding, so two bands meet flush and every gap on the page is one decision.
   ============================================================================ */

:root {
    --ts-black: #05080a;
    --ts-navy: #16305c;          /* section headings */
    --ts-deep: #12213f;          /* the dark pill */
    --ts-ink: #0a2338;
    --ts-ink-soft: #4a6b7a;
    --ts-mint: #7fe6ce;          /* every primary button */
    --ts-mint-pale: #c8e4e8;     /* unused: the diagonal now takes --ts-mint */
    --ts-blue: #1b4eff;          /* "Your Local Townsquare..." */
    --ts-brand-blue: #1b2aff;    /* the logo square */
    /* The Brand colors tab sets --ts-mint, --ts-on-mint, --ts-secondary,
       --ts-on-secondary and --ts-navy (layout.php); the rest derive from them. */
    --ts-secondary: #c8e4e8;     /* the diagonal */
    --ts-on-secondary: #0a2338;  /* text on the diagonal */
    --ts-on-mint: #06261f;       /* text on a primary button */
    --ts-brand-sub: #2f6bff;     /* the brand's second line */
    --ts-mint-hover: color-mix(in srgb, var(--ts-mint) 78%, #fff);
    --ts-mint-ring: color-mix(in srgb, var(--ts-mint) 62%, #000);
    --ts-yellow: #ffe93b;
    --ts-paper: #ffffff;

    --ts-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --ts-max: 1320px;
    --ts-gutter: 28px;
    --ts-band: 88px;
}

/* --------------------------------------------------------------- base ---- */

.ts, .ts * { box-sizing: border-box; }

.ts {
    margin: 0;
    font-family: var(--ts-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ts-ink);
    background: var(--ts-paper);
    -webkit-font-smoothing: antialiased;
}

.ts h1, .ts h2, .ts h3, .ts h4 { margin: 0 0 .45em; line-height: 1.22; letter-spacing: -.02em; font-weight: 700; }
.ts p { margin: 0 0 1em; }
.ts a { color: inherit; text-decoration: none; }
.ts img { max-width: 100%; display: block; }
.ts ul { max-width: 1000px; margin: auto; padding: 0; list-style: none; }
/* The footer's lists are not the audience bar: the rule above centred the
   Terms and Privacy row inside the footer's flex row, pushing it off the left edge. */
.ts-footer ul { margin: 0; }

.ts-container { width: 100%; max-width: var(--ts-max); margin: 0 auto; padding: 0 var(--ts-gutter); }
.ts-band { padding: var(--ts-band) 0; }

/* ------------------------------------------------------------- buttons ---- */

.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.ts-btn:hover { transform: translateY(-2px); }

/* Scoped with .ts so a modifier outranks the base `.ts a { color: inherit }`
   rule — without it a button painted its label in its own background. */
.ts .ts-btn--mint { background: var(--ts-mint); color: var(--ts-on-mint); }
.ts .ts-btn--mint:hover { background: var(--ts-mint-hover); }
.ts .ts-btn--deep { background: var(--ts-deep); color: #fff; }
.ts .ts-btn--deep:hover { background: #1b3157; }
.ts .ts-btn--ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.ts .ts-btn--ghost:hover { background: rgba(255,255,255,.1); }
.ts-btn--sm { padding: 11px 24px; font-size: 14px; }

/* -------------------------------------------------------------- header ---- */

/* The header floats on the banner; it only takes a ground of its own once the
   banner has scrolled past, so the film is never framed by a bar. */
.ts-header { position: absolute; top: 0; left: 0; right: 0; z-index: 60; }
.ts-header__inner { display: flex; align-items: center; gap: 20px; height: 92px; }

/* The lockup is built rather than dropped in: the supplied wordmark is dark
   grey on transparent and disappears on film. The square is the artwork, the
   two words are type, and they stay legible on any ground. */
.ts-brand { display: inline-flex; align-items: center; gap: 12px; }
.ts-brand img { width: 44px; height: 44px; border-radius: 6px; }
/* A Full logo keeps its own proportions: the width is the saved one (inline),
   the height follows, and a phone never lets it run past the burger. */
.ts-brand .ts-brand__logo { height: auto; max-width: min(100%, 58vw); border-radius: 0; object-fit: contain; }
.ts-brand span { display: block; line-height: 1.15; }
.ts-brand b { display: block; font-size: 17px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.ts-brand em { display: block; font-style: normal; font-size: 17px; font-weight: 700; color: var(--ts-brand-sub); letter-spacing: -.01em; }
.ts-brand em i { font-style: normal; color: var(--ts-mint); }

.ts-header__actions { display: flex; align-items: center; gap: var(--ts-header-gap, 18px); margin-left: auto; }
.ts .ts-header__signin { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ts-signin-color, #fff); }
.ts .ts-header__signin:hover { color: var(--ts-signin-hover, var(--ts-mint)); }

/* Each header button takes its colors from the Header tab; an empty field
   keeps the look below. Scoped under the actions row so it outranks the
   generic outline and primary button rules further down. */
.ts .ts-header__actions .ts-header__explore {
    background: var(--ts-explore-bg, transparent);
    color: var(--ts-explore-color, #fff);
    /* No separate outline once the button has a fill: the border takes the
       background color unless a border color is chosen. */
    border-color: var(--ts-explore-border, var(--ts-explore-bg, rgba(255, 255, 255, .55)));
}
.ts .ts-header__actions .ts-header__explore:hover {
    background: var(--ts-explore-hover-bg, var(--ts-explore-bg-soft, rgba(255, 255, 255, .12)));
    color: var(--ts-explore-hover-color, var(--ts-explore-color, #fff));
    border-color: var(--ts-explore-border, var(--ts-explore-hover-bg, var(--ts-explore-bg-soft, #fff)));
}
.ts .ts-header__actions .ts-header__start {
    background: var(--ts-start-bg, var(--ts-mint));
    color: var(--ts-start-color, var(--ts-on-mint));
}
.ts .ts-header__actions .ts-header__start:hover {
    background: var(--ts-start-hover-bg, color-mix(in srgb, var(--ts-start-bg, var(--ts-mint)) 78%, #fff));
    color: var(--ts-start-hover-color, var(--ts-start-color, var(--ts-on-mint)));
}
/* The burger: hidden on desktop, a 44px tap target on a phone; the three bars
   fold into an X while the panel is open. Needs the markup in the header and
   the small script in theme.js. */
.ts-burger {
    display: none;
    margin-left: auto;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
}
.ts-burger span { display: block; width: 20px; height: 2px; margin: 0 auto; border-radius: 2px; background: #fff; transition: transform .25s ease, opacity .2s ease; }
.is-open .ts-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.is-open .ts-burger span:nth-child(2) { opacity: 0; }
.is-open .ts-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.ts-mobilenav { display: none; }

/* -------------------------------------------------------------- banner ---- */

.ts-hero {
    position: relative;
    min-height: clamp(348px, 41.2vw, 791px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;          /* the wordmark's blend mixes with the banner only */
    background: #05080a;
    color: #fff;
    padding-top: clamp(110px, 9vw, 172px);
}

/* Three states the band has to read in: the film playing, the film blocked or
   still loading, and a visitor who has asked the system for less motion. The
   drawn poster underneath carries the last two, so the banner is never blank
   and never a black rectangle. */
.ts-hero__media { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #05080a center/cover no-repeat; }

/* A YouTube film as scenery. The iframe is sized to COVER rather than fit:
   16:9 stretched to whichever of the two dimensions is short, centred, so a
   tall phone screen shows the middle of the frame instead of two black bars.
   It takes no clicks - the player is decoration, and every control the page
   offers is its own. */
/* The film box is a size container, so the frame is measured against the
   box itself and not the viewport: .ts-hero is clamp(348px, 41.2vw, 791px)
   tall, not viewport-tall, and vh/vw were letterboxing the iframe inside it. */
.ts-hero__film { position: absolute; inset: 0; container-type: size; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.ts-hero.has-video .ts-hero__film { opacity: 1; }
.ts-hero__film iframe {
    position: absolute;
    top: 50%; left: 50%;
    /* The * 1.2 is deliberate overscan. No embed parameter removes YouTube's
       title bar, avatar or centre play button; oversizing 20% past cover
       pushes that chrome outside the box and overflow:hidden crops it. */
    width: calc(100cqw * 1.2);  height: calc(56.25cqw * 1.2);          /* 16:9 by width  */
    min-width: calc(177.78cqh * 1.2); min-height: calc(100cqh * 1.2);  /* 16:9 by height */
    transform: translate(-50%, -50%);
    border: 0;
}
/* Film is somebody else's exposure, so something predictable sits between it
   and the words. */
.ts-hero__scrim {
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(4,8,16,.55) 0%, rgba(4,8,16,.22) 50%, rgba(4,8,16,.10) 100%),
        linear-gradient(180deg, rgba(4,8,16,.6) 0%, rgba(4,8,16,.15) 18%, rgba(4,8,16,0) 42%, rgba(4,8,16,.35) 62%, rgba(4,8,16,.55) 100%);
}

/* The headline sits a little down from the header, not pressed against it. */
.ts-hero__inner { position: relative; z-index: 2; padding-top: 40px; }
.ts-hero h1 {
    font-size: clamp(28px, 2.75vw, 52px);
    /* Set as dealmaker.tech sets Inter: bold, a soft white, tracked tight. */
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.03em;
    color: rgba(255, 255, 255, .88);
    max-width: 22ch;
    margin: 0;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

/* The wordmark across the floor of the banner, at a size no headline would
   dare. Two words set flush, never overlapping. It is scenery, so it
   is hidden from a screen reader. */
.ts .ts-hero__wordmark {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin: auto 0 0;
    padding: 0 var(--ts-gutter);
    font-size: clamp(38px, 10.2vw, 196px);
    line-height: .82;
    font-weight: 500;
    letter-spacing: -.035em;
    white-space: nowrap;
    user-select: none;
    /* White letters blended soft-light into the film, as dealmaker.tech sets
       its giant logo: the film shows through, so the letters brighten and
       darken with every shot - that is the "flash", no animation of its own. */
    color: rgba(255, 255, 255, .72);
    mix-blend-mode: soft-light;
}
.ts-hero__wordmark span { display: inline-block; }
.ts-hero__wordmark span + span { margin-left: 0; }

/* The audience bar rides the banner's bottom edge. */
/* A clear gap of its own between the film and the bar. */
.ts-audience { position: relative; z-index: 3; background: #05080a; padding: clamp(24px, 2.4vw, 44px) 0 clamp(8px, .8vw, 14px); }
/* Sampled off the mockup: fill #151d33, a 1px #69aca5 ring, labels in
   regular weight with a little tracking, the chosen one in mint and nothing
   else - no pill, no border, no fill behind it. 82px tall at 1920. */
.ts-audience__bar {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    height: clamp(52px, 4.3vw, 82px);
    padding: 0 clamp(10px, 1.6vw, 30px);
    border: 1px solid var(--ts-tabs-outline, var(--ts-mint-ring));
    border-radius: 999px;
    background: var(--ts-tabs-bg, #151d33);
}
.ts-audience__bar { list-style: none; margin: 0; }
.ts-audience__bar .nav-item { display: flex; }
.ts-audience__bar .nav-link {
    flex: 0 1 auto;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    /* Inter as dealmaker.tech sets its nav: medium weight, no tracking. */
    font-size: clamp(14px, 1.1vw, 21px);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ts-tabs-text, rgba(255, 255, 255, .82));
    padding: 0 12px;
    line-height: 1;
    white-space: nowrap;
    transition: color .18s ease;
}
.ts-audience__bar .nav-link:hover, .ts-audience__bar .nav-link:focus { color: var(--ts-tabs-active, var(--ts-mint)); }
.ts-audience__bar .nav-link.active { color: var(--ts-tabs-active, var(--ts-mint)); background: none; }

/* ------------------------------------------------------------ platform ---- */

/* One black band, cut by a pale diagonal, holding the platform pitch above
   and the ecosystem line below — the mockup's centre of gravity. */
.ts-split {
    position: relative;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(900px 540px at 78% 76%, rgba(38, 86, 112, .38), transparent 70%),
        radial-gradient(700px 460px at 18% 8%, rgba(24, 54, 78, .32), transparent 68%),
        linear-gradient(158deg, #0a1216 0%, #040c11 46%, #081015 100%);
}
/* The diagonal takes the secondary color from the Brand colors tab. */
.ts-split__wedge { position: absolute; inset: 0; background: var(--ts-secondary); clip-path: polygon(0 0, 48% 100%, 0 100%); }
.ts-split__net {
    position: absolute;
    inset: 0;
    background: url("../img/network.png") right center / cover no-repeat;
    opacity: .5;
}
.ts-split__inner { position: relative; z-index: 2; }
.ts-split__body { position: relative; }
.ts-split__body > .ts-container { position: relative; z-index: 2; }

.ts-platform { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(20px, 2.4vw, 46px); align-items: center; padding: clamp(28px, 3vw, 58px) 0 clamp(44px, 4vw, 76px); }
.ts-platform__shot { display: flex; justify-content: flex-end; }
.ts-phone-stack { position: relative; width: fit-content; }
.ts-platform__shot img { width: min(330px, 100%); filter: drop-shadow(0 30px 60px rgba(0,0,0,.55)); }
.ts-platform h2 { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.2; color: #fff; max-width: 16ch; }
.ts-platform p { color: rgba(255, 255, 255, .82); max-width: 48ch; font-size: 15px; margin-bottom: 28px; }

/* The button sits on its own dark plate in the mockup, which keeps it off the
   photographic background behind it. */
.ts-platform__plate { display: inline-flex; }

.ts-ecosystem { padding-bottom: clamp(24px, 2.4vw, 46px); }
/* This text sits on the diagonal, which is the secondary color, so it takes the text-on-secondary color. */
.ts-ecosystem h3 { font-size: clamp(17px, 1.75vw, 33px); line-height: 1.3; color: var(--ts-on-secondary); margin-bottom: 10px; }
.ts-ecosystem p { font-size: clamp(14px, 1.05vw, 20px); color: var(--ts-on-secondary); max-width: 40ch; margin: 0; }
.ts-ecosystem__local { text-align: right; }
/* In the mockup this text starts near the screen edge (about 4.2% in), on the
   widest part of the pale wedge, not at the 1320 container edge. Only this
   column moves - by left, not margin, so the Townsquare link keeps its
   place; the container is unchanged. min(0px, ...) keeps it in place
   on screens where the container edge is already that close. */
@media (min-width: 1081px) {
    .ts-ecosystem > .col-md-7 { position: relative; left: min(0px, calc(4.2vw - (100vw - var(--ts-max)) / 2 - var(--ts-gutter))); }
}
/* Mint, the accent the audience bar's chosen tab uses: the old blue #1b4eff sank into the dark band. */
.ts-ecosystem__local a { font-size: clamp(16px, 1.6vw, 31px); font-weight: 700; color: var(--ts-eco-link, var(--ts-on-mint)); letter-spacing: .01em; }
.ts-ecosystem__local a:hover { color: var(--ts-eco-link-hover, #fff); }

/* ------------------------------------------------------------ features ---- */

/* The heading and the card text take their color and size from the Features &
   tools tab. Each is a var with THIS FILE'S OWN VALUE as the fallback, so an
   unset field renders byte for byte what it rendered before the fields existed
   - the size still answers to the screen, the heading still follows the theme's
   Heading color. layouts/layout.php sets these only when a value is valid. */
.ts-features h2 { font-size: var(--ts-features-title-size, clamp(30px, 3.6vw, 68px)); color: var(--ts-features-title-color, var(--ts-navy)); margin-bottom: 36px; }
.ts-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.1vw, 21px); }
.ts-feature {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 451 / 640;   /* the mockup's card */
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    color: #fff;
    background: #0b0f14 center/cover no-repeat;
    transition: transform .25s ease, box-shadow .25s ease;
}
.ts-feature:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(11, 15, 20, .28); }
.ts-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,10,16,.1) 0%, rgba(6,10,16,.35) 45%, rgba(6,10,16,.88) 100%); }
.ts-feature > * { position: relative; z-index: 1; }
.ts-feature__mark {
    position: absolute; top: 18px; right: 18px; z-index: 2;
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.9);
    display: flex; align-items: center; justify-content: center;
}
.ts-feature__mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.ts-feature h3 { font-size: var(--ts-card-title-size, clamp(22px, 2.2vw, 42px)); font-weight: 700; letter-spacing: .01em; text-transform: uppercase; margin: 0 0 10px; color: var(--ts-card-title-color, #fff); }
.ts-feature p { font-size: var(--ts-card-text-size, clamp(12.5px, 1vw, 18px)); line-height: 1.45; color: var(--ts-card-text-color, rgba(255,255,255,.9)); margin: 0; }

/* --------------------------------------------------------------- verbs ---- */

.ts-verbs { text-align: center; padding: 56px 0 20px; }
.ts-verbs p { font-size: clamp(20px, 2.55vw, 48px); font-weight: 400; color: var(--ts-verbs-color, var(--ts-ink)); margin: 0; letter-spacing: -.01em; }
.ts-verbs span { white-space: nowrap; }
.ts-verbs i { font-style: normal; color: var(--ts-verbs-dot, var(--ts-mint)); padding: 0 10px; }

.ts-join { display: flex; justify-content: center; padding: 22px 0 84px; }
.ts-join .ts-btn { font-size: clamp(16px, 1.3vw, 25px); padding: clamp(16px, 1.5vw, 28px) clamp(28px, 2.5vw, 48px); }
/* The Join button's colors come from the Call to action tab; scoped under
   .ts-join so it outranks the dark button style it otherwise uses. */
.ts .ts-join .ts-btn { background: var(--ts-join-bg, var(--ts-deep)); color: var(--ts-join-color, #fff); }
.ts .ts-join .ts-btn:hover {
    background: var(--ts-join-hover-bg, var(--ts-join-bg-soft, #1b3157));
    color: var(--ts-join-hover-color, var(--ts-join-color, #fff));
}

/* -------------------------------------------------------------- footer ---- */

/* The Footer tab's colors override these; each fallback is what the footer has
   always drawn, so an unset field changes nothing. */
.ts-footer { background: var(--ts-footer-bg, var(--ts-black)); color: var(--ts-footer-color, rgba(255,255,255,.72)); padding: 64px 0 26px; }
.ts-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr) 1.2fr; gap: 34px; }
.ts-footer h5 { color: var(--ts-footer-heading, #fff); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
.ts-footer li { margin-bottom: 10px; font-size: 14px; }
.ts-footer a:hover { color: var(--ts-footer-link-hover, #fff); }
.ts-footer__brand p { font-size: 14px; max-width: 32ch; margin-top: 18px; }
.ts-social { display: flex; gap: 10px; margin-top: 18px; }
.ts-social a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: #fff; }
.ts-social a:hover { background: var(--ts-mint); color: var(--ts-on-mint); }
.ts-subscribe input { width: 100%; padding: 12px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-family: inherit; font-size: 14px; margin-bottom: 10px; }
.ts-subscribe input::placeholder { color: rgba(255,255,255,.5); }
.ts-subscribe button { width: 100%; }
.ts-footer__bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--ts-footer-divider, rgba(255,255,255,.12)); font-size: 13px; }
.ts-footer__bottom ul { display: flex; gap: 22px; flex-wrap: wrap; }

/* --------------------------------------------------------- video modal ---- */

.ts-modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.9); }
.ts-modal.is-open { display: flex; }
.ts-modal__frame { position: relative; width: min(1040px, 100%); aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.ts-modal__frame iframe, .ts-modal__frame video { width: 100%; height: 100%; border: 0; display: block; }
.ts-modal__close { position: absolute; top: -46px; right: 0; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* -------------------------------------------------------------- reveal ---- */

.ts-reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.ts-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ts-reveal { opacity: 1; transform: none; transition: none; } }

/* ---------------------------------------------------------- responsive ---- */

@media (max-width: 1080px) {
    .ts-platform { grid-template-columns: 1fr; gap: 36px; }
    .ts-platform__copy { order: 0; }
    .ts-platform__shot { justify-content: center; }
    .ts-phone-stack { display: flex; flex-direction: column; align-items: center; width: 100%; transform: none; }
    /* At bottom:-48px the dots escaped the flow and landed on the headline. */
    .ts-phone-stack .ts-dotbar { position: static; transform: none; margin: 18px auto 0; }
    .ts-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ts-footer__grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 860px) {
    .ts-ecosystem__local { text-align: left; margin-top: 18px; }
    /* Here the link sits on the flat secondary-color band below, so it takes
       the text-on-secondary color, like the heading beside it. */
    .ts-ecosystem__local a { color: var(--ts-eco-link, var(--ts-on-secondary)); text-decoration: underline; text-underline-offset: 4px; }
    .ts-ecosystem__local a:hover { color: var(--ts-eco-link-hover, var(--ts-eco-link, var(--ts-on-secondary))); text-decoration-thickness: 2px; }
    /* A flat band instead of the triangle: at this width the wedge reached
       ~172px across where the heading runs ~351px, and read as cut off. 78.5%
       is measured - the copy ends by 76.7% and the heading starts by 80.5% on
       every tab. Re-check it if a panel's copy grows. */
    .ts-split__wedge { clip-path: polygon(0 78.5%, 100% 78.5%, 100% 100%, 0 100%); }
}

@media (max-width: 760px) {
    :root { --ts-band: 56px; --ts-gutter: 18px; }
    .ts-header__inner { height: 74px; }
    .ts-brand img { width: 38px; height: 38px; }
    .ts-brand b, .ts-brand em { font-size: 15px; }
    /* The header is fixed here, so the banner carries its height itself. */
    .ts-hero { min-height: auto; padding-top: 96px; }
    .ts-hero__scrim { background: linear-gradient(180deg, rgba(4,8,16,.7), rgba(4,8,16,.86)); }
    .ts-hero h1 { max-width: none; }
    .ts-hero__wordmark { font-size: 9vw; }
    .ts-audience__bar { justify-content: flex-start; }
    .ts-audience__bar button { padding: 10px 20px; font-size: 14px; }
    .ts-feature-grid { grid-template-columns: 1fr; }
    .ts-footer__grid { grid-template-columns: 1fr 1fr; }
    .ts-footer__brand, .ts-footer__subscribe { grid-column: 1 / -1; }
    .ts-modal__close { top: auto; bottom: -46px; right: 50%; transform: translateX(50%); }
}

/* --------------------------------------------------------------- phone ---- */

/* The device is drawn, not photographed: only the screen is a picture, so the
   frame never dates and the screenshot inside can be replaced on its own. */
.ts-phone {
    position: relative;
    width: clamp(168px, 19.4vw, 315px);
    padding: 0;
}
.ts-phone img { border-radius: 27px; width: 100%; display: block; }

/* Over film the header has no ground of its own, so its words carry a shadow
   rather than trusting whatever frame happens to be playing behind them. */
.ts-header .ts-brand b,
.ts-header .ts-brand em,
.ts-header .ts-header__signin { text-shadow: 0 1px 14px rgba(0, 0, 0, .75); }

@media (max-width: 760px) {
    /* The audience bar wraps rather than scrolling out of sight: a name half
       off the edge of a phone reads as a bug, not as an invitation to swipe. */
    .ts-audience__bar { flex-wrap: wrap; justify-content: center; overflow: visible; }
    .ts-audience__bar button { padding: 9px 16px; font-size: 14px; }
    .ts-verbs p { font-size: 19px; }

    /* At 387px the header measured 416px and the actions ran past the right
       edge, so the page scrolled sideways. The header is fixed (static would
       drop its z-index and let the banner paint over the open menu), and the
       existing actions row IS the dropdown, so no link is written twice. */
    .ts-header { position: fixed; top: 0; left: 0; right: 0; z-index: 120; background: rgba(5, 8, 10, .92); backdrop-filter: blur(10px); }
    .ts-header__inner { position: relative; }
    .ts-header .ts-brand b, .ts-header .ts-brand em { white-space: nowrap; }
    .ts-burger { display: flex; }
    .ts-header__actions {
        display: none;
        position: absolute;
        top: calc(100% + 8px); left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin: 0;
        padding: 14px;
        border-radius: 18px;
        background: rgba(8, 12, 18, .97);
        box-shadow: 0 20px 44px rgba(0, 0, 0, .55);
    }
    .ts-header__inner.is-open .ts-header__actions { display: flex; }
    .ts-mobilenav { display: flex; flex-direction: column; }
    .ts-mobilenav a { display: block; padding: 11px 4px; font-size: 15px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .ts-mobilenav a:last-child { border-bottom: 0; }
    .ts-header .ts-header__signin { display: block; text-align: center; padding: 12px; font-size: 15px; }
    .ts-header__actions .ts-btn { width: 100%; justify-content: center; padding: 13px 18px; font-size: 15px; }
    .ts-hero h1 { font-size: clamp(21px, 5.9vw, 26px); line-height: 1.24; }
    .ts-audience { padding: 18px 0 22px; }
}

/* ---------------------------------------------------- audience panels ---- */

/* The bar on the banner is a real tablist: it changes the band below it.
   One panel is visible at a time and they are the same height, so switching
   never moves the page under the reader's hands. */
.ts-panel h2 { font-size: clamp(24px, 2.5vw, 48px); line-height: 1.18; color: #fff; max-width: 16ch; margin-bottom: 18px; }
.ts-panel p { color: rgba(255, 255, 255, .82); max-width: 46ch; font-size: clamp(14px, 1.05vw, 20px); margin-bottom: 26px; }
/* More air between the copy and its button (a global p rule can shrink the margin above). */
.ts-panel .ts-platform__plate { margin-top: 14px; }
/* The banner swipes: show a grab hand, and a closed hand while dragging. Buttons and links keep the pointer. */
.ts-platform { cursor: grab; }
.ts-platform.is-dragging, .ts-platform.is-dragging * { cursor: grabbing; user-select: none; }
.ts-platform a, .ts-platform button { cursor: pointer; }

/* The dot control under the phone drives the same four panels. It is a
   convenience, not the primary control, so it is hidden from screen readers
   and out of the tab order — the bar above already says all of this. */
.ts-dotbar { position: absolute; right: 0; bottom: -48px; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--ts-dots-bg, rgba(22, 26, 30, .95)); box-shadow: 0 10px 24px rgba(0,0,0,.4); }
.ts-dotbar button { width: 11px; height: 11px; padding: 0; border: 0; border-radius: 999px; background: var(--ts-dots-color, #fff); cursor: pointer; transition: width .22s ease, background-color .22s ease; }
.ts-dotbar button.is-on { width: 42px; background: var(--ts-dots-active, var(--ts-mint)); }

/* The Explore button in the header: an outline, so the mint one stays the
   only thing on the page asking to be pressed first. */
.ts .ts-btn--outline { border-color: rgba(255, 255, 255, .55); color: #fff; background: transparent; }
.ts .ts-btn--outline:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.ts-phone img { transition: opacity .25s ease; }

/* ---- front-end editing control (admins only; drawn once by the layout) ----
   The engine emits .ig-edit-btn on every v2 page and each theme styles it;
   this is the same block the other themes carry, in this theme's navy and
   mint. Not scoped under .ts: the layout draws it after the page content. */
.ig-edit-btn { position: fixed; bottom: 24px; right: 24px; z-index: 9999;
               display: flex; align-items: stretch; font-family: var(--ts-font); font-size: 14px; }
.ig-edit-btn .ig-edit-btn__main { display: inline-flex; align-items: center; gap: 8px;
               padding: 10px 20px; background: var(--ts-deep); color: #fff;
               text-decoration: none; border-radius: 999px 0 0 999px;
               box-shadow: 0 6px 18px rgba(0,0,0,.35); font-weight: 600; font-size: 14px; }
.ig-edit-btn .ig-edit-btn__main:only-child { border-radius: 999px; }
.ig-edit-btn .ig-edit-btn__main:hover { background: #1b3157; color: var(--ts-mint); }
.ig-edit-btn .ig-edit-btn__toggle { border: 0; background: var(--ts-deep); color: #fff;
               border-left: 1px solid rgba(255,255,255,.25); border-radius: 0 999px 999px 0;
               padding: 0 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.35); font-size: 14px; }
.ig-edit-btn .ig-edit-btn__toggle:hover { background: #1b3157; }
.ig-edit-btn .ig-edit-btn__more { position: absolute; right: 0; bottom: 100%; margin: 0 0 8px;
               padding: 6px 0; list-style: none; background: var(--ts-deep); border-radius: 10px;
               box-shadow: 0 6px 18px rgba(0,0,0,.35); min-width: 210px; display: none; }
.ig-edit-btn.is-open .ig-edit-btn__more { display: block; }
.ig-edit-btn .ig-edit-btn__more a { display: block; padding: 8px 16px; color: #fff;
               text-decoration: none; font-size: 14px; white-space: nowrap; }
.ig-edit-btn .ig-edit-btn__more a:hover { background: #1b3157; color: var(--ts-mint); }

/* ==========================================================================
   MOBILE PASS. Authored and checked in the browser at phone widths, so these
   values stay as they are. Desktop layout is untouched - every rule below is
   inside a max-width query except the two swipe-surface rules, which only
   describe how a drag behaves.
   ========================================================================== */

/* Slider: allow vertical page scroll while swiping sideways; stop image ghost-drag */
body .ts-platform { touch-action: pan-y; }
body .ts-platform img { -webkit-user-drag: none; user-select: none; }

/* ---- Tablet & mobile (<=1080px) ---------------------------------------- */
@media (max-width: 1080px) {
  /* Space between slider dots and the heading below */
  body .ts-platform .ts-phone-stack .ts-dotbar { margin-bottom: 28px; }

  /* Mobile menu: solid background + one-line button */
  body .ts-header__actions { background: rgb(8, 12, 18); }
  body .ts-header__actions .ts-header__explore {
    white-space: nowrap;
    text-align: center;
    justify-content: center;
    line-height: 1.2;
    font-size: clamp(12px, 4vw, 15px);
    padding: 14px 16px;
  }
}

/* ---- Mobile (<=860px) --------------------------------------------------- */
@media (max-width: 860px) {
  /* Light band no longer drawn at a fixed 78.5% - it follows the block */
  body .ts-split__wedge { display: none; }
  body .ts-ecosystem {
    background: var(--ts-secondary);
    box-shadow: 0 0 0 100vmax var(--ts-secondary); /* full-width colour */
    clip-path: inset(0 -100vmax);                   /* left/right only */
    padding-top: 28px;
    margin-top: 0;
  }
  /* "Your Local Townsquare..." link readable on the light band */
  body .ts-ecosystem__local a { color: var(--ts-on-secondary); }
}

/* ---- Mobile (<=767px) --------------------------------------------------- */
@media (max-width: 767px) {
  /* Audience tab box: grows to fit, spaced rows */
  body .ts-audience__bar {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
    column-gap: 4px;
    padding: 14px 12px;
    border-radius: 26px;
  }
  body .ts-audience__bar .nav-link { line-height: 1.3; padding: 2px 10px; }

  /* "Connect - Discover - Engage / Access - Grow" on two tidy lines */
  body .ts-verbs p {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 0;
    line-height: 1.3;
  }
  body .ts-verbs p i { padding: 0 12px; }
  body .ts-verbs p i:nth-of-type(3) {
    flex-basis: 100%;
    height: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  /* Tighter vertical spacing */
  body .ts-features { padding-bottom: 28px; }
  body .ts-verbs    { padding-top: 0; padding-bottom: 0; }
  body .ts-join     { padding-top: 16px; padding-bottom: 32px; }
  body .ts-footer   { padding-top: 28px; }

  /* The bottom row stacks: space-between on one line pushed the copyright
     hard against the right edge with the legal links crowding it. The links
     stay a wrapping row of their own - only the two blocks separate. */
  body .ts-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ---- Small phones (<=480px): slightly smaller text ---------------------- */
@media (max-width: 480px) {
  body .ts-split h2 { font-size: 21px; }
  body .ts-split h3 { font-size: 16px; }
  body .ts-band h2  { font-size: 24px; }
  body .ts-band h3  { font-size: 19px; }
  body .ts-verbs p  { font-size: 16px; }
  body .ts-verbs p i { padding: 0 9px; }
  body .ts-btn      { font-size: 14px; }
  body .ts-join .ts-btn {
    font-size: 14px;
    padding: 14px 22px;
    gap: 8px;
    white-space: nowrap;
    max-width: 100%;
  }
}

/* ===== Mobile fixes ===== */

/* 1. Feature cards: show the tall grid on tablet/mobile (reveal never triggered) */
@media (max-width: 1080px) {
  .ts-feature-grid.ts-reveal {
    opacity: 1;
    transform: none;
  }
}

/* Audience arrows hidden on desktop */
.ts-audience__arrow { display: none; }

@media (max-width: 760px) {

  /* 2. Platform section: hide phone image, dots below text */
  .ts-platform { gap: 20px; }
  .ts-platform__shot { order: 2; }
  .ts-platform .ts-phone { display: none; }
  .ts-platform .ts-phone-stack .ts-dotbar { margin: 28px auto 0; }

  /* 3. Audience tabs: one line, full width, arrows at the edges */
  .ts-audience__nav {
    display: flex;
    align-items: center;
    background: rgb(30, 30, 32);
    margin-left: calc(-1 * var(--ts-gutter, 18px));
    margin-right: calc(-1 * var(--ts-gutter, 18px));
    border-radius: 0;
  }
  .ts-audience__nav .ts-audience__bar {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-left: 0;
    padding-right: 0;
    border-radius: 0;
  }
  .ts-audience__nav .ts-audience__bar::-webkit-scrollbar { display: none; }
  .ts-audience__nav .nav-item { flex: 0 0 auto; scroll-snap-align: center; }
  .ts-audience__nav .nav-link { white-space: nowrap; }

  .ts-audience__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    height: 28px;
    margin: 0 6px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: rgb(251, 222, 35);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: opacity .2s;
  }
  .ts-audience__arrow[disabled] { opacity: .25; cursor: default; }

  /* 4. Ecosystem heading: remove forced line break */
  .ts-ecosystem h3 br { display: none; }
}

@media (max-width: 760px) {
  .ts-audience__bar {
    border: 0;
  }
}
