/* Site layer on top of Tachyons (css/application.css).
   Only rules that Tachyons classes cannot express live here. */

:root {
  --kt-blue: #1f66c7;
  --kt-border: rgba(0, 0, 0, .1);
  --kt-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[hidden] { display: none !important; }

/* Darker Tachyons blue and gray so text meets WCAG AA contrast
   (4.5:1) on both white and the near-white page background. */
.blue, .hover-blue:hover, .hover-blue:focus { color: var(--kt-blue); }
.bg-blue { background-color: var(--kt-blue); }
.b--blue { border-color: var(--kt-blue); }
.gray { color: #666; }

:focus-visible {
  outline: 2px solid var(--kt-blue);
  outline-offset: 2px;
}

.kt-skip {
  position: absolute;
  left: -9999px;
}

.kt-skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  padding: .5rem 1rem;
  background: #fff;
  border-radius: .25rem;
}

.kt-brand { letter-spacing: -.01em; }

/* Tools menu: a <details> dropdown that works without JavaScript. */
.kt-menu summary { list-style: none; }
.kt-menu summary::-webkit-details-marker { display: none; }
.kt-menu[open] summary { background: #f4f4f4; }

.kt-menu__panel {
  top: calc(100% + .5rem);
  width: 18rem;
  max-height: 75vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

@media screen and (max-width: 30em) {
  .kt-menu__panel { position: fixed; top: 3.5rem; left: 1rem; right: 1rem; width: auto; }
}

.kt-menu__panel a[aria-current="page"] { color: var(--kt-blue); font-weight: 600; }

/* Tool cards on the home page and in related tools. */
.kt-card {
  transition: border-color .15s ease-in, box-shadow .15s ease-in, transform .15s ease-in;
}

.kt-card:hover,
.kt-card:focus-visible {
  border-color: var(--kt-blue);
  box-shadow: 0 6px 18px rgba(31, 102, 199, .15);
  transform: translateY(-1px);
}

.kt-filter:focus { border-color: var(--kt-blue); outline: none; box-shadow: 0 0 0 3px rgba(31, 102, 199, .2); }

.kt-tag { background: #e8f1fc; color: #1d4f91; }

/* IP results: a two-column card instead of a tall list. The scripts write
   dt/dd pairs with Tachyons spacing classes, which these rules override. */
#ip-address {
  display: grid;
  grid-template-columns: max-content 1fr;
  max-width: 40rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--kt-border);
  border-radius: .5rem;
}
#ip-address dt { margin: 0; padding: .5rem 1.5rem .5rem 0; color: #555; }
#ip-address dd { margin: 0; padding: .5rem 0; font-size: .875rem; word-break: break-word; }
#ip-address dt:not(:first-of-type),
#ip-address dt:not(:first-of-type) + dd { border-top: 1px solid var(--kt-border); }

/* Result tables (Email Header Parser): white card, aligned cells. */
main table {
  background: #fff;
  border: 1px solid var(--kt-border);
  border-radius: .5rem;
  border-collapse: separate;
  padding: 0 1rem;
}
main table td,
main table th { padding: .75rem 1rem .75rem 0; vertical-align: top; text-align: left; }
#summary td:first-child,
#headers td:first-child { width: 12rem; white-space: nowrap; }
#summary tr:last-child td,
#headers tr:last-child td,
#hops tr:last-child td { border-bottom: 0; }

/* Reserve space so a loading ad does not shift the page. */
.kt-ad { min-height: 120px; }

/* Code and data read better in a monospace font. */
main textarea,
main input[type="text"],
main input[type="number"],
#ip-address dd,
.kt-mono {
  font-family: var(--kt-mono);
}

main textarea:focus,
main input[type="text"]:focus,
main input[type="number"]:focus {
  border-color: var(--kt-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 102, 199, .2);
}

/* Long-form "About" text: keep lines at a readable length. */
main article p,
main article li { max-width: 42rem; }

main pre {
  background: #fff;
  border: 1px solid var(--kt-border);
  border-radius: .5rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--kt-mono);
  font-size: .875rem;
  line-height: 1.5;
}

/* Alay Translator: restyle the React app markup from cdn.kaklabs.com. */
/* The page header already shows the title, so hide the app's own header. */
.b-alay__header { display: none; }
.b-alay__app__fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.b-alay__app__fieldset__list { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.5rem; }
.b-alay__app__fieldset__list__checkbox input { margin-right: .5rem; }
.b-alay__app__textarea {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: .75rem;
  font-size: .875rem;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: .25rem;
  background: #fff;
  font-family: var(--kt-mono);
}
.b-alay__app__textarea[readonly] { background: #f4f4f4; }

/* HTTP Status Codes: status badge colors by class. */
.kt-status { min-width: 4rem; }
.kt-status--1 { background: #e8f1fc; color: #1d4f91; }
.kt-status--2 { background: #e6f4ea; color: #1e6b34; }
.kt-status--3 { background: #fff4e0; color: #8a5300; }
.kt-status--4 { background: #fdecea; color: #a1281b; }
.kt-status--5 { background: #f3e8fd; color: #6a2a9c; }
