/*
 * Porchfest — Profile Hub Styles
 * Scoped to .pf-hub and .pf-profile-wrap.
 *
 * Design tokens:
 *   Primary:         #00687c
 *   Primary dark:    #004e5e
 *   Background:      #fbf9f8
 *   Surface:         #ffffff
 *   Surface low:     #f5f3f3
 *   Surface mid:     #efeded
 *   Outline:         #bcc9ce
 *   Text:            #1b1c1c
 *   Text muted:      #3c494d / #6b7280
 */

/* ── Hub-page background override ────────────────────────────────────────────── */
/* Scoped to body.pf-hub-page (added by user-hub.php via body_class filter).     */
/* Does NOT affect any other page on the site.                                   */

body.pf-hub-page {
    background-color: #fbf9f8 !important;
    color: #1b1c1c !important;
}

/* Neutralise Kadence's theme wrappers that carry their own black background.
 * Kadence outputs: body.content-style-unboxed.page .site { background:#000 }
 * The .site div (#page) sits between body and our content, covering body's bg. */
body.pf-hub-page .site,
body.pf-hub-page #page,
body.pf-hub-page .content-bg,
body.pf-hub-page .site-main,
body.pf-hub-page .entry-content,
body.pf-hub-page .page-content,
body.pf-hub-page main,
body.pf-hub-page #content,
body.pf-hub-page #main,
body.pf-hub-page .content-area {
    background-color: transparent !important;
    color: inherit !important;
}

/* ── Neutralise Kadence child-theme form.acf-form overrides ───────────────────── */
/* The child theme sets width constraints and colors on form.acf-form that break  */
/* the hub layout. These rules restore our design within the hub page.            */

body.pf-hub-page form.acf-form {
    background-color: transparent !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

body.pf-hub-page form.acf-form input[type="text"],
body.pf-hub-page form.acf-form input[type="email"],
body.pf-hub-page form.acf-form input[type="tel"],
body.pf-hub-page form.acf-form input[type="number"],
body.pf-hub-page form.acf-form input[type="url"],
body.pf-hub-page form.acf-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    margin-bottom: 0 !important;
}

/* Kill Kadence child theme's blue border-color on focus (it fights our box-shadow) */
body.pf-hub-page form.acf-form input:focus,
body.pf-hub-page form.acf-form textarea:focus,
body.pf-hub-page form.acf-form select:focus {
    border: none !important;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

body.pf-hub-page form.acf-form select {
    width: auto !important;
    min-width: 180px;
    border: none !important;
    margin-bottom: 0 !important;
}

body.pf-hub-page form.acf-form input[type="submit"],
body.pf-hub-page .acf-form input[type="submit"] {
    background: linear-gradient(135deg, #004e5e, #00687c) !important;
    color: #ffffff !important;
    border: none !important;
}

/* ── Page wrapper ─────────────────────────────────────────────────────────────── */

.pf-hub {
    max-width: 1020px;
    margin: 0 auto 80px;
    padding: 0 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1b1c1c;
}

/* ── Sticky site header ───────────────────────────────────────────────────────── */

.pf-hub-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 249, 248, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    margin: 0 -24px 0;
    padding: 0 24px;
    border-bottom: 1px solid rgba(188, 201, 206, 0.35);
}

/* Offset for the WP admin bar when present */
.admin-bar .pf-hub-header { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .pf-hub-header { top: 46px; }
}

.pf-hub-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 64px;
}

.pf-hub-logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #004e5e;
    flex-shrink: 0;
    text-decoration: none;
}

/* ── Tab navigation (lives inside the sticky header) ─────────────────────────── */

.pf-hub-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.pf-hub-tabs a {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: #6c797e;
    border-radius: 100px;
    background: transparent;
    transition: color 0.15s ease, background 0.15s ease;
}

.pf-hub-tabs a:hover {
    color: #00687c;
    background: rgba(0, 104, 124, 0.07);
}

.pf-hub-tabs a.active {
    color: #004e5e;
    background: rgba(0, 104, 124, 0.1);
}

