/* ============================================================================
   Prayer Requests page — /Prayer
   ============================================================================
   Migrated out of a 453-line inline <style> block in Pages/Prayer.cshtml.

   Third page with this shape, after Give and Connect: a coherent `prayer-`
   vocabulary on a private token block, this one described as a "dark cyan
   theme". The cyan was hardcoded, so the page could not follow a theme or do
   dark mode.

   Everything colour-bearing is --ac-* now: the brand for identity, the shared
   surface/text/border tokens for the rest, and status tokens only where there is
   a real status. There are no colour values in this file.

   STATUS COLOURS, USED PROPERLY
   -----------------------------
   Green stays on "Answered" — a prayer being answered is a genuine state change,
   and .prayer-card.answered / .answered-badge mark it. Red stays on delete.

   Yellow is GONE. The Edit button was `background:#fefce8; color:#a16207;
   border:1px solid #fde047` — amber, which in this system means warning. Editing
   your own prayer request is not a warning. It is now a neutral icon button, per
   the row-action convention in components.css.

   ACCESSIBILITY FIXES MADE HERE
   -----------------------------
   The shipped palette had twelve WCAG failures. The cyan was the root of the
   worst of them — #0891b2 simply cannot carry white text:

     white on #0891b2 (Pray / Praying buttons)      3.68:1  ->  6.29:1
     #0891b2 text on white (outline button)         3.68:1  ->  6.29:1
     #0891b2 on #f0fdfa (the "N praying" pill)      3.53:1  ->  5.62:1
     #dc2626 delete button on #fef2f2               4.41:1  ->  6.80:1
     #059669 "Saved" status on the notify bar       3.61:1  ->  7.68:1
     #e2e8f0 textarea border                        1.23:1  ->  3.43:1
     #cbd5e1 name-picker dropdown border            1.48:1  ->  3.43:1
     #22d3ee / #86efac / #fde047 / #fecaca / #cffafe button and panel
       borders, all between 1.07:1 and 1.81:1, against a 3:1 requirement
       (SC 1.4.11 — a border that identifies a control).
   ============================================================================ */

:root {
    /* Pass-throughs to the theme brand, keeping the rules below readable. */
    --prayer-accent: var(--ac-brand);
    --prayer-accent-hover: var(--ac-brand-hover);
    --prayer-accent-subtle: var(--ac-brand-soft);
    --prayer-on-accent: var(--ac-brand-contrast);

    --prayer-radius: var(--ac-radius-md);
    --prayer-radius-lg: var(--ac-radius-lg);
}


/* ============================================================================
   Page header
   ============================================================================ */

.prayer-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ac-gap);
    margin-bottom: 1.5rem;
    padding-bottom: var(--ac-gap);
    border-bottom: var(--ac-border-width) solid var(--ac-border);
}

.prayer-page-header h1,
.prayer-page-header h2 {
    color: var(--ac-text);
    font-weight: var(--ac-weight-heading);
    font-size: var(--ac-text-2xl);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* ============================================================================
   Buttons
   ============================================================================ */

.prayer-btn-primary {
    background: var(--ac-gradient-brand);
    color: var(--prayer-on-accent);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--prayer-radius);
    font-weight: var(--ac-weight-semibold);
    cursor: pointer;
    transition: var(--ac-transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.prayer-btn-primary:hover {
    background: var(--prayer-accent-hover);
    color: var(--prayer-on-accent);
    transform: translateY(-2px);
    box-shadow: var(--ac-shadow-md);
}

.prayer-btn-primary:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--prayer-on-accent), var(--ac-focus-ring);
}

.prayer-btn-outline {
    background: var(--ac-surface);
    color: var(--prayer-accent);
    border: 2px solid var(--prayer-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--prayer-radius);
    font-weight: var(--ac-weight-semibold);
    cursor: pointer;
    transition: var(--ac-transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.prayer-btn-outline:hover {
    background: var(--prayer-accent-subtle);
    color: var(--prayer-accent);
}

.prayer-btn-outline:focus-visible {
    outline: none;
    box-shadow: var(--ac-focus-ring);
}

@media (prefers-reduced-motion: reduce) {
    .prayer-btn-primary:hover { transform: none; }
}

/* Submitting state: dim the form and swallow clicks so nothing can be
   double-submitted or edited while the request is in flight. */
.prayer-form-busy {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

#submitRequestBtn:disabled {
    cursor: not-allowed;
    transform: none;
}


/* ============================================================================
   "@" name picker
   ============================================================================ */

.prayer-mention-wrap { position: relative; }

.prayer-mention-dropdown {
    position: absolute;
    z-index: 1060;              /* above the card, below Bootstrap modals */
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--ac-surface-raised);
    border: var(--ac-border-width) solid var(--ac-border-strong);
    border-radius: var(--prayer-radius);
    box-shadow: var(--ac-shadow-lg);
    padding: 0.25rem;
}

.prayer-mention-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--ac-radius-sm);
    cursor: pointer;
    color: var(--ac-text);
}

