/**
 * Studio Pages default section skin.
 *
 * The section stack rendered by PageRenderer. Every colour, space, radius and
 * font is an --ec-* token, so a page is themed by whichever Studio template
 * and preset the site uses. Sections render CONTAINED inside the framework
 * shell; contrast bands are rounded panels (matching the storefront hero).
 * Single-class specificity so a template's own `.pages` skin can override by
 * source order.
 */

.ts-pages {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 6vw, 5rem);
    margin-block: clamp(1.5rem, 4vw, 3rem);
}

.ts-pages :where(h1, h2, h3, h4, p) { margin: 0; }
.ts-section { position: relative; }

/* -------------------------------------------------------------------- *
 * Buttons
 * -------------------------------------------------------------------- */

.ts-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border: 1px solid transparent;
    border-radius: var(--ec-btn-radius, 8px);
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--ec-dur-1, 0.15s) var(--ec-ease, ease), background var(--ec-dur-1, 0.15s) var(--ec-ease, ease);
}
.ts-page-btn:hover { transform: translateY(-1px); }
.ts-page-btn--primary { background: var(--ec-accent); color: var(--ec-accent-fg); }
.ts-page-btn--ghost { background: transparent; color: var(--ec-fg); border-color: var(--ec-border); }
.ts-page-btn--oncontrast { background: var(--ec-bg); color: var(--ec-fg); }
.ts-tone-dark .ts-page-btn--ghost,
.ts-tone-accent .ts-page-btn--ghost { color: inherit; border-color: color-mix(in oklab, currentColor 35%, transparent); }

/* -------------------------------------------------------------------- *
 * Tone panels
 * -------------------------------------------------------------------- */

.ts-tone-dark,
.ts-tone-accent { border-radius: var(--ec-radius, 14px); padding: clamp(2.25rem, 5vw, 4rem); }
.ts-tone-dark { background: var(--ec-fg); color: var(--ec-bg); }
.ts-tone-accent { background: var(--ec-accent); color: var(--ec-accent-fg); }

/* -------------------------------------------------------------------- *
 * Hero
 * -------------------------------------------------------------------- */

.ts-hero-sec .ts-section__inner { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.ts-hero-sec--split .ts-section__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ts-hero-sec--band .ts-section__inner { grid-template-columns: minmax(0, 1fr); }
.ts-hero-sec__eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ec-accent); }
.ts-hero-sec__title { margin-top: 0.7rem; font-family: var(--ec-font-display); font-weight: var(--ec-disp-weight, 700); letter-spacing: var(--ec-disp-tracking, normal); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; color: var(--ec-fg); }
.ts-hero-sec__subtitle { margin-top: 1.1rem; max-width: 46ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--ec-fg-2); }
.ts-hero-sec__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.9rem; }
.ts-hero-sec__media { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--ec-img-radius, 12px); border: 1px solid var(--ec-border); background:
    linear-gradient(135deg, var(--ec-surface) 0%, var(--ec-surface-2) 100%); }
.ts-hero-sec.ts-tone-dark .ts-hero-sec__title, .ts-hero-sec.ts-tone-accent .ts-hero-sec__title { color: inherit; }
.ts-hero-sec.ts-tone-dark .ts-hero-sec__subtitle, .ts-hero-sec.ts-tone-accent .ts-hero-sec__subtitle { color: color-mix(in oklab, currentColor 78%, transparent); }
.ts-hero-sec.ts-tone-dark .ts-hero-sec__eyebrow, .ts-hero-sec.ts-tone-accent .ts-hero-sec__eyebrow { color: color-mix(in oklab, currentColor 85%, transparent); }
.ts-hero-sec.ts-tone-dark .ts-hero-sec__media, .ts-hero-sec.ts-tone-accent .ts-hero-sec__media { background: color-mix(in oklab, currentColor 12%, transparent); border-color: color-mix(in oklab, currentColor 25%, transparent); }

