/* Ask Jones — Your Internet Enquiry Service
   A loving parody of the late-90s Ask Jeeves, relocated to Wales. */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=Playfair+Display:ital@1&display=swap');

:root {
  --cream: #fef4c1;
  --cream-dark: #ece0a0;
  --maroon: #7a1f1f;
  --maroon-dark: #5c1717;
  --green: #1e4d2b;
  --green-dark: #143a20;
  --link-blue: #0000cc;
  --link-visited: #551a8b;
  --ink: #2b2416;
  --gold: #d4a017;
  --border: #4a3f2a;
  --paper: #fffef2;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 16px;
  line-height: 1.45;
}

/* ---- Beveled "Windows 95 dialog" box look ---- */
.bevel {
  border-top: 2px solid #fffef2;
  border-left: 2px solid #fffef2;
  border-right: 2px solid #7a7255;
  border-bottom: 2px solid #7a7255;
  box-shadow: inset -1px -1px 0 #4a3f2a, inset 1px 1px 0 #ffffff;
}

/* ---- "NEW" pulse chip ---- */
.new-chip {
  display: inline-block;
  background: var(--maroon);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  margin-left: 6px;
  border: 1px solid var(--maroon-dark);
  vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---- Retro footer badges ---- */
.retro-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.retro-badges .badge-chip {
  background: var(--paper);
  border-top: 2px solid #fffef2;
  border-left: 2px solid #fffef2;
  border-right: 2px solid #7a7255;
  border-bottom: 2px solid #7a7255;
  box-shadow: inset -1px -1px 0 #4a3f2a, inset 1px 1px 0 #ffffff;
  font-size: 11px;
  font-family: Georgia, serif;
  padding: 5px 9px;
  text-align: center;
  line-height: 1.3;
  color: var(--ink);
}
.retro-badges .construction {
  background: repeating-linear-gradient(45deg, #f4c430, #f4c430 8px, #1a1a1a 8px, #1a1a1a 16px);
  color: #1a1a1a;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.hit-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: Georgia, serif;
}
.hit-counter .digits {
  background: #0c0c0c;
  color: #33ff55;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 3px 6px;
  border: 2px solid #444;
  box-shadow: inset 0 0 4px rgba(51,255,85,0.5);
}

.webring {
  text-align: center;
  font-size: 13px;
  margin: 10px 0;
  padding: 6px;
  border-top: 1px dashed #cbbf8a;
  border-bottom: 1px dashed #cbbf8a;
}
.webring button.link-like {
  background: none;
  border: none;
  color: var(--link-blue);
  text-decoration: underline;
  font-family: Georgia, serif;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.webring button.link-like:hover { color: var(--maroon); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fffef2;
  font-family: Georgia, serif;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; }

a {
  color: var(--link-blue);
  text-decoration: underline;
}
a:visited { color: var(--link-visited); }
a:hover { color: var(--maroon); }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 14px 40px;
}

/* ---- Nav ---- */
.nav {
  display: flex;
  gap: 0;
  margin: 0 0 18px;
  padding-top: 14px;
  list-style: none;
}
.nav a {
  display: block;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid var(--border);
  background: var(--green);
}
.nav a:visited { color: #fff; }
.nav li { flex: 1; }
.nav li.home { flex: 1.3; }
.nav li:not(:first-child) a { border-left: none; }
.nav a.active,
.nav li.home a {
  background: var(--maroon);
}
.nav a:hover {
  background: var(--gold);
  color: var(--ink);
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 18px;
}

.mascot {
  flex: 0 0 auto;
  width: 280px;
  height: auto;
  display: block;
}

.header-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 6px;
}

.wordmark {
  flex: 1 1 auto;
  margin-top: -8px;
  margin-left: -78px;
}
.wordmark .logo-img {
  display: block;
  height: 112px;
  width: auto;
  margin-left: 10px;
}
.wordmark .tagline {
  font-style: italic;
  font-size: 21px;
  color: var(--maroon-dark);
  margin: 4px 0 0 78px;
}

.badge {
  flex: 0 0 190px;
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 10px;
  font-size: 13px;
}
.badge-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}
.badge .icons {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.badge svg { width: 30px; height: 22px; display: block; }
.badge .daffodil { width: 26px; height: 26px; display: block; }
.badge strong {
  color: var(--maroon);
  display: block;
}

/* ---- Search block ---- */
.ask-panel {
  margin-bottom: 8px;
}
.ask-panel h2 {
  font-size: 18px;
  color: var(--maroon);
  margin: 0 0 8px;
}
.ask-form {
  display: flex;
  gap: 10px;
}
.ask-form input[type="text"] {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 16px;
  padding: 9px 10px;
  border: 2px inset #888;
  background: var(--paper);
}
.ask-form button {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
  background: var(--maroon);
  border: 1px solid var(--maroon-dark);
  border-radius: 14px;
  padding: 8px 26px;
  cursor: pointer;
}
.ask-form button:hover { background: var(--maroon-dark); }
.ask-form button:active { transform: translateY(1px); }

/* Loading + answer */
.loading {
  display: none;
  margin: 12px 0;
  font-style: italic;
  color: var(--green-dark);
}
.loading.show { display: block; }
.loading .bar {
  height: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
  margin-top: 6px;
  overflow: hidden;
}
.loading .bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(45deg, var(--maroon), var(--maroon) 8px, var(--green) 8px, var(--green) 16px);
  animation: fill 1.1s linear forwards;
}
@keyframes fill { to { width: 100%; } }

.answer {
  display: none;
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 6px solid var(--green);
}
.answer.show { display: block; }
.answer .q {
  font-weight: bold;
  color: var(--maroon);
  margin: 0 0 6px;
}
.answer .a {
  margin: 0;
}
.answer .a::before {
  content: "Jones says: ";
  font-weight: bold;
  color: var(--green-dark);
}

/* Recent questions */
.recent h3 {
  font-size: 15px;
  color: var(--maroon);
  margin: 18px 0 6px;
}
.recent ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recent li { border: none; }
.recent button {
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--border);
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  cursor: pointer;
}
.recent button:hover { background: var(--cream-dark); }

