/*
 * UI Lib design system: tokens and shared components.
 *
 * Every class here is prefixed "u-" so it cannot collide with the
 * edd-widgets stylesheets, which still style the product grid, account,
 * checkout and classic product pages.
 */

:root {
    /* Colour */
    --u-ink: #111111;
    --u-text: #2B2B2B;
    --u-muted: #454545;
    --u-subtle: #8F8F8F;
    --u-line: #E1E4E8;
    --u-line-strong: #CBD0D6;
    --u-surface: #FFFFFF;
    --u-surface-soft: #F4F6F8;
    --u-surface-warm: #FBF6E8;
    --u-header-bg: rgba(251, 250, 248, 0.92);
    --u-brand: #D62828;
    --u-brand-hover: #AE1F1F;
    --u-accent: #FFD730;
    --u-accent-soft: #FFE96B;
    --u-accent-pale: #FFF0A8;
    --u-positive: #0A7A50;
    --u-dark: #0D0D0D;
    --u-dark-2: #1C1C1C;
    --u-dark-3: #262626;
    --u-dark-line: #3D3D3D;
    --u-dark-text: #C4C4C4;
    --u-dark-muted: #B5B5B5;

    /* Type */
    --u-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --u-display-xl: clamp(38px, 5.6vw, 72px);
    --u-display-l: clamp(28px, 3.4vw, 44px);
    --u-display-m: clamp(24px, 2.8vw, 36px);

    /* Layout */
    --u-container: 1200px;
    --u-gutter: 24px;
    --u-section: clamp(64px, 7vw, 96px);
    --u-radius: 6px;
    --u-radius-lg: 8px;
    --u-header-h: 64px;
}

/* Base -------------------------------------------------------------- */

/* reset.css sets overflow-x:hidden on html and body, which turns body
   into a scroll container and silently disables position:sticky.
   "clip" hides overflow the same way without doing that. */
html,
body.u-site {
    overflow-x: clip;
}

body.u-site {
    margin: 0;
    font-family: var(--u-font);
    color: var(--u-ink) !important; /* edd-widgets style.css sets !important */
    background: var(--u-surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.u-site a {
    text-decoration: none;
}

.u-site img {
    max-width: 100%;
    height: auto;
}

.u-container {
    max-width: calc(var(--u-container) + 2 * var(--u-gutter));
    margin-inline: auto;
    padding-inline: var(--u-gutter);
}

.u-section {
    padding-block: var(--u-section) 0;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.u-skip-link:focus {
    clip: auto;
    width: auto;
    height: auto;
    z-index: 1000;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    background: var(--u-surface);
    color: var(--u-ink);
}

/* Type -------------------------------------------------------------- */

.u-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--u-muted);
}

.u-eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--u-brand);
    flex-shrink: 0;
}

.u-eyebrow--brand {
    color: var(--u-brand);
}

.u-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.u-section-head--center {
    justify-content: center;
    text-align: center;
}

.u-section-head--center .u-eyebrow {
    justify-content: center;
}

.u-section-head__title {
    margin: 0;
    max-width: 24ch;
    font-size: var(--u-display-l);
    line-height: 1.06;
    letter-spacing: -0.036em;
    font-weight: 800;
    color: inherit;
    text-wrap: pretty;
}

.u-section-head--center .u-section-head__title {
    margin-inline: auto;
}

.u-section-head__text {
    margin: 14px 0 0;
    max-width: 62ch;
    font-size: 16px;
    line-height: 1.6;
    color: var(--u-muted);
}

.u-section-head--center .u-section-head__text {
    margin-inline: auto;
}

.u-prose {
    font-size: 16px;
    line-height: 1.65;
    color: var(--u-text);
}

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

.u-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    border: 1px solid transparent;
    border-radius: var(--u-radius);
    font-family: var(--u-font);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .055em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

/* The label is one flex item, so a long label wraps as ordinary text.
   Without the span, anything inline in it (WordPress swaps emoji for
   <img class="emoji">) became a separate item in its own column. */
.u-btn__label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.u-btn__label img.emoji {
    display: inline;
    width: 1em;
    height: 1em;
    margin: 0 .1em;
    vertical-align: -0.1em;
}

