/* Hillsborough Masjid Events — front end. Fonts inherit from the theme. */

.hm-hub {
	--hm-primary: var(--hm-brand-primary, #0b5ea8);
	--hm-secondary: var(--hm-brand-secondary, #2f7d4f);
	--hm-cream: var(--hm-brand-cream, #f8f5ef);
	--hm-ink: #1c2530;
	--hm-muted: #5b6673;
	--hm-line: #e3e6ea;
	--hm-card: #fff;
	--hm-radius: 14px;
	--hm-shadow: 0 1px 2px rgba(16, 40, 61, .06), 0 4px 16px rgba(16, 40, 61, .06);
	color: var(--hm-ink);
	line-height: 1.55;
}
.hm-hub *, .hm-hub *::before, .hm-hub *::after { box-sizing: border-box; }
.hm-hub img { max-width: 100%; height: auto; display: block; }
.hm-hub a { color: var(--hm-primary); }
.hm-hub .hm-icon { flex: none; vertical-align: middle; }
.hm-hub .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hm-hub :focus-visible { outline: 2px solid var(--hm-primary); outline-offset: 2px; }
.hm-page-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 20px 64px; }

/* ------------------------------------------------------------ Buttons */
.hm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: .6em 1.25em;
	border: 2px solid transparent; border-radius: 999px;
	font: inherit; font-weight: 600; font-size: .95em; line-height: 1.2;
	text-decoration: none !important; cursor: pointer;
	transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.hm-btn:hover { transform: translateY(-1px); }
.hm-btn-primary { background: var(--hm-primary); color: #fff !important; }
.hm-btn-primary:hover { background: color-mix(in srgb, var(--hm-primary) 85%, #000); }
.hm-btn-outline { border-color: currentColor; color: var(--hm-primary) !important; background: transparent; }
.hm-btn-outline:hover { background: color-mix(in srgb, var(--hm-primary) 8%, transparent); }
.hm-btn-accent { background: var(--hm-secondary); color: #fff !important; }
.hm-btn-accent:hover { background: color-mix(in srgb, var(--hm-secondary) 85%, #000); }

/* ------------------------------------------------------------ Grid + cards */
.hm-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
@media (min-width: 1024px) {
	.hm-feed .hm-grid { grid-template-columns: repeat(var(--hm-cols, 3), minmax(0, 1fr)); }
}

.hm-card {
	position: relative; display: flex; flex-direction: column;
	overflow: hidden; border: 1px solid var(--hm-line); border-radius: var(--hm-radius);
	background: var(--hm-card); box-shadow: var(--hm-shadow);
	transition: transform .2s ease, box-shadow .2s ease;
}
.hm-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 40, 61, .06), 0 12px 28px rgba(16, 40, 61, .12); }
.hm-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--hm-primary), var(--hm-secondary)); }
.hm-card-media img { width: 100%; height: 100%; object-fit: cover; }
.hm-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .85);
	background-image: linear-gradient(135deg, transparent 0 48%, rgba(255,255,255,.08) 48% 52%, transparent 52%), linear-gradient(45deg, transparent 0 48%, rgba(255,255,255,.08) 48% 52%, transparent 52%);
	background-size: 36px 36px; }
.hm-brand-dar-al-quran .hm-card-media { background: linear-gradient(135deg, #e2a434, #b8791b); }
.hm-brand-legacy-series .hm-card-media { background: linear-gradient(135deg, #2f7d4f, #1d5234); }

.hm-date-badge {
	position: absolute; top: 12px; left: 12px;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	min-width: 54px; padding: 6px 8px; border-radius: 10px;
	background: #fff; color: var(--hm-ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); line-height: 1.1; text-align: center;
}
.hm-date-badge span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hm-primary); }
.hm-date-badge strong { font-size: 22px; }
.hm-flag { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: #b32d2e; color: #fff; font-size: 12px; font-weight: 700; }
.hm-card-body .hm-flag { position: static; margin-left: 6px; }

.hm-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 18px 18px; }
.hm-card-date { margin: 0; font-weight: 700; color: var(--hm-primary); font-size: .95em; }
.hm-hub .hm-card-title { margin: 0; font-size: 1.15em; line-height: 1.3; }
.hm-card-title a { color: var(--hm-ink) !important; text-decoration: none !important; }
.hm-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hm-card-title a:focus-visible { outline: none; }
.hm-card:focus-within { outline: 2px solid var(--hm-primary); outline-offset: 2px; }
.hm-card-cats { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--hm-muted); font-size: .88em; }
.hm-card-meta { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: .92em; color: var(--hm-ink); }
.hm-card-meta li { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.hm-card-meta .hm-icon { margin-top: 3px; color: var(--hm-primary); }
.hm-card-excerpt { margin: 4px 0 0; color: var(--hm-muted); font-size: .93em; }
.hm-card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--hm-primary); font-size: .92em; }
.hm-card:hover .hm-card-link .hm-icon { transform: translateX(3px); }
.hm-card-link .hm-icon { transition: transform .2s; }
.hm-card.is-cancelled .hm-card-title a { text-decoration: line-through !important; }
.hm-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--hm-primary) 10%, transparent); color: var(--hm-primary); font-weight: 600; }

