/**
 * AshesWP 1.8.15 — product description progressive disclosure + editor typography.
 * Scoped to .asheswp-product-description (do not restyle global .editor-content).
 */

.asheswp-product-description {
    --pd-fade-from: color-mix(in srgb, var(--asheswp-surface, #fff) 0%, transparent);
    --pd-fade-to: var(--asheswp-surface, #fff);
    --pd-text: var(--asheswp-text-primary, #1c2128);
    --pd-muted: var(--asheswp-text-secondary, #4d5560);
    --pd-link: var(--asheswp-color-primary, #ff7239);
    --pd-border: var(--asheswp-border, #e4e7eb);
    --pd-soft: var(--asheswp-surface-soft, #f7f8fa);
    position: relative;
    max-width: 72ch;
}

.asheswp-product-description__clip {
    position: relative;
    overflow: hidden;
    max-height: none;
    transition: max-height 300ms ease;
}

.asheswp-product-description.is-collapsible:not(.is-expanded) .asheswp-product-description__fade {
    opacity: 1;
}

.asheswp-product-description__fade {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 88px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(to top, var(--pd-fade-to), var(--pd-fade-from));
    transition: opacity 200ms ease;
}

.asheswp-product-description__toggle {
    min-height: 48px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 20px;
    border: 1px solid var(--pd-border);
    border-radius: 12px;
    background: var(--pd-soft);
    color: var(--pd-link);
    font: inherit;
    font-size: 15px;
    font-family: var(--SemiBold, inherit);
    cursor: pointer;
}

.asheswp-product-description__toggle:hover {
    border-color: color-mix(in srgb, var(--pd-link) 40%, var(--pd-border));
    background: var(--asheswp-surface-warm, #fff5ef);
}

.asheswp-product-description__toggle:focus-visible {
    outline: 3px solid var(--asheswp-focus-ring-color, var(--pd-link));
    outline-offset: 2px;
}

.asheswp-product-description__toggle[hidden] {
    display: none !important;
}

/* Editor typography — product description only */
.asheswp-product-description__body {
    color: var(--pd-text);
    font-size: 15px;
    line-height: 1.9;
    text-align: right;
    overflow-wrap: break-word;
    word-break: normal;
}

.asheswp-product-description__body > *:first-child {
    margin-top: 0;
}

.asheswp-product-description__body > *:last-child {
    margin-bottom: 0;
}

.asheswp-product-description__body h2,
.asheswp-product-description__body h3,
.asheswp-product-description__body h4 {
    margin: 1.6em 0 0.55em;
    color: var(--pd-text);
    font-family: var(--SemiBold, inherit);
    line-height: 1.45;
}

.asheswp-product-description__body h2 {
    font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
}

.asheswp-product-description__body h3 {
    font-size: clamp(1.08rem, 1rem + 0.35vw, 1.25rem);
}

.asheswp-product-description__body h4 {
    font-size: 1.05rem;
}

.asheswp-product-description__body p {
    margin: 0 0 1em;
    max-width: 72ch;
}

.asheswp-product-description__body ul,
.asheswp-product-description__body ol {
    margin: 0 0 1em;
    padding-inline-start: 1.25em;
}

.asheswp-product-description__body ul {
    list-style: disc;
}

.asheswp-product-description__body ol {
    list-style: decimal;
}

.asheswp-product-description__body li {
    margin: 0.45em 0;
    line-height: 1.9;
    list-style: inherit;
}

.asheswp-product-description__body li::before {
    content: none !important;
    display: none !important;
}

.asheswp-product-description__body a {
    color: var(--pd-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.asheswp-product-description__body a:focus-visible {
    outline: 3px solid var(--asheswp-focus-ring-color, var(--pd-link));
    outline-offset: 2px;
}

.asheswp-product-description__body img,
.asheswp-product-description__body figure {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.asheswp-product-description__body figure {
    margin: 1.25em 0;
}

.asheswp-product-description__body blockquote {
    margin: 1.25em 0;
    padding: 12px 16px;
    border-inline-start: 3px solid var(--pd-link);
    background: var(--pd-soft);
    color: var(--pd-muted);
    border-radius: 0 12px 12px 0;
}

.asheswp-product-description__body table {
    width: 100%;
    max-width: 100%;
    margin: 1.25em 0;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.asheswp-product-description__body th,
.asheswp-product-description__body td {
    padding: 10px 12px;
    border: 1px solid var(--pd-border);
    text-align: right;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: anywhere;
}

.asheswp-product-description__body th {
    background: var(--pd-soft);
    font-family: var(--SemiBold, inherit);
}

/* Latin / numbers stay LTR where marked */
.asheswp-product-description__body :lang(en),
.asheswp-product-description__body code,
.asheswp-product-description__body .sku {
    unicode-bidi: isolate;
}

html[data-theme="dark"] .asheswp-product-description,
html[data-asheswp-theme="dark"] .asheswp-product-description,
body.dark-mode .asheswp-product-description {
    --pd-fade-to: var(--asheswp-surface-elevated, #1f252d);
    --pd-text: var(--asheswp-text-primary);
    --pd-muted: var(--asheswp-text-secondary);
    --pd-border: var(--asheswp-border);
    --pd-soft: var(--asheswp-surface-soft);
}

@media (prefers-reduced-motion: reduce) {
    .asheswp-product-description__clip,
    .asheswp-product-description__fade {
        transition: none;
    }
}
