/* Treatments on the homepage: icon tiles, each opening a side panel with the full explanation. */
.treatment-feature-section {
    background: var(--surface);
}

.treatment-feature-section .dk-small-pets {
    background: #fff;
}

.treatment-feature-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 4vw, 56px);
}

.treatment-feature-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px 48px;
}

.treatment-feature-head .heading {
    max-width: 720px;
}

.treatment-feature-head .lead {
    max-width: 420px;
    font-size: 17px;
    line-height: 1.6;
}

.treatment-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.treatment-tile-item {
    display: flex;
    min-width: 0;
}

.treatment-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    min-height: 300px;
    padding: 32px;
    border-radius: var(--radius-card);
    background: #fff;
    color: var(--ink);
}

.treatment-tile:focus-visible {
    border-radius: var(--radius-card);
}

.treatment-tile-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    transition: transform 0.5s var(--ease-out);
}

.treatment-tile-icon .icon {
    width: 32px;
    height: 32px;
    stroke-width: 1.4;
}

.treatment-tile:hover .treatment-tile-icon {
    transform: rotate(-8deg) scale(1.06);
}

.treatment-tile-text {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 12px;
}

.treatment-tile-title {
    margin: 0;
    font-size: 28px;
    font-weight: 300;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.treatment-tile:hover .treatment-tile-title {
    color: var(--accent);
}

.treatment-tile-summary {
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.treatment-tile-more {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    font-size: 15px;
    color: var(--accent);
}

.treatment-tile-knob {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent);
    transition: transform 0.35s var(--ease-out);
}

.treatment-tile:hover .treatment-tile-knob {
    transform: translateX(4px);
}

/* Side panel */
.treatment-dialog {
    position: fixed;
    inset: 16px 16px 16px auto;
    width: min(600px, calc(100vw - 32px));
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-card);
    background: #fff;
    color: var(--ink);
}

.treatment-dialog[open] {
    display: flex;
    flex-direction: column;
    animation: treatment-dialog-in 0.45s var(--ease-out);
}

.treatment-dialog.is-closing {
    animation: treatment-dialog-out 0.3s ease forwards;
}

.treatment-dialog::backdrop {
    background: rgba(var(--shade), 0.55);
    animation: treatment-backdrop-in 0.3s ease;
}

/* Without JavaScript the panel still opens through its address. */
html:not(.treatments-ready) .treatment-dialog:is(:target, :has(:target)) {
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 100vmax rgba(var(--shade), 0.55);
}

@keyframes treatment-dialog-in {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
}

@keyframes treatment-dialog-out {
    to {
        opacity: 0;
        transform: translateX(32px);
    }
}

@keyframes treatment-backdrop-in {
    from {
        opacity: 0;
    }
}

.treatment-dialog-head {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 28px 20px 32px;
    border-bottom: 1px solid #ececec;
}

.treatment-dialog-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.treatment-dialog-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
}

.treatment-dialog-icon .icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.treatment-dialog-title {
    flex-grow: 1;
    margin: 0;
    font-size: 32px;
    font-weight: 300;
    line-height: 1.15;
}

.treatment-dialog-close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    transition: background-color 0.3s ease;
}

.treatment-dialog-close:hover {
    background: var(--surface-hover);
}

.treatment-jumps ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.treatment-jump {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--surface);
    font-size: 13.5px;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

.treatment-jump:hover {
    background: var(--ink);
    color: #fff;
}

.treatment-dialog-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    padding: 24px 32px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* The body scrolls, so its parts keep their own height instead of shrinking to fit. */
.treatment-dialog-body > * {
    flex-shrink: 0;
}

/* Photos are never cropped: a tall one is scaled down and centred instead. */
.treatment-dialog-photo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(640px, 75vh);
    align-self: center;
    border-radius: 20px;
}

.treatment-dialog-intro {
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #2a2a2a;
}

.treatment-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid #ececec;
    scroll-margin-top: 16px;
}

.treatment-detail-title {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.25;
}

.treatment-detail-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #3a3a3a;
}

/* Widths follow each photo's aspect ratio (--ratio), so photos in a row share one height and stay whole. */
.treatment-detail-photos {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.treatment-detail-photos li {
    /* Scaled up, because flex-grow factors that add up to less than 1 leave part of the row empty. */
    flex: calc(var(--ratio, 1) * 100) 1 0;
    min-width: 0;
}

.treatment-detail-photos figure {
    margin: 0;
}

.treatment-detail-photos img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

.treatment-detail-photos.is-single img {
    width: auto;
    max-width: 100%;
    max-height: min(640px, 75vh);
    margin: 0 auto;
}

.treatment-detail-photos figcaption {
    padding: 6px 2px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.treatment-dialog-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 32px;
    border-top: 1px solid #ececec;
}

.treatment-dialog-cta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 6px 6px 6px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
}

.treatment-dialog-knob {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #fff;
    color: var(--accent);
    transition: transform 0.35s var(--ease-out);
}

.treatment-dialog-cta:hover .treatment-dialog-knob {
    transform: rotate(-45deg);
}

.treatment-dialog-call {
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.treatment-dialog-call:hover {
    color: var(--accent);
}

@media (max-width: 1000px) {
    .treatment-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .treatment-feature-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .treatment-feature-head .lead {
        font-size: 15px;
    }

    .treatment-tiles {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    /* On phones a tile is a row: icon, name with summary, and the arrow. */
    .treatment-tile {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) 36px;
        align-items: center;
        gap: 16px;
        min-height: 0;
        padding: 18px 16px 18px 18px;
        border-radius: 22px;
    }

    .treatment-tile-icon {
        width: 56px;
        height: 56px;
    }

    .treatment-tile-icon .icon {
        width: 26px;
        height: 26px;
    }

    .treatment-tile-text {
        gap: 4px;
        margin-top: 0;
    }

    .treatment-tile-title {
        font-size: 20px;
    }

    .treatment-tile-summary {
        font-size: 13px;
        line-height: 1.5;
    }

    .treatment-tile-more {
        margin-top: 0;
    }

    .treatment-tile-more-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .treatment-dialog {
        inset: 8px;
        width: auto;
        border-radius: 24px;
    }

    .treatment-dialog-head {
        gap: 14px;
        padding: 16px 12px 14px 16px;
    }

    .treatment-dialog-heading {
        gap: 12px;
    }

    .treatment-dialog-icon {
        width: 44px;
        height: 44px;
    }

    .treatment-dialog-icon .icon {
        width: 20px;
        height: 20px;
    }

    .treatment-dialog-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .treatment-dialog-close {
        width: 44px;
        height: 44px;
    }

    .treatment-jumps ul {
        flex-wrap: nowrap;
        margin-right: -12px;
        padding-right: 12px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .treatment-jumps ul::-webkit-scrollbar {
        display: none;
    }

    .treatment-jump {
        flex: 0 0 auto;
        padding: 0 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .treatment-dialog-body {
        gap: 16px;
        padding: 16px 16px 24px;
    }

    .treatment-dialog-photo {
        border-radius: 16px;
    }

    .treatment-dialog-intro {
        font-size: 16px;
    }

    .treatment-detail {
        padding-top: 20px;
    }

    .treatment-detail-title {
        font-size: 20px;
    }

    .treatment-detail-photos img {
        border-radius: 12px;
    }

    .treatment-dialog-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 12px 8px;
    }

    .treatment-dialog-cta {
        justify-content: space-between;
        padding-left: 20px;
    }

    .treatment-dialog-call {
        display: inline-flex;
        align-self: center;
        align-items: center;
        min-height: 44px;
    }
}
