/* FlyNumber rates — Jekyll site styles
 * Drop in /assets/css/rates.css
 */

:root {
  --rates-primary: 221 83% 53%;
  --rates-fg: 222 84% 5%;
  --rates-muted: 215 16% 47%;
  --rates-border: 214 32% 91%;
  --rates-bg: 0 0% 99%;  /* matches the site-wide body bg (#fdfdfd) so /rates and /coverage don't flash a cooler canvas vs the rest of the Jekyll pages */
  --rates-card: 0 0% 100%;
}

.rates-page * { box-sizing: border-box; }
.rates-page {
  background: hsl(var(--rates-bg));
  color: hsl(var(--rates-fg));
  /* Use the site's Inter so the rates page doesn't visually disconnect from
     the rest of flynumber.com (which is also Inter). The original design
     used `ui-sans-serif, system-ui, ...` which becomes a different OS font
     and reads as a typography "jump" on the page. */
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  /* Full-bleed: minima's .wrapper constrains to ~800px which crams the table.
     Pull the element out to viewport width, then .rates-main caps at 1320px. */
  width: 100vw;
  position: relative;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
/* Inherit Inter into every text descendant so site-wide rules (e.g.
   `h1,h2,h3,h4 { font-family: Assistant }` from custom.css) don't sneak
   in a third typeface mid-card. */
.rates-page h1, .rates-page h2, .rates-page h3, .rates-page h4,
.rates-page h5, .rates-page h6,
.rates-page p, .rates-page li, .rates-page span,
.rates-page button, .rates-page input, .rates-page select,
.rates-page label, .rates-page th, .rates-page td,
.rates-page dt, .rates-page dd {
  font-family: inherit;
}
/* `100vw` can leak past the visible viewport when the page has a vertical
   scrollbar (the scrollbar gutter is excluded from the visible area but
   included in vw). Clip the overflow on ancestors to prevent a phantom
   horizontal scrollbar on Windows/older browsers. */
html:has(.rates-page),
body:has(.rates-page) { overflow-x: clip; }
.rates-page a { color: hsl(var(--rates-primary)); text-decoration: none; }
.rates-page a:hover { text-decoration: underline; }
.rates-page button { font-family: inherit; cursor: pointer; }

.rates-header {
  background:
    radial-gradient(1200px 300px at 80% -50%, hsl(var(--rates-primary) / 0.10), transparent 60%),
    hsl(var(--rates-card));
  border-bottom: 1px solid hsl(var(--rates-border));
}
.rates-header-inner { max-width: 1320px; margin: 0 auto; padding: 28px 32px 36px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: hsl(var(--rates-muted)); margin-bottom: 18px; }
.crumbs a { color: hsl(var(--rates-muted)); }
.crumbs a:hover { color: hsl(var(--rates-fg)); text-decoration: none; }
.crumbs-current { color: hsl(var(--rates-fg)); font-weight: 500; }

.header-flex { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.rates-header h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 8px; }
.page-sub { margin: 0; font-size: 15px; color: hsl(var(--rates-muted)); max-width: 640px; line-height: 1.55; }

.header-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  font-size: 14px; font-weight: 500; border-radius: 10px; border: 1px solid transparent;
  transition: background 150ms, border-color 150ms; }
.btn-primary { background: hsl(var(--rates-primary)); color: white; }
.btn-primary:hover { background: hsl(221 83% 48%); text-decoration: none; }
/* `.rates-page a` (specificity 0,1,1) outweighs the unscoped `.btn-primary`
   (0,1,0) and the link-color cascade would render white-on-blue invisible.
   Scope the primary/outline button colors to win for any `<a>` variant. */
.rates-page a.btn-primary { color: white; }
.rates-page a.btn-primary:hover { color: white; }
.rates-page a.btn-outline { color: hsl(var(--rates-fg)); }
.btn-outline { background: white; color: hsl(var(--rates-fg)); border-color: hsl(var(--rates-border)); }
.btn-outline:hover { background: hsl(210 40% 96%); text-decoration: none; }

.rates-main { max-width: 1320px; margin: 0 auto; padding: 32px 32px 80px;
  display: flex; flex-direction: column; gap: 24px; }

/* Product tabs (3 tabs: voice / tollfree / sms — DID/FlyNumber-rental tab dropped, coverage is its own page) */
.prod-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 14px;
  padding: 8px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.prod-tab { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  text-align: left; color: hsl(var(--rates-muted)); transition: all 150ms; }
