/* Martek Repeater Directory — front end + admin */

.hrd-list, .hrd-filters, .hrd-detail, .hrd-form, .hrd-stats, .hrd-notice, .hrd-map {
	--hrd-accent: #0b5ea8;
	--hrd-accent-contrast: #fff;
	--hrd-border: rgba(127, 127, 127, 0.35);
	--hrd-zebra: rgba(127, 127, 127, 0.08);
	--hrd-radius: 6px;
	box-sizing: border-box;
}
.hrd-list *, .hrd-filters *, .hrd-detail *, .hrd-form *, .hrd-stats * { box-sizing: border-box; }

/* Buttons */
.hrd-btn {
	display: inline-block;
	padding: 0.5em 1em;
	border: 1px solid var(--hrd-accent);
	border-radius: var(--hrd-radius);
	background: transparent;
	color: var(--hrd-accent);
	font: inherit;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
}
.hrd-btn:hover, .hrd-btn:focus { background: var(--hrd-accent); color: var(--hrd-accent-contrast); }
.hrd-btn-primary { background: var(--hrd-accent); color: var(--hrd-accent-contrast); }
.hrd-btn-primary:hover, .hrd-btn-primary:focus { filter: brightness(1.1); }

/* Filter bar */
.hrd-filters { margin: 0 0 1.25em; padding: 0.9em; border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); }
.hrd-filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75em; }
.hrd-filter { display: flex; flex-direction: column; gap: 0.25em; font-size: 0.9em; }
.hrd-filter span { font-weight: 600; }
.hrd-filter input, .hrd-filter select { width: 100%; max-width: 100%; }
.hrd-filter-actions { margin-top: 0.8em; display: flex; gap: 0.75em; align-items: center; }
.hrd-reset { font-size: 0.9em; }

/* Table */
.hrd-table-wrap { overflow-x: auto; }
.hrd-table { width: 100%; border-collapse: collapse; margin: 0 0 0.75em; font-size: 0.95em; }
.hrd-table th, .hrd-table td { padding: 0.5em 0.65em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hrd-border); }
.hrd-table thead th { border-bottom-width: 2px; white-space: nowrap; }
.hrd-table tbody tr:nth-child(even) { background: var(--hrd-zebra); }
.hrd-table .hrd-sort { text-decoration: none; color: inherit; }
.hrd-table .hrd-sort:hover { text-decoration: underline; }
.hrd-table tr.hrd-past { opacity: 0.55; }
.hrd-count { font-size: 0.85em; opacity: 0.75; margin: 0.25em 0 0; }
.hrd-empty { padding: 1em; border: 1px dashed var(--hrd-border); border-radius: var(--hrd-radius); }

/* Cards */
.hrd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1em; margin-bottom: 1em; }
.hrd-card { border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); padding: 0.9em 1em; }
.hrd-card-title { margin: 0 0 0.4em; font-size: 1.15em; }
.hrd-card-freq { display: block; font-size: 0.85em; font-weight: 400; opacity: 0.8; }
.hrd-card-sched { margin: 0 0 0.5em; opacity: 0.85; }
.hrd-card-dl { margin: 0; }
.hrd-card-dl > div { display: flex; gap: 0.5em; padding: 0.15em 0; font-size: 0.92em; }
.hrd-card-dl dt { font-weight: 600; min-width: 5.5em; }
.hrd-card-dl dd { margin: 0; }

/* Badges */
.hrd-badge { display: inline-block; padding: 0.1em 0.55em; border-radius: 999px; font-size: 0.8em; font-weight: 600; border: 1px solid var(--hrd-border); white-space: nowrap; }
.hrd-status-on { background: rgba(30, 140, 60, 0.15); border-color: rgba(30, 140, 60, 0.5); }
.hrd-status-off { background: rgba(200, 40, 40, 0.15); border-color: rgba(200, 40, 40, 0.5); }
.hrd-status-test { background: rgba(220, 150, 0, 0.18); border-color: rgba(220, 150, 0, 0.55); }
.hrd-badge-ares, .hrd-badge-races, .hrd-badge-skywarn { background: rgba(11, 94, 168, 0.12); border-color: rgba(11, 94, 168, 0.45); }

/* Pagination */
.hrd-pagination { margin: 0.5em 0 1em; }
.hrd-pagination .page-numbers { display: inline-block; padding: 0.25em 0.6em; margin: 0 0.15em 0.25em 0; border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); text-decoration: none; }
.hrd-pagination .page-numbers.current { background: var(--hrd-accent); color: var(--hrd-accent-contrast); border-color: var(--hrd-accent); }

/* Detail */
.hrd-detail { margin: 0 0 1.5em; }
.hrd-detail-head { margin-bottom: 0.75em; }
.hrd-callsign { margin: 0 0 0.1em; }
.hrd-freq-big { margin: 0.1em 0 0.4em; font-size: 1.5em; font-weight: 700; }
.hrd-freq-big .hrd-offset { font-size: 0.65em; font-weight: 400; opacity: 0.75; }
.hrd-badges { margin: 0; }
.hrd-dl { margin: 0 0 1em; border-top: 1px solid var(--hrd-border); }
.hrd-dl-row { display: grid; grid-template-columns: minmax(8em, 11em) 1fr; gap: 1em; padding: 0.5em 0; border-bottom: 1px solid var(--hrd-border); }
.hrd-dl-row dt { font-weight: 600; }
.hrd-dl-row dd { margin: 0; overflow-wrap: anywhere; }
.hrd-subhead { margin: 1.2em 0 0.4em; }
.hrd-edit-link { margin-top: 1em; font-size: 0.9em; }

