/**
 * Meridian components: typography, buttons, cards, modules, forms and the
 * Joomla core pages. Warm editorial look: rounded surfaces, hairline
 * borders, Bricolage Grotesque display, Figtree body, uppercase
 * letter-spaced micro-labels and pill buttons. All values come from the
 * token layer.
 */

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    font-style: var(--ec-disp-style);
    letter-spacing: var(--ec-disp-tracking);
    text-transform: var(--ec-disp-transform);
    line-height: 1.1;
    margin-block: 0 0.6em;
    color: var(--ec-fg);
}

/* Emphasis inside display type picks up the warm accent */
h1 em, h2 em, h3 em, h4 em, h5 em, h6 em {
    font-style: italic;
    color: var(--ec-accent);
}

p {
    margin-block: 0 1em;
    color: inherit;
}

a {
    color: var(--ec-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--ec-dur-1) var(--ec-ease);
}

a:hover {
    color: var(--ec-fg);
}

/* Buttons: rounded pills, weight 600. .ts-btn stays accent-colored: the
   shared cart drawer and checkout CTAs render this class and must keep the
   conversion color. Accent hover dims via brightness, never a color flip. */
.ts-btn,
button.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 14px 28px;
    border: 1px solid var(--ec-accent);
    border-radius: var(--ec-btn-radius);
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
    font-family: var(--ec-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: filter var(--ec-dur-1) var(--ec-ease), transform var(--ec-dur-1) var(--ec-ease),
                background var(--ec-dur-1) var(--ec-ease), border-color var(--ec-dur-1) var(--ec-ease),
                color var(--ec-dur-1) var(--ec-ease);
}

.ts-btn:hover {
    filter: brightness(0.92);
    color: var(--ec-accent-fg);
}

.ts-btn:active {
    transform: scale(0.98);
}

/* Hairline pill */
.ts-btn--outline {
    background: transparent;
    border-color: var(--ec-border);
    color: var(--ec-fg);
}

.ts-btn--outline:hover {
    filter: none;
    border-color: var(--ec-fg);
    color: var(--ec-fg);
}

/* Soft pill: tertiary action on the surface wash */
.ts-btn--soft {
    background: var(--ec-surface-2);
    border-color: var(--ec-surface-2);
    color: var(--ec-fg);
}

.ts-btn--soft:hover {
    filter: none;
    background: var(--ec-border);
    border-color: var(--ec-border);
    color: var(--ec-fg);
}

/* Solid ink pill (e.g. the 404 "back home" CTA): flips to accent on hover */
.ts-btn--ink {
    background: var(--ec-fg);
    border-color: var(--ec-fg);
    color: var(--ec-bg);
}

.ts-btn--ink:hover {
    filter: none;
    background: var(--ec-accent);
    border-color: var(--ec-accent);
    color: var(--ec-accent-fg);
}

/* Cards: rounded surface, hairline, soft warm lift on hover */
.ts-card {
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    transition: transform var(--ec-dur-2) var(--ec-ease), box-shadow var(--ec-dur-2) var(--ec-ease);
}

.ts-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ec-shadow);
}

.ts-card__title {
    margin: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ec-border);
    font-size: 1.25rem;
}

.ts-card__body {
    padding: 1.25rem;
}

/* Badges: uppercase micro-label pills. Defined here rather than store.css
   because the article override emits publication badges on non-store pages. */
.ts-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ec-accent-soft);
    color: var(--ec-accent);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ts-badge--stock {
    background: var(--ec-surface-2);
    color: var(--ec-fg-2);
}

/* Modules */
.ts-module__title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

/* Stacked modules in a column (e.g. the sidebar) need vertical breathing
   room so their cards don't butt up against each other. */
.ts-col .ts-module + .ts-module {
    margin-top: var(--ec-grid-gap);
}

/* Forms baseline: rounded fields on the cream canvas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    background: var(--ec-surface);
    color: var(--ec-fg);
    font-family: var(--ec-font-body);
    font-size: 0.9375rem;
    transition: border-color var(--ec-dur-1) var(--ec-ease);
}

input::placeholder,
textarea::placeholder {
    color: var(--ec-fg-2);
    opacity: 0.7;
}

:focus-visible {
    outline: 2px solid var(--ec-accent);
    outline-offset: 2px;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="search"]:focus-visible,
input[type="number"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--ec-accent);
}

/* Field labels as uppercase micro-labels (.ts-check is a body-copy label) */
.ts-main label:not(.ts-check),
.ts-main .control-label {
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

/* Content area: Joomla core component output */
.ts-main .page-header h1,
.ts-main .page-header h2 {
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    margin-bottom: 0.5rem;
}

.ts-main h1 a,
.ts-main h2 a,
.ts-main h3 a {
    color: var(--ec-fg);
    text-decoration: none;
}

.ts-main h1 a:hover,
.ts-main h2 a:hover,
.ts-main h3 a:hover {
    color: var(--ec-accent);
}

/* Article meta as an uppercase micro row */
.ts-main .article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin: 0 0 1.25rem;
    padding: 0;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ts-main .article-info dd {
    margin: 0;
}

.ts-main .article-info-term {
    display: none;
}

/* Content imagery gets the token radius. The EasyCommerce SPA styles its own
   imagery, so exclude its mount: a product card clips the image with the card's
   own radius, and rounding the image itself curved its bottom corners in the
   middle of the card. */
.ts-main img:not(#ec-store-root img) {
    border-radius: var(--ec-img-radius);
}

.ts-main blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    border-left: 2px solid var(--ec-accent);
    color: var(--ec-fg);
    font-family: var(--ec-font-display);
    font-weight: 500;
    font-size: 1.35rem;
    line-height: 1.4;
}

