/* ========================================
   IPDATA.FREE — the keyless free tier
   Built from the same parts as the dataset pages (geolocation, threat intelligence):
   a hero with a schematic, a strip and a stats row; numbered sections; the code
   window; bordered tables and grids.
   ======================================== */

/* ---- Hero ---- */

/* The headline breaks by phrase: after "thousand" on a wide screen, into three lines on a phone */

/* Hero schematic: background layer */

/* What one call returns, and the visitor's own answer under it */

/* A long answer wraps beside the arrow, and the detail drops under it */

/* ========================================
   SECTIONS: a centred, numbered header over the content
   ======================================== */
.free-section {
  padding: var(--space-5xl) 0;
  position: relative;
  z-index: 1;
}

.free-section--alt {
  background: var(--bg-secondary);
}

.free-section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.free-section-header h2 {
  margin-top: var(--space-lg);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.free-section-header p {
  margin-top: var(--space-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* Inline code, in the tables and cells */
.free-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  color: var(--text-primary);
  white-space: nowrap;
}

.free-section .muted {
  color: var(--text-secondary);
}

/* ========================================
   01 · LIVE: the code window, with the command as its path bar
   ======================================== */
.editor-wrap {
  max-width: 860px;
  margin: 0 auto;
}

/* The path bar is the command itself: type an address, run it */
.free-cmd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem var(--space-lg);
  border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
  background: color-mix(in srgb, var(--text-primary) 2%, transparent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.free-cmd-prompt {
  color: var(--text-muted);
}

.free-cmd-host {
  white-space: nowrap;
}

.free-cmd input {
  flex: 1;
  min-width: 6ch;
  margin-left: -0.5rem;
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: inherit;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  caret-color: var(--accent);
}

.free-cmd input:focus {
  border-bottom-color: var(--text-primary);
}

.free-cmd input::placeholder {
  color: var(--text-muted);
}

.free-cmd-run {
  flex-shrink: 0;
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg-primary);
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  cursor: pointer;
}

.free-cmd-run:focus-visible,
.free-cmd input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Syntax: the same quiet scheme as the dataset pages */
.editor-code .ek { color: var(--text-muted); }

/* How much of today's allowance is left */
.free-quota-bar {
  display: inline-block;
  width: 96px;
  height: 3px;
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.free-quota-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--text-primary);
  transition: width 0.4s ease;
}

/* Field notes under the window */
.editor-fields {
  margin-top: var(--space-2xl);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
}

.editor-field {
  padding: var(--space-lg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.editor-field:nth-child(3n) {
  border-right: none;
}

.editor-field:nth-last-child(-n+3) {
  border-bottom: none;
}

.editor-field-line {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-field-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.editor-field-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================================
   02 · TERMS: the whole deal, as a table
   ======================================== */
.free-terms {
  border: 1px solid var(--border);
  overflow: hidden;
}

.free-term-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background 150ms ease;
}

.free-term-row:last-child {
  border-bottom: none;
}

.free-term-row:hover {
  background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.free-term-row dt,
.free-term-row dd {
  margin: 0;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
}

.free-term-row dt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  border-right: 1px solid var(--border);
}

.free-term-row dd {
  display: block;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-primary);
}

/* ========================================
   03 · PER IP: three callers, three quotas
   ======================================== */
.free-cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
}

.free-case {
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  border-right: 1px solid var(--border);
}

.free-case:last-child {
  border-right: none;
}

.free-case-num {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: var(--space-sm);
}

.free-case-figure {
  margin: var(--space-sm) 0 var(--space-lg);
  color: var(--text-primary);
}

.free-case-figure svg {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  opacity: 0.75;
}

/* the title and the copy in the site's type; the number and the quota line stay mono as figures do */
.free-case h4 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.free-case p {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.free-case-quota {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--text-primary);
}

/* ========================================
   04 · BEYOND: when a thousand isn't enough
   ======================================== */
.free-next {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.free-next-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-xl);
  border-right: 1px solid var(--border);
}

.free-next-card:last-child {
  border-right: none;
}

