/**
 * TPF Memberships - frontend styles
 * Theme-agnostic. Colours come from CSS custom properties set per shortcode instance.
 */

.tpf-memberships {
    display: grid;
    gap: 24px;
    align-items: stretch;
    margin: 0 0 32px;
    box-sizing: border-box;
}

.tpf-memberships *,
.tpf-memberships *::before,
.tpf-memberships *::after {
    box-sizing: border-box;
}

.tpf-memberships--cols-1 { grid-template-columns: minmax(0, 1fr); }
.tpf-memberships--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tpf-memberships--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tpf-memberships--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Tier card */
.tpf-membership-tier {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    background: var(--tpf-card-bg, #ffffff);
    color: var(--tpf-text, #333333);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--tpf-radius, 8px);
    text-align: center;
}

.tpf-memberships--flat .tpf-membership-tier {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 24px 16px;
}

.tpf-membership-tier--highlighted {
    border-color: var(--tpf-accent, #a2a368);
    border-width: 2px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

/* Badge */
.tpf-membership-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    padding: 5px 14px;
    background: var(--tpf-accent, #a2a368);
    color: var(--tpf-button-text, #ffffff);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Name + tagline */
.tpf-membership-name {
    margin: 8px 0 6px;
    font-size: 22px;
    line-height: 1.25;
    color: inherit;
}

.tpf-membership-tagline {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
    opacity: 0.75;
}

/* Price */
.tpf-membership-price {
    margin: 0 0 20px;
    line-height: 1.1;
}

.tpf-membership-price-prefix {
    font-size: 22px;
    vertical-align: super;
}

.tpf-membership-price-amount {
    font-size: 44px;
    font-weight: 700;
}

.tpf-membership-price-suffix {
    font-size: 15px;
    opacity: 0.7;
}

/* Features */
.tpf-membership-features {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    text-align: left;
    flex-grow: 1;
}

.tpf-membership-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
}

.tpf-membership-feature-icon {
    flex-shrink: 0;
    color: var(--tpf-accent, #a2a368);
    font-weight: 700;
    line-height: 1.5;
}

.tpf-membership-feature--excluded {
    opacity: 0.45;
}

.tpf-membership-feature--excluded .tpf-membership-feature-text {
    text-decoration: line-through;
}

.tpf-membership-feature--excluded .tpf-membership-feature-icon {
    color: currentColor;
}

/* Button */
.tpf-membership-button {
    display: inline-block;
    margin-top: auto;
    padding: 14px 26px;
    background: var(--tpf-accent, #a2a368);
    color: var(--tpf-button-text, #ffffff) !important;
    border-radius: var(--tpf-radius, 8px);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    text-decoration: none !important;
    text-transform: uppercase;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tpf-membership-button:hover,
.tpf-membership-button:focus {
    opacity: 0.88;
    transform: translateY(-1px);
    color: var(--tpf-button-text, #ffffff) !important;
}

/* Responsive */
@media (max-width: 980px) {
    .tpf-memberships--cols-3,
    .tpf-memberships--cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tpf-memberships--cols-2,
    .tpf-memberships--cols-3,
    .tpf-memberships--cols-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .tpf-membership-price-amount {
        font-size: 38px;
    }
}