.ts-main hr {
    border: 0;
    border-top: 1px solid var(--ec-border);
    margin-block: 2rem;
}

.ts-main table {
    width: 100%;
    border-collapse: collapse;
    margin-block: 1.25rem;
}

.ts-main th,
.ts-main td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--ec-border);
    text-align: left;
}

.ts-main th {
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Blog/list layouts */
.ts-main .items-leading > div,
.ts-main .blog-item,
.ts-main .items-row {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--ec-border);
}

/* Joomla/Bootstrap buttons become hairline pills */
.ts-main .readmore a,
.ts-main .btn:not(.ts-btn) {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-btn-radius);
    background: none;
    color: var(--ec-fg);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--ec-dur-1) var(--ec-ease), color var(--ec-dur-1) var(--ec-ease);
}

.ts-main .readmore a:hover,
.ts-main .btn:not(.ts-btn):hover {
    border-color: var(--ec-fg);
    color: var(--ec-fg);
}

.ts-main .btn-primary:not(.ts-btn) {
    background: var(--ec-accent);
    border-color: var(--ec-accent);
    color: var(--ec-accent-fg);
}

.ts-main .btn-primary:not(.ts-btn):hover {
    border-color: var(--ec-accent);
    color: var(--ec-accent-fg);
    filter: brightness(0.92);
}

/* Pagination (Joomla/Bootstrap output): rounded pill links */
.ts-main .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.ts-main .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--ec-border);
    border-radius: 999px;
    background: none;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--ec-dur-1) var(--ec-ease), color var(--ec-dur-1) var(--ec-ease),
                background var(--ec-dur-1) var(--ec-ease);
}

.ts-main .page-link:hover {
    border-color: var(--ec-fg);
    color: var(--ec-fg);
}

.ts-main .page-item.active .page-link {
    background: var(--ec-accent);
    border-color: var(--ec-accent);
    color: var(--ec-accent-fg);
}

.ts-main .page-item.disabled .page-link {
    opacity: 0.4;
}

/* Pagination arrows: the first/prev/next/last controls use icomoon glyphs
   (.icon-angle-*) that render empty without the icon font. Repaint them as
   SVG-masked chevrons in currentColor so they always show. */
.ts-main .page-link [class*="icon-angle"] {
    display: inline-block;
    width: 16px;
    height: 16px;
    font-size: 0;
    line-height: 0;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.ts-main .page-link [class*="icon-angle"]::before {
    content: none;
}

.ts-main .page-link .icon-angle-left {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}

.ts-main .page-link .icon-angle-right {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

.ts-main .page-link .icon-angle-double-left {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='11 17 6 12 11 7'/%3E%3Cpolyline points='18 17 13 12 18 7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='11 17 6 12 11 7'/%3E%3Cpolyline points='18 17 13 12 18 7'/%3E%3C/svg%3E");
}

.ts-main .page-link .icon-angle-double-right {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='13 17 18 12 13 7'/%3E%3Cpolyline points='6 17 11 12 6 7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='13 17 18 12 13 7'/%3E%3Cpolyline points='6 17 11 12 6 7'/%3E%3C/svg%3E");
}

/* Breadcrumbs module: uppercase micro crumbs with "/" separators */
.ts-module--mod_breadcrumbs ol,
.ts-module--mod_breadcrumbs .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

.ts-module--mod_breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.ts-module--mod_breadcrumbs li + li::before {
    content: "/";
    color: var(--ec-fg-2);
    font-weight: 400;
}

/* Core emits its own divider glyphs in some layouts; ours replaces them */
.ts-module--mod_breadcrumbs .divider {
    display: none;
}

.ts-module--mod_breadcrumbs a {
    color: var(--ec-fg-2);
    text-decoration: none;
    transition: color var(--ec-dur-1) var(--ec-ease);
}

.ts-module--mod_breadcrumbs a:hover {
    color: var(--ec-accent);
}

.ts-module--mod_breadcrumbs .active,
.ts-module--mod_breadcrumbs li[aria-current] {
    color: var(--ec-fg);
}

/* Error pages (404 / 403 / 500): centered, big accent code, rounded card */
.ts-error-page {
    background-color: var(--ec-bg);
}

.ts-error {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ec-sect-y) var(--ec-gut);
    overflow: hidden;
    text-align: center;
}

.ts-error::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(38rem 38rem at 15% 15%, var(--ec-accent-soft), transparent 60%),
        radial-gradient(32rem 32rem at 85% 85%, var(--ec-accent-soft), transparent 60%);
    pointer-events: none;
}

