/* ==========================================================================
   SCCI Membership Directory — theme-match override for style-mem.css
   Scope: only known plugin selectors (.member-s, #print, .print-card, etc.)
   and :has()-scoped structural targets. Nothing here touches theme-owned
   selectors (.scci-footer-*, .scci-member-wrapper, .scci-directory-search,
   .scci-renewal-box, .searchform) — those already match your theme.
   ========================================================================== */

:root {
    --scciplg-blue:        #1535a0;
    --scciplg-blue-dark:   #0e2580;
    --scciplg-navy:        #1B2856;
    --scciplg-navy-2:      #212C6A;
    --scciplg-deep-navy:   #111c45;
    --scciplg-bg-dark:     #0f1a3e;
    --scciplg-border:      rgba(255,255,255,0.10);
    --scciplg-text-dim:    rgba(255,255,255,0.72);
    --scciplg-white:       #ffffff;
    --scciplg-black:       #000000;
    --scciplg-radius-sm:   6px;
    --scciplg-radius-md:   10px;
    --scciplg-radius-lg:   14px;
    --scciplg-font-head:   'Playfair Display', Georgia, serif;
    --scciplg-font-body:   'DM Sans', 'Raleway', 'Inter', sans-serif;
}

/* ──────────────────────────────────────────────────────────────
   1. Search bar — [member-search] shortcode's own form
   (guaranteed markup: <form><div class="member-s">…</div></form>)
   Distinct from the home page's .searchform, which your theme
   file already styles.
   ────────────────────────────────────────────────────────────── */
body form .member-s {
    display: flex;
    gap: 0;
    max-width: 640px;
    margin: 0 auto 8px auto;
}

body form .member-s input[type="text"] {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    padding: 0 18px !important;
    background: var(--scciplg-white);
    border: 1px solid rgba(27,40,86,0.25);
    border-right: none;
    border-radius: var(--scciplg-radius-sm) 0 0 var(--scciplg-radius-sm);
    color: var(--scciplg-deep-navy);
    font-family: var(--scciplg-font-body);
    font-size: 15px;
    outline: none;
    transform: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
body form .member-s input[type="text"]::placeholder {
    color: rgba(27,40,86,0.45);
}
body form .member-s input[type="text"]:focus {
    border-color: var(--scciplg-blue);
    box-shadow: 0 0 0 3px rgba(21,53,160,0.12);
}

/* Search button — matches View/Print navy */
body form .member-s button[type="submit"] {
    width: auto !important;
    height: 48px;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 30px;
    background: var(--scciplg-navy) !important;
    color: var(--scciplg-white);
    border: 1px solid var(--scciplg-navy);
    border-radius: 0 var(--scciplg-radius-sm) var(--scciplg-radius-sm) 0;
    font-family: var(--scciplg-font-body);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
body form .member-s button[type="submit"]:hover {
    background: var(--scciplg-blue-dark) !important;
    border-color: var(--scciplg-blue-dark) !important;
}
body form .member-s button[type="submit"]:focus-visible {
    outline: 2px solid var(--scciplg-blue-dark);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    body form .member-s {
        flex-direction: column;
        gap: 8px;
    }
    body form .member-s input[type="text"] {
        width: 100% !important;
        border-right: 1px solid rgba(27,40,86,0.25);
        border-radius: var(--scciplg-radius-sm);
    }
    body form .member-s button[type="submit"] {
        width: 100% !important;
        border-radius: var(--scciplg-radius-sm);
        padding: 13px 24px;
        justify-content: center;
    }
}

/* ──────────────────────────────────────────────────────────────
   2. Search results table — output directly after the .member-s
   form with no wrapping class. Scoped via :has() so it only ever
   matches that specific table, not any other table on the page.
   ────────────────────────────────────────────────────────────── */
body form:has(> .member-s) + table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    margin: 20px auto 0 auto;
    font-family: var(--scciplg-font-body);
    border-radius: var(--scciplg-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px -18px rgba(11,15,40,0.35);
    border: 1px solid rgba(27,40,86,0.12);
}

body form:has(> .member-s) + table thead {
    background: var(--scciplg-navy);
}
body form:has(> .member-s) + table thead th {
    color: var(--scciplg-white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 14px 16px;
    text-align: left;
    border: none;
}

body form:has(> .member-s) + table tbody tr {
    background: var(--scciplg-white);
    border-bottom: 1px solid rgba(27,40,86,0.10);
    transition: background 0.18s ease;
}
body form:has(> .member-s) + table tbody tr:nth-child(even) {
    background: #f5f6fb;
}
body form:has(> .member-s) + table tbody tr:hover {
    background: rgba(21,53,160,0.06);
}
body form:has(> .member-s) + table tbody td {
    padding: 13px 16px;
    color: var(--scciplg-deep-navy);
    font-size: 14px;
    text-align: left;
}

/* View button — navy, matches Search/Print */
body form:has(> .member-s) + table tbody td a button {
    background: var(--scciplg-navy) !important;
    color: var(--scciplg-white);
    border: 1px solid var(--scciplg-navy) !important;
    border-radius: var(--scciplg-radius-sm);
    padding: 8px 20px;
    font-family: var(--scciplg-font-body);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
body form:has(> .member-s) + table tbody td a button:hover {
    background: var(--scciplg-blue-dark) !important;
    border-color: var(--scciplg-blue-dark) !important;
    transform: translateY(-1px);
}

/* Mobile: stacked cards with visible labels (flex-based — reliable stacking) */
@media (max-width: 600px) {
    body form:has(> .member-s) + table thead {
        display: none;
    }
    body form:has(> .member-s) + table {
        border: none;
        box-shadow: none;
        background: transparent;
    }
    body form:has(> .member-s) + table,
    body form:has(> .member-s) + table tbody,
    body form:has(> .member-s) + table tr,
    body form:has(> .member-s) + table td {
        display: block;
        width: 100%;
    }
    body form:has(> .member-s) + table tr {
        margin-bottom: 14px;
        background: var(--scciplg-white);
        border: 1px solid rgba(27,40,86,0.12);
        border-radius: var(--scciplg-radius-md);
        overflow: hidden;
        box-shadow: 0 6px 18px -12px rgba(11,15,40,0.25);
    }
    body form:has(> .member-s) + table td {
        display: flex;
        flex-direction: column;
        gap: 3px;
        text-align: left;
        padding: 10px 16px;
        border-bottom: 1px solid rgba(27,40,86,0.08);
    }
    body form:has(> .member-s) + table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(17,28,69,0.5);
    }
    body form:has(> .member-s) + table td:last-child {
        border-bottom: none;
        text-align: center;
        padding: 14px 16px;
    }
    body form:has(> .member-s) + table td:last-child::before {
        content: none;
    }
    body form:has(> .member-s) + table td a button {
        width: 100%;
    }
}

/* ──────────────────────────────────────────────────────────────
   3. Member detail card — [member-detail] shortcode output
   (guaranteed markup: <div id="print"> … </div>, ID-scoped, safe)
   ────────────────────────────────────────────────────────────── */
body div:has(> #print) {
    max-width: 900px;
    margin: 24px auto;
}

/* Print button — navy, matches Search/View */
body div:has(> #print) > button {
    background: var(--scciplg-navy) !important;
    color: var(--scciplg-white);
    border: 1px solid var(--scciplg-navy) !important;
    border-radius: var(--scciplg-radius-sm);
    height: 40px;
    box-sizing: border-box;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
    font-family: var(--scciplg-font-body);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 16px -6px rgba(14,37,128,0.5);
    margin: 15px;
}
body div:has(> #print) > button:hover {
    background: var(--scciplg-blue-dark) !important;
    border-color: var(--scciplg-blue-dark) !important;
    transform: translateY(-2px);
}

body #print {
    background: var(--scciplg-white);
    border: 1px solid rgba(27,40,86,0.12);
    border-radius: var(--scciplg-radius-lg);
    padding: 32px;
    margin-top: 16px;
    box-shadow: 0 10px 30px -18px rgba(11,15,40,0.35);
}
body #print h1 {
    font-family: var(--scciplg-font-head);
    color: var(--scciplg-navy);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 0;
    width: auto;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(21,53,160,0.15);
}

body #print table {
    width: 100%;
    border: none;
    border-collapse: collapse;
    table-layout: auto;
}
body #print table tr {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(27,40,86,0.08);
}
body #print table tr:last-child {
    border-bottom: none;
}
body #print table td {
    padding: 12px 10px;
    text-align: left;
    font-family: var(--scciplg-font-body);
    font-size: 14px;
    color: var(--scciplg-deep-navy);
    border: none;
}
body #print table td:first-child {
    width: 220px;
    color: rgba(17,28,69,0.55);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    vertical-align: middle;
}