.prayer-mention-item:hover,
.prayer-mention-item.active {
    background: var(--prayer-accent-subtle);
}

.prayer-mention-item .mention-name { font-weight: var(--ac-weight-semibold); }

.prayer-mention-item .mention-status {
    font-size: var(--ac-text-xs);
    color: var(--ac-text-muted);
}

.prayer-mention-empty {
    padding: 0.5rem 0.65rem;
    color: var(--ac-text-muted);
    font-size: var(--ac-text-sm);
}


/* ============================================================================
   Notification opt-in bar
   ============================================================================ */

.prayer-notify-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    background: var(--prayer-accent-subtle);
    border: var(--ac-border-width) solid var(--prayer-accent);
    border-radius: var(--prayer-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.prayer-notify-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: var(--ac-weight-semibold);
    color: var(--ac-text);
}

.prayer-notify-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}

.prayer-notify-options .form-check {
    margin: 0;
    min-height: auto;
}

.prayer-notify-options .form-check-label {
    color: var(--ac-text);
    cursor: pointer;
    user-select: none;
}

.prayer-notify-options .form-check-input:checked {
    background-color: var(--prayer-accent);
    border-color: var(--prayer-accent);
}

.prayer-notify-options .form-check-input:disabled ~ .form-check-label {
    color: var(--ac-text-muted);
    cursor: not-allowed;
}

.prayer-notify-status {
    font-size: var(--ac-text-sm);
    color: var(--ac-text-muted);
    margin-left: auto;
    min-height: 1.2em;
}

/* Full-width footnote inside the flex bar. */
.prayer-notify-note {
    flex-basis: 100%;
    font-size: var(--ac-text-xs);
    color: var(--ac-text-muted);
    margin: 0;
}

/* Ink tokens, not fills — these are coloured text on a tinted panel. */
.prayer-notify-status.is-saved {
    color: var(--ac-success-text);
    font-weight: var(--ac-weight-semibold);
}

.prayer-notify-status.is-error {
    color: var(--ac-danger-text);
    font-weight: var(--ac-weight-semibold);
}


/* ============================================================================
   Section card (the new-request form)
   ============================================================================ */

.prayer-section-card {
    background: var(--ac-surface);
    border: var(--ac-border-width) solid var(--ac-border);
    border-radius: var(--prayer-radius-lg);
    box-shadow: var(--ac-shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.prayer-section-card .card-header {
    background: var(--ac-surface-sunken);
    border-bottom: var(--ac-border-width) solid var(--ac-border);
    padding: 1rem 1.25rem;
}

.prayer-section-card .card-header h2,
.prayer-section-card .card-header h5 {
    margin: 0;
    color: var(--ac-text);
    font-weight: var(--ac-weight-semibold);
    font-size: var(--ac-text-lg);
}

.prayer-section-card .card-body {
    padding: 1.25rem;
    /* site.css makes every .card-body a centred column flex container, which
       shrink-wraps the children and collapsed the name-picker wrapper to the
       textarea's default cols width. Opt this card back out. */
    display: block;
    text-align: left;
}

.prayer-form-card {
    background: var(--ac-surface);
    border: 2px solid var(--prayer-accent);
}


/* ============================================================================
   Request cards
   ============================================================================ */

.prayer-card {
    background: var(--ac-surface);
    border-radius: var(--prayer-radius);
    border: var(--ac-border-width) solid var(--ac-border);
    padding: var(--ac-gap);
    margin-bottom: var(--ac-gap);
    transition: var(--ac-transition-fast);
}

.prayer-card:hover {
    box-shadow: var(--ac-shadow-md);
    border-color: var(--prayer-accent);
}

/* Answered is a genuine state change, so it earns the success tint. Was a
   #f0fdf4 -> #dcfce7 gradient with a #86efac border at 1.40:1. */
.prayer-card.answered {
    background: var(--ac-success-soft);
    border-color: var(--ac-success);
}

.prayer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ac-border);
    flex-shrink: 0;
}

