/* ================================================================== */
/*  Plugin Footer — Frontend Styles                                   */
/* ================================================================== */

/* ---------- Footer Container ------------------------------------ */
.pf-footer {
    background-color: var(--pf-bg, #1a1a2e);
    display: block;
    width: var(--pf-bg-width, 100%);
    max-width: min(var(--pf-bg-max-width, 100%), calc(100% - (var(--pf-margin, 0px) * 2)));
    margin: 0;
    margin-bottom: 0 !important;
    padding: var(--pf-padding, 40px);
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .pf-footer {
        margin-right: var(--pf-margin, 0);
        margin-left: var(--pf-margin, 0);
    }
}

/* ---------- Grid Inner ------------------------------------------ */
.pf-footer-inner {
    display: grid;
    grid-template-columns: repeat(var(--pf-cols, 3), 1fr);
    grid-auto-rows: auto;
    gap: var(--pf-gap, 20px);
    width: 100%;
    max-width: 100%;
}

.pf-footer-mobile-inner {
    display: none;
}

/* ---------- Grid Item ------------------------------------------- */
.pf-grid-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ---------- Link inside grid item ------------------------------- */
.pf-item-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    padding: 4px 8px;
    /* Added padding for background hover */
    margin: -4px -8px;
    /* Offset padding to avoid pushing layout */
    border-radius: 4px;
}

.pf-item-link:hover {
    color: var(--pf-hover-color, inherit) !important;
    background-color: var(--pf-hover-bg, transparent);
}

/* ---------- Text Content ---------------------------------------- */
.pf-text-content {
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: normal;
}

.pf-item-text,
.pf-item-text .pf-item-link,
.pf-item-text .pf-text-content {
    max-width: none;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

/* ---------- Icon Content ---------------------------------------- */
.pf-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pf-item-icon {
    min-width: max-content;
}

.pf-item-icon .pf-icon img,
.pf-item-icon .pf-icon svg {
    max-width: none;
    height: auto;
}

/* ---------- HTML Content ---------------------------------------- */
.pf-html-content {
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: normal;
}

.pf-html-content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
    margin: -2px -4px;
}

.pf-html-content a:hover {
    color: var(--pf-hover-color, inherit) !important;
    background-color: var(--pf-hover-bg, transparent);
    text-decoration: none;
}

.pf-html-content ul,
.pf-html-content ol {
    margin: 0;
    padding-left: 1.2em;
}

.pf-html-content li {
    margin-bottom: 4px;
}

.pf-html-content img {
    max-width: 100%;
    height: auto;
}

/* ---------- Responsive ------------------------------------------ */
@media (max-width: 768px) {
    .pf-footer-inner {
        display: none;
    }

    .pf-footer-mobile-inner {
        display: flex;
        gap: 24px;
        align-items: flex-start;
        width: 100%;
        max-width: 100%;
    }

    .pf-footer-mobile-column {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        gap: 24px;
        min-width: 0;
    }

    .pf-footer-mobile-column:empty {
        display: none;
    }

    .pf-grid-item {
        text-align: left !important;
        justify-self: stretch !important;
        align-self: start !important;
        width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .pf-item-link,
    .pf-text-content,
    .pf-html-content {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .pf-item-text,
    .pf-item-text .pf-item-link,
    .pf-item-text .pf-text-content {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .pf-footer {
        width: var(--pf-bg-width, 100%);
        max-width: calc(100% - (var(--pf-mobile-margin, 0px) * 2));
        margin: 0 !important;
        margin-right: var(--pf-mobile-margin, 0px) !important;
        margin-left: var(--pf-mobile-margin, 0px) !important;
        padding: 40px 24px 28px;
    }

    .pf-icon img {
        max-width: 200px !important;
        height: auto !important;
    }

    .pf-text-content,
    .pf-html-content {
        line-height: 1.65;
    }

    .pf-html-content h1,
    .pf-html-content h2,
    .pf-html-content h3,
    .pf-html-content h4,
    .pf-html-content h5,
    .pf-html-content h6,
    .pf-html-content strong {
        color: inherit;
        font-size: 1em;
        font-weight: 700;
        line-height: 1.35;
        margin: 0 0 8px;
    }

    .pf-html-content p {
        margin: 0 0 18px;
    }

    .pf-html-content ul,
    .pf-html-content ol {
        list-style: none;
        margin: 0;
        padding-left: 0;
    }

    .pf-html-content li {
        margin-bottom: 6px;
    }

    .pf-html-content a {
        display: inline-block;
        text-decoration: none;
        padding: 0;
        margin: 0;
    }
}