@media (max-width: 600px) {
    body #print { padding: 20px; }
    body #print h1 { font-size: 22px; }
    body #print table td:first-child {
        width: auto;
        display: block;
        padding-bottom: 2px;
    }
    body #print table td:last-child {
        display: block;
        padding-top: 0;
    }
}

/* ──────────────────────────────────────────────────────────────
   4. Admin "Print Members" output (.print-card) — class-scoped,
   only affects the plugin's own generated print cards.
   ────────────────────────────────────────────────────────────── */
body .print-card {
    background: var(--scciplg-white);
    border: 1px solid rgba(27,40,86,0.12);
    border-radius: var(--scciplg-radius-md);
    padding: 24px;
    margin-bottom: 20px;
    font-family: var(--scciplg-font-body);
}
body .print-card h1 {
    font-family: var(--scciplg-font-head);
    color: var(--scciplg-navy);
    font-size: 22px;
    margin: 0 0 16px 0;
    width: auto;
}
body .print-card table td {
    padding: 10px 8px;
    color: var(--scciplg-deep-navy);
    border: none;
    border-bottom: 1px solid rgba(27,40,86,0.08);
}

/* ──────────────────────────────────────────────────────────────
   5. Misc ID/class-scoped plugin elements (already unique enough
   to be safe to restyle without touching theme layout)
   ────────────────────────────────────────────────────────────── */
body #btn_print,
body .btn_print {
    background: var(--scciplg-navy);
    color: var(--scciplg-white);
    border: 1px solid var(--scciplg-navy);
    border-radius: var(--scciplg-radius-sm);
    font-family: var(--scciplg-font-body);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.2s;
}
body #btn_print:hover,
body .btn_print:hover {
    background: var(--scciplg-blue-dark);
}

body .btn-cross {
    background: #b3261e;
    border-radius: var(--scciplg-radius-sm);
}

body #view_d_mem_list {
    border: 1px solid rgba(27,40,86,0.15);
    border-radius: var(--scciplg-radius-sm);
    background: var(--scciplg-white);
    color: var(--scciplg-deep-navy);
    font-family: var(--scciplg-font-body);
}