/* mobiletracker.au — presentation layer on top of Pico CSS. */

:root {
  --pico-primary: #00DE60;
  --pico-primary-hover: #00c455;
}
[data-theme="dark"] {
  --brand: #00DE60;
  --brand-text: #00DE60;
  --brand-soft-bg: rgba(0, 222, 96, 0.12);
}
[data-theme="light"] {
  --brand: #00A94D;
  --brand-text: #007A33;
  --brand-soft-bg: rgba(0, 169, 77, 0.14);
}

/* ── Links and headings ── */
[data-theme="dark"] a:not([role="button"]) {
  color: #D1D5DB;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}
[data-theme="light"] a:not([role="button"]) {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.2);
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}
a:not([role="button"]):hover {
  color: var(--brand-text);
  text-decoration-color: var(--brand-text);
}
[data-theme="dark"] h1 strong { color: #FFFFFF; }
[data-theme="dark"] h1 span { color: #708090; font-weight: 300; }
[data-theme="light"] h1 strong { color: #111111; }
[data-theme="light"] h1 span { color: #556070; font-weight: 300; }

/* ── Buttons ── */
.btn-cta {
  background: #00DE60;
  color: #000 !important;
  font-weight: 600;
  border: none;
  text-decoration: none !important;
}
.btn-cta:hover { background: #00c455; color: #000 !important; }
.btn-outline {
  background: transparent;
  color: var(--brand-text) !important;
  border: 1px solid var(--brand);
  text-decoration: none !important;
  font-weight: 600;
}
.btn-outline:hover { background: var(--brand-soft-bg); }
.btn-sm { width: auto; padding: 0.3rem 0.75rem; margin: 0; font-size: 0.88rem; }
.nojs-only { display: none; }

/* ── Primitives ── */
.price { font-weight: bold; }
.tag {
  font-size: 0.78em; padding: 0.12em 0.45em; border-radius: 4px;
  background: var(--pico-secondary-background); color: #fff; white-space: nowrap;
}
.muted { color: var(--pico-muted-color); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 0.8rem; }
.nowrap { white-space: nowrap; }
.sub { display: block; font-size: 0.78rem; color: var(--pico-muted-color); }

/* ── Filter card ── */
.filter-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  margin-bottom: 1.25rem;
}
.filter-card > header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.filter-body { padding: 0.75rem 1rem 1rem; }
.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.filter-row label {
  margin-bottom: 0; font-size: 0.8rem; color: var(--pico-muted-color);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.filter-row select { margin-bottom: 0; padding: 0.4rem 0.5rem; font-size: 0.9rem; }
fieldset.control { border: none; padding: 0; margin: 0 0 0.75rem; }
fieldset.control legend {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--pico-muted-color); margin-bottom: 0.35rem;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip-group label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin: 0; padding: 0.3rem 0.65rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  cursor: pointer; font-weight: 400; font-size: 0.88rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chip-group label:hover { border-color: var(--brand); background: var(--brand-soft-bg); }
.chip-group label:has(input:checked) {
  border-color: var(--brand); background: var(--brand-soft-bg);
  color: var(--brand-text); font-weight: 600;
}
.chip-group input { margin: 0; }
.control-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nojs-hint { font-size: 0.8rem; color: var(--pico-muted-color); }

/* ── Badges and perks ── */
.network-badge {
  display: inline-block; padding: 0.12rem 0.45rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid transparent;
}
.network-telstra-full { background: #0033a0; color: #fff; border-color: #0033a0; }
.network-telstra-wholesale { background: transparent; color: #7aa7ff; border-color: #7aa7ff; }
[data-theme="light"] .network-telstra-wholesale { color: #1746a2; border-color: #1746a2; }
.network-optus { background: #00a5a8; color: #fff; }
.network-vodafone { background: #e60000; color: #fff; }

.tech-badge {
  display: inline-block; padding: 0.05rem 0.35rem; border-radius: 3px;
  background: var(--brand-soft-bg); color: var(--brand-text);
  font-weight: 700; font-size: 0.75rem;
}
.cap-badge {
  display: inline-block; padding: 0.05rem 0.35rem; border-radius: 3px;
  background: rgba(220, 120, 0, 0.14); color: #b45309; font-weight: 700; font-size: 0.72rem;
}
[data-theme="dark"] .cap-badge { color: #fbbf24; }
.uncapped { color: var(--pico-muted-color); font-size: 0.82rem; }
.perk {
  display: inline-block; font-size: 0.7rem; padding: 0.05rem 0.3rem;
  margin: 0.05rem 0.1rem 0.05rem 0; border-radius: 3px;
  border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color); white-space: nowrap;
}
.data-arrow { color: var(--pico-muted-color); margin: 0 0.15rem; }
.promo-end { color: var(--pico-muted-color); white-space: nowrap; font-size: 0.78rem; }
[data-theme="light"] .promo-end-soon { color: #92400e; font-weight: 600; }
[data-theme="dark"] .promo-end-soon { color: #fbbf24; font-weight: 600; }

/* ── Comparison table ── */
.table-scroll { overflow-x: auto; }
table.compare { font-size: 0.88rem; min-width: 900px; }
table.compare th, table.compare td { padding: 0.55rem 0.5rem; vertical-align: top; }
table.compare thead th {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--pico-muted-color); white-space: nowrap;
}
table.compare thead th a { color: inherit; text-decoration: none; }
table.compare thead th a:hover { color: var(--brand-text); }
table.compare tbody tr:hover { background: rgba(127, 127, 127, 0.06); }
table td .cell { display: block; }
.plan-name { font-weight: 600; }
.provider-name { font-size: 0.82rem; }
.plan-badges { margin-top: 0.3rem; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.plan-perks { margin-top: 0.25rem; }

/* ── Plan detail ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.metric-grid article { margin: 0; }
.metric {
  font-size: 1.8rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.plan-cta { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── Navigation ── */
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none !important; }
.brand svg { flex: 0 0 auto; filter: drop-shadow(0 0 3px #00DE60); }
.brand-name { margin: 0; font-size: 1.5rem; line-height: 1; color: var(--pico-color); }
.brand-name span { font-weight: 300; }
.btn-round {
  width: 1.75rem; height: 1.75rem; padding: 0; border-radius: 50%;
  line-height: 1; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (min-width: 769px) { .nav-mobile { display: none; } }
@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .nav-mobile details ul {
    display: flex; flex-direction: column; position: absolute; right: 0; min-width: 12rem;
    background: var(--pico-background-color); border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius); padding: 0.5rem 0; z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .nav-mobile details ul li { padding: 0.25rem 1rem; }
}

/* Turn wide tables into labelled cards below the tablet breakpoint. */
@media (max-width: 768px) {
  table.table-cards { min-width: 0; }
  .table-cards thead { display: none; }
  .table-cards tbody tr {
    display: block;
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-card-background-color);
  }
  .table-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--pico-muted-border-color);
    text-align: right;
  }
  .table-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--pico-muted-color);
    text-align: left;
  }
  .table-cards td .cell { min-width: 0; }
  .table-cards td:last-child { border-bottom: none; }
  /* The first cell is the card heading, not a label/value pair. */
  .table-cards td:first-child {
    display: block;
    text-align: left;
    border-bottom: 1px solid var(--pico-muted-border-color);
  }
  .table-cards td:first-child::before { display: none; }
}

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* ── Footer ── */
.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  font-size: 0.85em;
  color: var(--pico-muted-color);
}
.site-footer nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-footer nav a { color: inherit; }
.site-footer .copyright { text-align: center; opacity: 0.75; margin-bottom: 0; }

/* ── Small layout helpers ── */
.nojs-hint-top { margin: 0.6rem 0 0; }