.prod-tab:hover { background: hsl(220 25% 98%); color: hsl(var(--rates-fg)); }
.prod-tab.is-active { background: hsl(var(--rates-primary) / 0.06); border-color: hsl(var(--rates-primary) / 0.18); color: hsl(var(--rates-fg)); }
.prod-tab-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; background: hsl(210 40% 96%);
  color: hsl(var(--rates-muted)); flex-shrink: 0; }
.prod-tab.is-active .prod-tab-icon { background: hsl(var(--rates-primary)); color: white; }
.prod-tab-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.prod-tab-label { font-size: 15px; font-weight: 600; color: hsl(var(--rates-fg)); line-height: 1.3; }
.prod-tab-sub { font-size: 13px; color: hsl(var(--rates-muted)); line-height: 1.3; }

/* Filters */
.filters { background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.filter-row { display: grid; grid-template-columns: 280px 1fr; gap: 12px; align-items: end; }
.filter-col { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 13px; font-weight: 500; color: hsl(var(--rates-muted));
  letter-spacing: 0.01em; }
.select-native, .search-field input {
  width: 100%; height: 44px; padding: 0 14px;
  background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: hsl(var(--rates-fg));
}
.select-native:focus, .search-field input:focus { outline: none; border-color: hsl(var(--rates-primary));
  box-shadow: 0 0 0 3px hsl(var(--rates-primary) / 0.15); }
.search-field { position: relative; }
.search-field input { padding-left: 40px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: hsl(var(--rates-muted)); pointer-events: none; }

.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.active-filters[hidden] { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: hsl(var(--rates-primary) / 0.08); border: 1px solid hsl(var(--rates-primary) / 0.20);
  color: hsl(221 83% 40%); border-radius: 999px; font-size: 12px; font-weight: 500; }
.filter-chip-clear { background: transparent; border-color: hsl(var(--rates-border)); color: hsl(var(--rates-muted)); }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr);
  background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.stat { padding: 16px 20px; border-right: 1px solid hsl(var(--rates-border));
  display: flex; flex-direction: column; gap: 4px; }
.stat:last-child { border-right: none; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--rates-muted)); }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: hsl(var(--rates-fg)); }
.stat-sub { font-size: 12px; color: hsl(var(--rates-muted)); }

/* Results meta */
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 4px; flex-wrap: wrap; }
.results-count { font-size: 14px; color: hsl(var(--rates-muted)); }
.results-count strong { color: hsl(var(--rates-fg)); font-weight: 600; }
.heat-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: hsl(var(--rates-muted)); }
.heat-legend-bar { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid hsl(var(--rates-border)); }
.heat-legend-bar > span { display: inline-block; width: 24px; height: 12px; }
.heat-legend[hidden] { display: none; }

/* Tables */
.table-wrap { background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.rates-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.rates-table thead th { position: sticky; top: 0;
  background: hsl(220 25% 98%); border-bottom: 1px solid hsl(var(--rates-border));
  padding: 12px 18px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: hsl(var(--rates-muted)); user-select: none; cursor: pointer;
  text-align: left; z-index: 1; }
.rates-table thead th.num-col { text-align: right; }
.rates-table thead th:hover { color: hsl(var(--rates-fg)); background: hsl(220 25% 96%); }
.rates-table thead th small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; margin-top: 2px; opacity: 0.7; }
.rates-table thead th.is-sorted { color: hsl(var(--rates-fg)); }
.rates-table thead th.is-sorted::after { content: "↑"; margin-left: 4px; color: hsl(var(--rates-primary)); }
.rates-table thead th.is-sorted.is-desc::after { content: "↓"; }
/* Minima ships a default table style with bordered cells + striped rows
   (see minima/_base.scss:231 `table`). Strip both inside our scoped page,
   then re-apply ONLY the design's intended single bottom divider per row. */
.rates-page table { border: 0; color: inherit; }
.rates-page .rates-table th,
.rates-page .rates-table td { border: 0; }
.rates-page .rates-table tbody tr:nth-child(even) { background: transparent; }
/* Higher-specificity rule wins over the reset above: subtle row divider only,
   no vertical borders, no zebra. */
.rates-page .rates-table tbody td { border-bottom: 1px solid hsl(220 20% 95%); }
.rates-page .rates-table tbody tr:last-child td { border-bottom: 0; }
.rates-table tbody td { padding: 14px 18px; vertical-align: middle; }
.rates-table tbody td.num-col { text-align: right; }
.rates-table tbody tr:hover { background: hsl(var(--rates-primary) / 0.025); }

.flag { display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px;
  background: hsl(210 40% 96%); border: 1px solid hsl(var(--rates-border));
  font-size: 16px; line-height: 1; flex-shrink: 0; }
