/* =============================================================
   Catholic Organizer — Mobile-Responsive Stylesheet
   Drop this file into: assets/css/organizer-mobile.css
   Then enqueue it in catholic-organizer.php (see instructions
   at the bottom of this file).
   ============================================================= */

/* ── 1. CONTAINER ─────────────────────────────────────────── */
.catholic-organizer-container {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 40px !important;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ── 2. META BAR (Parish / Role row) ─────────────────────── */
.organizer-meta {
    margin-bottom: 25px;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ── 3. TAB NAV ───────────────────────────────────────────── */
.organizer-tabs-nav {
    border-bottom: 2px solid #006699;
    margin-bottom: 0;
}

.organizer-tabs-nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;          /* allows wrapping on small screens */
}

.organizer-tabs-nav li {
    margin: 0 !important;
    padding: 0 !important;
}

.organizer-tabs-nav a {
    display: block;
    padding: 10px 16px;       /* slightly tighter than 12px 20px */
    border-radius: 4px 4px 0 0;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.organizer-tabs-nav a.tab-active {
    background: #006699 !important;
    color: #fff !important;
}

.organizer-tabs-nav a.tab-inactive {
    background: #f1f1f1 !important;
    color: #333 !important;
}

.organizer-tabs-nav a.tab-inactive:hover {
    background: #dde8f0 !important;
    color: #006699 !important;
}

/* ── 4. TAB CONTENT PANEL ────────────────────────────────── */
.organizer-tab-content {
    padding: 25px;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* ── 5. HOME — sub-tab nav (Announcements / Discussions) ─── */
.organizer-subtab-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.organizer-subtab-nav a {
    padding: 10px 18px;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #ccc;
    border-bottom: none;
    white-space: nowrap;
}

/* ── 6. HOME — discussion filter tag row ─────────────────── */
.organizer-tag-filters {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
}

.organizer-tag-filters a {
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ccc;
    white-space: nowrap;
}

/* Discussion action bar (button + filters) */
.organizer-discussion-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* ── 7. HOME — new discussion form ───────────────────────── */
/* Title + Tag row */
.organizer-discussion-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.organizer-discussion-form-row .field-title {
    flex: 3;
}

.organizer-discussion-form-row .field-tag {
    flex: 1;
    min-width: 130px;
}

/* ── 8. FILES — upload form row ──────────────────────────── */
.organizer-file-upload-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.organizer-file-upload-row .field-file {
    flex: 2;
    min-width: 200px;
}

.organizer-file-upload-row .field-desc {
    flex: 3;
    min-width: 200px;
}

/* Files grid */
.organizer-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* ── 9. BOOKMARKS grid ────────────────────────────────────── */
.organizer-bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* ── 10. MEDIA PICKER MODAL ──────────────────────────────── */
.organizer-media-modal-content {
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
}

/* ── 11. DISCUSSION THREAD — header meta row ─────────────── */
.organizer-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── 12. GENERAL FORM INPUTS ─────────────────────────────── */
.organizer-input,
.organizer-select,
.organizer-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 15px;
    font-family: inherit;
}

/* ── 13. ACTION BUTTON ROW ───────────────────────────────── */
.organizer-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── 14. CALENDAR — toolbar (Add Event + view toggles) ───── */
.organizer-calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.organizer-btn-add {
    background: #28a745;
    color: #fff;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
}

.organizer-view-toggles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.organizer-toggle-btn {
    border: 1px solid #006699;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.organizer-toggle-active {
    background: #006699;
    color: #fff;
}

.organizer-toggle-inactive {
    background: #fff;
    color: #006699;
}

/* ── 15. CALENDAR — event form 2-column rows ──────────────── */
.organizer-form-row-2col {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.organizer-form-col {
    flex: 1;
    min-width: 0;
}

/* ── 16. CALENDAR — event list item meta row ──────────────── */
.organizer-event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ── 17. CONTACTS — pill sub-tab nav ─────────────────────── */
.organizer-contacts-subnav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
    align-items: center;
}

.organizer-pill-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s;
}

.pill-active {
    background: #006699;
    color: #fff !important;
}

.pill-inactive {
    background: #eef0f2;
    color: #333 !important;
}

.pill-inactive:hover {
    background: #dde8f0;
    color: #006699 !important;
}

/* Privacy box wrapper — dashed border around both privacy selects */
.organizer-privacy-box {
    padding: 15px;
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 6px;
    margin-bottom: 15px;
}
.organizer-name-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.organizer-name-prefix { flex: 1; min-width: 0; }
.organizer-name-first  { flex: 2; min-width: 0; }
.organizer-name-last   { flex: 2; min-width: 0; }

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ─
   MOBILE BREAKPOINTS
   ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

/* ── Tablet: ≤ 768px ─────────────────────────────────────── */
@media (max-width: 768px) {

    .catholic-organizer-container {
        padding: 20px !important;
    }

    .organizer-tab-content {
        padding: 18px;
    }

    .organizer-tabs-nav a {
        padding: 9px 13px;
        font-size: 13px;
    }

    .organizer-bookmarks-grid {
        grid-template-columns: 1fr;
    }

    .organizer-discussion-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .organizer-discussion-form-row .field-tag {
        min-width: unset;
    }

    .organizer-thread-header {
        flex-direction: column;
    }

    /* Calendar: hide grid view on tablet too — list is better at this width */
    .organizer-grid-toggle,
    .organizer-calendar-grid-view {
        display: none !important;
    }

    /* Calendar toolbar: stack button above toggles */
    .organizer-calendar-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Calendar form: date/time 2-col rows stack */
    .organizer-form-row-2col {
        flex-direction: column;
        gap: 10px;
    }

    /* Contacts: pill nav wraps naturally (already flex-wrap) */
    .organizer-contacts-subnav {
        gap: 6px;
    }

    /* Contacts name row: stack prefix above first+last */
    .organizer-name-row {
        flex-wrap: wrap;
    }

    .organizer-name-prefix {
        flex: 0 0 100%;  /* full width on its own line */
    }
}

/* ── Mobile: ≤ 480px ─────────────────────────────────────── */
@media (max-width: 480px) {

    .catholic-organizer-container {
        padding: 12px !important;
    }

    /* Page title */
    .catholic-organizer-container .entry-title {
        font-size: 1.6em !important;
    }

    /* Tab nav — each tab expands to fill a row of two */
    .organizer-tabs-nav ul {
        gap: 3px;
    }

    .organizer-tabs-nav li {
        flex: 1 1 calc(33% - 3px); /* 3 tabs per row */
        min-width: 0;
    }

    .organizer-tabs-nav a {
        padding: 9px 6px;
        font-size: 12px;
        text-align: center;
        border-radius: 4px 4px 0 0;
    }

    .organizer-tab-content {
        padding: 14px;
    }

    /* Sub-tab nav */
    .organizer-subtab-nav {
        flex-direction: column;
        gap: 0;
        border-bottom: none;
    }

    .organizer-subtab-nav a {
        border-radius: 4px;
        margin-bottom: 4px;
        border: 1px solid #ccc;
    }

    /* Discussion toolbar: stack button above filters */
    .organizer-discussion-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Tag filters: allow to wrap freely */
    .organizer-tag-filters {
        gap: 4px;
    }

    .organizer-tag-filters a {
        font-size: 12px;
        padding: 3px 8px;
    }

    /* Files upload row: fully stacked */
    .organizer-file-upload-row {
        flex-direction: column;
        gap: 8px;
    }

    .organizer-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    /* Bookmarks */
    .organizer-bookmarks-grid {
        grid-template-columns: 1fr;
    }

    /* Action bars */
    .organizer-action-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Media picker modal — full-screen on mobile */
    .organizer-media-modal-content {
        width: 95% !important;
        max-height: 90vh !important;
    }

    /* Calendar: hide grid toggle button and grid view entirely on mobile */
    .organizer-grid-toggle,
    .organizer-calendar-grid-view {
        display: none !important;
    }

    /* Discussion thread header */
    .organizer-thread-header {
        flex-direction: column;
    }

    /* Calendar toolbar: fully stacked, add-button full width */
    .organizer-calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .organizer-btn-add {
        text-align: center;
    }

    .organizer-view-toggles {
        justify-content: center;
    }

    /* Calendar form: date/time rows stack */
    .organizer-form-row-2col {
        flex-direction: column;
        gap: 8px;
    }

    /* Calendar event list meta: each item on its own line */
    .organizer-event-meta-row {
        flex-direction: column;
        gap: 4px;
    }

    /* Home tag filters: ~3 per row so they wrap onto 2 lines nicely */
    .organizer-tag-filters a {
        flex: 1 1 calc(33% - 5px);
        text-align: center;
        min-width: 80px;
    }

    /* Contacts pill nav: 2 per row (3rd wraps underneath) */
    .organizer-pill-btn {
        display: inline-block;
        flex: 1 1 calc(50% - 6px);
        text-align: center;
        min-width: 100px;
        box-sizing: border-box;
    }

    /* Contacts name row: fully stacked */
    .organizer-name-row {
        flex-direction: column;
        gap: 8px;
    }

    .organizer-name-prefix,
    .organizer-name-first,
    .organizer-name-last {
        flex: 0 0 100%;
    }

    /* Reply form textarea */
    .organizer-reply-textarea {
        font-size: 16px; /* prevents iOS zoom-on-focus */
    }

    /* General inputs — prevent iOS auto-zoom (font must be ≥16px) */
    input[type="text"],
    input[type="url"],
    input[type="email"],
    input[type="file"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* =============================================================
   HOW TO ENQUEUE THIS FILE
   Add this to catholic-organizer.php inside
   catholic_organizer_enqueue_scripts():

   wp_enqueue_style(
       'catholic-organizer-mobile',
       plugin_dir_url( __FILE__ ) . 'assets/css/organizer-mobile.css',
       array(),
       '1.0'
   );
   ============================================================= */

/* =============================================================
   PARISH DIRECTORY
   ============================================================= */

.co-directory-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Notices ─────────────────────────────────────────────── */
.co-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}
.co-notice-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.co-notice-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.co-notice-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ── Back link ───────────────────────────────────────────── */
.co-back-link {
    display: inline-block;
    color: #006699;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
}
.co-back-link:hover { text-decoration: underline; }

/* ── Search header ───────────────────────────────────────── */
.co-directory-title    { font-size: 26px; margin-bottom: 6px; color: #222; }
.co-directory-subtitle { font-size: 15px; color: #666; margin-bottom: 25px; }

/* ── Search form ─────────────────────────────────────────── */
.co-search-form {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.co-search-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.co-search-field { display: flex; flex-direction: column; gap: 5px; }
.co-search-field label { font-weight: bold; font-size: 13px; color: #444; }

.co-search-zip   { flex: 1; min-width: 110px; }
.co-search-city  { flex: 2; min-width: 150px; }
.co-search-state { flex: 1; min-width: 70px; }

.co-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.co-search-input:focus { border-color: #006699; outline: none; box-shadow: 0 0 0 2px rgba(0,102,153,0.15); }

.co-search-divider {
    font-size: 13px;
    color: #999;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.co-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    text-align: center;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.co-btn:hover { opacity: 0.88; }

.co-btn-primary   { background: #006699; color: #fff; }
.co-btn-secondary { background: #eef0f2; color: #333; border: 1px solid #ccc; }
.co-btn-success   { background: #28a745; color: #fff; }
.co-btn-full      { display: block; width: 100%; box-sizing: border-box; padding: 12px; font-size: 15px; }

.co-search-btn { flex-shrink: 0; padding: 9px 22px; }

/* ── Results header ──────────────────────────────────────── */
.co-results-header { margin-bottom: 15px; font-size: 15px; color: #444; }

/* ── Parish list ─────────────────────────────────────────── */
.co-parish-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }

.co-parish-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #006699;
    border-radius: 6px;
    padding: 18px 20px;
    transition: box-shadow 0.15s;
}
.co-parish-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.08); }

.co-parish-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.co-parish-card-info { flex: 1; min-width: 0; }

.co-parish-name    { margin: 0 0 5px 0; font-size: 18px; color: #222; }
.co-parish-address { font-size: 14px; color: #666; margin-bottom: 5px; }

.co-parish-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ── Badges ──────────────────────────────────────────────── */
.co-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}
.co-badge-pending { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.co-badge-active  { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ── "Don't see your parish" box ─────────────────────────── */
.co-not-found-box {
    background: #f0f7ff;
    border: 1px solid #b8d9f0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-top: 20px;
}
.co-not-found-box p { margin: 0 0 8px 0; }

/* ── Parish detail header ────────────────────────────────── */
.co-parish-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.co-parish-contact-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #555;
    margin-top: 8px;
}
.co-parish-contact-row a { color: #006699; }

.co-section-title { font-size: 18px; color: #333; margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px; }

/* ── Groups grid ─────────────────────────────────────────── */
.co-groups-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
    gap: 18px;
    margin-bottom: 25px;
}

.co-group-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.co-group-thumb img { width: 100%; height: 140px; object-fit: cover; display: block; }

.co-group-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.co-group-name { margin: 0 0 8px 0; font-size: 16px; color: #222; }
.co-group-desc { font-size: 13px; color: #666; line-height: 1.5; flex: 1; margin-bottom: 12px; }
.co-group-meta { font-size: 13px; color: #888; margin-bottom: 12px; }

/* ── Empty state ─────────────────────────────────────────── */
.co-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* ── Add parish confirm box ──────────────────────────────── */
.co-section-box {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 25px;
}

.co-confirm-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.co-confirm-note {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #fffbea;
    border-left: 3px solid #f0ad00;
    border-radius: 0 4px 4px 0;
}

.co-confirm-field { margin-bottom: 14px; }
.co-confirm-field label { display: block; font-weight: bold; font-size: 13px; margin-bottom: 4px; color: #444; }

.co-readonly-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #e9ecef;
    color: #495057;
    cursor: not-allowed;
    box-sizing: border-box;
    font-size: 14px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .co-search-row { flex-direction: column; gap: 10px; }
    .co-search-zip,
    .co-search-city,
    .co-search-state { flex: 1 1 100%; }
    .co-search-divider { display: none; }
    .co-search-btn { width: 100%; }

    .co-parish-card-body { flex-direction: column; align-items: flex-start; }
    .co-parish-card-body .co-btn { width: 100%; box-sizing: border-box; text-align: center; }

    .co-parish-header { flex-direction: column; }
    .co-groups-grid { grid-template-columns: 1fr; }

    .co-directory-title { font-size: 20px; }
}

/* ── Verified users display ──────────────────────────────── */
.co-verified-users {
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px 18px;
    margin-bottom: 20px;
}

.co-verified-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #155724;
    font-weight: bold;
}

.co-verified-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.co-verified-badge {
    background: #fff;
    border: 1px solid #c3e6cb;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #333;
}

/* ── Create group box ────────────────────────────────────── */
.co-create-group-box {
    background: #e8f4fd;
    border: 1px solid #b8d9f0;
    border-radius: 8px;
    padding: 18px 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.co-create-group-box p { margin: 0; font-size: 15px; }

@media (max-width: 600px) {
    .co-create-group-box { flex-direction: column; align-items: flex-start; }
    .co-create-group-box .co-btn { width: 100%; text-align: center; box-sizing: border-box; }
    .co-verified-list { flex-direction: column; }
}

/* =============================================================
   MY GROUPS PAGE
   ============================================================= */

.co-my-groups-wrap  { max-width: 900px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.co-create-group-wrap { max-width: 700px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ── Page header row ─────────────────────────────────────── */
.co-my-groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.co-my-groups-title {
    font-size: 26px;
    margin: 0;
    color: #222;
}

/* ── Empty state ─────────────────────────────────────────── */
.co-empty-groups-wrap { max-width: 860px; }

.co-empty-groups-msg {
    text-align: center;
    padding: 30px 20px 10px;
    color: #555;
}

.co-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.co-empty-groups-msg h3 {
    font-size: 20px;
    color: #333;
    margin: 0 0 8px 0;
}

.co-empty-groups-msg p {
    font-size: 15px;
    color: #666;
    margin: 0 0 20px 0;
}

/* ── Parish section header ───────────────────────────────── */
.co-parish-section-header {
    background: #006699;
    color: #fff;
    border-radius: 8px 8px 0 0;
    padding: 14px 20px;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.co-parish-section-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.co-parish-section-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.co-parish-section-meta a { color: #fff; }

/* ── Groups grid under a parish ──────────────────────────── */
.co-my-groups-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

/* ── Individual group card ───────────────────────────────── */
.co-my-group-card {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.co-my-group-thumb img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.co-my-group-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.co-my-group-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.co-my-group-name {
    margin: 0;
    font-size: 16px;
    color: #222;
    line-height: 1.3;
}

/* Role badges */
.co-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.co-role-leader      { background: #006699; color: #fff; }
.co-role-coordinator { background: #28a745; color: #fff; }
.co-role-member      { background: #eef0f2; color: #555; }

.co-my-group-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    flex: 1;
    margin: 0 0 10px 0;
}

.co-my-group-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 14px;
}

.co-my-group-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.co-my-group-actions .co-btn {
    font-size: 13px;
    padding: 7px 14px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .co-my-groups-header { flex-direction: column; align-items: flex-start; }
    .co-my-groups-grid   { grid-template-columns: 1fr; }
    .co-parish-section-header { border-radius: 8px 8px 0 0; }
    .co-my-group-actions { flex-direction: column; }
    .co-my-group-actions .co-btn { text-align: center; }
}

/* =============================================================
   JOIN FLOW — PUBLIC GROUP VIEW & PENDING REQUESTS
   ============================================================= */

/* ── Public group view ───────────────────────────────────── */
.co-public-group-wrap { max-width: 700px; margin: 0 auto; }

.co-public-group-hero img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
}

.co-public-group-body { padding: 0; }

.co-public-group-parish {
    font-size: 14px;
    color: #006699;
    font-weight: bold;
    margin-bottom: 12px;
}

.co-public-group-desc {
    color: #444;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.co-public-group-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.co-public-group-action { margin-top: 20px; }

.co-join-btn {
    font-size: 15px;
    padding: 12px 28px;
}

.co-pending-badge {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    display: inline-block;
}

/* ── Pending requests box in Members tab ─────────────────── */
.co-pending-requests-box {
    background: #fffbea;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.co-pending-title {
    margin: 0 0 14px 0;
    font-size: 15px;
    color: #856404;
}

.co-pending-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #ffe082;
    flex-wrap: wrap;
}

.co-pending-row:last-child { border-bottom: none; padding-bottom: 0; }

.co-pending-info { flex: 1; min-width: 0; }

.co-pending-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .co-pending-row     { flex-direction: column; align-items: flex-start; }
    .co-pending-actions { width: 100%; }
    .co-pending-actions .co-btn { flex: 1; text-align: center; }
}