/* =========================================================
   KENTUCKY OPEN SCIENCE WIKI - SHARED STYLESHEET
   The late-1990s portal look is intentional. Keep it; make it accessible.
   ========================================================= */

:root {
  --bg: #ece9d8;            /* Windows XP-ish parchment */
  --bg-panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #555;
  --navy: #1c3a78;
  --navy-dark: #0d214a;
  --red: #b8232a;
  --orange: #e87b00;
  --khaki: #c4b886;
  --rule: #888;
  --link: #0000ee;
  --link-visited: #551a8b;
  --shadow: rgba(0,0,0,0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--link); text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--red); background: #fff7a8; }

/* ===== SKIP LINK (WCAG 2.4.1) =====
   First Tab stop on every page. Off-screen until it has focus, then a navy
   tab over the banner with a dark/orange/dark focus ring. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.skip-link:visited { color: white; }
.skip-link:hover { background: var(--red); color: white; }
.skip-link:focus {
  top: 12px;
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--navy-dark);
}

/* ===== TOP BANNER ===== */
.banner {
  background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%);
  border-bottom: 3px double var(--navy);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.banner .wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.banner .wordmark .name {
  font-family: "Times New Roman", Times, serif;
  font-size: 30px;
  font-weight: bold;
  color: var(--navy);
  letter-spacing: -1px;
}
.banner .wordmark .name .tld {
  color: var(--red);
}
.banner .wordmark .tagline {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

/* ===== SHIMMERING KENTUCKY (inline SVG in layout.html, no GIF) =====
   A glossy map of the state; every 4 s a glint sweeps across it from left to
   right. At rest (and with the animation removed) the glint sits off the map. */
.ky-mark {
  width: 112px;
  height: 50.5px;               /* 112 x the viewBox's 45.1/100 */
  flex-shrink: 0;
  filter: drop-shadow(0 2px 2px var(--shadow));
}
.ky-mark .ky-shimmer {
  transform: skewX(-20deg);
  animation: ky-shimmer 4s ease-in-out infinite;
}
@keyframes ky-shimmer {
  0%, 55%   { transform: translateX(0) skewX(-20deg); }
  85%, 100% { transform: translateX(150px) skewX(-20deg); }
}

/* ===== TOP NAV ===== */
.topnav {
  background: var(--navy);
  color: white;
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--navy-dark);
}
.topnav a {
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-right: 1px solid var(--navy-dark);
}
.topnav a:visited { color: white; }
.topnav a:hover { background: var(--red); color: white; }
.topnav a.current { background: var(--orange); color: black; }

