/*
 * 2launch.online — main stylesheet
 * Ported from the static prototypes (index3.html, show.html).
 * Web 1.0 aesthetic: monospaced, navy headers, classic link colors, multi-column directory.
 */

:root {
  --navy: #000080;
  --link: #0000EE;
  --visited: #551A8B;
  --border: #cccccc;
  --muted: #666666;
  --bg-soft: #f5f5f5;
}

* { box-sizing: border-box; }

body {
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  background-color: #ffffff;
  margin: 20px;
  color: #000000;
}

h1 {
  font-size: 24px;
  color: var(--navy);
  margin: 0 0 5px;
}

h2 {
  font-size: 18px;
  color: var(--navy);
  margin: 25px 0 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}

h3 {
  font-size: 16px;
  color: var(--navy);
  margin: 20px 0 8px;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:visited { color: var(--visited); }

/* Layout shell */
.header {
  border-bottom: 2px solid var(--navy);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.header-title { text-decoration: none; }
.header-title h1 { display: inline; }
.header-title:visited h1 { color: var(--navy); }

.search-bar form {
  display: inline-flex;
  gap: 4px;
}

.search-bar input[type="text"] {
  font-family: inherit;
  font-size: 13px;
  padding: 3px 6px;
  border: 1px solid var(--border);
}

.search-bar input[type="submit"] {
  font-family: inherit;
  font-size: 13px;
  padding: 3px 10px;
  background: #fff;
  border: 1px solid var(--navy);
  color: var(--navy);
  cursor: pointer;
}

.search-bar input[type="submit"]:hover {
  background: var(--navy);
  color: #fff;
}

.tagline {
  font-size: 11px;
  color: #333;
  margin-top: 15px;
  margin-bottom: 15px;
  max-width: 700px;
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 15px;
  font-size: 11px;
  color: var(--muted);
}

/* Flash messages */
.flash {
  padding: 8px 12px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.flash-notice { background: #eef; border-color: var(--navy); }
.flash-alert { background: #fee; border-color: #c00; color: #c00; }

/* Directory index — Yahoo/AltaVista-style inline layout */
.browse-controls {
  margin-bottom: 15px;
  font-size: 12px;
}

.toggle {
  cursor: pointer;
  color: #333;
  user-select: none;
}

.toggle input {
  margin-right: 4px;
  vertical-align: middle;
}

.directory-content {
  column-count: 3;
  column-gap: 40px;
  column-rule: 1px solid var(--border);
}

.category {
  margin-bottom: 14px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.category-name {
  margin-bottom: 3px;
}

.category-name strong a,
.category-name strong a:visited {
  color: var(--navy);
}

/* Inline comma-separated subcategories. Commas live in CSS ::before so
   they can be regenerated correctly when items are hidden via the toggle. */
.subcategory-inline {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.subcategory-inline > span {
  display: inline;
}

.subcategory-inline > span + span::before {
  content: ", ";
}

.count {
  color: var(--muted);
  font-size: 11px;
}

.new {
  color: #ff0000;
  font-weight: bold;
  font-size: 10px;
}

/* Hide-empty mode: hide any element marked empty */
body.hide-empty .directory-content [data-empty="true"] {
  display: none;
}

/* When hiding, regenerate commas between visible siblings only */
body.hide-empty .subcategory-inline > span::before {
  content: "";
}
body.hide-empty .subcategory-inline > span:not([data-empty="true"]) ~ span:not([data-empty="true"])::before {
  content: ", ";
}

/* Category show page */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 15px;
}

.breadcrumb a { color: var(--link); }

.listing-row {
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

.listing-row .listing-title {
  font-weight: bold;
}

.subcategories {
  margin: 15px 0 25px;
}

.subcategories .item {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: bold;
}

/* Listing show page */
.project-header {
  background-color: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 25px;
}

.project-title {
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 6px;
}

.project-tagline {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  font-style: italic;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.meta-item {
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 12px;
}

.action-buttons { margin: 20px 0; }

.action-button {
  background: #f0f0f0;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  margin-right: 10px;
  text-decoration: none;
  display: inline-block;
}

.action-button:hover { background: #e0e0e0; }

.content-section {
  margin-bottom: 30px;
}

.content-section p,
.content-section li {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Forms */
.form-section {
  max-width: 600px;
}

.form-section .field {
  margin-bottom: 15px;
}

.form-section label {
  display: block;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 4px;
  font-size: 13px;
}

.form-section input[type="text"],
.form-section input[type="url"],
.form-section input[type="email"],
.form-section textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  width: 100%;
}

.form-section textarea { min-height: 80px; resize: vertical; }

.form-section .hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.form-section .errors {
  color: #c00;
  font-size: 12px;
  margin-top: 3px;
}

.form-section input[type="submit"] {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 20px;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  cursor: pointer;
}

.form-section input[type="submit"]:hover { background: #00004d; }

/* Honeypot field — hidden from humans, tempting for bots */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Category picker — filterable accordion on submission form */
.picker-filter {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  box-sizing: border-box;
}

.category-picker {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: #fafafa;
  padding: 8px;
  font-size: 12px;
}

.cat-group {
  margin-bottom: 4px;
}

.cat-group-sub {
  margin-left: 18px;
  margin-top: 3px;
}

.cat-summary {
  cursor: pointer;
  padding: 3px 0;
  font-weight: bold;
  color: var(--navy);
}

.cat-group-sub > .cat-summary {
  font-weight: normal;
  color: #333;
}

.cat-summary input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
}

.cat-name { vertical-align: middle; }

.cat-children {
  margin-left: 20px;
  margin-top: 2px;
  padding-left: 4px;
}

.cat-option {
  display: block;
  padding: 2px 0;
  cursor: pointer;
}

.cat-option input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
}

.cat-option:has(input:checked) {
  color: var(--navy);
}

/* When filtering is active, hide anything that doesn't match or contain a match */
.category-picker.filtering .cat-group:not(.matches),
.category-picker.filtering .cat-option:not(.matches) {
  display: none;
}

/* Selected chips */
.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  min-height: 22px;
}

.chip {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 6px 2px 8px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #333;
}

.chip.primary {
  border-color: var(--navy);
  background: #eef;
}

.chip-primary-tag {
  font-size: 9px;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.chip-remove:hover {
  color: #c00;
}

/* Admin queue */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
}

.admin-table td.url { color: var(--muted); word-break: break-all; }

.admin-actions form { display: inline; }
.admin-actions button {
  font-family: inherit;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  margin-right: 4px;
}

.admin-actions button.approve:hover { background: var(--navy); color: #fff; }
.admin-actions button.reject { border-color: #c00; color: #c00; }
.admin-actions button.reject:hover { background: #c00; color: #fff; }

/* Search results */
.search-results .result {
  padding: 10px 0;
  border-bottom: 1px dotted var(--border);
}

.search-results .result .title {
  font-weight: bold;
  color: var(--navy);
}

.search-results .result .desc {
  color: #333;
  font-size: 12px;
  margin-top: 3px;
}

.search-results .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* Manifesto / long-form prose */
.manifesto {
  max-width: 640px;
  margin: 0 auto;
}

.manifesto-title {
  text-align: center;
  margin-bottom: 30px;
}

.manifesto p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: #333;
}

.manifesto h3 {
  margin-top: 30px;
}

.manifesto .manifesto-line {
  font-weight: bold;
  color: var(--navy);
  font-size: 15px;
  margin: 18px 0;
}

/* Responsive: collapse columns on narrow screens */
@media (max-width: 800px) {
  .directory-content { column-count: 1; }
  .header-top { flex-direction: column; align-items: flex-start; }
}