/* -------------------------------------------------------------------- *
 * Shared band heading
 * -------------------------------------------------------------------- */

.ts-features__heading, .ts-stats__heading, .ts-testimonials__heading, .ts-faq__heading, .ts-products__heading, .ts-catband__heading, .ts-modules__heading {
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight, 700);
    letter-spacing: var(--ec-disp-tracking, normal);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.15;
    color: var(--ec-fg);
}
.ts-features__heading, .ts-stats__heading, .ts-testimonials__heading, .ts-modules__heading { text-align: center; margin-bottom: 1.5rem; }
.ts-stats.ts-tone-dark .ts-stats__heading, .ts-stats.ts-tone-accent .ts-stats__heading { color: inherit; }

/* -------------------------------------------------------------------- *
 * Feature grid
 * -------------------------------------------------------------------- */

.ts-features__sub { margin: -0.8rem auto 1.8rem; max-width: 52ch; text-align: center; color: var(--ec-fg-2); line-height: 1.6; }
.ts-features__grid { display: grid; grid-template-columns: repeat(var(--ts-cols, 3), minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); }
.ts-feature { padding: 1.5rem; background: var(--ec-surface); display: flex; flex-direction: column; gap: 0.5rem; }
.ts-feature__num { font-family: var(--ec-font-display); font-weight: 800; font-size: 0.85rem; color: var(--ec-accent); }
.ts-feature__title { font-family: var(--ec-font-display); font-size: 1.1rem; font-weight: 700; color: var(--ec-fg); }
.ts-feature__text { color: var(--ec-fg-2); line-height: 1.55; font-size: 0.95rem; }

/* -------------------------------------------------------------------- *
 * Stats
 * -------------------------------------------------------------------- */

.ts-stats__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); }
.ts-stat { border-left: 2px solid var(--ec-border); padding-left: 0.9rem; }
.ts-tone-dark .ts-stat, .ts-tone-accent .ts-stat { border-left-color: color-mix(in oklab, currentColor 30%, transparent); }
.ts-stat__value { font-family: var(--ec-font-display); font-weight: var(--ec-disp-weight, 700); font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1; color: var(--ec-accent); }
.ts-tone-dark .ts-stat__value, .ts-tone-accent .ts-stat__value { color: inherit; }
.ts-stat__label { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ec-fg-2); }
.ts-tone-dark .ts-stat__label, .ts-tone-accent .ts-stat__label { color: color-mix(in oklab, currentColor 78%, transparent); }

/* -------------------------------------------------------------------- *
 * Testimonials
 * -------------------------------------------------------------------- */

.ts-testimonials__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
.ts-testimonials__grid--single { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
.ts-testimonial { margin: 0; }
.ts-testimonial__quote { margin: 0 0 1rem; font-family: var(--ec-font-display); font-weight: 600; font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.35; color: var(--ec-fg); }
.ts-testimonial__quote::before { content: '\201C'; color: var(--ec-accent); }
.ts-testimonial__quote::after { content: '\201D'; color: var(--ec-accent); }
.ts-testimonial__by { display: flex; flex-direction: column; gap: 0.15rem; }
.ts-testimonial__author { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ec-fg); }
.ts-testimonial__role { font-size: 0.85rem; color: var(--ec-fg-2); }

/* -------------------------------------------------------------------- *
 * FAQ (native accordion)
 * -------------------------------------------------------------------- */

