/* HEFFA Notices — front-end display
   Scoped entirely under .heffa-notices so it sits inside the existing theme
   without touching anything else. Visual model: an official notice register,
   each entry spined with a type-colored rail and a docket-style citation. */

.heffa-notices {
	--hn-ink:      #1b2430;
	--hn-muted:    #5c6675;
	--hn-faint:    #8b94a1;
	--hn-line:     #e2e6ec;
	--hn-surface:  #ffffff;
	--hn-accent:   #1f4e79;   /* per-type accents override this below */

	max-width: 860px;
	margin: 0 auto;
	color: var(--hn-ink);
	font-size: 16px;
	line-height: 1.5;
}

.heffa-notices *,
.heffa-notices *::before,
.heffa-notices *::after { box-sizing: border-box; }

/* Hidden utility (filter state) */
.heffa-notice[hidden],
.heffa-notices__section[hidden],
.heffa-notices__none[hidden] { display: none !important; }

/* -------- Filter bar -------- */
.heffa-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: .55rem .9rem;
	padding: .8rem .95rem;
	margin: 0 0 1.2rem;
	background: #f7f8fa;
	border: 1px solid var(--hn-line);
	border-radius: 4px;
}
.heffa-filters__icon {
	color: var(--hn-muted);
	font-size: .95rem;
	padding-bottom: .5rem;
}
.heffa-filter {
	display: inline-flex;
	flex-direction: column;
	gap: .2rem;
}
.heffa-filter__label {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--hn-faint);
}
.heffa-filter__select {
	font-size: .9rem;
	color: var(--hn-ink);
	background: #fff;
	border: 1px solid var(--hn-line);
	border-radius: 4px;
	padding: .42rem .55rem;
	min-width: 160px;
	max-width: 100%;
}
.heffa-filter__select:focus-visible {
	outline: 2px solid var(--hn-accent);
	outline-offset: 1px;
}
.heffa-filter__clear {
	margin-left: auto;
	background: none;
	border: none;
	color: var(--hn-accent);
	font: inherit;
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	padding: .45rem .3rem;
}
.heffa-filter__clear:hover { text-decoration: underline; }
.heffa-filters__count {
	color: var(--hn-faint);
	font-size: .82rem;
	padding-bottom: .5rem;
	font-variant-numeric: tabular-nums;
}

/* -------- Sections (group_by="type") -------- */
.heffa-notices__section + .heffa-notices__section { margin-top: 2.5rem; }
.heffa-notices__section-title {
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--hn-muted);
	margin: 0 0 .9rem;
	padding-bottom: .5rem;
	border-bottom: 2px solid var(--hn-line);
}

/* -------- The register entry -------- */
.heffa-notice {
	position: relative;
	display: flex;
	background: var(--hn-surface);
	border: 1px solid var(--hn-line);
	border-radius: 3px;
	overflow: hidden;
}
.heffa-notice + .heffa-notice { margin-top: .85rem; }

.heffa-notice__rail {
	flex: 0 0 5px;
	background: var(--hn-accent);
}
.heffa-notice__body {
	flex: 1 1 auto;
	padding: 1.15rem 1.35rem 1.25rem;
	min-width: 0;
}

/* Top line: type eyebrow + prominent date chip */
.heffa-notice__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: .5rem;
}
.heffa-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--hn-accent);
}

/* Notice date — now a clear chip with a calendar icon */
.heffa-notice__date {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-size: .9rem;
	font-weight: 600;
	color: var(--hn-ink);
	background: #f2f5f8;
	border: 1px solid var(--hn-line);
	padding: .28rem .65rem;
	border-radius: 999px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.heffa-notice__date i { color: var(--hn-accent); font-size: .9em; }
.heffa-notice__date time { color: inherit; }

/* Title */
.heffa-notice__title {
	margin: 0 0 .4rem;
	font-size: 1.16rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--hn-ink);
}
.heffa-notice__title a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color .15s ease;
}
.heffa-notice__title a:hover,
.heffa-notice__title a:focus-visible { border-bottom-color: currentColor; }