.ts-error__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 36rem;
    padding: clamp(2rem, 5vw, 3.5rem);
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-shadow);
}

.ts-error__code {
    margin: 0;
    font-family: var(--ec-font-display);
    font-weight: 700;
    font-size: clamp(5rem, 18vw, 10rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: var(--ec-accent);
}

.ts-error__title {
    margin: 0.5rem 0 0.6rem;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.1;
}

.ts-error__desc {
    max-width: 30rem;
    margin: 0 auto 1.75rem;
    color: var(--ec-fg-2);
    font-size: 1rem;
    line-height: 1.7;
}

.ts-error__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.ts-error__detail {
    margin: 1.5rem auto 0;
    max-width: 30rem;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 0.8125rem;
    word-break: break-word;
}

.ts-error__module {
    margin-top: 1.5rem;
}

/* Offline (maintenance) page: the same rounded surface card */
.ts-offline {
    position: relative;
    max-width: 34rem;
    margin: var(--ec-sect-y) auto;
    padding: clamp(2rem, 5vw, 3rem);
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-shadow);
    text-align: center;
}

.ts-offline__message {
    color: var(--ec-fg-2);
}

.ts-offline__form fieldset {
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    padding: 1.5rem;
    text-align: left;
}

.ts-offline__form legend {
    padding-inline: 0.5rem;
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

.ts-offline__form label {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}


/* ------------------------------------------------------------------ *
 * Core-page overrides (auth, recovery, profile, article, journal, categories)
 * ------------------------------------------------------------------ */

/* ================================================================== *
 * Auth surface: login / logout / registration (token-driven)
 * Refines the core Joomla user widgets: resets the stray fieldset
 * box, styles control-groups, fixes the password toggle + strength
 * meter, adds an "or" divider and tames oversized extra-button icons.
 * ================================================================== */

/* Card shell: rounded surface with the warm shadow */
.ts-auth {
    max-width: 30rem;
    margin: var(--ec-sect-y) auto;
    padding: clamp(1.75rem, 1.25rem + 3vw, 2.75rem);
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-shadow);
}

.ts-auth--wide {
    max-width: 40rem;
}

.ts-auth--narrow {
    max-width: 26rem;
    text-align: center;
}

.ts-auth--narrow .ts-auth__desc {
    margin-inline: auto;
}

/* Header: display-font title + muted subtitle rhythm */
.ts-auth__title {
    margin: 0 0 0.4rem;
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    letter-spacing: var(--ec-disp-tracking);
    text-transform: var(--ec-disp-transform);
    font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.4rem);
    line-height: 1.05;
}

.ts-auth__desc {
    margin: 0 0 1.6rem;
    color: var(--ec-fg-2);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.ts-auth__image {
    max-width: 100%;
    margin-bottom: 1.25rem;
    border-radius: var(--ec-img-radius);
}

/* Problem 1: kill the browser's default <fieldset> border box */
.ts-auth fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

/* Registration section headings */
.ts-auth__legend {
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ec-border);
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    letter-spacing: var(--ec-disp-tracking);
    font-size: 1.3rem;
}

/* Problem 2: control-group rhythm, micro-labels + fields */
.ts-auth__form .control-group {
    margin-bottom: 1.15rem;
}

.ts-auth__form .control-label,
.ts-auth__form .control-label label {
    display: block;
    margin-bottom: 0.45rem;
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

.ts-auth__form .controls {
    display: block;
}

.ts-auth .star,
.ts-auth .red {
    color: var(--ec-accent);
}

/* "Required field" spacer row: quiet it down to a muted note */
.ts-auth .field-spacer .control-label,
.ts-auth .field-spacer .control-label label {
    margin: 0;
    font-family: var(--ec-font-body);
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ec-fg-2);
}

.ts-auth .form-control {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    background: var(--ec-surface);
    color: var(--ec-fg);
    font-family: var(--ec-font-body);
    font-size: 0.9375rem;
    line-height: 1.4;
    transition: border-color var(--ec-dur-1) var(--ec-ease);
}

.ts-auth .form-control::placeholder {
    color: var(--ec-fg-2);
    opacity: 0.7;
}

/* Focus = accent hairline, not a ring (beats the global hard outline) */
.ts-auth .form-control:focus,
.ts-auth .form-control:focus-visible {
    outline: none;
    border-color: var(--ec-accent);
    box-shadow: none;
}

/* Problem 3: password field: flex the input-group, fix the toggle */
.ts-auth .input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.ts-auth .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Toggle = ghost square attached to the input's right edge.
   Scoped through .ts-main .ts-auth to out-rank .ts-main .btn:not(.ts-btn). */
