/**
 * Custom Features module - frontend styles.
 * Minimalist FisherKlima-inspired layout.
 *
 * - Category title: bold, uppercase, customizable color & size
 * - Underline below category in same color, full width
 * - Feature name (left): bold, theme color
 * - Feature value (right): regular weight, customizable color
 * - Subtle separator between rows
 *
 * All rules scoped under .customfeatures-wrapper so the rest of the theme is untouched.
 */

.customfeatures-wrapper {
    /* Defaults — overridden inline by PHP-rendered <style> block */
    --cf-cat-color: #4a5568;
    --cf-border-color: #4a5568;
    --cf-val-color: #1a202c;
    --cf-cat-size: 22px;
    --cf-val-size: 14px;

    width: 100%;
    color: inherit;
    font-family: inherit;
    line-height: 1.55;
}

/* ---------- Category section ---------- */

.customfeatures-wrapper .cf-group {
    margin: 0 0 1rem 0;
    padding: 0;
}

.customfeatures-wrapper .cf-group:last-child {
    margin-bottom: 0;
}

.customfeatures-wrapper .cf-group-title {
    margin: 0;
    padding: 0 0 0.5rem 0;
    font-size: var(--cf-cat-size);
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--cf-cat-color);
    background: #fff0;
    border: 0;
    border-bottom: 2px solid var(--cf-border-color);
}

.customfeatures-wrapper .cf-group-desc {
    margin: 0 0 0.75rem 0;
    font-size: 0.92em;
    opacity: 0.8;
}

/* ---------- Feature list ---------- */

.customfeatures-wrapper .cf-feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: block;
}

.customfeatures-wrapper .cf-feature-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    margin: 0;
    font-size: var(--cf-val-size);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.customfeatures-wrapper .cf-feature-row:first-child {
    border-top: 0;
}

/* Feature name (left side): bold */
.customfeatures-wrapper .cf-feature-name {
    flex: 1 1 60%;
    margin: 0;
    padding: 0;
    font-weight: 600;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Feature value (right side): regular, customizable color */
.customfeatures-wrapper .cf-feature-value {
    flex: 0 1 40%;
    margin: 0;
    padding: 0;
    text-align: right;
    font-weight: 400;
    color: var(--cf-val-color);
}

/* ---------- Tooltip ---------- */

.customfeatures-wrapper .cf-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.customfeatures-wrapper .cf-tooltip:hover,
.customfeatures-wrapper .cf-tooltip:focus {
    opacity: 1;
    outline: none;
}

.customfeatures-wrapper .cf-tooltip-icon {
    flex-shrink: 0;
}

.customfeatures-wrapper .cf-tooltip-text {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.82em;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

.customfeatures-wrapper .cf-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
}

.customfeatures-wrapper .cf-tooltip:hover .cf-tooltip-text,
.customfeatures-wrapper .cf-tooltip:focus .cf-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ---------- Mobile (≤ 600px) ---------- */

@media (max-width: 600px) {
    .customfeatures-wrapper .cf-group {
        margin-bottom: 1.5rem;
    }

    .customfeatures-wrapper .cf-group-title {
        /* On mobile, scale category title down a bit if it would overflow */
        font-size: calc(var(--cf-cat-size) * 0.85);
    }

    .customfeatures-wrapper .cf-feature-row {
        padding: 0.3rem 0;
        gap: 0.6rem;
    }

    .customfeatures-wrapper .cf-feature-name,
    .customfeatures-wrapper .cf-feature-value {
        font-size: 0.95em;
    }

    /* Allow long values to wrap on narrow screens */
    .customfeatures-wrapper .cf-feature-value {
        word-break: break-word;
    }

    /* Tooltip: full-width on mobile */
    .customfeatures-wrapper .cf-tooltip-text {
        max-width: 90vw;
    }
}