.hm-empty, .hm-notice { margin: 16px 0; padding: 18px 20px; border-radius: 12px; background: var(--hm-cream); color: var(--hm-muted); text-align: center; }
.hm-notice { text-align: left; color: var(--hm-ink); border-left: 4px solid var(--hm-primary); }
.hm-notice-warn { border-left-color: #b32d2e; background: #fcf0f1; }

/* ------------------------------------------------------------ Filters */
.hm-filters { display: flex; flex-direction: column; gap: 14px; margin: 0 0 20px; padding: 18px; border-radius: var(--hm-radius); background: var(--hm-cream); }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-chip { position: relative; }
.hm-chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.hm-chip span, .hm-chip-link {
	display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
	border: 1.5px solid var(--hm-line); border-radius: 999px; background: #fff;
	color: var(--hm-ink) !important; font-weight: 600; font-size: .92em; text-decoration: none !important; cursor: pointer;
	transition: background .15s, border-color .15s;
}
.hm-chip span:hover, .hm-chip-link:hover { border-color: var(--hm-primary); }
.hm-chip input:checked + span, .hm-chip-link.is-active { background: var(--hm-primary); border-color: var(--hm-primary); color: #fff !important; }
.hm-chip input:focus-visible + span { outline: 2px solid var(--hm-primary); outline-offset: 2px; }
.hm-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hm-select select, .hm-search input {
	min-height: 44px; padding: 0 14px; border: 1.5px solid var(--hm-line); border-radius: 10px;
	background: #fff; color: var(--hm-ink); font: inherit; font-size: .95em;
}
.hm-select { flex: 1 1 180px; }
.hm-select select { width: 100%; }
.hm-search { position: relative; display: flex; align-items: center; flex: 2 1 220px; margin: 0; }
.hm-search label { position: relative; display: flex; align-items: center; width: 100%; margin: 0; }
.hm-search .hm-icon { position: absolute; left: 12px; color: var(--hm-muted); pointer-events: none; }
.hm-search input { width: 100%; padding-left: 38px; }
.hm-js .hm-apply { display: none; }
.hm-results-bar { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; color: var(--hm-muted); font-size: .92em; }
.hm-clear { font-weight: 600; }
.hm-pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 32px; color: var(--hm-muted); }

/* ------------------------------------------------------------ Feed on blue background */
.hm-feed-dark .hm-view-all .hm-btn-primary { background: #fff; color: var(--hm-primary) !important; }
.hm-feed-dark .hm-empty { background: rgba(255, 255, 255, .12); color: #fff; }
.hm-view-all { margin: 28px 0 0; text-align: center; }
.hm-feed-list .hm-grid { grid-template-columns: 1fr !important; }
@media (min-width: 640px) {
	.hm-feed-list .hm-card { flex-direction: row; }
	.hm-feed-list .hm-card-media { flex: 0 0 34%; aspect-ratio: auto; min-height: 180px; }
}

/* ------------------------------------------------------------ Single event */
.hm-event-hero { display: grid; gap: 24px; align-items: center; margin-bottom: 20px; }
@media (min-width: 900px) { .hm-event-hero:has(.hm-event-hero-media) { grid-template-columns: 1.1fr 1fr; } .hm-event-hero-media { order: 2; } }
.hm-event-hero-media { overflow: hidden; border-radius: 18px; aspect-ratio: 16 / 10; }
.hm-event-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hm-eyebrow { margin: 0 0 8px; color: var(--hm-secondary); font-weight: 700; letter-spacing: .02em; }
.hm-hub .hm-event-title { margin: 0 0 16px; font-size: clamp(1.8em, 4vw, 2.6em); line-height: 1.15; color: var(--hm-primary); }
.is-cancelled .hm-event-title { text-decoration: line-through; }
.hm-event-when { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 1.05em; }
.hm-event-when li { display: flex; align-items: center; gap: 10px; margin: 0; }
.hm-event-when .hm-icon { color: var(--hm-primary); }
.hm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 28px; }
.hm-dropdown { position: relative; }
.hm-dropdown > summary { list-style: none; }
.hm-dropdown > summary::-webkit-details-marker { display: none; }
.hm-dropdown-menu {
	position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 260px;
	margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--hm-line);
	border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .15);
}
.hm-dropdown-menu li { margin: 0; }
.hm-dropdown-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--hm-ink) !important; text-decoration: none !important; font-weight: 500; }
.hm-dropdown-menu a:hover { background: var(--hm-cream); }
.hm-dropdown-sep { margin-top: 4px !important; padding-top: 4px; border-top: 1px solid var(--hm-line); }