.ts-main .ts-auth .input-password-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--ec-border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: var(--ec-surface);
    color: var(--ec-fg-2);
    cursor: pointer;
    transition: color var(--ec-dur-1) var(--ec-ease), border-color var(--ec-dur-1) var(--ec-ease);
}

.ts-main .ts-auth .input-password-toggle:hover {
    color: var(--ec-fg);
}

.ts-auth .input-group:focus-within .form-control,
.ts-auth .input-group:focus-within .input-password-toggle {
    border-color: var(--ec-accent);
}

/* Repaint the icomoon glyph (font not bundled) as an SVG mask in currentColor */
.ts-auth .input-password-toggle .icon-eye,
.ts-auth .input-password-toggle .icon-eye-slash {
    display: inline-block;
    width: 18px;
    height: 18px;
    font-size: 0;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.ts-auth .input-password-toggle .icon-eye::before,
.ts-auth .input-password-toggle .icon-eye-slash::before {
    content: none;
}

.ts-auth .input-password-toggle .icon-eye {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.ts-auth .input-password-toggle .icon-eye-slash {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94'/%3E%3Cpath d='M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94'/%3E%3Cpath d='M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

/* Keep the SR-only toggle label hidden even if core utility CSS is absent */
.ts-auth .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Problem 4: password strength meter -> slim token-driven track */
.ts-auth meter {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 5px;
    margin-top: 0.6rem;
    border: 0;
    border-radius: 999px;
    background: var(--ec-surface-2);
    overflow: hidden;
}

.ts-auth meter::-webkit-meter-bar {
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: var(--ec-surface-2);
}

.ts-auth meter::-webkit-meter-optimum-value,
.ts-auth meter::-webkit-meter-suboptimum-value,
.ts-auth meter::-webkit-meter-even-less-good-value {
    border-radius: 999px;
    background: var(--ec-accent);
    transition: width var(--ec-dur-2) var(--ec-ease);
}

.ts-auth meter::-moz-meter-bar {
    border-radius: 999px;
    background: var(--ec-accent);
}

/* Helper / min-requirements / strength-state text: muted + small */
.ts-auth .text-muted,
.ts-auth .small,
.ts-auth small,
.ts-auth [id$="-rules"],
.ts-auth .password-group .text-center {
    color: var(--ec-fg-2);
    font-size: 0.8rem;
    line-height: 1.45;
}

.ts-auth [id$="-rules"] {
    margin-bottom: 0.55rem;
}

.ts-auth [id$="-rules"] strong {
    color: var(--ec-fg);
    font-weight: 600;
}

.ts-auth .password-group .text-center {
    margin-top: 0.4rem;
    text-align: center;
}

/* Problem 8: remember-me checkbox */
.ts-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--ec-fg);
}

.ts-check input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    margin: 0;
    accent-color: var(--ec-accent);
    cursor: pointer;
}

.ts-check span {
    -webkit-user-select: none;
    user-select: none;
}

/* Primary submit + extra (social / passkey) buttons */
.ts-auth__submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.ts-auth__actions {
    margin-top: 1.5rem;
}

.ts-auth__extra {
    width: 100%;
    justify-content: center;
    margin-top: 0.6rem;
}

/* Problem 5: never let a button icon blow up to hero size */
.ts-btn svg,
.ts-btn img,
.ts-auth__extra svg,
.ts-auth__extra img {
    width: 1.25em;
    height: 1.25em;
    flex: 0 0 auto;
}

/* Problem 6: "or" divider, a micro word floating between hairlines */
.ts-auth__divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1rem 0;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.ts-auth__divider::before,
.ts-auth__divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--ec-border);
}

.ts-auth__divider span {
    flex: 0 0 auto;
}

/* Problem 7: neutralise the browser autofill blue wash */
.ts-auth input:-webkit-autofill,
.ts-auth input:-webkit-autofill:hover,
.ts-auth input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px var(--ec-surface) inset;
    -webkit-text-fill-color: var(--ec-fg);
    caret-color: var(--ec-fg);
}

/* Footer options row with a hairline rule */
.ts-auth__options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin-top: 1.5rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--ec-border);
    font-size: 0.875rem;
}

.ts-auth__options a {
    color: var(--ec-fg-2);
    text-decoration: none;
    transition: color var(--ec-dur-1) var(--ec-ease);
}

.ts-auth__options a:hover {
    color: var(--ec-accent);
}

.ts-auth__options .ts-auth__register {
    margin-left: auto;
    font-weight: 600;
    color: var(--ec-accent);
}

/* Stack the options row on small screens */
@media (max-width: 767.98px) {
    .ts-auth__options {
        gap: 0.6rem;
    }

    .ts-auth__options .ts-auth__register {
        margin-left: 0;
    }
}

/* Recovery (remind / reset request / confirm / complete) reuses the .ts-auth
   card system verbatim: card, title, desc, .control-group fields, submit and
   the password widget/strength meter are all styled by the shared auth CSS.
   No recovery-specific rules are required; every value stays token-driven. */
