/* Parish Events – front end. Inherits the theme's fonts; colours via --pe-accent. */
.pe-events,
.pe-single-details,
.pe-event-page {
	--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, .pe-event-page a { text-decoration: none; box-shadow: none; border-bottom: 0; }
.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 + Featured picture cards */
.pe-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25em; }
.pe-featured-grid { grid-template-columns: repeat(var(--pe-cols, 3), minmax(0, 1fr)); }
.pe-card { border: 1px solid var(--pe-border); border-radius: var(--pe-radius); overflow: hidden; display: flex; flex-direction: column; background: #fff; color: #222; transition: box-shadow .2s, transform .2s; }
.pe-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); transform: translateY(-2px); }
.pe-card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--pe-soft); overflow: hidden; }
.pe-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.pe-fit-contain .pe-card-img img { object-fit: contain; object-position: center; }
.pe-card-date { position: absolute; top: .6em; left: .6em; background: #fff; border-radius: var(--pe-radius); padding: .3em .55em; text-align: center; line-height: 1.05; box-shadow: 0 2px 8px rgba(0,0,0,.18); min-width: 3em; }
.pe-card-date .pe-dow { display: block; font-size: .7em; text-transform: uppercase; letter-spacing: .06em; color: var(--pe-muted); }
.pe-card-date .pe-day { display: block; font-size: 1.45em; font-weight: 700; color: var(--pe-accent); }
.pe-card-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; background: linear-gradient(135deg, var(--pe-soft), rgba(0,0,0,.08)); }
.pe-card-placeholder .pe-day { font-size: 2.6em; }
.pe-card-body { padding: .9em 1em 1.1em; }
.pe-card .pe-item-title { font-size: 1.1em; margin: .15em 0 0; }
.pe-card .pe-when { color: var(--pe-accent); font-weight: 600; font-size: .85em; line-height: 1.4; }
.pe-card-time { display: block; font-weight: normal; color: var(--pe-muted); }
.pe-all-button { text-align: center; margin-top: 1.25em; }

/* 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; }

/* Buttons (shared) */
.pe-actions { margin: .5em 0 0; display: flex; flex-wrap: wrap; gap: .5em; }
.pe-button { display: inline-block; padding: .5em 1em; border: 1px solid var(--pe-accent); color: var(--pe-accent) !important; border-radius: var(--pe-radius); font-size: .92em; text-decoration: none !important; background: #fff; line-height: 1.3; }
.pe-button:hover, .pe-button:focus { background: var(--pe-accent); color: #fff !important; }
.pe-button-primary { background: var(--pe-accent); color: #fff !important; }
.pe-button-primary:hover { filter: brightness(1.1); }

/* Single event page */
.pe-single-page { width: 100%; max-width: none; float: none; }
.pe-single-main { width: 100%; max-width: 1140px; margin: 0 auto; padding: 2em 1.25em 3em; float: none; }
.pe-event-page { width: 100%; }
.pe-event-page a { text-decoration: none; }
.pe-event-page .pe-back { margin: 0 0 1em; font-size: .95em; }
.pe-event-page .pe-back a, .pe-series-label { color: var(--pe-accent); font-weight: 600; }
.pe-series-label { margin: 0 0 .25em; font-size: .9em; text-transform: uppercase; letter-spacing: .04em; }
.pe-event-title { margin: 0 0 .25em; line-height: 1.2; }
.pe-event-when { margin: 0 0 1.5em; font-size: 1.15em; font-weight: 600; }
.pe-badge-past { margin-left: .4em; font-weight: normal; }
.pe-event-hero { display: grid; grid-template-columns: 1fr; gap: 2em; align-items: start; margin-bottom: 2em; }
.pe-event-hero.has-image { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.pe-event-image { margin: 0; }
.pe-event-image img { display: block; width: 100%; height: auto; border-radius: var(--pe-radius); box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.pe-event-info { background: var(--pe-soft); border: 1px solid var(--pe-border); border-top: 4px solid var(--pe-accent); border-radius: var(--pe-radius); padding: 1.25em 1.5em 1.5em; }
.pe-info-heading { margin: 0 0 .75em; font-size: 1.3em; }
.pe-event-info dl { margin: 0 0 1em; }
.pe-detail { display: flex; gap: 1em; margin: 0 0 .6em; }
.pe-detail dt { flex: 0 0 5.5em; font-weight: 700; margin: 0; }
.pe-detail dd { margin: 0; }
.pe-cal-heading { margin: 1.25em 0 0; font-weight: 700; font-size: .9em; }
.pe-event-main { min-width: 0; }
.pe-event-content, .pe-event-content.entry-content { float: none !important; width: auto !important; max-width: none !important; margin: 1.75em 0 0 !important; padding: 0 !important; font-size: 1.05em; }
.pe-event-content img { max-width: 100%; height: auto; }
.pe-event-page::after, .pe-event-hero::after { content: ""; display: table; clear: both; }
.pe-event-content > *:first-child { margin-top: 0; }
.pe-upcoming-dates { margin: 0 0 2em; }
.pe-upcoming-dates h2 { font-size: 1.25em; }
.pe-upcoming-dates ul { margin: 0 0 0 1.25em; }
.pe-event-nav { display: flex; justify-content: space-between; gap: 1em; border-top: 1px solid var(--pe-border); padding-top: 1.25em; }
.pe-event-nav a { color: inherit; max-width: 48%; }
.pe-event-nav a span { display: block; font-size: .85em; color: var(--pe-accent); font-weight: 600; }
.pe-nav-next { text-align: right; margin-left: auto; }

/* Older "details box" (kept for themes using the compact layout) */
.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); }

/* Full-width: hide any sidebar a theme still prints on event pages */
body.pe-full-width #secondary, body.pe-full-width #sidebar { display: none !important; }
body.pe-full-width .pe-single-page { width: 100% !important; max-width: none !important; float: none !important; margin-left: 0; margin-right: 0; }

@media (max-width: 900px) {
	.pe-featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
	.pe-event-hero.has-image { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.pe-featured-grid { grid-template-columns: 1fr; }
}

/* 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; margin-bottom: .75em; }
	.pe-detail dt { flex: none; }
	.pe-single-main { padding-top: 1.25em; }
}