/* .u-btn sets display, which would otherwise override the hidden attribute. */
.u-btn[hidden] {
    display: none;
}

.u-btn--sm {
    padding: 12px 18px;
    font-size: 12.5px;
    letter-spacing: .06em;
}

.u-btn--block {
    display: flex;
    width: 100%;
}

.u-site .u-btn--primary {
    background: var(--u-brand);
    color: #fff;
}

.u-site .u-btn--primary:hover {
    background: var(--u-brand-hover);
    color: #fff;
}

.u-site .u-btn--dark {
    background: var(--u-dark-3);
    color: #fff;
}

.u-site .u-btn--dark:hover {
    background: var(--u-brand);
    color: #fff;
}

.u-site .u-btn--outline {
    background: var(--u-surface);
    border-color: var(--u-line-strong);
    color: var(--u-ink);
}

.u-site .u-btn--outline:hover {
    border-color: var(--u-ink);
    color: var(--u-ink);
}

.u-site .u-btn--light {
    background: #fff;
    color: var(--u-ink);
}

.u-site .u-btn--light:hover {
    background: var(--u-accent);
    color: var(--u-ink);
}

.u-site .u-btn--ghost-dark {
    border-color: #4D4D4D;
    color: #fff;
}

.u-site .u-btn--ghost-dark:hover {
    background: #fff;
    color: var(--u-ink);
}

.u-site .u-btn--soft {
    background: var(--u-surface-soft);
    border-color: #D8DCE1;
    color: var(--u-ink);
}

.u-site .u-btn--soft:hover {
    background: var(--u-dark-3);
    border-color: var(--u-dark-3);
    color: #fff;
}

.u-btn--compact {
    padding: 10px 14px;
    font-size: 11.5px;
}

.u-site .u-textlink {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--u-brand);
}

.u-site .u-textlink:hover {
    color: var(--u-brand-hover);
}

.u-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* Small pieces ------------------------------------------------------- */

.u-chip {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--u-line);
    border-radius: 4px;
    font-size: 10.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--u-muted);
}

.u-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 4px;
    background: var(--u-ink);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.u-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(135deg, var(--u-surface-soft) 0 10px, #E8EBEE 10px 20px);
    color: var(--u-muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Grid of bordered cells sharing 1px borders (limits, solutions). */
.u-cells {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1px;
    background: var(--u-line);
    border: 1px solid var(--u-line);
    border-radius: var(--u-radius-lg);
    overflow: hidden;
}

.u-cells > * {
    background: var(--u-surface);
    padding: 24px;
}

.u-cell__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--u-ink);
}

.u-cell__text {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--u-muted);
}

/* Accordion (native <details>). */
.u-accordion {
    display: grid;
    gap: 10px;
}

.u-accordion details {
    border: 1px solid var(--u-line);
    border-radius: var(--u-radius);
    background: var(--u-surface);
}

.u-accordion details[open] {
    border-color: var(--u-ink);
}

.u-accordion summary {
    padding: 16px 18px;
    font-size: 15.5px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.u-accordion summary::-webkit-details-marker {
    display: none;
}

.u-accordion summary::after {
    content: "+";
    font-weight: 400;
    font-size: 20px;
    line-height: 1;
    color: var(--u-muted);
}

.u-accordion details[open] summary::after {
    content: "–";
}

.u-accordion__body {
    padding: 0 18px 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--u-muted);
}

.u-accordion__body > :first-child {
    margin-top: 0;
}

.u-accordion__body > :last-child {
    margin-bottom: 0;
}

/* Own-vs-rent calculator (template-parts/components/calculator.php).
   Always on a dark background: the homepage band or the product card. */
.u-calc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    color: #fff;
}

.u-calc--card {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 36px;
}

.u-calc__title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    text-wrap: pretty;
}

.u-calc__controls {
    display: grid;
    gap: 26px;
    max-width: 440px;
    margin-top: 32px;
}

.u-calc--card .u-calc__controls {
    gap: 18px;
    margin-top: 22px;
}

.u-calc__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--u-subtle);
}