/* Profile */
.ts-profile {
    max-width: 46rem;
    margin-inline: auto;
}

.ts-profile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ec-border);
}

.ts-profile__title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.ts-profile__body dl {
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) 1fr;
    gap: 0.6rem 1.5rem;
    margin: 0;
}

.ts-profile__body dt {
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
    padding-top: 0.2rem;
}

.ts-profile__body dd {
    margin: 0;
}

/* ==========================================================================
   Article (editorial, full-container width)
   Full-width header + featured image above a two-zone grid whose sticky
   left rail carries the info block, tags and icons while the right zone
   holds the reading body at a comfortable measure.
   ========================================================================== */
.ts-article {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-block: calc(var(--ec-sect-y) / 2) var(--ec-sect-y);
}

/* Full-width header ------------------------------------------------------- */
.ts-article__header {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* Uppercase eyebrow with the leading accent rule */
.ts-article__eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 1rem;
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ec-accent);
    line-height: 1;
}

.ts-article__eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--ec-accent);
}

.ts-article__eyebrow a {
    color: var(--ec-accent);
    text-decoration: none;
    transition: opacity var(--ec-dur-1) var(--ec-ease);
}

.ts-article__eyebrow a:hover {
    opacity: 0.7;
}

.ts-article__pageheading {
    margin: 0 0 0.5rem;
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

.ts-article__title {
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    letter-spacing: -0.03em;
    text-transform: var(--ec-disp-transform);
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    line-height: 1.05;
    margin: 0;
    max-width: none;
    color: var(--ec-fg);
}

.ts-article__title em {
    font-style: italic;
    color: var(--ec-accent);
}

.ts-article__header .ts-badge {
    margin-top: 1rem;
}

/* Featured image: full container width ------------------------------------ */
.ts-article__hero {
    margin: 0 0 clamp(2rem, 4vw, 3rem);
}

.ts-article__hero img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 34rem;
    object-fit: cover;
    border-radius: var(--ec-img-radius);
    border: 1px solid var(--ec-border);
}

/* URL links block --------------------------------------------------------- */
.ts-article__links {
    margin-block: 1.5rem;
}

/* Two-zone grid ----------------------------------------------------------- */
.ts-article__layout {
    display: block;
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--ec-border);
}

@media (min-width: 1024px) {
    .ts-article__layout {
        display: grid;
        grid-template-columns: 16rem minmax(0, 1fr);
        gap: clamp(1.5rem, 4vw, 3.5rem);
        align-items: start;
    }

    .ts-article__layout--full {
        grid-template-columns: minmax(0, 1fr);
    }

    /* DOM order is main-then-aside (content first); place the aside left. */
    .ts-article__main {
        grid-column: 2;
        grid-row: 1;
    }

    .ts-article__aside {
        grid-column: 1;
        grid-row: 1;
    }

    .ts-article__layout--full .ts-article__main {
        grid-column: 1;
    }
}

.ts-article__main {
    min-width: 0;
}

/* Reading body ------------------------------------------------------------ */
.ts-article__body {
    --ts-measure: 72ch;
    font-family: var(--ec-font-body);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--ec-fg);
    overflow-wrap: break-word;
}

/* Flowing text keeps a readable measure; rich media fills the whole column. */
.ts-article__body > p,
.ts-article__body > h2,
.ts-article__body > h3,
.ts-article__body > h4,
.ts-article__body > h5,
.ts-article__body > h6,
.ts-article__body > ul,
.ts-article__body > ol,
.ts-article__body > dl,
.ts-article__body > blockquote,
.ts-article__body > pre {
    max-width: var(--ts-measure);
}

.ts-article__body > figure,
.ts-article__body > table,
.ts-article__body > iframe,
.ts-article__body > p:has(> div),
.ts-article__body > p:has(> iframe),
.ts-article__body > p:has(> .gpstools-react-component) {
    max-width: none;
}

.ts-article__body p {
    margin: 0 0 1.35rem;
}

.ts-article__body a {
    color: var(--ec-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: text-decoration-thickness var(--ec-dur-1) var(--ec-ease);
}

.ts-article__body a:hover {
    text-decoration-thickness: 2px;
}

.ts-article__body h2,
.ts-article__body h3,
.ts-article__body h4 {
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    line-height: 1.15;
    margin: 2.25rem 0 0.85rem;
    color: var(--ec-fg);
}

.ts-article__body h2 {
    font-size: 1.85rem;
}

.ts-article__body h3 {
    font-size: 1.45rem;
}

.ts-article__body h4 {
    font-size: 1.2rem;
}

.ts-article__body ul,
.ts-article__body ol {
    margin: 0 0 1.35rem;
    padding-left: 1.4rem;
}

.ts-article__body li {
    margin-bottom: 0.4rem;
}

.ts-article__body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ec-img-radius);
}

