/* ============================================================
   Tingler Advisory — User Profile Styling
   Drop into Template Settings → Advanced → Custom CSS
   or append to /templates/tingler_advisory/css/template.css
   ============================================================ */

/* Outer container — gives the profile breathing room */
.com-users-profile {
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
}

/* ── Edit Profile button (top-right) ── */
.com-users-profile__edit {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    display: flex;
    justify-content: flex-end;
}
.com-users-profile__edit .btn-group { display: inline-flex; }
.com-users-profile__edit .btn,
.com-users-profile__edit a.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    background: linear-gradient(135deg, var(--ta-accent), var(--ta-accent-dark));
    color: #0C0E11 !important;
    border: none;
    border-radius: 4px;
    font-family: var(--ta-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    box-shadow: 0 2px 12px rgba(200, 169, 110, 0.25);
    transition:
        opacity 200ms ease,
        transform 200ms ease,
        box-shadow 200ms ease;
}
.com-users-profile__edit .btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(200, 169, 110, 0.4);
    color: #0C0E11 !important;
}
.com-users-profile__edit .icon-user-edit {
    width: 14px;
    height: 14px;
    display: inline-block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 14.66V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.34M18 2l4 4-10 10H8v-4L18 2z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 14.66V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.34M18 2l4 4-10 10H8v-4L18 2z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}

/* ── Each profile section (fieldset) becomes a card ── */
.com-users-profile fieldset,
#users-profile-core,
#users-profile-custom,
#users-profile-custom-webauthn,
.com-users-profile__core,
.com-users-profile__params,
.com-users-profile__custom {
    position: relative;
    /* min-width: 0 + display: block on fieldset normalizes legend rendering */
    display: block;
    min-width: 0;
    padding: 1.75rem 2rem 1.5rem;
    margin: 0 0 1.5rem 0;
    background: var(--ta-bg-card);
    border: 1px solid var(--ta-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition:
        background var(--ta-dur-slow, 400ms) ease,
        border-color var(--ta-dur-slow, 400ms) ease,
        box-shadow var(--ta-dur-base, 250ms) ease;
}
.com-users-profile fieldset:hover,
#users-profile-core:hover,
#users-profile-custom:hover,
#users-profile-custom-webauthn:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* ── Fieldset legends — bypass legend HTML quirk via CSS-generated content ── */

/* Hide the real <legend> (still accessible to screen readers) */
.com-users-profile fieldset > legend,
#users-profile-core > legend,
#users-profile-custom > legend,
#users-profile-custom-webauthn > legend {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Make fieldset a flex column so ::before/::after order works */
.com-users-profile fieldset,
#users-profile-core,
#users-profile-custom,
#users-profile-custom-webauthn {
    display: flex !important;
    flex-direction: column !important;
    border-left: 3px solid var(--ta-accent) !important;
    border-image: linear-gradient(to bottom, var(--ta-accent), var(--ta-accent-dark)) 1 100% !important;
}

/* EYEBROW (::before) — small label on top */
.com-users-profile fieldset::before,
#users-profile-core::before,
#users-profile-custom::before,
#users-profile-custom-webauthn::before {
    display: block !important;
    position: static !important;
    order: -2 !important;
    margin: 0 0 0.4rem 0 !important;
    padding: 0 !important;
    font-family: var(--ta-font-mono, 'DM Mono', monospace) !important;
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--ta-accent) !important;
    background: transparent !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
}

/* MAIN TITLE (::after) — large display heading below eyebrow */
.com-users-profile fieldset::after,
#users-profile-core::after,
#users-profile-custom::after,
#users-profile-custom-webauthn::after {
    display: block !important;
    position: static !important;
    order: -1 !important;
    margin: 0 0 1.5rem 0 !important;
    padding: 0 !important;
    font-family: var(--ta-font-display, 'Playfair Display', serif) !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--ta-text-primary) !important;
    letter-spacing: -0.01em !important;
    line-height: 1.2 !important;
    background: transparent !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
}

/* Per-fieldset content: eyebrow + title */
#users-profile-core::before              { content: 'Konto' !important; }
#users-profile-core::after               { content: 'Profil' !important; }

#users-profile-custom::before            { content: 'Einstellungen' !important; }
#users-profile-custom::after             { content: 'Basiseinstellungen' !important; }

#users-profile-custom-webauthn::before   { content: 'Sicherheit' !important; }
#users-profile-custom-webauthn::after    { content: 'Passkey-Anmeldung' !important; }

/* ── Definition list (dt / dd pairs) ── */
.com-users-profile dl.dl-horizontal,
.com-users-profile dl {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
}
.com-users-profile dt,
.com-users-profile dd {
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ta-border-subtle);
    display: flex;
    align-items: center;
    min-height: 2.75rem;
}
.com-users-profile dl > dt:nth-last-of-type(1),
.com-users-profile dl > dd:nth-last-of-type(1) {
    border-bottom: none;
    padding-bottom: 0;
}
.com-users-profile dl > dt:nth-of-type(1),
.com-users-profile dl > dd:nth-of-type(1) {
    padding-top: 0;
}

.com-users-profile dt {
    font-family: var(--ta-font-mono, 'DM Mono', monospace);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ta-text-muted);
    padding-right: 1rem;
}

.com-users-profile dd {
    font-family: var(--ta-font-body, 'DM Sans', sans-serif);
    font-size: 0.95rem;
    color: var(--ta-text-primary);
    font-weight: 500;
}

/* Empty / placeholder values get muted treatment */
.com-users-profile dd:where(:not(:has(*))) {
    /* fallback: not all browsers support :has() yet */
}
/* Style "Keine Information eingegeben" subtly */
.com-users-profile dd {
    position: relative;
}

/* ── Mobile responsive ── */
@media (max-width: 640px) {
    .com-users-profile {
        max-width: 100%;
    }
    .com-users-profile fieldset,
    #users-profile-core,
    #users-profile-custom,
    #users-profile-custom-webauthn {
        padding: 1.5rem 1.25rem 1rem;
    }
    .com-users-profile dl.dl-horizontal,
    .com-users-profile dl {
        grid-template-columns: 1fr;
    }
    .com-users-profile dt {
        padding: 0.75rem 0 0.25rem;
        border-bottom: none;
        font-size: 0.65rem;
        min-height: auto;
    }
    .com-users-profile dd {
        padding: 0 0 0.875rem;
        border-bottom: 1px solid var(--ta-border-subtle);
        min-height: auto;
    }
    .com-users-profile dl > dt:nth-of-type(1) {
        padding-top: 0;
    }
    .com-users-profile__edit {
        justify-content: stretch;
    }
    .com-users-profile__edit .btn {
        width: 100%;
        justify-content: center;
    }
    .com-users-profile fieldset > legend,
    #users-profile-core > legend,
    #users-profile-custom > legend,
    #users-profile-custom-webauthn > legend {
        font-size: 1.25rem;
    }
}

/* ── Print friendly ── */
@media print {
    .com-users-profile__edit { display: none; }
    .com-users-profile fieldset {
        background: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}