/* ── Header end: avatar ───────────────────────────────────────────────────────── */

.pf-hub-header-end {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pf-hub-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 104, 124, 0.15);
    display: block;
}

/* ── Page heading block (below sticky header) ────────────────────────────────── */

.pf-hub-page-header {
    padding: 40px 0 32px;
}

.pf-hub-page-header h1,
.pf-hub h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #1b1c1c;
    margin: 0 0 6px;
    line-height: 1.15;
}

.pf-hub-page-header p,
.pf-hub > p {
    font-size: 15px;
    font-weight: 500;
    color: #3c494d;
    margin: 0;
    line-height: 1.5;
}

/* ── Associated performer/porch info block ────────────────────────────────────── */

.pf-associated-info {
    background: #f0f7f9;
    border-left: 3px solid #00687c;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #1b1c1c;
}

.pf-associated-info p {
    margin: 0;
}

/* ── Card sections ────────────────────────────────────────────────────────────── */

.pf-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.pf-card-header {
    margin-bottom: 20px;
}

.pf-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.pf-card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em;
    color: #1b1c1c;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
}

.pf-card-desc {
    font-size: 13px;
    color: #6c797e;
    margin: 0;
    line-height: 1.5;
}

/* ── Language / section badge ─────────────────────────────────────────────────── */

.pf-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #00687c;
    background: rgba(0, 188, 223, 0.12);
    border: 1px solid rgba(0, 104, 124, 0.15);
    border-radius: 100px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Submit row ───────────────────────────────────────────────────────────────── */

.pf-form-submit {
    margin: 24px 0 48px;
}

.pf-btn-save {
    display: block !important;
    width: 100% !important;
    height: 56px;
    background: linear-gradient(135deg, #004e5e 0%, #00687c 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 20px rgba(0, 104, 124, 0.30);
    -webkit-appearance: none;
    appearance: none;
    padding: 0 32px;
    box-sizing: border-box;
}

.pf-btn-save:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 24px rgba(0, 104, 124, 0.40) !important;
}

.pf-btn-save:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* The form wrapper itself is transparent — cards provide the visual containers */
.pf-hub .acf-form {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    max-width: none !important;
}

/* Hide ACF spinner — the button press provides enough feedback */
.pf-form-submit .acf-spinner {
    display: none;
}

/* ── Field rows ───────────────────────────────────────────────────────────────── */

.pf-hub .acf-fields > .acf-field {
    border-top: 1px solid #efeded;
    padding: 18px 0;
    margin: 0;
}

.pf-hub .acf-fields > .acf-field:first-child {
    border-top: none;
    padding-top: 0;
}

/* ── Two-column grid layout for paired fields ────────────────────────────────── */

.pf-hub .acf-fields.pf-fields-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

.pf-hub .acf-fields.pf-fields-two-col > .acf-field {
    border-top: none;
    padding-top: 0;
}

.pf-hub .acf-fields.pf-fields-two-col > .acf-field + .acf-field {
    border-top: none;
}

@media (max-width: 540px) {
    .pf-hub .acf-fields.pf-fields-two-col {
        grid-template-columns: 1fr;
    }
}

/* ── Labels ───────────────────────────────────────────────────────────────────── */