.cell-country { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-country-text { display: flex; flex-direction: column; line-height: 1.3; }
.cell-country-name { font-weight: 500; }
.cell-country-cc { font-size: 11px; color: hsl(var(--rates-muted)); letter-spacing: 0.04em; }

.prefix-chip { display: inline-flex; align-items: center; padding: 3px 9px;
  background: hsl(210 40% 96%); border: 1px solid hsl(var(--rates-border)); border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 500; color: hsl(var(--rates-fg)); letter-spacing: 0.02em; }

.rate-pill { display: inline-flex; align-items: baseline; gap: 2px; padding: 4px 10px;
  background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 8px;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: hsl(var(--rates-fg)); }
.rate-pill-primary { background: hsl(var(--rates-primary) / 0.08);
  border-color: hsl(var(--rates-primary) / 0.22); color: hsl(221 83% 40%); }
.rate-pill-sub { font-size: 11px; font-weight: 500; opacity: 0.7; }
/* heat tiers set via inline style by JS, but provide a default fallback */
.rate-pill[data-heat="1"] { background: hsl(140 70% 94%); border-color: transparent; color: hsl(142 72% 29%); }
.rate-pill[data-heat="2"] { background: hsl(43 96% 89%); border-color: transparent; color: hsl(38 92% 35%); }
.rate-pill[data-heat="3"] { background: hsl(28 96% 78%); border-color: transparent; color: hsl(17 88% 40%); }
.rate-pill[data-heat="4"] { background: hsl(0 80% 78%); border-color: transparent; color: hsl(0 74% 42%); }

.num { font-variant-numeric: tabular-nums; }
.num-zero { color: hsl(var(--rates-muted)); }

.billing-chip { display: inline-flex; align-items: center; padding: 2px 8px;
  background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; font-weight: 500; color: hsl(var(--rates-muted)); }

.type-chip { display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500; }
.type-local    { background: hsl(214 100% 96%); color: hsl(221 83% 40%); }
.type-mobile   { background: hsl(262 80% 96%);  color: hsl(262 83% 50%); }
.type-tollfree { background: hsl(140 75% 94%);  color: hsl(142 72% 29%); }

.empty { padding: 64px 20px; text-align: center; }
.empty[hidden] { display: none; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty-sub { font-size: 14px; color: hsl(var(--rates-muted)); }

/* Mobile cards */
.card-list { display: none; flex-direction: column; gap: 10px; }
.m-card { background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 12px;
  padding: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.m-card-head { display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid hsl(220 20% 95%); }
.m-card-head-text { flex: 1; min-width: 0; }
.m-card-country { font-weight: 600; font-size: 14px; }
.m-card-network { font-size: 12px; color: hsl(var(--rates-muted));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 0; }
.m-card-grid > div { display: flex; flex-direction: column; gap: 2px; }
.m-card-grid dt { font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  text-transform: uppercase; color: hsl(var(--rates-muted)); }
.m-card-grid dd { margin: 0; font-size: 13px; color: hsl(var(--rates-fg)); }

/* Footer */
.rates-foot { border-top: 1px dashed hsl(var(--rates-border)); padding-top: 28px; margin-top: 12px; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 24px; }
.foot-cols h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.foot-cols p { margin: 0; font-size: 13px; line-height: 1.6; color: hsl(var(--rates-muted)); }
.foot-cols code { background: hsl(210 40% 96%); border: 1px solid hsl(var(--rates-border));
  padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.foot-meta { font-size: 12px; color: hsl(var(--rates-muted)); text-align: center; }

/* ---- FlyNumber additions ---- */

/* Intro card — two-column split (text + image) on desktop, stacked on mobile */
.rates-intro { background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 14px;
  padding: 28px 32px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.rates-intro-split { display: grid; grid-template-columns: 1fr 220px; gap: 32px; align-items: center; }
.rates-intro-text p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; color: hsl(var(--rates-fg)); }
.rates-intro-text p:last-child { margin-bottom: 0; }
.rates-intro-text ul { margin: 0 0 12px; padding-left: 22px; font-size: 16px; line-height: 1.65;
  color: hsl(var(--rates-fg)); list-style: disc outside; }
/* The site-wide custom.css applies a neo-brutalist box treatment to every `ul li`
   (border, shadow, centered text). That's the wrong look inside the rates intro
   card — reset to plain list-item styling here. */
.rates-intro-text ul li {
  background: none;
  padding: 0;
  margin: 0 0 6px;
  border: 0;
  box-shadow: none;
  text-align: left;
  display: list-item;
  position: static;
  font-size: 16px;
  line-height: 1.65;
}
.rates-intro-fineprint { font-size: 14px; color: hsl(var(--rates-muted)); }
.rates-intro-image { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; }
.rates-intro-image img,
.rates-intro-image picture { max-width: 100%; height: auto; aspect-ratio: 1 / 1; }

/* Info cards — moved up from the design's footer (How billing works / About connect
   fees / Need a custom rate?). Sits between intro and tabs so users see context
   before encountering the cryptic billing notation. */
.rates-info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card { background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 12px;
  padding: 18px 20px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.info-card h4 { margin: 0 0 8px; font-size: 16px; font-weight: 600; line-height: 1.3;
  color: hsl(var(--rates-fg)); }
.info-card p { margin: 0; font-size: 14px; line-height: 1.6; color: hsl(var(--rates-muted)); }
.info-card code { background: hsl(210 40% 96%); border: 1px solid hsl(var(--rates-border));
  padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.info-card a { color: hsl(var(--rates-primary)); font-weight: 500; }
.info-card a:hover { text-decoration: underline; }

/* Inline heat legend living inside the "Rate / min" column header (per v2 design) */
.heat-inline { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
  vertical-align: middle; font-size: 10px; font-weight: 400; letter-spacing: 0;
  text-transform: none; color: hsl(var(--rates-muted)); }
.heat-inline-end { line-height: 1; }
.heat-inline-bar { display: inline-flex; border-radius: 999px; overflow: hidden;
  border: 1px solid hsl(var(--rates-border)); }
.heat-inline-bar > i { display: inline-block; width: 12px; height: 8px; }

/* Subtle bottom fineprint */
.rates-fineprint { font-size: 12px; color: hsl(var(--rates-muted)); text-align: center;
  padding-top: 16px; border-top: 1px dashed hsl(var(--rates-border)); margin-top: 8px; }

/* Filter row override: 3 cols (country, search, tier OR direction) */
.rates-page .filter-row { grid-template-columns: 280px 1fr 200px; }
.rates-page .filter-row [hidden] { display: none; }

/* Loading / error banner per panel — only takes space when it actually has
   content. The :empty rule collapses the gap between the filter row and the
   table when there's nothing to announce. */
.rates-status { font-size: 13px; color: hsl(var(--rates-muted)); padding: 6px 4px; min-height: 22px; }
.rates-status:empty { padding: 0; min-height: 0; }
.rates-status.is-error { color: hsl(0 74% 42%); font-weight: 500; }
.rates-status.is-loading::after { content: " …"; color: hsl(var(--rates-muted)); }

/* Server pagination bar */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 4px 0; flex-wrap: wrap; }
.pager[hidden] { display: none; }
.pager-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  background: white; border: 1px solid hsl(var(--rates-border)); border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 500; color: hsl(var(--rates-fg));
  transition: background 150ms, border-color 150ms; }
.pager-btn:hover:not([disabled]) { background: hsl(210 40% 96%);
  border-color: hsl(var(--rates-primary) / 0.4); }
.pager-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.pager-info { font-size: 13px; color: hsl(var(--rates-muted)); }

/* Wider mobile cards: dl-style for SMS / toll-free with fewer cols */
.m-card-rate { font-weight: 600; font-size: 16px; color: hsl(var(--rates-fg)); }

/* ---- Responsive (overrides + additions) ---- */

@media (max-width: 1100px) {
  .rates-page .filter-row { grid-template-columns: 1fr 1fr; }
  .rates-page .filter-row .filter-col:first-child,
  .rates-page .filter-row .search-col { grid-column: span 2; }
}

@media (max-width: 1024px) {
  .prod-tabs { grid-template-columns: repeat(2, 1fr); }
  .rates-info-cards { grid-template-columns: 1fr; gap: 10px; }
  .foot-cols { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 720px) {
  .rates-main { padding: 20px 18px 60px; gap: 16px; }
  .rates-intro { padding: 16px 18px; }
  .rates-intro-text p { font-size: 14px; }
  .rates-intro-split { grid-template-columns: 1fr; gap: 16px; }
  .rates-intro-image { max-width: 180px; margin: 0 auto; }
  .prod-tabs { grid-template-columns: 1fr; padding: 6px; gap: 6px; }
  .prod-tab-sub { display: none; }
  .filters { padding: 14px; }
  .rates-page .filter-row { grid-template-columns: 1fr; }
  .rates-page .filter-row .filter-col:first-child,
  .rates-page .filter-row .search-col { grid-column: span 1; }
  .table-wrap { display: none; }
  .card-list { display: flex; }
  .pager { justify-content: center; padding-top: 12px; }
  .pager-info { width: 100%; text-align: center; order: -1; margin-bottom: 4px; }
  /* Hide inline heat legend on mobile (table is hidden in card mode anyway) */
  .heat-inline { display: none; }
}
