/**
 * MCF — gallery lightbox profile button (ADJ-49)
 *
 * The button is injected as each slide's lightGallery `subHtml`, so it lands in
 * the lightbox's own caption bar (`.lg-sub-html`). Styling is scoped to
 * `.mcf-lb-profile` and overrides only the generic `.lg-sub-html a` rule from
 * uncode/library/css/style-lightgallery.css — nothing else in the lightbox is
 * touched.
 *
 * The button takes its resting colour from the caption bar it sits in
 * (`color: inherit`), so it follows whichever skin the gallery element is set to
 * with no second rule: #eee on the default dark lightbox, #222 when the element
 * is lbox_skin="white". Only the hover inverse needs the skin split — and note
 * that the skin class lands on `.lg-container`, an ANCESTOR of `.lg-outer`, so
 * the override is written the way the parent stylesheet writes its own.
 */

.lg-outer .lg-sub-html .mcf-lb-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin: 8px 0 2px;
    padding: 0.6em 1.25em;
    border: 1px solid currentColor;
    border-radius: 2em;
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* `.lg-sub-html > *:first-child` carries a !important top margin in the parent
   stylesheet; match it so a button with no caption above it isn't pushed down. */
.lg-outer .lg-sub-html > .mcf-lb-profile:first-child {
    margin-top: 2px !important;
}

.lg-outer .lg-sub-html .mcf-lb-profile:hover,
.lg-outer .lg-sub-html .mcf-lb-profile:focus {
    background-color: #fff;
    color: #111;
    text-decoration: none;
}

.lg-outer .lg-sub-html .mcf-lb-profile:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.lg-outer .lg-sub-html .mcf-lb-profile-arrow {
    font-size: 1.15em;
    line-height: 1;
    transform: translateY(-1px);
}

/* White lightbox skin (lbox_skin="white") — invert the hover. */
.lg-light-skin .lg-outer .lg-sub-html .mcf-lb-profile:hover,
.lg-light-skin .lg-outer .lg-sub-html .mcf-lb-profile:focus {
    background-color: #222;
    color: #fff;
}

@media (max-width: 480px) {
    .lg-outer .lg-sub-html .mcf-lb-profile {
        padding: 0.55em 1em;
        font-size: 11px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
 * TOOLBAR presentation — an icon beside the lightbox's own controls, with a
 * tooltip. Sizing/colour deliberately inherit `.lg-toolbar .lg-icon` so it
 * reads as one of Uncode's own buttons; only the SVG and tooltip are ours.
 * ───────────────────────────────────────────────────────────────────────── */

.lg-toolbar .mcf-lb-profile-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    opacity: 0.7;
    transition: opacity 0.2s ease-out;
}

.lg-toolbar .mcf-lb-profile-icon:hover,
.lg-toolbar .mcf-lb-profile-icon:focus {
    opacity: 1;
}

.lg-toolbar .mcf-lb-profile-icon svg {
    display: block;
    pointer-events: none;
}

/* Tooltip. `content` comes from the label PHP resolved, so it names the right
   platform ("View Landscaper Profile" / "View Licensee Profile") with no
   duplicate native title tooltip alongside it. */
.lg-toolbar .mcf-lb-profile-icon::after {
    content: attr(data-mcf-tip);
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1;
    padding: 6px 10px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-out, visibility 0.15s ease-out;
}

.lg-toolbar .mcf-lb-profile-icon:hover::after,
.lg-toolbar .mcf-lb-profile-icon:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.lg-light-skin .lg-toolbar .mcf-lb-profile-icon::after {
    background-color: rgba(255, 255, 255, 0.95);
    color: #111;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Touch devices have no hover to reveal a tooltip — the icon alone must carry
   the meaning there, so show the label inline instead. */
@media (hover: none) {
    .lg-toolbar .mcf-lb-profile-icon::after {
        position: static;
        opacity: 1;
        visibility: visible;
        padding: 0 0 0 6px;
        background: none;
        box-shadow: none;
        color: inherit;
        font-size: 10px;
    }

    .lg-toolbar .mcf-lb-profile-icon {
        width: auto;
        padding-left: 10px;
    }
}