.ts-faq__heading { margin-bottom: 0.4rem; }
.ts-faq__intro { color: var(--ec-fg-2); line-height: 1.6; max-width: 52ch; margin-bottom: 1.2rem; }
.ts-faq__list { border-top: 2px solid var(--ec-border); }
.ts-faq__item { border-bottom: 1px solid var(--ec-border); }
.ts-faq__q { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0.1rem; cursor: pointer; list-style: none; font-family: var(--ec-font-display); font-weight: 700; font-size: 1.05rem; color: var(--ec-fg); }
.ts-faq__q::-webkit-details-marker { display: none; }
.ts-faq__glyph { flex: none; width: 1rem; height: 1rem; position: relative; }
.ts-faq__glyph::before, .ts-faq__glyph::after { content: ''; position: absolute; background: var(--ec-accent); }
.ts-faq__glyph::before { top: 50%; left: 0; right: 0; height: 2px; transform: translateY(-50%); }
.ts-faq__glyph::after { left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); transition: opacity var(--ec-dur-1, 0.15s) var(--ec-ease, ease); }
.ts-faq__item[open] .ts-faq__glyph::after { opacity: 0; }
.ts-faq__a { padding: 0 0.1rem 1rem; font-size: 0.95rem; line-height: 1.6; color: var(--ec-fg-2); max-width: 62ch; }

/* -------------------------------------------------------------------- *
 * CTA
 * -------------------------------------------------------------------- */

.ts-cta-sec .ts-section__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.9rem; max-width: 62ch; margin-inline: auto; }
.ts-cta-sec__eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ec-accent); }
.ts-cta-sec.ts-tone-dark .ts-cta-sec__eyebrow, .ts-cta-sec.ts-tone-accent .ts-cta-sec__eyebrow { color: color-mix(in oklab, currentColor 85%, transparent); }
.ts-cta-sec__title { font-family: var(--ec-font-display); font-weight: var(--ec-disp-weight, 700); letter-spacing: var(--ec-disp-tracking, normal); font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1; color: var(--ec-fg); }
.ts-cta-sec.ts-tone-dark .ts-cta-sec__title, .ts-cta-sec.ts-tone-accent .ts-cta-sec__title { color: inherit; }
.ts-cta-sec__body { font-size: 1.1rem; line-height: 1.6; color: var(--ec-fg-2); }
.ts-cta-sec.ts-tone-dark .ts-cta-sec__body, .ts-cta-sec.ts-tone-accent .ts-cta-sec__body { color: color-mix(in oklab, currentColor 80%, transparent); }
.ts-cta-sec__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 0.8rem; }

/* -------------------------------------------------------------------- *
 * Rich text
 * -------------------------------------------------------------------- */

.ts-richtext-sec__body { font-family: var(--ec-font-body); font-size: 1.1rem; line-height: 1.75; color: var(--ec-fg-2); }
.ts-richtext-sec__body p { margin: 0 0 1em; }
.ts-richtext-sec--narrow .ts-richtext-sec__body { max-width: 58ch; }
.ts-richtext-sec--normal .ts-richtext-sec__body { max-width: 75ch; }
.ts-richtext-sec--wide .ts-richtext-sec__body { max-width: 90ch; }

/* -------------------------------------------------------------------- *
 * Trust bar
 * -------------------------------------------------------------------- */

.ts-trust--bordered { border-block: 1px solid var(--ec-border); }
.ts-trust__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 3rem); }
.ts-trust__item { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ec-fg-2); font-weight: 600; font-size: 0.9rem; }
.ts-trust__icon { color: var(--ec-accent); }

/* -------------------------------------------------------------------- *
 * Product grid (EasyCommerce)
 * -------------------------------------------------------------------- */