/* ===== MARQUEE ===== */
.marquee {
  background: black;
  color: #ffd200;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  padding: 6px 0;
  border-top: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
  overflow: hidden;
  white-space: nowrap;
}
.marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 28s linear infinite;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ===== LAYOUT (sidebar + main) ===== */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  max-width: 1100px;
  margin: 18px auto;
  padding: 0 14px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar .panel {
  background: var(--bg-panel);
  border: 2px solid var(--rule);
  border-style: outset;
  padding: 10px;
  font-size: 12px;
}
.sidebar .panel h3 {
  margin: 0 0 8px 0;
  font-size: 12px;
  background: var(--navy);
  color: white;
  padding: 4px 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar ul {
  margin: 0;
  padding: 0 0 0 18px;
}
.sidebar li { margin-bottom: 4px; }

/* visitor counter */
.counter {
  background: black;
  color: #29ff29;
  font-family: "Courier New", monospace;
  font-size: 22px;
  letter-spacing: 4px;
  text-align: center;
  padding: 6px 4px;
  border: 2px inset #555;
}
.counter-label {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== MAIN CONTENT ===== */
.main {
  background: var(--bg-panel);
  border: 2px solid var(--rule);
  border-style: outset;
  padding: 22px 26px;
  min-height: 400px;
}
.main h1 {
  font-family: "Times New Roman", Times, serif;
  color: var(--navy);
  font-size: 28px;
  margin: 0 0 4px 0;
  border-bottom: 3px double var(--navy);
  padding-bottom: 6px;
}
.main h2 {
  font-family: "Times New Roman", Times, serif;
  color: var(--navy);
  font-size: 20px;
  margin: 22px 0 10px 0;
}
.main .lede {
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 18px 0;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.product-card {
  background: #fdfdfa;
  border: 3px solid var(--khaki);
  border-style: outset;
  padding: 10px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card .thumb {
  height: 110px;
  background: linear-gradient(135deg, #f3f3f3 0%, #d0d0d0 100%);
  border: 1px inset #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  line-height: 1;
}
.product-card .name {
  font-weight: bold;
  font-size: 13px;
  color: var(--navy);
  margin-top: 8px;
}
.product-card .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.product-card .price {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: var(--red);
  font-weight: bold;
  margin-top: 4px;
}
.product-card .desc {
  font-size: 11px;
  margin-top: 6px;
  color: #333;
  flex-grow: 1;
}
.product-card .buy {
  display: inline-block;
  margin-top: 8px;
  background: var(--orange);
  color: black;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  padding: 4px 0;
  border: 2px outset #ffd081;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.product-card .buy:hover { background: var(--red); color: white; }
.product-card .buy:visited { color: black; }

/* NEW! blinking badge */
.badge-new {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--red);
  color: yellow;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 6px;
  border: 1px solid black;
  transform: rotate(8deg);
  animation: blink 1.1s steps(2, start) infinite;
  letter-spacing: 1px;
  z-index: 2;
}
@keyframes blink {
  to { visibility: hidden; }
}

/* ===== "Under construction" pill ===== */
.under-construction {
  display: inline-block;
  background: repeating-linear-gradient(
    45deg, #ffd200 0 12px, #000 12px 24px
  );
  color: white;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 10px;
  text-shadow: 1px 1px 0 black;
  border: 1px solid black;
}

/* ===== Guestbook entries ===== */
.gb-entry {
  background: #fffceb;
  border: 1px solid #c8b870;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 13px;
}
.gb-entry .gb-meta {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.gb-entry .gb-name {
  color: var(--navy);
  font-weight: bold;
}
.gb-form {
  background: #f5f0d8;
  border: 2px inset #999;
  padding: 14px;
  margin: 16px 0;
}
.gb-form input, .gb-form textarea {
  font-family: inherit;
  font-size: 13px;
  border: 2px inset #aaa;
  background: #f3f3f3;
  color: #777;
  width: 100%;
  padding: 4px;
  margin-top: 4px;
}
.gb-form button {
  background: #c0c0c0;
  border: 2px outset #fff;
  font-family: inherit;
  padding: 4px 14px;
  margin-top: 10px;
  cursor: not-allowed;
  color: #777;
}
.gb-form .disabled-note {
  font-size: 12px;
  color: var(--red);
  font-style: italic;
  margin-top: 8px;
}

/* ===== Footer ===== */
.footer-retro {
  max-width: 1100px;
  margin: 24px auto 30px;
  padding: 14px;
  border-top: 3px double var(--navy);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.footer-retro .badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.footer-retro .badge {
  background: white;
  border: 1px solid var(--rule);
  padding: 4px 10px;
  font-family: "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 1px;
}
.footer-retro a { color: var(--navy); }

/* ===== Tables (corporate-style data block) ===== */
.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}
.specs th, .specs td {
  border: 1px solid #888;
  padding: 5px 8px;
  text-align: left;
}
.specs th {
  background: var(--navy);
  color: white;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.specs tr:nth-child(even) td { background: #f4f4ec; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .banner { flex-wrap: wrap; padding: 10px 14px; }
  .banner .wordmark .name { font-size: 24px; }
  .topnav a { padding: 8px 10px; font-size: 11px; }
  .main { padding: 14px; }
  .main h1 { font-size: 22px; }
}

/* ===== Reflow helpers (WCAG 1.4.10) ===== */
/* Grid items default to min-width:auto, which lets wide content (tables) push
   the whole column past a narrow viewport. */
.layout > * { min-width: 0; }

/* Wrap a data table in this to let it scroll inside its own box instead of the
   page. Use a <section> with tabindex="0" and aria-labelledby so
   keyboard and screen-reader users can reach and name it. */
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll:focus { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ===== WIKI: search forms ===== */
.search-form label {
  display: block;
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}
.search-form input[type="search"] {
  font-family: inherit;
  font-size: 13px;
  border: 2px inset #aaa;
  background: #ffffff;
  color: var(--ink);
  width: 100%;
  padding: 4px;
}
.search-form button {
  background: #c0c0c0;
  border: 2px outset #fff;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 12px;
  margin-top: 6px;
  cursor: pointer;
  color: black;
}
.search-form button:active { border-style: inset; }
.search-hero {
  background: #f5f0d8;
  border: 2px inset #999;
  padding: 12px 14px;
  margin: 16px 0;
}
.search-hero input[type="search"] { max-width: 420px; }
.search-filters {
  border: 1px solid var(--khaki);
  margin: 10px 0 0;
  padding: 4px 10px 8px;
  font-size: 12px;
}
.search-filters legend { font-weight: bold; padding: 0 4px; }
.search-filters label {
  display: inline-block;
  font-weight: normal;
  margin: 0 14px 0 0;
}
.search-status {
  font-style: italic;
  color: var(--muted);
  min-height: 1.4em;
  margin: 0 0 6px;
}

/* ===== WIKI: project lists ===== */
.project-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.project-item {
  border-bottom: 1px dotted var(--rule);
  padding: 8px 0;
}
.project-item[hidden], .area[hidden] { display: none; }
.project-name { font-weight: bold; font-size: 14px; }
.project-meta { font-size: 11px; color: var(--muted); margin-left: 4px; }
.project-desc { margin: 3px 0 0; font-size: 12px; }
.project-desc mark { background: #fff7a8; color: inherit; }
.flag {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid black;
  vertical-align: 1px;
}
.flag-archived { background: #dddddd; color: #222; }
.flag-fork { background: var(--khaki); color: black; }
.flag-template { background: #cfe3ff; color: black; }
.area-blurb {
  font-style: italic;
  color: var(--muted);
  font-size: 12px;
  margin: -4px 0 6px;
}
.main h2 .count { font-size: 14px; color: var(--muted); font-weight: normal; }
.jump { font-size: 12px; }
.area-list { padding-left: 18px; }
.area-list li { margin-bottom: 6px; }
.topic-cloud {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.topic-cloud li { font-size: 11px; color: var(--muted); }
.topic-cloud a {
  display: inline-block;
  background: #fdfdfa;
  border: 2px outset var(--khaki);
  padding: 2px 8px;
  font-size: 12px;
  text-decoration: none;
}

/* ===== WIKI: project pages ===== */
.breadcrumb { font-size: 11px; margin: 0 0 8px; }
.status-note { font-size: 12px; }
.source-note { font-size: 11px; color: var(--muted); font-style: italic; }
.toc { font-size: 12px; columns: 2; column-gap: 24px; }
.toc .toc-3 { margin-left: 14px; }
.contributors { columns: 2; font-size: 12px; }
.specs th[scope="col"], .specs thead th { white-space: nowrap; }
.specs tr > th:first-child:not([scope]) { width: 30%; }
.specs caption { text-align: left; font-style: italic; color: var(--muted); padding: 4px 0; }
.main code {
  font-family: "Courier New", Courier, monospace;
  background: #f4f4ec;
  padding: 0 3px;
}
.clone {
  background: black;
  color: #29ff29;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 2px inset #555;
  white-space: pre;
}
.clone code { background: transparent; color: inherit; padding: 0; }

/* ===== BOUNTY BOARD: claim dialog (a 1998-style window) ===== */
.claim-dialog {
  padding: 0;
  border: 2px outset #dfdfdf;
  background: var(--bg);
  color: var(--ink);
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}
.claim-dialog::backdrop { background: rgba(13, 33, 74, 0.55); }
.claim-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(90deg, var(--navy-dark) 0%, var(--navy) 60%, #3a6ea5 100%);
  padding: 4px 4px 4px 10px;
}
.claim-titlebar h2 {
  margin: 0;
  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: white;
  overflow-wrap: anywhere;
}
.claim-close {
  flex-shrink: 0;
  width: 24px;
  height: 22px;
  padding: 0;
  line-height: 1;
  font-size: 16px;
  font-weight: bold;
  color: black;
  background: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
}
.claim-close:active { border-style: inset; }
.claim-body { padding: 12px 14px 14px; }
.claim-meta {
  margin: 0 0 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}
.claim-body label {
  display: block;
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}
.claim-body textarea {
  display: block;
  width: 100%;
  height: min(46vh, 420px);
  resize: vertical;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  background: #ffffff;
  color: var(--ink);
  border: 2px inset #aaa;
  padding: 6px 8px;
}
.claim-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.claim-button {
  display: inline-block;
  background: #c0c0c0;
  color: black;
  border: 2px outset #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 14px;
  text-decoration: none;
  cursor: pointer;
}
.claim-button:visited, .claim-button:hover { color: black; }
.claim-button:hover { background: #d4d0c8; }
.claim-button:active { border-style: inset; }
#claim-copy { background: var(--orange); border-color: #ffd081; }
#claim-copy:hover { background: #ff9a26; }
.claim-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 12px;
  text-align: right;
}
