/* Parish Events – front end. Inherits the theme's fonts; colours via --pe-accent. */
.pe-events,
.pe-single-details {
	--pe-accent: #7a1f2b;
	--pe-border: rgba(0, 0, 0, .12);
	--pe-muted: rgba(0, 0, 0, .62);
	--pe-soft: rgba(0, 0, 0, .035);
	--pe-radius: 6px;
}
.pe-events { margin: 1.5em 0; }
.pe-events *, .pe-single-details * { box-sizing: border-box; }
.pe-events a { text-decoration: none; }
.pe-events a:hover, .pe-events a:focus { text-decoration: underline; }
.pe-title { margin: 0 0 .75em; }

/* View switcher */
.pe-view-switch { display: flex; gap: 0; margin: 0 0 1.25em; border: 1px solid var(--pe-border); border-radius: var(--pe-radius); width: max-content; max-width: 100%; overflow: hidden; }
.pe-view-switch a { padding: .5em 1.1em; color: inherit; border-right: 1px solid var(--pe-border); font-size: .95em; }
.pe-view-switch a:last-child { border-right: 0; }
.pe-view-switch a.is-active { background: var(--pe-accent); color: #fff; }
.pe-view-switch a:hover { text-decoration: none; background: var(--pe-soft); }
.pe-view-switch a.is-active:hover { background: var(--pe-accent); }

/* Shared bits */
.pe-datebox { flex: 0 0 auto; width: 3.6em; text-align: center; line-height: 1.1; }
.pe-datebox .pe-dow, .pe-card-placeholder .pe-dow { display: block; font-size: .75em; text-transform: uppercase; letter-spacing: .06em; color: var(--pe-muted); }
.pe-datebox .pe-day, .pe-card-placeholder .pe-day { display: block; font-size: 1.7em; font-weight: 700; color: var(--pe-accent); }
.pe-when { margin: 0 0 .2em; font-size: .92em; color: var(--pe-muted); }
.pe-location { margin: .2em 0 0; font-size: .92em; }
.pe-item-title { margin: 0; font-size: 1.15em; line-height: 1.3; }
.pe-item-title a { color: inherit; }
.pe-badge { display: inline-block; font-size: .75em; padding: .05em .5em; border-radius: 999px; background: var(--pe-soft); border: 1px solid var(--pe-border); color: var(--pe-muted); vertical-align: middle; }
.pe-empty { padding: 1em; background: var(--pe-soft); border-radius: var(--pe-radius); }
.pe-heading-note { font-weight: 600; margin: 0 0 .5em; }

/* List */
.pe-month-heading { font-size: 1em; text-transform: uppercase; letter-spacing: .06em; color: var(--pe-muted); margin: 1.5em 0 .5em; padding-bottom: .35em; border-bottom: 1px solid var(--pe-border); }
.pe-list .pe-month-heading:first-child { margin-top: 0; }
.pe-item { display: flex; gap: 1em; align-items: flex-start; padding: 1em 0; border-bottom: 1px solid var(--pe-border); }
.pe-item-body { flex: 1 1 auto; min-width: 0; }
.pe-excerpt { margin: .4em 0 0; font-size: .95em; }
.pe-thumb { flex: 0 0 160px; }
.pe-thumb img { display: block; width: 160px; height: 110px; object-fit: cover; border-radius: var(--pe-radius); }

/* Pager */
.pe-pager { display: flex; justify-content: space-between; margin: 1.25em 0 0; gap: 1em; }
.pe-pager a, .pe-month-nav a { color: var(--pe-accent); font-weight: 600; }

/* Photo */
.pe-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25em; }
.pe-card { border: 1px solid var(--pe-border); border-radius: var(--pe-radius); overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.pe-card-img { display: block; aspect-ratio: 16 / 10; background: var(--pe-soft); }
.pe-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-card-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; }
.pe-card-placeholder .pe-day { font-size: 2.6em; }
.pe-card-body { padding: .9em 1em 1.1em; }