/* Stats */
.hrd-stats { display: flex; flex-wrap: wrap; gap: 0.75em; margin: 0 0 1em; }
.hrd-stat { flex: 0 1 auto; min-width: 6em; padding: 0.6em 0.9em; border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); text-align: center; }
.hrd-stat strong { display: block; font-size: 1.5em; line-height: 1.1; }
.hrd-stat span { font-size: 0.85em; opacity: 0.8; }

/* Notices */
.hrd-notice { padding: 0.7em 1em; margin: 0 0 1em; border-left: 4px solid var(--hrd-accent); background: var(--hrd-zebra); border-radius: 0 var(--hrd-radius) var(--hrd-radius) 0; }
.hrd-notice-error { border-left-color: #c62828; }
.hrd-notice-success { border-left-color: #2e7d32; }

/* Forms (front end and admin share field markup) */
.hrd-fieldset { margin: 0 0 1.25em; padding: 0.75em 1em 1em; border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); }
.hrd-group-title { padding: 0 0.4em; font-weight: 700; }
.hrd-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9em 1.1em; }
.hrd-field { display: flex; flex-direction: column; gap: 0.25em; min-width: 0; }
.hrd-field label { font-weight: 600; }
.hrd-field input[type="text"], .hrd-field input[type="url"], .hrd-field input[type="email"], .hrd-field input[type="time"],
.hrd-field input[type="date"], .hrd-field input[type="number"], .hrd-field select, .hrd-field textarea { width: 100%; max-width: 100%; }
.hrd-field .hrd-check, .hrd-checkgroup .hrd-check { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 400; margin-right: 1em; }
.hrd-field .hrd-check input { width: auto; }
.hrd-checkgroup { border: 0; margin: 0; padding: 0; min-width: 0; }
.hrd-checkgroup legend { font-weight: 600; padding: 0; margin-bottom: 0.25em; }
.hrd-type-multi, .hrd-type-textarea, .hrd-field-notes, .hrd-field-description { grid-column: 1 / -1; }
.hrd-help { margin: 0; font-size: 0.85em; opacity: 0.75; }
.hrd-req { color: #c62828; }
.hrd-has-error input, .hrd-has-error select, .hrd-has-error textarea { border-color: #c62828; }
.hrd-error { margin: 0; color: #c62828; font-size: 0.9em; }
.hrd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.hrd-form-actions { margin: 1em 0 0; }

/* Map */
.hrd-map { width: 100%; margin: 0 0 1em; border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); z-index: 0; }
.hrd-popup { line-height: 1.4; }
.hrd-popup div { margin: 0.1em 0; }

/* Mobile: stack table rows */
@media (max-width: 640px) {
	.hrd-table thead { position: absolute; left: -9999px; }
	.hrd-table, .hrd-table tbody, .hrd-table tr, .hrd-table td { display: block; width: 100%; }
	.hrd-table tr { border: 1px solid var(--hrd-border); border-radius: var(--hrd-radius); margin-bottom: 0.75em; padding: 0.25em 0; }
	.hrd-table td { border: 0; padding: 0.25em 0.75em; display: flex; gap: 0.75em; }
	.hrd-table td::before { content: attr(data-label); font-weight: 600; min-width: 6em; flex: 0 0 6em; }
	.hrd-table td:empty { display: none; }
	.hrd-dl-row { grid-template-columns: 1fr; gap: 0.1em; }
}

/* ---------- Admin ---------- */
.hrd-admin-form .hrd-fieldset { background: #fff; }
.hrd-admin-form .hrd-fields { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hrd-admin-form .hrd-field label { font-weight: 600; }
.hrd-admin-form .hrd-help { opacity: 1; color: #646970; }
.hrd-admin-cards { display: flex; flex-wrap: wrap; gap: 1em; margin: 1em 0; }
.hrd-admin-card { background: #fff; border: 1px solid #c3c4c7; padding: 0.5em 1.25em 1em; min-width: 240px; }
.hrd-admin-card .hrd-big { font-size: 2.2em; margin: 0; line-height: 1.2; }
.hrd-matrix-wrap { overflow-x: auto; }
.hrd-matrix th, .hrd-matrix td { text-align: center; vertical-align: bottom; }
.hrd-matrix tbody th { text-align: left; vertical-align: middle; }
.hrd-matrix .hrd-group-head { text-align: center; border-left: 2px solid #c3c4c7; }
.hrd-matrix .hrd-rot { height: 12em; padding: 0.4em 0.2em; }
.hrd-matrix .hrd-rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 400; }
.hrd-doc { background: #fff; border: 1px solid #c3c4c7; padding: 0 1.25em 1em; margin: 1em 0; max-width: 900px; }
.hrd-doc code { font-size: 0.95em; }