/* Status / deadline pills */
.heffa-notice__flags {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin: .1rem 0 .55rem;
}
.heffa-pill {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .02em;
	padding: .2rem .55rem;
	border-radius: 999px;
	line-height: 1.25;
}
.heffa-pill i { font-size: .9em; }
.heffa-pill--deadline   { background: #fdf1d8; color: #8a5a00; }
.heffa-pill--closed     { background: #eceef1; color: #6a7482; }
.heffa-pill--superseded { background: #f6e7e7; color: #8f3a3a; }

/* Institutions + bond series */
.heffa-notice__insts {
	margin: 0 0 .5rem;
	font-size: .92rem;
	color: var(--hn-muted);
	font-weight: 600;
}
.heffa-notice__insts > i { color: var(--hn-accent); margin-right: .15rem; }
.heffa-notice__series {
	margin-left: .55rem;
	font-weight: 500;
	color: var(--hn-faint);
}
.heffa-notice__series i { color: var(--hn-faint); margin-right: .1rem; }

/* Summary */
.heffa-notice__summary {
	margin: 0 0 .65rem;
	color: var(--hn-ink);
}

/* Key/value lines (event, FAR) + relation line */
.heffa-notice__line,
.heffa-notice__far,
.heffa-notice__rel {
	margin: 0 0 .35rem;
	font-size: .9rem;
	color: var(--hn-muted);
}
.heffa-notice__k {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--hn-faint);
	margin-right: .5rem;
}
.heffa-notice__k i { color: var(--hn-faint); }
.heffa-notice__cite {
	font-variant-numeric: tabular-nums;
	color: var(--hn-ink);
	font-weight: 500;
}
.heffa-notice__rel > i { color: var(--hn-accent); margin-right: .3rem; }
.heffa-notice__rel a { color: var(--hn-accent); text-decoration: none; }
.heffa-notice__rel a:hover { text-decoration: underline; }

/* Actions */
.heffa-notice__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: .85rem;
}
.heffa-notice__download {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	background: var(--hn-accent);
	color: #fff;
	font-size: .88rem;
	font-weight: 600;
	text-decoration: none;
	padding: .5rem .9rem;
	border-radius: 3px;
	transition: filter .15s ease;
}
.heffa-notice__download:hover,
.heffa-notice__download:focus-visible { filter: brightness(1.1); color: #fff; }
.heffa-notice__more {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-size: .88rem;
	font-weight: 600;
	color: var(--hn-accent);
	text-decoration: none;
}
.heffa-notice__more i { font-size: .85em; }
.heffa-notice__more:hover { text-decoration: underline; }

/* Superseded entries recede */
.heffa-notice.is-superseded { background: #fbfbfc; }
.heffa-notice.is-superseded .heffa-notice__title a,
.heffa-notice.is-superseded .heffa-notice__title { color: var(--hn-muted); }
.heffa-notice.is-superseded .heffa-notice__rail { opacity: .45; }

/* Per-type accent colors */
.heffa-notice--public-hearing  { --hn-accent: #1f4e79; } /* institutional blue */
.heffa-notice--meeting-notice  { --hn-accent: #4f5a68; } /* slate */
.heffa-notice--rfq-procurement { --hn-accent: #8a6410; } /* bronze */
.heffa-notice--bid             { --hn-accent: #6b2f3c; } /* deep maroon */
.heffa-notice--other           { --hn-accent: #5c6675; }

/* Empty / no-match states */
.heffa-notices--empty p,
.heffa-notices__none {
	color: var(--hn-muted);
	font-style: italic;
	padding: 1rem 0;
}

/* Keyboard focus visibility */
.heffa-notices a:focus-visible {
	outline: 2px solid var(--hn-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Small screens */
@media (max-width: 600px) {
	.heffa-filters { gap: .5rem; }
	.heffa-filter { flex: 1 1 100%; }
	.heffa-filter__select { min-width: 0; width: 100%; }
	.heffa-filter__clear { margin-left: 0; }
	.heffa-filters__count { width: 100%; padding-bottom: 0; }
	.heffa-notice__top { flex-direction: column; align-items: flex-start; gap: .4rem; }
	.heffa-notice__body { padding: 1rem 1.05rem 1.1rem; }
	.heffa-notice__title { font-size: 1.08rem; }
	.heffa-notice__actions { gap: .75rem; }
	.heffa-notice__download { width: 100%; justify-content: center; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.heffa-notices * { transition: none !important; }
}
