/*
 * xRent foundations
 *
 * Interface defaults drawn from Apple's Human Interface Guidelines
 * (accessibility, color, typography, motion and materials). Part 1 always
 * applies. Part 2, the refined style, is scoped to body.xrent-refined
 * (Customizer > Default Setting > Refined Style). Colors come from the theme
 * tokens, so the Customizer brand colors keep working.
 */

:root {
    --xrent-ease: cubic-bezier(0.32, 0.72, 0, 1);
    --xrent-duration: 240ms;
    --xrent-focus-color: var(--color-primary, #12715B);
    --xrent-control-radius: 12px;
    --xrent-hairline: rgba(0, 0, 0, 0.08);
    --xrent-material: saturate(180%) blur(20px);
    /* Field edges at 3:1 or more against white and the cream panels (WCAG 1.4.11); hints at 4.5:1. */
    --xrent-field-border: #86868b;
    --xrent-placeholder: #6e6e73;
    --xrent-product-media-ratio: 4 / 3;
}
.uc-dark {
    --xrent-hairline: rgba(255, 255, 255, 0.12);
    --xrent-field-border: #7c7c80;
    --xrent-placeholder: #98989d;
    /*
     * The brand color is too dark for text on dark surfaces (#12715B on #101013 is 2.9:1).
     * Text links use a lighter tint of it (60% brand, 40% white: 5.6:1 or more on every
     * dark surface); filled buttons keep the brand color itself.
     */
    --xrent-accent-text: color-mix(in srgb, var(--color-primary, #12715B) 60%, #fff);
    --link-color-text: var(--xrent-accent-text);
}


/*=============================
    1. Foundations
===============================*/

/* Respect the reader's text size and give native controls and scrollbars the page's appearance. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: light;
}
html.uc-dark {
    color-scheme: dark;
}

/* Keyboard focus stays visible. Several stylesheets reset outline on :focus; this restores it for keyboard use only. */
:focus-visible:not([tabindex="-1"]) {
    outline: 2px solid var(--xrent-focus-color) !important;
    outline-offset: 2px !important;
}
:is(input, select, textarea):focus-visible:not([tabindex="-1"]) {
    outline-offset: 0 !important;
}

/* The dark-mode logo replaces the header logo wherever the page, or the section around it, is dark. */
.xrent-logo-dark:not(.uc-dark *) {
    display: none;
}
.uc-dark .xrent-logo-light {
    display: none;
}

/* Links inside post text need more than color to stand out on hover and focus. */
.post-text a:not(.btn):is(:hover, :focus-visible),
.comment-text a:not(.btn):is(:hover, :focus-visible) {
    text-decoration: underline !important;
    text-underline-offset: 0.2em;
}

/* Balanced headings and no orphaned last words. Zero specificity, so any explicit setting wins. */
:where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
    text-wrap: balance;
}
:where(p, li, blockquote, figcaption) {
    text-wrap: pretty;
}

/* Comment fields: 16px text so iOS Safari does not zoom on focus, readable hints, and a textarea people can resize. */
.comment-form .form-grp :is(input, textarea),
.comment-form .form-grp :is(input, textarea)::placeholder {
    font-size: 1rem;
}
.comment-form .form-grp :is(input, textarea)::placeholder {
    color: var(--xrent-placeholder);
    opacity: 1;
}
.comment-form .form-grp textarea {
    max-height: none;
    resize: vertical;
}

/* Accent links stay readable in dark mode. */
.uc-dark .uc-link {
    color: var(--xrent-accent-text);
}
/* Dimmed text on a brand-colored panel: 70% white on #12715B is 3.8:1, 90% is 5.0:1. */
:is(.bg-primary, .uc-dark .dark\:bg-primary) :is(.text-opacity-50, .text-opacity-60, .text-opacity-70, .text-opacity-75, .text-opacity-80) {
    --bs-text-opacity: 0.9;
}

/*
 * Icon-only header controls get a 44 by 44 px hit area without moving them: the
 * menu button draws a 20 px icon and the menu panel's close button is 32 px.
 */
.uc-navbar-toggle-icon {
    position: relative;
}
.uc-navbar-toggle-icon::after,
.uc-offcanvas-close::after {
    content: "";
    position: absolute;
    inset: -12px;
}
.uc-offcanvas-close::after {
    inset: -6px;
}

/* Touch targets of at least 44 by 44 px on touch screens. */
@media (pointer: coarse) {
    /* Slider dots stay 8 px but sit 24 px apart, each with a 24 px hit area (WCAG 2.5.8). */
    .swiper-pagination-bullets {
        --swiper-pagination-bullet-horizontal-gap: 8px;
    }
    .swiper-pagination-bullet {
        position: relative;
    }
    .swiper-pagination-bullet::after {
        content: "";
        position: absolute;
        inset: -8px;
    }
    .backtotop-wrap > *,
    .mobile-nav-toggler button,
    .pagination .page-numbers,
    .comment-reply-link {
        min-width: 44px;
        min-height: 44px;
    }
    .comment-reply-link {
        display: inline-flex;
        align-items: center;
    }
}

/* Motion is optional: show the end state without movement. */
@media (prefers-reduced-motion: reduce) {
    html,
    html:focus-within {
        scroll-behavior: auto !important;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Solid bars for people who turn transparency off. */
@media (prefers-reduced-transparency: reduce) {
    .uc-navbar-container.uc-navbar-sticky {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: #ffffff !important;
    }
    .uc-dark .uc-navbar-container.uc-navbar-sticky {
        background: #1f1f1f !important;
    }
}

/* Stronger edges when the system asks for more contrast. */
@media (prefers-contrast: more) {
    :root {
        --xrent-border-color: rgba(131, 131, 131, 0.7);
        --xrent-hairline: rgba(0, 0, 0, 0.4);
    }
    .uc-dark {
        --xrent-hairline: rgba(255, 255, 255, 0.5);
    }
}


/*=============================
    2. Refined style
===============================*/

/* Large type tracks tighter, as the system display styles do. */
:where(.xrent-refined) :where(h1, h2, .h1, .h2) {
    letter-spacing: -0.022em;
}
:where(.xrent-refined) :where(h3, h4, .h3, .h4) {
    letter-spacing: -0.012em;
}

/* Capsule buttons with press feedback. Radius utilities (rounded-*) still win. */
.xrent-refined .btn {
    border-radius: 980px;
    transition: color var(--xrent-duration) var(--xrent-ease),
        background-color var(--xrent-duration) var(--xrent-ease),
        border-color var(--xrent-duration) var(--xrent-ease),
        box-shadow var(--xrent-duration) var(--xrent-ease),
        transform var(--xrent-duration) var(--xrent-ease);
}
.xrent-refined .btn:active {
    transform: scale(0.98);
}

/* Fields: softer corners and a brand-colored focus ring instead of the default blue one. */
.xrent-refined :is(.form-control, .form-select, .tp-form-control),
.xrent-refined .widget select {
    border-radius: var(--xrent-control-radius);
    transition: border-color var(--xrent-duration) var(--xrent-ease),
        box-shadow var(--xrent-duration) var(--xrent-ease);
}
/* The comment form matches the other fields: same corners and an edge people can see. */
.xrent-refined .comment-form .form-grp :is(input, textarea) {
    border-radius: var(--xrent-control-radius);
    transition: border-color var(--xrent-duration) var(--xrent-ease),
        box-shadow var(--xrent-duration) var(--xrent-ease);
}
.xrent-refined :is(.form-control, .form-select, .tp-form-control),
.xrent-refined .widget select,
.xrent-refined .comment-form .form-grp :is(input, textarea) {
    border-color: var(--xrent-field-border);
}
.xrent-refined .comment-form .form-grp :is(input, textarea):focus {
    border-color: var(--xrent-focus-color);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb, 18, 113, 91), 0.2);
    outline: 2px solid transparent !important;
}
/* The reply link is a button, so it takes the button shape. */
.xrent-refined .comment-reply-link {
    border-radius: 980px;
}
/* The search button sits flush against the field's right edge. */
.xrent-refined form[role="search"] .form-control + button[type="submit"] {
    border-radius: 0 var(--xrent-control-radius) var(--xrent-control-radius) 0;
}
.xrent-refined :is(.form-control, .form-select, .tp-form-control):focus {
    border-color: var(--xrent-focus-color);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb, 18, 113, 91), 0.2);
    outline: 2px solid transparent !important; /* still visible in forced colors mode */
}