.prayer-text {
    font-size: var(--ac-text-lg);
    color: var(--ac-text);
    line-height: var(--ac-leading-normal);
}

.prayer-meta {
    color: var(--ac-text-muted);
    font-size: var(--ac-text-sm);
}

.prayer-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--prayer-accent-subtle);
    color: var(--prayer-accent);
    padding: 0.25rem 0.75rem;
    border-radius: var(--ac-radius-pill);
    font-weight: var(--ac-weight-semibold);
    font-size: var(--ac-text-sm);
}


/* ============================================================================
   Card actions
   ============================================================================
   Pray / Answered stay LABELLED — they are state changes the user is choosing,
   not repeated row actions, and the label is the whole affordance. Edit and
   Delete are icon-only .ac-icon-btn in the markup now.
   ============================================================================ */

.prayer-action-btn {
    padding: 0.4rem 0.75rem;
    border-radius: var(--ac-radius-sm);
    font-size: var(--ac-text-sm);
    font-weight: var(--ac-weight-medium);
    border: var(--ac-border-width) solid transparent;
    cursor: pointer;
    transition: var(--ac-transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.prayer-action-btn:focus-visible {
    outline: none;
    box-shadow: var(--ac-focus-ring);
}

.prayer-action-btn.pray {
    background: var(--prayer-accent-subtle);
    color: var(--prayer-accent);
    border-color: var(--prayer-accent);
}

.prayer-action-btn.pray:hover {
    background: var(--prayer-accent);
    color: var(--prayer-on-accent);
}

.prayer-action-btn.praying {
    background: var(--prayer-accent);
    color: var(--prayer-on-accent);
    border-color: var(--prayer-accent);
}

.prayer-action-btn.answer {
    background: var(--ac-success-soft);
    color: var(--ac-success-text);
    border-color: var(--ac-success);
}

.prayer-action-btn.answer:hover {
    background: var(--ac-success);
    color: #ffffff;
}

.answered-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--ac-success);
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: var(--ac-radius-pill);
    font-weight: var(--ac-weight-semibold);
    font-size: var(--ac-text-xs);
}


/* ============================================================================
   Textarea
   ============================================================================ */

.prayer-textarea {
    width: 100%;
    border: var(--ac-border-width) solid var(--ac-border-strong);
    border-radius: var(--prayer-radius);
    padding: var(--ac-gap);
    font-size: var(--ac-text-base);
    background-color: var(--ac-surface);
    color: var(--ac-text);
    resize: vertical;
    transition: var(--ac-transition-fast);
}

.prayer-textarea:focus {
    outline: none;
    border-color: var(--prayer-accent);
    box-shadow: var(--ac-focus-ring);
}

.prayer-textarea::placeholder { color: var(--ac-text-subtle); }


/* ============================================================================
   Modal + toggle
   ============================================================================ */

.prayer-modal .modal-content {
    border: var(--ac-border-width) solid var(--ac-border);
    border-radius: var(--prayer-radius-lg);
    overflow: hidden;
}

.prayer-modal .modal-header {
    background: var(--ac-surface-sunken);
    border-bottom: var(--ac-border-width) solid var(--ac-border);
}

.prayer-modal .modal-title {
    color: var(--ac-text);
    font-weight: var(--ac-weight-semibold);
}

.prayer-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--ac-surface-sunken);
    padding: 0.5rem 1rem;
    border-radius: var(--prayer-radius);
}

.prayer-toggle .form-check-input:checked {
    background-color: var(--prayer-accent);
    border-color: var(--prayer-accent);
}


/* ============================================================================
   Small screens
   ============================================================================ */

@media (max-width: 768px) {
    .prayer-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .prayer-page-header h1,
    .prayer-page-header h2 { font-size: 1.5rem; }

    .prayer-card { padding: 0.875rem; }

    .prayer-avatar {
        width: 40px;
        height: 40px;
    }

    .prayer-text { font-size: var(--ac-text-base); }
}


/* ============================================================================
   Print — people print prayer lists
   ============================================================================ */

@media print {
    .prayer-notify-bar,
    .prayer-section-card,
    .prayer-action-btn,
    .prayer-btn-primary,
    .prayer-btn-outline,
    .ac-icon-btn { display: none !important; }

    .prayer-card {
        box-shadow: none;
        border: 1px solid #cccccc;
        break-inside: avoid;
    }
}