.ts-products__head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.4rem; }
.ts-products__all { margin-left: auto; font-size: 0.85rem; font-weight: 600; color: var(--ec-accent); text-decoration: none; }
.ts-products__grid { display: grid; grid-template-columns: repeat(var(--ts-cols, 4), minmax(0, 1fr)); gap: 1.1rem; }
.ts-pg-card { display: block; color: inherit; text-decoration: none; }
.ts-pg-card__media { aspect-ratio: 4 / 5; border: 1px solid var(--ec-border); background: var(--ec-surface); overflow: hidden; }
.ts-pg-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ts-pg-card__row { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; align-items: flex-start; }
.ts-pg-card__name { font-family: var(--ec-font-display); font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.ts-pg-card__price { font-size: 0.85rem; color: var(--ec-fg-2); margin-top: 0.15rem; }
.ts-pg-card__add { flex: none; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border: 1px solid var(--ec-border); font-family: var(--ec-font-display); font-weight: 800; }

/* -------------------------------------------------------------------- *
 * Category band
 * -------------------------------------------------------------------- */

.ts-catband__heading { margin-bottom: 1.2rem; }
.ts-catband__grid { display: grid; grid-template-columns: repeat(var(--ts-cols, 4), minmax(0, 1fr)); gap: 0; }
/* Per-tile rings collapse into shared hairlines and leave empty tracks in a
   partial last row blank, rather than exposing the container border colour. */
.ts-catband__tile { background: var(--ec-bg); padding: 1.1rem 1rem; display: flex; flex-direction: column; gap: 1.4rem; box-shadow: 0 0 0 1px var(--ec-border); }
.ts-catband__num { font-family: ui-monospace, Menlo, monospace; font-size: 0.7rem; color: color-mix(in oklab, var(--ec-fg-2) 80%, transparent); }
.ts-catband__title { font-family: var(--ec-font-display); font-weight: 700; font-size: 1.05rem; }
.ts-catband__count { font-size: 0.8rem; color: var(--ec-fg-2); margin-top: 0.15rem; }
.ts-catband__arrow { color: var(--ec-accent); font-weight: 800; }

/* -------------------------------------------------------------------- *
 * Featured product
 * -------------------------------------------------------------------- */

.ts-featured .ts-section__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.ts-featured--flip .ts-featured__media { order: 2; }
.ts-featured__media { aspect-ratio: 4 / 3; border-radius: var(--ec-img-radius, 12px); border: 1px solid var(--ec-border); background: linear-gradient(135deg, var(--ec-surface) 0%, var(--ec-surface-2) 100%); }
.ts-featured.ts-tone-dark .ts-featured__media { background: color-mix(in oklab, currentColor 12%, transparent); border-color: color-mix(in oklab, currentColor 25%, transparent); }
.ts-featured__eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ec-accent); }
.ts-featured.ts-tone-dark .ts-featured__eyebrow { color: color-mix(in oklab, currentColor 85%, transparent); }
.ts-featured__name { margin-top: 0.6rem; font-family: var(--ec-font-display); font-weight: var(--ec-disp-weight, 700); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; color: var(--ec-fg); }
.ts-featured.ts-tone-dark .ts-featured__name { color: inherit; }
.ts-featured__blurb { margin-top: 0.9rem; max-width: 40ch; color: var(--ec-fg-2); line-height: 1.6; }
.ts-featured.ts-tone-dark .ts-featured__blurb { color: color-mix(in oklab, currentColor 78%, transparent); }
.ts-featured__price { margin-top: 1rem; font-family: var(--ec-font-display); font-weight: 700; font-size: 1.35rem; }
.ts-featured__actions { margin-top: 1.2rem; }

/* -------------------------------------------------------------------- *
 * Module position
 * -------------------------------------------------------------------- */

.ts-modules__body { display: flex; flex-direction: column; gap: 1.5rem; }

/* -------------------------------------------------------------------- *
 * Mobile
 * -------------------------------------------------------------------- */

@media (max-width: 860px) {
    .ts-hero-sec--split .ts-section__inner,
    .ts-featured .ts-section__inner { grid-template-columns: minmax(0, 1fr); }
    .ts-hero-sec--split .ts-hero-sec__media,
    .ts-featured--flip .ts-featured__media { order: -1; }
    .ts-features__grid { grid-template-columns: minmax(0, 1fr); }
    .ts-products__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ts-catband__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .ts-page-btn { transition: none; }
    .ts-faq__glyph::after { transition: none; }
}
