/**
 * Privacy Policy Pop-Up (Help Scout 3494975367)
 * Layout follows the client's reference: header (title + revision line + ×),
 * scrolling policy, footer bar (scroll hint + green Close). Bottom sheet with a
 * full-width Close on mobile.
 *
 * Everything is scoped to .lhlic-pp / .lhlic-pp-container. Never style
 * .swal2-* on its own: the age popup (js/age-popup.js) shares SweetAlert2.
 * Colours and font are the site's own: Open Sans + #104C10 (lh26-carina.css,
 * loaded on every page), #00461c (age popup button), #D3DED7 (carina borders).
 */
.lhlic-pp-container {
    padding: 24px;
}

.lhlic-pp.swal2-popup {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title close"
        "body  body"
        "hint  actions";
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 0;
    border-radius: 12px;
    color: #231F20;
    font-family: "Open Sans", Arial, sans-serif;
    text-align: left;
    overflow: hidden;
}

/* Header and footer bars, drawn behind their grid rows. */
.lhlic-pp.swal2-popup::before,
.lhlic-pp.swal2-popup::after {
    content: "";
    grid-column: 1 / -1;
}
.lhlic-pp.swal2-popup::before {
    grid-row: 1;
    border-bottom: 1px solid #D3DED7;
}
.lhlic-pp.swal2-popup::after {
    grid-row: 3;
    border-top: 1px solid #D3DED7;
    background: #f5f5f5;
}

.lhlic-pp .lhlic-pp__title {
    grid-area: title;
    z-index: 1;
    margin: 0;
    padding: 20px 16px 16px 24px;
    color: #231F20;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
}
.lhlic-pp .lhlic-pp__revised {
    display: block;
    margin-top: 4px;
    color: #3B3B3A;
    font-size: 13px;
    font-weight: 400;
}

.lhlic-pp .lhlic-pp__x {
    grid-area: close;
    z-index: 2;
    align-self: center;
    width: 36px;
    height: 36px;
    margin: 0 20px 0 0;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: #f5f5f5;
    color: #231F20;
    font-size: 26px;
}
.lhlic-pp .lhlic-pp__x:hover {
    background: #e6efe9;
    color: #231F20;
}

/* The policy: the only part that scrolls. */
.lhlic-pp .lhlic-pp__body {
    grid-area: body;
    min-height: 0;
    max-height: 60vh;
    margin: 0;
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: #231F20;
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
}
.lhlic-pp .lhlic-pp__body h2,
.lhlic-pp .lhlic-pp__body h3,
.lhlic-pp .lhlic-pp__body h4 {
    margin: 24px 0 8px;
    color: #231F20;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}
.lhlic-pp .lhlic-pp__body p,
.lhlic-pp .lhlic-pp__body ul,
.lhlic-pp .lhlic-pp__body ol {
    margin: 0 0 12px;
}
.lhlic-pp .lhlic-pp__body ul,
.lhlic-pp .lhlic-pp__body ol {
    padding-left: 22px;
}
.lhlic-pp .lhlic-pp__body li {
    margin-bottom: 4px;
}
.lhlic-pp .lhlic-pp__body a {
    color: #104C10;
    text-decoration: underline;
    overflow-wrap: anywhere;
}
.lhlic-pp .lhlic-pp__body img {
    max-width: 100%;
    height: auto;
}
.lhlic-pp .lhlic-pp__body figure {
    margin: 0 0 16px;
}
/* Tables scroll sideways inside their own box instead of widening the pop-up. */
.lhlic-pp .lhlic-pp__body .wp-block-table {
    overflow-x: auto;
}
.lhlic-pp .lhlic-pp__body table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 14px;
}
.lhlic-pp .lhlic-pp__body th,
.lhlic-pp .lhlic-pp__body td {
    /* SweetAlert2 sets break-word on its content, which splits table words mid-word. */
    word-break: normal;
    overflow-wrap: normal;
    padding: 8px;
    border: 1px solid #D3DED7;
    text-align: left;
    vertical-align: top;
}

.lhlic-pp .lhlic-pp__footer {
    grid-area: hint;
    z-index: 1;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 14px 24px;
    border: 0;
    color: #3B3B3A;
    font-size: 13px;
    text-align: left;
}

.lhlic-pp .lhlic-pp__actions {
    grid-area: actions;
    z-index: 1;
    justify-content: flex-end;
    margin: 0;
    padding: 12px 24px 12px 0;
}
.lhlic-pp .lhlic-pp__close {
    min-width: 96px;
    padding: 10px 24px;
    border: 0;
    border-radius: 8px;
    background: #104C10;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.lhlic-pp .lhlic-pp__close:hover {
    background: #00461c;
}

.lhlic-pp .lhlic-pp__x:focus-visible,
.lhlic-pp .lhlic-pp__close:focus-visible,
.lhlic-pp .lhlic-pp__body a:focus-visible {
    outline: 3px solid #104C10;
    outline-offset: 2px;
    box-shadow: none;
}
.lhlic-pp .lhlic-pp__body:focus-visible {
    outline: 3px solid #104C10;
    outline-offset: -3px;
}

/* Link feedback while the policy loads. */
a.lhlic-pp-loading {
    cursor: progress;
    opacity: 0.6;
}

@media (max-width: 640px) {
    .lhlic-pp-container {
        padding: 8px 8px 0;
    }
    .lhlic-pp.swal2-popup {
        grid-template-areas:
            "title close"
            "body  body"
            "actions actions";
        max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px); /* mobile address bar */
        border-radius: 12px 12px 0 0;
    }
    .lhlic-pp .lhlic-pp__title {
        padding: 16px 12px 12px 16px;
        font-size: 18px;
    }
    .lhlic-pp .lhlic-pp__x {
        margin-right: 12px;
    }
    .lhlic-pp .lhlic-pp__body {
        max-height: none;
        padding: 16px;
    }
    .lhlic-pp .lhlic-pp__footer {
        display: none !important;
    }
    .lhlic-pp .lhlic-pp__actions {
        padding: 12px 16px 16px;
    }
    .lhlic-pp .lhlic-pp__close {
        width: 100%;
        padding: 14px;
    }
}

/* Narrow screens: each table row becomes a card ("Label ... value" lines)
   instead of scrolling sideways. Labels and classes come from privacy-popup.js. */
@media (max-width: 700px) {
    .lhlic-pp .lhlic-pp__body table,
    .lhlic-pp .lhlic-pp__body tbody,
    .lhlic-pp .lhlic-pp__body tr,
    .lhlic-pp .lhlic-pp__body th,
    .lhlic-pp .lhlic-pp__body td {
        display: block;
        width: auto;
        border: 0;
    }
    .lhlic-pp .lhlic-pp__body thead,
    .lhlic-pp .lhlic-pp__body .lhlic-pp-headrow {
        display: none;
    }
    .lhlic-pp .lhlic-pp__body tr {
        margin-bottom: 8px;
        border: 1px solid #D3DED7;
        border-radius: 6px;
    }
    .lhlic-pp .lhlic-pp__body .lhlic-pp-rowhead {
        background: #e6efe9;
        font-weight: 700;
    }
    .lhlic-pp .lhlic-pp__body td[data-label] {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-top: 1px solid #D3DED7;
    }
    .lhlic-pp .lhlic-pp__body td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
    }
}