.ts-article__body figure {
    margin: 1.75rem 0;
}

.ts-article__body figure img {
    width: 100%;
}

.ts-article__body figcaption {
    margin-top: 0.6rem;
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

.ts-article__body blockquote {
    max-width: var(--ts-measure);
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.75rem;
    border-left: 2px solid var(--ec-accent);
    color: var(--ec-fg);
    font-family: var(--ec-font-display);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
}

.ts-article__body iframe {
    max-width: 100%;
}

.ts-article__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.ts-article__body th,
.ts-article__body td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--ec-border);
    text-align: left;
}

.ts-article__body th {
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
}

/* Guest teaser + read-more login ------------------------------------------ */
.ts-article__body--teaser .read-more,
.ts-article__body--teaser p.read-more {
    margin-top: 1.5rem;
}

.ts-article__body--teaser .read-more a,
.ts-article__body--teaser a.btn,
.ts-article__body--teaser a.register {
    display: inline-block;
    padding: 14px 28px;
    background: var(--ec-accent);
    color: var(--ec-accent-fg);
    border: 0;
    border-radius: var(--ec-btn-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: filter var(--ec-dur-1) var(--ec-ease);
}

.ts-article__body--teaser .read-more a:hover,
.ts-article__body--teaser a.btn:hover,
.ts-article__body--teaser a.register:hover {
    filter: brightness(0.92);
}

/* Sticky meta rail -------------------------------------------------------- */
.ts-article__aside {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--ec-fg-2);
}

@media (min-width: 1024px) {
    .ts-article__aside {
        position: sticky;
        top: 6rem;
        align-self: start;
    }
}

@media (max-width: 1023.98px) {
    .ts-article__aside {
        margin-top: 2.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--ec-border);
    }
}

/* Info block as a vertical meta list with uppercase micro terms. */
.ts-article__aside .article-info {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    font-family: var(--ec-font-body);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ec-fg-2);
}

.ts-article__aside .article-info-term {
    display: block;
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ec-fg-2);
    margin: 0 0 0.15rem;
}

.ts-article__aside .article-info dd {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0;
    line-height: 1.4;
}

.ts-article__aside .article-info dd [class^="icon-"],
.ts-article__aside .article-info dd [class*=" icon-"] {
    color: var(--ec-accent);
    flex: none;
}

.ts-article__aside .article-info a {
    color: var(--ec-fg);
    text-decoration: none;
    border-bottom: 1px solid var(--ec-border);
    transition: border-color var(--ec-dur-1) var(--ec-ease);
}

.ts-article__aside .article-info a:hover {
    border-color: var(--ec-accent);
}

.ts-article__aside .article-info time {
    color: inherit;
}

/* Tags as soft rounded pills. */
.ts-article__tags .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-article__tags .tags li {
    margin: 0;
    padding: 0;
}

.ts-article__tags .tags a,
.ts-article__tags .tags .btn {
    display: inline-block;
    padding: 5px 12px;
    background: var(--ec-surface-2);
    color: var(--ec-fg-2);
    border: 0;
    border-radius: 999px;
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
    text-decoration: none;
    transition: background var(--ec-dur-1) var(--ec-ease), color var(--ec-dur-1) var(--ec-ease);
}

.ts-article__tags .tags a:hover,
.ts-article__tags .tags .btn:hover {
    background: var(--ec-accent-soft);
    color: var(--ec-accent);
}

/* Print / email / edit icons as ghost chips. */
.ts-article__actions .icons {
    margin: 0;
}

.ts-article__actions .float-end,
.ts-article__actions .float-start {
    float: none !important;
}

.ts-article__actions ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-article__actions a,
.ts-article__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 14px;
    border: 1px solid var(--ec-border);
    border-radius: 999px;
    background: none;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color var(--ec-dur-1) var(--ec-ease), color var(--ec-dur-1) var(--ec-ease);
}

.ts-article__actions a:hover,
.ts-article__actions .btn:hover {
    border-color: var(--ec-accent);
    color: var(--ec-accent);
}
/* ==========================================================================
   Category blog (Journal): header, card grid, secondary links
   ========================================================================== */

/* --- Category header ---------------------------------------------------- */
.ts-journal__head {
    margin-bottom: var(--ec-sect-y);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ec-border);
}

.ts-journal__eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 0.75rem;
    font-family: var(--ec-font-body);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ec-accent);
    line-height: 1;
}

.ts-journal__eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--ec-accent);
}

.ts-journal__title {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.25rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--ec-fg);
}

.ts-journal__title em {
    font-style: italic;
    color: var(--ec-accent);
}

.ts-journal__count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 1rem 0 0;
    padding: 5px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--ec-surface-2);
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ts-journal__count-num {
    color: var(--ec-accent);
}

.ts-journal__desc {
    max-width: 68ch;
    margin-top: 1rem;
    color: var(--ec-fg-2);
    font-size: 1rem;
    line-height: 1.65;
}