.hm-event-layout { display: grid; gap: 28px; }
@media (min-width: 900px) { .hm-event-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.hm-section { margin-bottom: 32px; }
.hm-hub .hm-section h2, .hm-hub .hm-panel h2 { margin: 0 0 12px; font-size: 1.3em; color: var(--hm-primary); }
.hm-prose > :first-child { margin-top: 0; }
.hm-panel { margin-bottom: 20px; padding: 20px; border-radius: var(--hm-radius); background: var(--hm-cream); }
.hm-hub .hm-panel h2 { font-size: 1.1em; }
.hm-details { margin: 0; }
.hm-details > div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, .07); }
.hm-details > div:last-child { border-bottom: 0; }
.hm-details dt { margin: 0; font-weight: 700; }
.hm-details dd { margin: 0; }
.hm-date-list { margin: 0; padding: 0; list-style: none; }
.hm-date-list li { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 7px 0; border-bottom: 1px solid rgba(0, 0, 0, .07); font-size: .95em; }
.hm-date-list li:last-child { border: 0; }
.hm-date-list li.is-current a { font-weight: 700; }
.hm-date-list span { color: var(--hm-muted); }
.hm-embed-box { padding: 12px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: #fff; }
.hm-embed-box iframe { display: block; width: 100% !important; max-width: 100%; min-height: 640px; border: 0; }
.hm-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.hm-section-head a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.hm-more-events { margin-top: 24px; padding-top: 32px; border-top: 1px solid var(--hm-line); }

/* ------------------------------------------------------------ Share */
.hm-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hm-share-label { margin-right: 4px; font-weight: 700; }
.hm-share-btn {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
	border: 1.5px solid var(--hm-line); border-radius: 999px; background: #fff;
	color: var(--hm-ink) !important; font: inherit; font-size: .9em; font-weight: 600; text-decoration: none !important; cursor: pointer;
}
.hm-share-btn:hover { border-color: var(--hm-primary); color: var(--hm-primary) !important; }
.hm-share-whatsapp { background: #e7f7ee; border-color: #bfe8cf; color: #106b3a !important; }
.hm-share-btn.is-done { background: #e7f7ee; border-color: #bfe8cf; }

@media (max-width: 600px) {
	.hm-actions .hm-btn, .hm-actions .hm-dropdown { flex: 1 1 100%; }
	.hm-actions .hm-dropdown summary { width: 100%; }
	.hm-dropdown-menu { right: 0; }
	.hm-filters { padding: 14px; }
	.hm-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
	.hm-chips::-webkit-scrollbar { display: none; }
	.hm-chip span, .hm-chip-link { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
	.hm-card, .hm-btn, .hm-card-link .hm-icon { transition: none; }
	.hm-card:hover, .hm-btn:hover { transform: none; }
}