/* ---- Two-column links area ---- */
.columns {
  display: flex;
  gap: 24px;
  margin-top: 26px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--cream);
}
.columns > div { flex: 1; }
.columns h3 {
  text-align: center;
  color: var(--maroon);
  font-size: 17px;
  margin: 0 0 10px;
}
.columns .link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
}
.columns button.link-like {
  background: none;
  border: none;
  padding: 0;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--link-blue);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.columns button.link-like:hover { color: var(--maroon); }

/* ---- Generic content page styles ---- */
.page-title {
  color: var(--maroon);
  font-size: 26px;
  margin: 4px 0 4px;
}
.page-sub {
  font-style: italic;
  color: var(--green-dark);
  margin: 0 0 20px;
}
.content-block {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.content-block h2 {
  color: var(--maroon);
  font-size: 19px;
  margin-top: 0;
}
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.shop-item {
  border: 1px solid #ddd4a8;
  padding: 10px 12px;
  background: var(--cream);
}
.shop-item .price {
  color: var(--maroon-dark);
  font-weight: bold;
}
.qa-entry {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #cbbf8a;
}
.qa-entry:last-child { border-bottom: none; }
.qa-entry .q { color: var(--maroon); font-weight: bold; }

/* ---- Footer ---- */
.footer {
  margin-top: 30px;
  font-size: 13px;
  color: var(--ink);
}
.footer nav {
  text-align: center;
  border: 1px solid var(--border);
  background: var(--cream-dark);
  padding: 8px 10px;
}
.footer nav a { margin: 0 8px; }
.footer .copy { margin: 8px 0 0; text-align: left; color: #6b6142; }

@media (max-width: 640px) {
  .header { flex-wrap: wrap; }
  .mascot { width: 160px; }
  .badge { flex-basis: 100%; }
  .columns { flex-direction: column; }
  .shop-grid { grid-template-columns: 1fr; }
  .wordmark .logo-img { height: 70px; }
}
