/*
 * BroadbandSwitch.uk - Router Help Hub styles
 * SCOPED to .router-help and the hub search so it will not collide with the
 * site's global stylesheet.  Uses the brand colour #E50571.
 * Cursor: these are additive.  Where the site already defines buttons, tables,
 * or breadcrumbs globally, prefer the site's own components and delete the
 * matching rules here to keep one source of truth.
 */
:root {
  --bsw-brand: #E50571;
  --bsw-brand-dark: #b4045a;
  --bsw-ink: #1a1a2e;
  --bsw-muted: #5b5b6b;
  --bsw-line: #e4e4ef;
  --bsw-bg-soft: #faf7fb;
  --bsw-conf-high: #0a7d3c;
  --bsw-conf-med: #9a6a00;
  --bsw-conf-low: #8a8a94;
}

/* ---- layout & typography (scoped) ---- */
.router-help { max-width: 860px; margin: 0 auto; color: var(--bsw-ink); line-height: 1.65; }
.router-help h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .5rem; }
.router-help h2 { font-size: 1.4rem; margin: 2.25rem 0 .75rem; }
.router-help h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.router-help p { margin: 0 0 1rem; }
.router-help .byline { color: var(--bsw-muted); font-size: .95rem; margin-bottom: 1.25rem; }
.router-help .byline a { color: var(--bsw-brand); }
.router-help code { background: var(--bsw-bg-soft); border: 1px solid var(--bsw-line);
  padding: .1em .4em; border-radius: 4px; font-size: .95em; }

/* ---- breadcrumb ---- */
.breadcrumb { font-size: .85rem; color: var(--bsw-muted); margin: 0 0 1rem; }
.breadcrumb a { color: var(--bsw-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--bsw-brand); text-decoration: underline; }
.breadcrumb .sep { margin: 0 .35rem; opacity: .6; }

/* ---- answer-first block (featured-snippet target) ---- */
.answer-first { background: var(--bsw-bg-soft); border-left: 4px solid var(--bsw-brand);
  padding: 1rem 1.25rem; border-radius: 0 8px 8px 0; margin: 0 0 1.5rem; }
.answer-first p { margin: 0; }

/* ---- on-page TOC ---- */
.page-toc { border: 1px solid var(--bsw-line); border-radius: 8px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.page-toc .toc-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--bsw-muted); margin: 0 0 .5rem; }
.page-toc ul { margin: 0; padding-left: 1.1rem; columns: 2; }
.page-toc a { color: var(--bsw-brand); }

/* ---- search widget (hub) ---- */
.router-search { margin: 2rem 0; }
.search-box { position: relative; }
#router-search-input { width: 100%; font-size: 1.1rem; padding: .9rem 1rem;
  border: 2px solid var(--bsw-line); border-radius: 10px; box-sizing: border-box; }
#router-search-input:focus { outline: none; border-color: var(--bsw-brand);
  box-shadow: 0 0 0 3px rgba(229,5,113,.15); }
.search-hint { display: block; font-size: .85rem; color: var(--bsw-muted); margin-top: .4rem; }
.search-results { list-style: none; margin: .5rem 0 0; padding: 0; }
.search-result a { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem;
  border: 1px solid var(--bsw-line); border-radius: 8px; margin-bottom: .4rem;
  text-decoration: none; color: var(--bsw-ink); transition: border-color .15s, background .15s; }
.search-result a:hover { border-color: var(--bsw-brand); background: var(--bsw-bg-soft); }
.sr-title { font-weight: 600; flex: 1; }
.sr-ip code { font-size: .85rem; }
.sr-type { font-size: .75rem; color: var(--bsw-muted); text-transform: uppercase; letter-spacing: .04em; }
.search-empty, .search-result.search-empty { padding: .8rem; color: var(--bsw-muted); font-style: italic; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- browse card grids ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.brand-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem;
  border: 1px solid var(--bsw-line); border-radius: 10px; text-decoration: none; color: var(--bsw-ink);
  transition: border-color .15s, box-shadow .15s, transform .1s; }
.brand-card:hover { border-color: var(--bsw-brand); box-shadow: 0 4px 14px rgba(229,5,113,.12); transform: translateY(-1px); }
.brand-card-name { font-weight: 700; font-size: 1.05rem; }
.brand-card-ip code { font-size: .8rem; }
.brand-card-cta { color: var(--bsw-brand); font-size: .85rem; font-weight: 600; margin-top: auto; }

/* ---- tables (scoped, mobile-responsive) ---- */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.router-table, .cap-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.router-table th, .cap-table th { text-align: left; background: var(--bsw-ink); color: #fff;
  padding: .6rem .7rem; font-weight: 600; }
