/* Macedon Directory: events. Follows the Kutlesh theme tokens and dark mode.
   The date tile is a tear-off calendar leaf: red band with the weekday, the day
   in the serif face, the month underneath. */
.mde, .mde-detail, .mde-form, .mde-org { --mde-red: var(--k-red, #a3121a); color: var(--ink, #1d1d1f); }
.mde *, .mde *::before, .mde *::after { box-sizing: border-box; }
.mde { max-width: 100%; overflow-x: clip; }
.mde-loading, .mde-empty { color: var(--muted, #5f5955); padding: 24px 0; }
.mde-empty p { margin: 0 0 14px; }

/* Bar: scope, view, actions */
.mde-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; }
.mde-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--soft, #f6f3f0); }
.mde-seg-btn { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.mde-seg-btn[aria-selected="true"] { background: var(--ink, #1d1d1f); color: var(--bg, #fff); }
.mde-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.mde-act { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line, #ebe6e1); color: inherit !important; font-weight: 600; font-size: 15px; text-decoration: none; }
.mde-act:hover { border-color: var(--mde-red); }
.mde-act-main { background: var(--mde-red); border-color: var(--mde-red); color: #fff !important; }
.mde-act-main:hover { filter: brightness(1.08); }

/* Filters */
.mde-filters { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; margin-bottom: 14px; }
.mde-search { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; max-width: 640px; min-height: 50px; padding: 0 18px; border-radius: 999px; background: var(--soft, #f6f3f0); border: 1.5px solid transparent; }
.mde-search:focus-within { border-color: var(--mde-red); }
.mde-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 16px; outline: none; }
.mde-filter { flex: 1 1 100%; min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 8px; }
.mde-filter[hidden] { display: none !important; }
.mde-filter-label { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted, #5f5955); }
.mde-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mde-pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line, #ebe6e1); background: var(--bg, #fff); color: inherit; font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.mde-pill.is-on { background: var(--mde-red); border-color: var(--mde-red); color: #fff; }
.mde-pill:hover:not(.is-on) { border-color: var(--mde-red); }
.mde-count { margin: 6px 0 4px; font-size: 14px; font-weight: 600; color: var(--muted, #5f5955); }
.mde-panel[hidden] { display: none !important; }

/* Agenda */
.mde-month { margin: 34px 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ink, #1d1d1f); font-family: var(--serif, Georgia, serif); font-size: clamp(24px, 3vw, 32px); font-weight: 700; line-height: 1.15; }
.mde-group { display: flex; flex-direction: column; }
.mde-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--line, #ebe6e1); }
.mde-group .mde-item:last-child { border-bottom: 0; }

.mde-date { display: flex; flex-direction: column; align-items: center; width: 76px; border-radius: 14px; overflow: hidden; background: var(--bg, #fff); border: 1.5px solid var(--line, #ebe6e1); text-decoration: none !important; color: inherit !important; line-height: 1; }
.mde-wd { width: 100%; padding: 6px 0 5px; background: var(--mde-red); color: #fff; font-size: 12px; font-weight: 700; text-align: center; letter-spacing: .05em; }
.mde-day { padding: 9px 4px 2px; font-family: var(--serif, Georgia, serif); font-size: 30px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.mde-mon { padding: 0 0 9px; font-size: 13px; font-weight: 600; color: var(--muted, #5f5955); }
.mde-item .mde-day { font-size: clamp(22px, 2.4vw, 30px); }

.mde-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mde-kind { margin: 0; font-size: 13px; font-weight: 600; color: var(--mde-red); }
.mde-title { margin: 0; font-family: var(--serif, Georgia, serif); font-size: clamp(19px, 2vw, 23px); font-weight: 700; line-height: 1.22; }
.mde-title a { color: inherit !important; text-decoration: none; }
.mde-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mde-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.mde-meta p { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 14.5px; font-weight: 600; }
.mde-meta svg { flex: none; margin-top: 3px; color: var(--mde-red); }
.mde-excerpt { margin: 2px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted, #5f5955); max-width: 70ch; }
.mde-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 6px; }
.mde-by, .mde-price { margin: 0; font-size: 14px; color: var(--muted, #5f5955); }
.mde-by a { color: inherit; font-weight: 600; }
.mde-price { font-weight: 600; color: var(--ink, #1d1d1f); }
.mde-links { display: flex; flex-wrap: wrap; gap: 8px; }
.mde-link { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 999px; background: var(--soft, #f6f3f0); color: inherit !important; font-size: 14px; font-weight: 600; text-decoration: none !important; }
.mde-link:hover { background: var(--ink, #1d1d1f); color: var(--bg, #fff) !important; }
.mde-link-main { background: var(--mde-red); color: #fff !important; }
.mde-link-main:hover { background: var(--mde-red); filter: brightness(1.08); color: #fff !important; }

.mde-thumb { display: block; width: 168px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--soft, #f6f3f0); }
.mde-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 720px) {
	.mde-item { grid-template-columns: 62px minmax(0, 1fr); gap: 14px; }
	.mde-date { width: 62px; }
	.mde-thumb { grid-column: 2; width: 100%; max-width: 420px; aspect-ratio: 16 / 9; }
	.mde-actions { margin-left: 0; width: 100%; }
	.mde-seg-btn { padding: 0 14px; font-size: 14.5px; }
	.mde-act { min-height: 42px; padding: 0 14px; font-size: 14.5px; }
	.mde-link { min-height: 38px; padding: 0 13px; font-size: 13.5px; }
	.mde-link-more { display: none; }
	.mde-filter .mde-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.mde-filter .mde-pills::-webkit-scrollbar { display: none; }
}

/* Map */
.mde-map { width: 100%; min-height: 420px; border-radius: 20px; overflow: hidden; background: var(--soft, #f6f3f0); }
.mde-pop { font-family: inherit; min-width: 180px; }
.mde-pop-title { display: block; font-weight: 700; font-size: 15px; color: var(--ink, #1d1d1f) !important; margin-bottom: 4px; }
.mde-pop p { margin: 2px 0 !important; font-size: 13px; }

/* Compact (home page) */
.mde-compact .mde-item { grid-template-columns: 62px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
.mde-compact .mde-date { width: 62px; }
.mde-compact .mde-title { font-size: 18px; }
.mde-compact .mde-meta p { font-size: 13.5px; }
.mde-more { margin: 12px 0 0; font-weight: 600; }
.mde-more a { color: var(--mde-red); }

/* Single event page */
.mde-detail { margin: 0 0 28px; }
.mde-detail-mk { margin: -6px 0 16px; font-family: var(--serif, Georgia, serif); font-size: 21px; color: var(--muted, #5f5955); }
.mde-past-note { display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; background: var(--soft, #f6f3f0); font-size: 14px; font-weight: 600; }
.mde-facts { display: grid; gap: 12px; margin: 0 0 20px; padding: 20px 22px; border-radius: 20px; background: var(--soft, #f6f3f0); }
.mde-facts > div { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.mde-facts dt { margin: 0; color: var(--mde-red); padding-top: 2px; }
.mde-facts dd { margin: 0; font-size: 16.5px; font-weight: 600; line-height: 1.45; }
.mde-facts dd small { font-weight: 500; color: var(--muted, #5f5955); }
.mde-facts dd a { color: inherit; }
.mde-facts dt.mde-dot { display: block; justify-self: start; width: 10px; height: 10px; margin: 7px 0 0 4px; padding: 0; border-radius: 999px; background: var(--mde-red); }
.mde-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.mde-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line, #ebe6e1); background: var(--bg, #fff); color: var(--ink, #1d1d1f) !important; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none !important; cursor: pointer; }
.mde-btn:hover { border-color: var(--mde-red); }
.mde-btn-main { background: var(--mde-red); border-color: var(--mde-red); color: #fff !important; }
.mde-btn-main:hover { filter: brightness(1.08); }
.mde-hero { margin: 0 0 8px; border-radius: 20px; overflow: hidden; }
.mde-hero img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: var(--soft, #f6f3f0); }
.mde-desc-mk { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line, #ebe6e1); }
.mde-back { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line, #ebe6e1); font-size: 15px; }
.mde-back a { font-weight: 600; color: var(--mde-red); }
.mde-correct { color: var(--muted, #5f5955); }

/* Upcoming events on a church or group page */
.mde-org { margin-top: 32px; }
.mde-org h2 { font-family: var(--serif, Georgia, serif); }
.mde-org-list { list-style: none; margin: 0; padding: 0; }
.mde-org-list li { border-top: 1px solid var(--line, #ebe6e1); }
.mde-org-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; color: inherit; text-decoration: none; }
.mde-org-list a:hover strong { text-decoration: underline; }
.mde-org-when { font-size: 14px; font-weight: 600; color: var(--mde-red); }

/* Submission form */
.mde-form { max-width: 780px; }
.mde-form fieldset { margin: 0 0 22px; padding: 18px 20px 6px; border: 1.5px solid var(--line, #ebe6e1); border-radius: 18px; }
.mde-form legend { padding: 0 8px; font-weight: 700; font-family: var(--serif, Georgia, serif); font-size: 18px; }
.mde-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.mde-form input, .mde-form select, .mde-form textarea { font: inherit; font-weight: 400; padding: 12px 14px; border: 1.5px solid var(--line, #ddd); border-radius: 12px; background: var(--bg, #fff); color: inherit; min-height: 48px; width: 100%; }
.mde-form input[type="file"] { padding: 10px; }
.mde-form input:focus-visible, .mde-form select:focus-visible, .mde-form textarea:focus-visible { outline: 2px solid var(--mde-red); outline-offset: 1px; }
.mde-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.mde-check label { flex-direction: row; align-items: flex-start; font-weight: 400; }
.mde-check input { min-height: 0; width: auto; margin-top: 4px; }
.mde-hint { color: var(--muted, #666); font-size: 14px; }
.mde-msg { padding: 16px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: 600; }
.mde-msg.is-ok { background: #e3f4e5; color: #1e6b2a; }
.mde-msg.is-error { background: #fde8e8; color: #b3121b; }
.md-hp { position: absolute; left: -9999px; }

.mde a:focus-visible, .mde button:focus-visible, .mde-detail a:focus-visible { outline: 2px solid var(--mde-red); outline-offset: 2px; }