.pf-hub .acf-label label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #3c494d;
    letter-spacing: -0.005em;
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pf-hub .acf-label .description {
    font-size: 12px;
    color: #6c797e;
    margin: 0 0 8px;
    font-style: normal;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Text inputs, email, tel, number, url ─────────────────────────────────────── */

.pf-hub .acf-input input[type="text"],
.pf-hub .acf-input input[type="email"],
.pf-hub .acf-input input[type="tel"],
.pf-hub .acf-input input[type="number"],
.pf-hub .acf-input input[type="url"] {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px;
    border: 1px solid #bcc9ce;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1b1c1c;
    background: #f5f3f3;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pf-hub .acf-input input[type="text"]:focus,
.pf-hub .acf-input input[type="email"]:focus,
.pf-hub .acf-input input[type="tel"]:focus,
.pf-hub .acf-input input[type="number"]:focus,
.pf-hub .acf-input input[type="url"]:focus {
    border: 1px solid #00687c !important;
    box-shadow: 0 0 0 3px rgba(0, 104, 124, 0.15) !important;
    background: #ffffff;
    outline: none !important;
}

/* ── Textarea ─────────────────────────────────────────────────────────────────── */

.pf-hub .acf-input textarea {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px;
    border: 1px solid #bcc9ce;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1b1c1c;
    background: #f5f3f3;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    resize: vertical;
    -webkit-appearance: none;
    appearance: none;
}

.pf-hub .acf-input textarea:focus {
    border: 1px solid #00687c !important;
    box-shadow: 0 0 0 3px rgba(0, 104, 124, 0.15) !important;
    background: #ffffff;
    outline: none !important;
}

/* ── Select ───────────────────────────────────────────────────────────────────── */

.pf-hub .acf-input select {
    padding: 14px 40px 14px 16px;
    border: 1px solid #bcc9ce;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1b1c1c;
    background-color: #f5f3f3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c797e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    -webkit-appearance: none;
    appearance: none;
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pf-hub .acf-input select:focus {
    border: 1px solid #00687c !important;
    box-shadow: 0 0 0 3px rgba(0, 104, 124, 0.15) !important;
    outline: none !important;
}

/* ── Select2 ──────────────────────────────────────────────────────────────────── */

.pf-hub .acf-input .select2-container .select2-selection {
    border: 1px solid #bcc9ce;
    border-radius: 12px;
    min-height: 48px;
    background: #f5f3f3;
}

.pf-hub .acf-input .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #1b1c1c;
}

.pf-hub .acf-input .select2-container--default.select2-container--focus .select2-selection {
    border-color: #00687c;
    box-shadow: 0 0 0 1px #00687c;
}

/* ── Checkboxes & radio buttons ───────────────────────────────────────────────── */

.pf-hub .acf-checkbox-list,
.pf-hub .acf-radio-list {
    margin: 0;
    padding: 0;
}

.pf-hub .acf-checkbox-list li,
.pf-hub .acf-radio-list li {
    margin-bottom: 10px;
    font-size: 15px;
    color: #1b1c1c;
    list-style: none;
}

.pf-hub .acf-checkbox-list input[type="checkbox"],
.pf-hub .acf-radio-list input[type="radio"] {
    margin-right: 8px;
    accent-color: #00687c;
    width: 17px;
    height: 17px;
    vertical-align: middle;
}

/* ── Image upload ─────────────────────────────────────────────────────────────── */

.pf-hub .acf-image-uploader .acf-button,
.pf-hub .acf-image-uploader .button {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Terms / conditions message block ────────────────────────────────────────── */

/* Tighten the gap between "Conditions" card header and the terms block */
.pf-hub .pf-card:has(.acf-field[data-key="field_pf_perf_terms_intro"]) .pf-card-header {
    margin-bottom: 4px;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] {
    background: #f0fafa;
    border: none;
    border-left: 4px solid #00687c;
    border-radius: 0 12px 12px 0;
    padding: 16px 20px !important;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] .acf-label {
    display: none;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] .acf-input {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #6c797e;
    font-style: italic;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] li {
    padding: 9px 0 9px 28px;
    border-bottom: 1px solid #daeef0;
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
    position: relative;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 9px;
    color: #00687c;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.55;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pf-hub .acf-field[data-key="field_pf_perf_terms_intro"] li strong {
    display: block;
    color: #1b1c1c;
    margin-bottom: 2px;
}

/* ── True/false checkbox (terms acceptance) ──────────────────────────────────── */

.pf-hub .acf-true-false label {
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

/* ── ACF's own submit div (hidden — we use .pf-form-submit instead) ──────────── */

.pf-hub .acf-form-submit {
    display: none;
}

/* ── Success notice ───────────────────────────────────────────────────────────── */

.pf-hub .acf-notice.-success {
    border-left: 4px solid #00687c;
    background: #f0fafa;
    border-radius: 0 12px 12px 0;
    color: #004e5e;
    font-weight: 500;
}

/* ── Section separator (when user has multiple roles) ────────────────────────── */

.pf-hub hr {
    border: none;
    border-top: 1px solid #e4e2e2;
    margin: 40px 0;
}

/* ── Schedule & share tabs: top padding + h2 ──────────────────────────────────── */

.pf-hub h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #1b1c1c;
    margin: 0 0 16px;
}

/* First element on schedule/share tabs needs breathing room below the sticky header */
.pf-hub h2:first-child {
    padding-top: 40px;
}

/* ── Mobile: collapse pf-hub padding on tiny screens ─────────────────────────── */

@media (max-width: 480px) {
    .pf-hub {
        padding: 0 16px;
    }
    .pf-hub-header {
        margin: 0 -16px 0;
        padding: 0 16px;
    }
    .pf-card {
        padding: 20px;
        border-radius: 20px;
    }
    .pf-hub-tabs a {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ── Performer / Porch sub-tabs (within profile tab) ──────────────────────────── */

.pf-profile-tabs {
    margin-bottom: 2rem;
}

.pf-ptab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #bcc9ce;
    margin-bottom: 2rem;
}

.pf-ptab-btn {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3c494d;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.pf-ptab-btn:hover {
    color: #00687c;
    text-decoration: none;
}

.pf-ptab-btn.active {
    color: #00687c;
    border-bottom-color: #00687c;
    font-weight: 600;
}

.pf-ptab-panel {
    display: none;
}

.pf-ptab-panel.active {
    display: block;
}

/* ── "My profile is complete" checkbox card ──────────────────────────────────── */

.pf-profile-complete-card {
    background: #f0f8fa;
    border: 2px solid #00687c;
}

.pf-profile-complete-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1b1c1c;
    cursor: pointer;
    padding: 4px 0;
}

.pf-profile-complete-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #00687c;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Share tab grid ──────────────────────────────────────────────────────────── */

.pf-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 24px 0 48px;
}

.pf-share-item {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px #bcc9ce;
    display: flex;
    flex-direction: column;
}

.pf-share-item img {
    width: 100%;
    height: auto;
    display: block;
    background: #f5f3f3;
}

.pf-share-item .pf-btn-download {
    display: block;
    text-align: center;
    padding: 12px 16px;
    background: #00687c;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.pf-share-item .pf-btn-download:hover {
    background: #004e5e;
    color: #ffffff;
}

.pf-share-caption {
    padding: 12px 14px 14px;
    background: #f5f3f3;
    border-top: 1px solid #e8e6e6;
}

.pf-share-caption-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin: 0 0 6px;
}

.pf-share-caption-text {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    margin: 0 0 10px;
    word-break: break-word;
}

.pf-btn-copy {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1.5px solid #00687c;
    background: #fff;
    color: #00687c;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pf-btn-copy:hover {
    background: #00687c;
    color: #fff;
}

.pf-btn-copy--done {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

/* ── Photo crop UI ────────────────────────────────────────────────────────────── */

.pf-crop-wrap {
    margin-top: 1rem;
    padding: 1rem;
    background: #f5f3f3;
    border: 1px solid #bcc9ce;
    border-radius: 12px;
    max-width: 440px;
}

.pf-crop-hint {
    font-size: 0.85rem;
    color: #3c494d;
    margin: 0 0 0.75rem;
}

.pf-crop-canvas {
    max-height: 280px;
    max-width: 100%;
    overflow: hidden;
}

.pf-crop-img {
    display: block;
    max-width: 100%;
}

.pf-crop-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.pf-crop-msg {
    font-size: 0.85rem;
    color: #c0392b;
    margin: 0.5rem 0 0;
    min-height: 1.2em;
}

.pf-crop-btn-row {
    margin-top: 0.5rem;
}

.pf-btn-adjust-crop {
    display: inline-block;
    padding: 8px 16px;
    background: #00687c;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pf-btn-adjust-crop:hover {
    background: #004e5e;
}