.router-table td, .cap-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--bsw-line);
  vertical-align: top; }
.router-table tr:nth-child(even) td, .cap-table tr:nth-child(even) td { background: var(--bsw-bg-soft); }
.muted { color: var(--bsw-muted); font-size: .85em; }

/* ---- confidence badges ---- */
.conf { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12em .5em;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; color: #fff; }
.conf-high { background: var(--bsw-conf-high); }
.conf-med  { background: var(--bsw-conf-med); }
.conf-low  { background: var(--bsw-conf-low); }

/* ---- steps, notes, faqs ---- */
.steps { margin: 0 0 1rem; padding-left: 1.3rem; }
.steps li { margin-bottom: .4rem; }
.note { background: #fff8e6; border: 1px solid #f0e2b8; border-radius: 8px; padding: .75rem 1rem;
  font-size: .92rem; }
.faq-item, .prob-item { border: 1px solid var(--bsw-line); border-radius: 8px; margin-bottom: .5rem; }
.faq-item summary, .prob-item summary { cursor: pointer; padding: .85rem 1rem; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker, .prob-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after, .prob-item summary::after { content: "+"; float: right; color: var(--bsw-brand); font-weight: 700; }
.faq-item[open] summary::after, .prob-item[open] summary::after { content: "\2212"; }
.faq-a, .prob-body { padding: 0 1rem 1rem; }

/* ---- CTAs ---- */
.deal-cta { background: linear-gradient(135deg, var(--bsw-brand), var(--bsw-brand-dark));
  color: #fff; padding: 1.5rem; border-radius: 12px; margin: 2rem 0; }
.deal-cta h2 { color: #fff; margin-top: 0; }
.deal-cta p { margin-bottom: .75rem; }
.btn { display: inline-block; padding: .65rem 1.2rem; border-radius: 8px; font-weight: 700;
  text-decoration: none; margin: .25rem .35rem .25rem 0; }
.btn-primary { background: #fff; color: var(--bsw-brand); }
.deal-cta .btn-primary { background: #fff; color: var(--bsw-brand); }
.btn-secondary { background: transparent; color: #fff; border: 2px solid #fff; }
/* On white sections (feedback), make primary use brand fill for contrast */
.feedback-block .btn-primary { background: var(--bsw-brand); color: #fff; }

/* Beat global a.btn { background:#fff } so outline secondary keeps white text on pink */
.router-help .deal-cta a.btn.btn-secondary,
.router-help .deal-cta a.btn.btn-secondary:link,
.router-help .deal-cta a.btn.btn-secondary:visited,
.router-help .deal-cta a.btn.btn-secondary:hover,
.router-help .deal-cta a.btn.btn-secondary:active {
  background: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  border: 2px solid #fff;
  box-shadow: none;
}
.router-help .deal-cta a.btn.btn-primary,
.router-help .deal-cta a.btn.btn-primary:link,
.router-help .deal-cta a.btn.btn-primary:visited,
.router-help .deal-cta a.btn.btn-primary:hover,
.router-help .deal-cta a.btn.btn-primary:active {
  background: #fff !important;
  color: var(--bsw-brand) !important;
  -webkit-text-fill-color: var(--bsw-brand);
  border: 1px solid #fff;
  text-decoration: none;
}

/* ---- feedback block ---- */
.feedback-block { border: 2px dashed var(--bsw-brand); border-radius: 12px; padding: 1.5rem;
  margin: 2.5rem 0 1rem; background: var(--bsw-bg-soft); }
.feedback-block h2 { margin-top: 0; }

/* ---- related ---- */
.related-list { columns: 2; padding-left: 1.1rem; }
.related-list a { color: var(--bsw-brand); }

/* ---- responsive: stacked tables on small screens ---- */
@media (max-width: 640px) {
  .page-toc ul, .related-list { columns: 1; }
  .router-table thead, .cap-table thead { display: none; }
  .router-table tr, .cap-table tr { display: block; border: 1px solid var(--bsw-line);
    border-radius: 8px; margin-bottom: .75rem; padding: .5rem; }
  .router-table td, .cap-table td { display: flex; justify-content: space-between; gap: 1rem;
    border: none; padding: .35rem .25rem; }
  .router-table td::before, .cap-table td::before { content: attr(data-label); font-weight: 700;
    color: var(--bsw-muted); flex-shrink: 0; }
}


/* House rule: white text on pink CTAs, including visited */
.router-help .feedback-block .btn-primary,
.router-help .feedback-block .btn-primary:visited,
.router-help .feedback-block .btn-primary:hover,
.router-help .feedback-block .btn-primary:active {
  background: var(--bsw-brand);
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  text-decoration: none;
}
