/*
 * Petsure Legal Document widget
 *
 * Type-led, trust-first surface for legal pages (terms, privacy,
 * refunds). Header uses the shared Section Title pattern untouched
 * (subheading eyebrow + animated heading, same as every other widget),
 * clauses use a hairline divider with the number as the only ornament,
 * and the contact block reuses the round accent-icon chip language of
 * the icon-list / icon-box widgets. Uses theme tokens only.
 */

.petsure-legal-doc {
    color: var(--petsure-text);
    font-family: var(--petsure-font-text);
    font-size: 1rem;
    line-height: 1.75;
    padding: 0 25px;
}

/* ── Header (shared Section Title — no overrides) ───── */

/* Last-update line under the heading */
.petsure-legal-doc__update {
    margin-top: 1.5em;
    margin-bottom: 1.75em;
    font-size: 0.813rem;
    line-height: 1.5;
    color: var(--petsure-text);
    opacity: 0.8;
}

/* ── Intro ───────────────────────────────────────── */

.petsure-legal-doc__intro {
    margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
    font-size: 1.0625rem;
    line-height: 1.75;
}

.petsure-legal-doc__intro p {
    margin: 0 0 1em;
}

.petsure-legal-doc__intro p:last-child {
    margin-bottom: 0;
}

/* ── Clauses ─────────────────────────────────────── */

.petsure-legal-doc__clauses {
    counter-reset: petsure-legal-clause;
}

.petsure-legal-clause {
    counter-increment: petsure-legal-clause;
    padding-top: 1.5rem;
    border-top: 1px solid var(--petsure-divider);
}

.petsure-legal-clause+.petsure-legal-clause {
    margin-top: 2.5rem;
}

.petsure-legal-clause__title {
    display: flex;
    align-items: baseline;
    gap: 0.75em;
    margin: 0 0 0.9em;
    color: var(--petsure-primary);
    font-family: var(--petsure-font-primary);
    font-weight: var(--petsure-heading-weight);
    font-size: 1.125rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* Auto-numbered clause marker: "1." "2." … */
.petsure-legal-clause__title::before {
    content: counter(petsure-legal-clause) ".";
    flex-shrink: 0;
    color: var(--petsure-accent);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.petsure-legal-clause__content {
    font-size: 1rem;
    line-height: 1.75;
}

.petsure-legal-clause__content p {
    margin: 0 0 1em;
}

.petsure-legal-clause__content p:last-child {
    margin-bottom: 0;
}

/* Nested lists inside clause content */
.petsure-legal-clause__content ul,
.petsure-legal-clause__content ol {
    margin: 0 0 1em;
    padding-left: 1.35em;
}

.petsure-legal-clause__content ul {
    list-style: none;
}

.petsure-legal-clause__content ul>li {
    position: relative;
    padding-left: 1em;
}

.petsure-legal-clause__content ul>li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--petsure-accent);
}

.petsure-legal-clause__content li {
    margin-bottom: 0.45em;
}

/* ── Contact channels ────────────────────────────── */

.petsure-legal-contact {
    position: relative;
    overflow: hidden;
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--petsure-divider);
    border-radius: var(--petsure-border-radius);
    background: var(--petsure-white);
}

/* Top accent bar as a real element clipped by the container's radius,
   so the colour never fights the border-radius curve. */
.petsure-legal-contact__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--petsure-accent);
    pointer-events: none;
}

.petsure-legal-contact__heading {
    margin: 0 0 0.5em;
    color: var(--petsure-primary);
    font-family: var(--petsure-font-primary);
    font-weight: var(--petsure-heading-weight);
    font-size: 1.25rem;
    line-height: 1.3;
}

.petsure-legal-contact__intro {
    margin: 0 0 1.5em;
    font-size: 0.938rem;
    line-height: 1.6;
    color: var(--petsure-text);
}

.petsure-legal-contact__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each channel is its own card */
.petsure-legal-channel {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--petsure-divider);
    border-radius: var(--petsure-border-radius);
    background: var(--petsure-background);
}

/* Round accent chip — same language as icon-list / icon-box */
.petsure-legal-channel__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(var(--petsure-accent-rgb), 0.1);
    color: var(--petsure-accent);
}

.petsure-legal-channel__icon i {
    font-size: 20px;
    color: inherit;
}

.petsure-legal-channel__icon svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.petsure-legal-channel__icon svg * {
    fill: inherit;
}

.petsure-legal-channel__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 2px;
}

.petsure-legal-channel__label {
    font-size: 0.813rem;
    line-height: 1.4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--petsure-text);
}

.petsure-legal-channel__value {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    color: var(--petsure-primary);
    overflow-wrap: break-word;
}

.petsure-legal-channel a.petsure-legal-channel__value {
    color: var(--petsure-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.petsure-legal-channel a.petsure-legal-channel__value:hover,
.petsure-legal-channel a.petsure-legal-channel__value:focus {
    color: var(--petsure-primary);
}

/* ── Acceptance ──────────────────────────────────── */

.petsure-legal-doc__acceptance {
    margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--petsure-primary);
    font-size: 0.938rem;
    line-height: 1.7;
    color: var(--petsure-primary);
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 767px) {
    .petsure-legal-clause__title {
        font-size: 1.0625rem;
    }

    .petsure-legal-clause__content,
    .petsure-legal-doc__intro {
        font-size: 0.95rem;
    }

    .petsure-legal-channel__icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}