.ts-journal__desc > :last-child {
    margin-bottom: 0;
}

.ts-journal__desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ec-img-radius);
}

.ts-journal__empty {
    margin: var(--ec-sect-y) 0;
    padding: 2.5rem 1.5rem;
    background: var(--ec-surface-2);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    color: var(--ec-fg-2);
    text-align: center;
}

/* --- Post-card grid ----------------------------------------------------- */
.ts-postgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: var(--ec-grid-gap);
    margin: 0;
}

.ts-postgrid + .ts-postgrid {
    margin-top: var(--ec-grid-gap);
}

/* --- Post card: rounded surface, warm lift ------------------------------ */
.ts-postcard {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    transition: transform var(--ec-dur-2) var(--ec-ease),
                box-shadow var(--ec-dur-2) var(--ec-ease);
}

.ts-postcard:hover {
    transform: translateY(-4px);
    box-shadow: var(--ec-shadow);
}

/* Media: 3:2, cover-fit image, subtle zoom on hover, rounded top via clip */
.ts-postcard__media {
    display: block;
    aspect-ratio: 3 / 2;
    background: var(--ec-surface-2);
    overflow: hidden;
}

.ts-postcard__media figure {
    width: 100%;
    height: 100%;
    margin: 0;
}

.ts-postcard__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform var(--ec-dur-3) var(--ec-ease);
}

.ts-postcard:hover .ts-postcard__media img {
    transform: scale(1.05);
}

.ts-postcard__media figcaption {
    display: none;
}

/* Themed placeholder: soft accent wash with a display-font monogram */
.ts-postcard__media--placeholder {
    display: grid;
    place-items: center;
    background: var(--ec-accent-soft);
}

.ts-postcard__monogram {
    font-family: var(--ec-font-display);
    font-weight: var(--ec-disp-weight);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1;
    color: var(--ec-accent);
    opacity: 0.75;
    user-select: none;
}

/* Body */
.ts-postcard__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.6rem;
    padding: 22px;
}

/* Title: display font, clamp to 2 lines, accent on hover */
.ts-postcard__body .page-header {
    margin: 0;
}

.ts-postcard__body .page-header h1,
.ts-postcard__body .page-header h2,
.ts-postcard__body .page-header h3,
.ts-postcard__body > h2,
.ts-postcard__body > h3 {
    margin: 0;
    font-size: 1.1875rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.ts-postcard__body .page-header a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ec-fg);
    text-decoration: none;
    transition: color var(--ec-dur-1) var(--ec-ease);
}

.ts-postcard__body .page-header a:hover {
    color: var(--ec-accent);
}

/* Meta row: uppercase micro-labels in accent */
.ts-postcard__body .article-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ec-accent);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ts-postcard__body .article-info-term {
    display: none;
}

.ts-postcard__body .article-info dd {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
}

.ts-postcard__body .article-info a {
    color: var(--ec-accent);
    text-decoration: none;
}

.ts-postcard__body .article-info a:hover {
    color: var(--ec-fg);
}

.ts-postcard__body .article-info [class^="icon-"],
.ts-postcard__body .article-info [class*=" icon-"] {
    font-size: 0.9em;
    opacity: 0.7;
}

/* Tags as soft rounded pills */
.ts-postcard__body .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-postcard__body .tags li {
    margin: 0;
}

.ts-postcard__body .tags a {
    display: inline-block;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--ec-surface-2);
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background var(--ec-dur-1) var(--ec-ease),
                color var(--ec-dur-1) var(--ec-ease);
}

.ts-postcard__body .tags a:hover {
    background: var(--ec-accent-soft);
    color: var(--ec-accent);
}

/* Excerpt: ~3 lines, soft fade to the card surface */
.ts-postcard__excerpt {
    position: relative;
    max-height: calc(1.6em * 3);
    overflow: hidden;
    color: var(--ec-fg-2);
    font-size: 0.875rem;
    line-height: 1.6;
}

.ts-postcard__excerpt::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2.6em;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--ec-surface));
    pointer-events: none;
}

.ts-postcard__excerpt > :first-child {
    margin-top: 0;
}

.ts-postcard__excerpt > :last-child {
    margin-bottom: 0;
}

.ts-postcard__excerpt :where(h1, h2, h3, h4, h5, h6) {
    margin: 0 0 0.3em;
    font-size: 0.98rem;
    line-height: 1.35;
}

.ts-postcard__excerpt :where(p, ul, ol) {
    margin: 0 0 0.5em;
}

.ts-postcard__excerpt img {
    display: none;
}

/* Read-more: an accent micro link with a sliding arrow */
.ts-postcard .readmore {
    margin: auto 0 0;
    padding-top: 14px;
}

.ts-postcard .readmore a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ec-accent);
    font-family: var(--ec-font-body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: gap var(--ec-dur-1) var(--ec-ease);
}

.ts-postcard .readmore a:hover {
    gap: 0.6rem;
    color: var(--ec-accent);
}

