/* Events (migration 0015): the cards on a masjid's timetable page and the Events tab of /app/ (assets/js/app/events.js),
   the managers' panel on /manage/ (assets/js/manage/events-panel.js; with console.css) and the badges of the platform
   console's held queue. Tokens only, logical properties (RTL). */

/* ── Cards ── */
.ev-list { display: grid; gap: 12px; }
.ev-feed { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.ev-card { gap: 8px; }
/* The Events tab's cards in a row are one height: the answer part (counts, Interested / Going, "Happening now") at the foot. */
.ev-feed .ev-card > :is(.ev-counts, .ev-now, .ev-rsvp:not(.ev-counts + .ev-rsvp)) { margin-top: auto; }
.ev-when { font-size: 13px; font-weight: 600; color: var(--gold-text); line-height: 1.5; }
.ev-when .hijri { font-weight: 400; }
.ev-when bdi { font-family: var(--font-body); }
.ev-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--heading); line-height: 1.3; overflow-wrap: anywhere; }
.ev-title:lang(ur) { font-family: 'Noto Nastaliq Urdu', serif; font-size: 18px; line-height: 1.9; }
.ev-title:is(:lang(ar), :lang(hi), :lang(te)) { font-family: var(--font-body); font-size: 19px; }
.ev-card.is-cancelled .ev-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ev-badge { align-self: flex-start; padding: 2px 10px; border-radius: 20px; background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: 600; }
.ev-masjid { font-size: 14px; color: var(--muted); }
.ev-masjid a { color: var(--gold-text); font-weight: 600; text-decoration: none; }
.ev-masjid a:hover { text-decoration: underline; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.ev-cat { padding: 2px 10px; border-radius: 20px; background: var(--gold-pale); color: var(--gold-text); font-weight: 600; font-size: 12px; }
.ev-desc { font-size: 14px; line-height: 1.65; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.ev-desc:lang(ur) { font-family: 'Noto Nastaliq Urdu', serif; line-height: 2.1; }
.ev-auto { font-size: 12px; color: var(--muted); }
.ev-auto .adm-link, .ev-card .adm-link, .jz-card .adm-link { padding: 0; border: 0; background: none; color: var(--gold-text); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ev-needs { font-size: 13px; color: var(--text); }
.ev-counts { font-size: 13px; font-weight: 600; color: var(--heading); }
.ev-now { font-size: 13px; font-weight: 600; color: var(--sage); }
.ev-rsvp { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-rsvp .act { min-height: 40px; }
.ev-rsvp .act[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.ev-rsvp .act[aria-pressed="true"]::before { content: "✓"; }
.ev-rsvp .act[disabled] { opacity: .6; cursor: wait; }
.ev-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.ev-msg { font-size: 13px; color: var(--gold-text); }
.ev-msg:empty { display: none; }
.ev-msg a { color: inherit; font-weight: 600; }
.ev-empty { font-size: 14px; color: var(--muted); }

/* On the timetable page, under the masjid's card. */
.md-events { margin-top: 18px; }
.md-events h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--heading); margin-bottom: 10px; }

/* The Events tab: "Masjids I follow" | "All masjids"; the Filters are for masjids, not events. */
.ev-scope { margin: 0 0 14px; }
.ev-scope-btn { padding: 8px 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 500 14px var(--font-body); cursor: pointer; }
.ev-scope-btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
#find-bar[data-tab="events"] :is(#filter-btn, #filter-panel, .filter-row) { display: none; }

/* ── The managers' panel (/manage/) ── */
.evp { display: grid; gap: 14px; }
.evp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.evp-list { list-style: none; display: grid; gap: 10px; }
.evp-row { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-alt); }
.evp-row .ev-title { font-size: 18px; }
.evp-row .adm-actions { margin-top: 4px; }
.evp-note { padding: 8px 12px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.evp-form { display: grid; gap: 4px; }
.evp-form .form-group { margin-bottom: 10px; }
.evp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 0 12px; }
.evp-form textarea { min-height: 110px; resize: vertical; }
.evp-form .adm-checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.evp-form fieldset.form-group { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.evp-form fieldset.form-group > legend { padding: 0; margin-bottom: 8px; }
.evp-guide { padding: 10px 12px; border-radius: 10px; background: var(--gold-pale); color: var(--gold-text); font-size: 13px; line-height: 1.55; }
.evp-tr { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.evp-tr > summary { cursor: pointer; font-weight: 600; color: var(--heading); min-height: 32px; display: flex; align-items: center; }
.evp-tr fieldset { border: 0; border-top: 1px solid var(--line); padding: 10px 0 0; margin-top: 10px; }
.evp-tr legend { font-size: 13px; font-weight: 600; color: var(--heading); padding-inline-end: 8px; }
.evp-tag { margin-inline-start: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.evp-who { list-style: none; display: grid; gap: 6px; font-size: 14px; }
.evp-who li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.evp-who b { color: var(--heading); }
.evp-form .field-error:empty { display: none; }

/* Status badges (console.css .badge): the manager's list and the platform console's queue. */
.badge[data-status="published"] { background: var(--brand); color: var(--on-brand); }
.badge[data-status="held"] { background: var(--gold-pale); color: var(--gold-text); border-color: var(--gold); }
.badge[data-status="cancelled"] { background: var(--tint); color: var(--muted); border-color: var(--line); }
.badge[data-status="removed"] { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }   /* 0024: taken down by the team */

/* ── Reporting an event (0024): the card's "Report this event" and the form (#dlg-report on /app/) ── */
.ev-report { font-size: 12px; color: var(--muted); }
.ev-report .adm-link { font-weight: 500; color: var(--muted); }
.ev-report.is-done { color: var(--gold-text); }
.report-dlg { max-width: 460px; }
.report-event { margin-bottom: 8px; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.report-reasons { border: 0; padding: 0; min-width: 0; display: grid; gap: 4px; }
.report-reasons > legend { padding: 0; margin-bottom: 6px; }
.report-reasons label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; cursor: pointer; }
.report-reasons input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.report-actions .act { min-height: 44px; }

/* ── Janazah announcements (0027): the card (events.js janazahCard) on Find a Masjid's Events tab and a masjid's page
   (#md-janazah, above "Coming up"), and /manage/'s panel with its preview. Calm: neutral colours only, an opaque surface
   (no season colours or pattern through it), no gold. ── */
.jz-section { margin: 0 0 28px; }
/* The Events tab's two parts (app/events.js): "Janazah announcements", then "Events" when both show. */
:is(.jz-section-title, .ev-list-title) { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--heading); margin-bottom: 8px; }
.jz-list { display: grid; gap: 12px; }
#md-janazah:not(:empty) { margin: 14px 0 10px; }
.jz-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-inline-start: 3px solid var(--muted); border-radius: 12px; }
.jz-inna { font-size: 13px; color: var(--muted); }
.jz-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--heading); }
.jz-name { font-size: 16px; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.jz-masjid { font-size: 14px; }
.jz-masjid a { color: var(--heading); font-weight: 600; }
.jz-line, .jz-note { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.jz-when { font-weight: 600; color: var(--heading); }
.jz-note { white-space: pre-line; margin-top: 4px; }
.jz-card:lang(ur) :is(.jz-line, .jz-note, .jz-name, .jz-inna) { line-height: 2.1; }
.jz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.jz-actions .act { min-height: 40px; }
.jz-dist { font-size: 13px; color: var(--muted); }
.badge[data-status="janazah"] { background: var(--tint); color: var(--heading); border-color: var(--muted); }   /* the console's badge */
/* /manage/: the form's two-way choices and the preview (the card, then the notice as a phone shows it). */
.jzp-choice { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.jzp-choice label { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; cursor: pointer; }
.jzp-choice input, .jzp-consent input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.jzp-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.jzp-sub { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); padding-inline-start: 12px;
  border-inline-start: 2px solid var(--line); margin: 4px 0 10px; }
.jzp-preview { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.jzp-preview > h4 { font-size: 13px; font-weight: 600; color: var(--muted); }   /* the preview's own label, never the card's heading */
.jzp-notice { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--tint); font-size: 14px; overflow-wrap: anywhere; }
.jzp-notice b { color: var(--heading); }
.jzp { margin-block-end: 28px; }   /* the Janazah box, then the events (manage/events-panel.js): two parts, not one */

@media (pointer: coarse) {
  .ev-scope-btn, .evp-row .act { min-height: 44px; }
  .jz-actions .act, .jzp-choice label { min-height: 44px; }
  /* "Report this event" (0024): a whole finger's target on phones, like the RSVP buttons above it (A11Y-1). */
  .ev-report :is(a, button) { display: inline-flex; align-items: center; min-height: 44px; }
}