.free-next-tier {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.free-next-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

.free-next-card p {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.free-next-card .btn {
  margin-top: auto;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1023px) {
  .editor-fields {
    grid-template-columns: repeat(2, 1fr);
  }

  .editor-field:nth-child(3n) {
    border-right: 1px solid var(--border);
  }

  .editor-field:nth-child(2n) {
    border-right: none;
  }

  .editor-field:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--border);
  }

  .editor-field:nth-last-child(-n+2) {
    border-bottom: none;
  }

  .free-term-row {
    grid-template-columns: 170px 1fr;
  }

  .free-cases {
    grid-template-columns: 1fr;
  }

  .free-case {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .free-case:last-child {
    border-bottom: none;
  }
}

@media (max-width: 767px) {

  .free-cmd {
    flex-wrap: wrap;
  }

  #free-quota {
    flex-wrap: wrap;
    gap: 2px var(--space-md);
  }

  #free-quota > span:first-child {
    flex-basis: 100%;
  }

  .editor-fields {
    grid-template-columns: 1fr;
  }

  .editor-field {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .editor-field:last-child {
    border-bottom: none !important;
  }

  .free-term-row {
    grid-template-columns: 1fr;
  }

  .free-term-row dt {
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
    padding: var(--space-md) var(--space-lg) var(--space-sm);
  }

  .free-term-row dd {
    padding: var(--space-sm) var(--space-lg) var(--space-md);
  }

  .free-section code.wrap {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .free-next {
    grid-template-columns: 1fr;
  }

  .free-next-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .free-next-card:last-child {
    border-bottom: none;
  }
}

/* the strip under the headline: five cells that just fit the column; the shared rule's wider padding on wide screens would push the last one under the card */
:root:not([data-json="0"]) .geo-hero-top .geo-hero-input { padding-left: 1.5rem; padding-right: 1.5rem; }

/* ---- 05 · Attribution: the credit, as a chip and as the HTML to paste ---- */
.attrib {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0.9rem 0;
}

.attrib-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.attrib-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.attrib-code {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.3rem 0.5rem 0.3rem 0.7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.attrib-code code {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attrib-copy {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
}

.attrib-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* the terms, the credit and the note as one block under the centred header: a column of reading width, set left */
.attrib-body {
  max-width: 760px;
  margin: 0 auto;
}

.attrib-body p {
  margin: 0 0 1.1rem;
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--text-secondary);
}

.attrib-body .attrib-note {
  margin: 1.25rem 0 0;
}

/* the hero's headline is the command itself, set in the mono face; the prompt sigil muted as a terminal shows it */
.free-command {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);   /* the mono face runs wider: sized so the command stays on one line */
  letter-spacing: -0.02em;
  white-space: nowrap;
}

@media (max-width: 479px) { .free-command { white-space: normal; } }

/* ---- 01 · Live: the response as the product pages' card (2026-10-15). The command line sits above the card, the
   switch above it chooses the rows, the JSON or the request as shell commands, and the foot is the day's allowance ---- */
.editor-wrap .free-cmd { margin: 0 0 var(--space-md); border: 1px solid var(--border); background: var(--bg-primary); }
.free-live-card-wrap { margin-top: var(--space-sm); }
.free-live-card-wrap .geo-card-tools { display: flex; }
.free-live-card.enrich-card { width: 100%; }
:root:is([data-theme="dark"]) .free-live-card.enrich-card { background: var(--bg-secondary); }
.free-live-card .enrich-card-meta { display: inline-flex; gap: .35rem; }
.free-live-card .geo-card-all { display: block; border-top: 1px solid var(--border); max-height: 23rem; overflow: auto; scrollbar-width: none; }
.free-live-card .geo-card-json { display: none; }
.free-live-card[data-view="json"] .geo-card-all, .free-live-card[data-view="shell"] .geo-card-all { display: none; }
.free-live-card[data-view="json"] .geo-card-json:not(.free-live-shell) { display: block; }
.free-live-card[data-view="shell"] .free-live-shell { display: block; }
.free-live-shell pre { counter-reset: none; }
.free-live-shell .ec { color: var(--text-muted); }
.free-live-shell .ex { color: var(--text-primary); }
.free-live-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; padding: .7rem 1.25rem; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .02em; color: var(--text-muted); }
.free-live-foot[hidden] { display: none; }
.free-live-foot strong { font-weight: 600; color: var(--text-primary); }
.free-live-foot .free-quota-bar { flex: 1 1 6rem; }
.free-live-card-wrap .geo-win-caption { margin-top: .9rem; }

/* links in the terms rows: underlined, the accent on hover, as the prose links on the product pages */
.free-term-row dd a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong, currentColor);
}

.free-term-row dd a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* the subtitle's link to the attribution section, underlined like the other prose links */
.geo-hero-sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong, currentColor);
}

.geo-hero-sub a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