.ts-postcard .readmore a [class^="icon-"],
.ts-postcard .readmore a [class*=" icon-"] {
    display: none;
}

.ts-postcard .readmore a::after {
    content: "\2192";
    font-weight: 600;
}

/* --- Leading card: larger, media + body side-by-side on >= 768px -------- */
.ts-postgrid--lead {
    grid-template-columns: 1fr;
}

.ts-postgrid--lead .ts-postcard {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: stretch;
}

.ts-postgrid--lead .ts-postcard__media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 15rem;
}

.ts-postgrid--lead .ts-postcard__body {
    padding: 28px;
    gap: 0.85rem;
    justify-content: center;
}

.ts-postgrid--lead .ts-postcard .page-header h1,
.ts-postgrid--lead .ts-postcard .page-header h2,
.ts-postgrid--lead .ts-postcard .page-header h3 {
    font-size: clamp(1.6rem, 2.4vw, 2.125rem);
}

.ts-postgrid--lead .ts-postcard__excerpt {
    max-height: calc(1.65em * 4);
    font-size: 0.9375rem;
    line-height: 1.65;
}

@media (max-width: 767.98px) {
    .ts-postgrid--lead .ts-postcard {
        grid-template-columns: 1fr;
    }

    .ts-postgrid--lead .ts-postcard__media {
        aspect-ratio: 3 / 2;
        height: auto;
        min-height: 0;
    }
}

/* --- Secondary "links" list: clean rows with hairline separators -------- */
.ts-journal .items-more {
    margin-top: var(--ec-sect-y);
}

.ts-postlinks {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ec-border);
}

.ts-postlinks__item {
    margin: 0;
    border-bottom: 1px solid var(--ec-border);
}

.ts-postlinks__link {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.9rem 0.35rem;
    color: var(--ec-fg);
    text-decoration: none;
    transition: color var(--ec-dur-1) var(--ec-ease),
                padding-inline-start var(--ec-dur-2) var(--ec-ease);
}

.ts-postlinks__link:hover {
    color: var(--ec-accent);
    padding-inline-start: 0.85rem;
}

.ts-postlinks__title {
    font-family: var(--ec-font-display);
    font-size: 1.15rem;
    font-weight: var(--ec-disp-weight);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.ts-postlinks__meta {
    flex: 0 0 auto;
    margin-inline-start: auto;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ts-postlinks__arrow {
    flex: 0 0 auto;
    color: var(--ec-accent);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--ec-dur-1) var(--ec-ease),
                transform var(--ec-dur-1) var(--ec-ease);
}

.ts-postlinks__link:hover .ts-postlinks__arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --- Sub-category section + submit action ------------------------------ */
.ts-journal__section {
    margin-top: var(--ec-sect-y);
    padding-top: 1.5rem;
    border-top: 1px solid var(--ec-border);
}

.ts-journal__section-title {
    margin: 0 0 1.25rem;
    font-size: 1.75rem;
    color: var(--ec-fg);
}

.ts-journal__actions {
    margin-top: var(--ec-sect-y);
}
/* Category grid (article categories): rounded surface tiles */
.ts-catlist {
    padding-block: calc(var(--ec-sect-y) / 2);
}

.ts-catgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: var(--ec-grid-gap);
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
}

.ts-catgrid__item {
    padding: 22px;
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    transition: transform var(--ec-dur-2) var(--ec-ease),
                box-shadow var(--ec-dur-2) var(--ec-ease);
}

.ts-catgrid__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--ec-shadow);
}

.ts-catgrid__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ts-catgrid__title {
    margin: 0;
    font-size: 1.35rem;
}

.ts-catgrid__title a {
    color: var(--ec-fg);
    text-decoration: none;
}

.ts-catgrid__title a:hover {
    color: var(--ec-accent);
}

.ts-catgrid__count {
    padding: 3px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--ec-surface-2);
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.ts-catgrid__toggle {
    margin-left: auto;
    width: 30px;
    height: 30px;
    border: 1px solid var(--ec-border);
    border-radius: 50%;
    background: none;
    color: var(--ec-fg-2);
    cursor: pointer;
    transition: border-color var(--ec-dur-1) var(--ec-ease), color var(--ec-dur-1) var(--ec-ease);
}

.ts-catgrid__toggle:hover {
    border-color: var(--ec-fg);
    color: var(--ec-fg);
}

.ts-catgrid__image {
    max-width: 100%;
    border-radius: var(--ec-img-radius);
    margin-top: 0.75rem;
}

.ts-catgrid__desc {
    margin-top: 0.6rem;
    color: var(--ec-fg-2);
    font-size: 0.9rem;
}

.ts-catgrid__children {
    grid-column: 1 / -1;
}

/* Pagination footer row */
.ts-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: var(--ec-sect-y);
    padding-top: 1.25rem;
    border-top: 1px solid var(--ec-border);
}

.ts-pager__counter {
    margin: 0;
    color: var(--ec-fg-2);
    font-family: var(--ec-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