/* Compact */
.pe-compact { list-style: none; margin: 0; padding: 0; }
.pe-compact li { display: flex; gap: .8em; align-items: center; padding: .6em 0; border-bottom: 1px solid var(--pe-border); margin: 0; }
.pe-compact li:last-child { border-bottom: 0; }
.pe-compact .pe-datebox { width: 3em; }
.pe-compact .pe-datebox .pe-day { font-size: 1.4em; }
.pe-compact-body a { font-weight: 600; color: inherit; }
.pe-compact-body .pe-when { display: block; margin: 0; }
.pe-all-link { margin: .75em 0 0; }
.pe-all-link a { color: var(--pe-accent); font-weight: 600; }

/* Month */
.pe-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5em; }
.pe-month-title { margin: 0; font-size: 1.35em; }
.pe-today-link { text-align: center; margin: 0 0 .75em; font-size: .9em; }
.pe-month-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0; }
.pe-month-grid th { padding: .5em .25em; font-size: .8em; text-transform: uppercase; letter-spacing: .05em; color: var(--pe-muted); text-align: center; border: 1px solid var(--pe-border); background: var(--pe-soft); }
.pe-month-grid th abbr { text-decoration: none; border: 0; }
.pe-month-grid td { vertical-align: top; height: 7em; padding: .35em; border: 1px solid var(--pe-border); font-size: .85em; }
.pe-cell-date { display: block; font-weight: 700; margin-bottom: .25em; }
.pe-cell-dow { display: none; }
.pe-other-month { background: var(--pe-soft); }
.pe-other-month .pe-cell-date { opacity: .45; }
.pe-is-today .pe-cell-date { color: var(--pe-accent); }
.pe-is-today { box-shadow: inset 0 0 0 2px var(--pe-accent); }
.pe-month-grid ul { list-style: none; margin: 0; padding: 0; }
.pe-month-grid li { margin: 0 0 .3em; line-height: 1.25; }
.pe-month-grid li a { display: block; color: inherit; padding: .15em .3em; border-left: 3px solid var(--pe-accent); background: var(--pe-soft); border-radius: 2px; overflow-wrap: break-word; hyphens: auto; font-size: .92em; }
.pe-cell-time { color: var(--pe-muted); font-size: .9em; }
.pe-month-empty { margin-top: 1em; }

/* Subscribe */
.pe-subscribe { margin-top: 1.5em; font-size: .9em; }
.pe-subscribe summary { cursor: pointer; color: var(--pe-accent); font-weight: 600; }
.pe-subscribe ul { margin: .5em 0 0 1.25em; }

/* Single event */
.pe-single-details { border: 1px solid var(--pe-border); border-left: 4px solid var(--pe-accent); border-radius: var(--pe-radius); padding: 1em 1.25em; margin: 0 0 1.5em; background: var(--pe-soft); }
.pe-single-details dl { margin: 0; }
.pe-detail { display: flex; gap: 1em; margin: 0 0 .4em; }
.pe-detail dt { flex: 0 0 5.5em; font-weight: 700; margin: 0; }
.pe-detail dd { margin: 0; }
.pe-actions { margin: .9em 0 0; display: flex; flex-wrap: wrap; gap: .5em; }
.pe-button { display: inline-block; padding: .45em .9em; border: 1px solid var(--pe-accent); color: var(--pe-accent); border-radius: var(--pe-radius); font-size: .9em; text-decoration: none; background: #fff; }
.pe-button:hover, .pe-button:focus { background: var(--pe-accent); color: #fff; text-decoration: none; }
.pe-button-primary { background: var(--pe-accent); color: #fff; }
.pe-badge-past { margin-left: .4em; }
.pe-upcoming-dates { margin-top: 2em; }
.pe-upcoming-dates ul { margin-left: 1.25em; }
.pe-back { margin-top: 1.5em; }

/* Phones: month grid becomes an agenda of days that have events */
@media (max-width: 700px) {
	.pe-thumb { display: none; }
	.pe-month-grid, .pe-month-grid tbody, .pe-month-grid tr, .pe-month-grid td { display: block; width: 100%; }
	.pe-month-grid thead { display: none; }
	.pe-month-grid td { height: auto; border: 0; border-bottom: 1px solid var(--pe-border); padding: .6em 0; font-size: 1em; }
	.pe-month-grid td:not(.pe-has-events), .pe-month-grid td.pe-other-month { display: none; }
	.pe-is-today { box-shadow: none; }
	.pe-cell-dow { display: inline; }
	.pe-detail { flex-direction: column; gap: 0; }
}