/* Sticky bar as a material: blur, saturation and a hairline edge. */
.xrent-refined .uc-navbar-container.uc-navbar-sticky {
    -webkit-backdrop-filter: var(--xrent-material);
    backdrop-filter: var(--xrent-material);
    box-shadow: 0 1px 0 var(--xrent-hairline);
}

/* Floating controls sit above content with a soft shadow. */
.xrent-refined .backtotop-wrap > * {
    box-shadow: 0 0 0 1px var(--xrent-hairline), 0 6px 20px rgba(0, 0, 0, 0.12);
}

/*
 * The top bar (xrent_topbar()): one short notice above the header, like a ribbon. Small type
 * (12px), centered, on a quiet surface: #1d1d1f on #f5f5f7 is 15.5:1, the default brand link
 * color 5.4:1; inverted in dark mode. It never moves and never hides the header below it.
 */
.xrent-topbar {
    position: relative;
    /* Above a page's full-height background layer (absolute, z-index 0: Atlas's hero), below the header. */
    z-index: 1;
    background: #f5f5f7;
    color: #1d1d1f;
    box-shadow: inset 0 -1px 0 var(--xrent-hairline);
}
.uc-dark .xrent-topbar {
    background: #1d1d1f;
    color: #f5f5f7;
}
.xrent-topbar .xrent-topbar__text {
    max-width: 980px;
    margin: 0 auto;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0.005em;
    text-align: center;
    text-wrap: balance;
}
.xrent-topbar .xrent-topbar__link {
    margin-inline-start: 0.25em;
    color: var(--link-color-text, var(--color-primary, #12715B));
    white-space: nowrap;
    text-decoration: none;
}
.xrent-topbar .xrent-topbar__link::after {
    content: "\00a0\203A"; /* a non-breaking space and a single right angle quote */
}
.xrent-topbar .xrent-topbar__link:hover,
.xrent-topbar .xrent-topbar__link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* The footer's credit link keeps the footer's text color (the brand green is 2.9:1 on a dark footer). */
.xrent-credit,
.xrent-credit:hover {
    color: inherit !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

/* Product cards are styled in xrent-woo.css ("Shop"), in every style. */

.xrent-refined ::selection {
    background-color: rgba(var(--bs-primary-rgb, 18, 113, 91), 0.2);
}