.u-calc__value {
    min-width: 48px;
    padding: 4px 10px;
    border: 1px solid #2E2E2E;
    border-radius: 5px;
    background: var(--u-dark-2);
    color: #fff;
    font-size: 15px;
    letter-spacing: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.u-calc input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.u-calc input[type=range]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: #2E2E2E;
}

.u-calc input[type=range]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #2E2E2E;
}

.u-calc input[type=range]::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--u-accent);
}

.u-calc input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--u-accent);
    border: 3px solid var(--u-dark);
    box-shadow: 0 0 0 1px var(--u-accent);
}

.u-calc input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--u-accent);
    border: 3px solid var(--u-dark);
    box-shadow: 0 0 0 1px var(--u-accent);
}

.u-calc input[type=range]:focus-visible::-webkit-slider-thumb {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.u-calc__rates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* .u-site prefix: edd-widgets styles every <button>, including :hover/:focus. */
.u-site .u-calc__rate,
.u-site .u-calc__rate:hover,
.u-site .u-calc__rate:focus {
    margin: 0;
    line-height: normal;
    padding: 10px 14px;
    border: 1px solid #2E2E2E;
    border-radius: var(--u-radius);
    background: var(--u-dark-2);
    color: var(--u-dark-muted);
    font-family: var(--u-font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.u-site .u-calc__rate[aria-pressed="true"] {
    background: var(--u-accent);
    border-color: var(--u-accent);
    color: var(--u-ink);
}

.u-calc__result {
    padding: clamp(26px, 3vw, 38px);
    border: 1px solid var(--u-dark-3);
    border-radius: 10px;
    background: #141414;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.u-calc--card .u-calc__result {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.u-calc__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 22px 0;
    border-bottom: 1px solid var(--u-dark-3);
}

.u-calc__row:first-child {
    padding-top: 0;
}

.u-calc--card .u-calc__row {
    padding: 12px 0;
}

.u-calc__row-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--u-subtle);
}

.u-calc__row-label small {
    display: block;
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--u-dark-muted);
}

.u-calc--card .u-calc__row-label small {
    display: none;
}

.u-calc__amount {
    font-size: clamp(34px, 4.6vw, 54px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.045em;
    color: #fff;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.u-calc--card .u-calc__amount {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -0.035em;
}

.u-calc__amount--accent {
    color: var(--u-accent);
}

.u-calc__row--keep {
    align-items: center;
    padding: 20px 22px;
    border: 0;
    border-radius: var(--u-radius-lg);
    background: var(--u-positive);
}

.u-calc__row--keep .u-calc__row-label {
    color: #fff;
}

.u-calc__row--keep .u-calc__amount {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -0.03em;
}

.u-calc--card .u-calc__row--keep {
    margin-top: 6px;
    padding: 14px 16px;
}

.u-calc__result .u-btn {
    margin-top: 14px;
}

.u-calc__note {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--u-subtle);
}

@media (prefers-reduced-motion: reduce) {
    .u-site *,
    .u-site *::before,
    .u-site *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}

/* Ticked points under a hero's buttons (homepage trust line, product
   price note). Two columns sized to their text; one on phones. */
.u-ticks {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: start;
    gap: 12px 40px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 16px;
    line-height: 1.4;
    color: var(--u-text);
}

@media (max-width: 560px) {
    .u-ticks {
        grid-template-columns: 1fr;
    }
}

.u-ticks li {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Green tick, drawn as a mask so the colour stays in CSS. */
.u-ticks li::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: #3FA35B;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4L14 4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4L14 4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Star rating (uilib_stars()): one star shape repeated five times as a
   mask over a gradient filled to --u-stars-fill. */
.u-stars {
    display: inline-block;
    flex: none;
    width: 70px;
    height: 14px;
    background: linear-gradient(90deg, #F5A623 var(--u-stars-fill, 0%), #D5D9DE 0);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.86 6.06 6.64.8-4.9 4.56 1.26 6.58L12 17.27 6.14 20.5l1.26-6.58L2.5 9.36l6.64-.8z'/%3E%3C/svg%3E") left center / 14px 14px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.86 6.06 6.64.8-4.9 4.56 1.26 6.58L12 17.27 6.14 20.5l1.26-6.58L2.5 9.36l6.64-.8z'/%3E%3C/svg%3E") left center / 14px 14px repeat-x;
}
