/**
 * VelocityVerify 1.5 — Subpages Design System Stylesheet
 * Scoped components for Legal, Informational, and Directory pages:
 * - Cookie Policy tables & opt-blocks
 * - Methodology metric cards & team profile grid
 * - Contact Us informational cards & direct communication channels
 * - ISP Performance Index rankings, tabs, speed bars, & score badges
 */

/* ── Common Content Shell Enhancements ─────────────────────── */
.document-shell h1,
.directory-shell h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--text, #f5f5f7);
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.document-shell h2,
.directory-shell h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text, #f5f5f7);
  margin-top: 2.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.12));
}

.document-shell h3,
.directory-shell h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text, #f5f5f7);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.document-shell p,
.document-shell li,
.directory-shell p,
.directory-shell li {
  color: var(--secondary, #a1a1aa);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.document-shell ul,
.directory-shell ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.document-shell strong,
.document-shell b,
.directory-shell strong,
.directory-shell b {
  color: var(--text, #f5f5f7);
  font-weight: 600;
}

.document-shell a,
.directory-shell a {
  color: var(--red, #ff003c);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.document-shell a:hover,
.directory-shell a:hover {
  color: #ff3366;
}

html[data-theme="light"] .document-shell a,
html[data-theme="light"] .directory-shell a {
  color: var(--red3, #d90033);
}

html[data-theme="light"] .document-shell a:hover,
html[data-theme="light"] .directory-shell a:hover {
  color: #b8002b;
}

/* ── Accessible Focus States (WCAG 2.2 AA Non-Text Contrast >= 3.0:1) ─ */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
summary:focus,
summary:focus-visible,
[tabindex]:focus,
[tabindex]:focus-visible {
  outline: 2px solid #ff003c !important;
  outline-offset: 2px !important;
}

html[data-theme="light"] a:focus,
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] textarea:focus-visible,
html[data-theme="light"] summary:focus,
html[data-theme="light"] summary:focus-visible,
html[data-theme="light"] [tabindex]:focus,
html[data-theme="light"] [tabindex]:focus-visible {
  outline: 2px solid #b8002b !important;
  outline-offset: 2px !important;
}

/* High contrast overrides for red/solid action buttons */
.cta-button:focus,
.cta-button:focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 3px !important;
}

html[data-theme="light"] .cta-button:focus,
html[data-theme="light"] .cta-button:focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px #000000 !important;
}

html[data-theme="light"] .skip-link:focus,
html[data-theme="light"] .skip:focus {
  background: #ffffff !important;
  color: #000000 !important;
  outline: 2px solid #000000 !important;
  outline-offset: 2px !important;
}

/* ── Cookie Policy Components ──────────────────────────────── */
.cookie-table-wrapper,
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0 2rem;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  background: var(--surface, #141416);
  -webkit-overflow-scrolling: touch;
}

.cookie-table,
table.content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
  line-height: 1.6;
}

.cookie-table th,
table.content-table th {
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  color: var(--text, #f5f5f7);
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.12));
}

.cookie-table td,
table.content-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--secondary, #a1a1aa);
  vertical-align: top;
}

.cookie-table tr:last-child td,
table.content-table tr:last-child td {
  border-bottom: none;
}

.cookie-table tr:hover td,
table.content-table tr:hover td {
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
}

/* High-contrast cookie categories */
.cat-essential {
  color: #10b981;
  font-weight: 700;
}
.cat-analytics {
  color: #f59e0b;
  font-weight: 700;
}
.cat-ads {
  color: #ef4444;
  font-weight: 700;
}

html[data-theme="light"] .cat-essential {
  color: #047857;
}
html[data-theme="light"] .cat-analytics {
  color: #b45309;
}
html[data-theme="light"] .cat-ads {
  color: #b91c1c;
}

.opt-block {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.opt-block h3 {
  margin-top: 0;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text, #f5f5f7);
}

.opt-block p:last-child,
.opt-block ul:last-child {
  margin-bottom: 0;
}

/* ── Methodology Metric & Team Cards ───────────────────────── */
.methodology-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.metric-card {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 1.35rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.metric-card:hover {
  border-color: var(--strong, rgba(255, 255, 255, 0.2));
  transform: translateY(-2px);
}

.metric-card__title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text, #f5f5f7);
  margin-bottom: 0.5rem;
}

.metric-card__desc {
  font-size: 13px;
  color: var(--secondary, #a1a1aa);
  line-height: 1.6;
  margin: 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.team-card {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #f5f5f7);
  margin: 0;
}

.team-card__name a {
  color: var(--text, #f5f5f7);
  text-decoration: none;
}

.team-card__name a:hover {
  color: var(--red, #ff003c);
  text-decoration: underline;
}

.team-card__role {
  font-size: 13px;
  font-weight: 600;
  color: var(--red, #ff003c);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[data-theme="light"] .team-card__role {
  color: var(--red3, #d90033);
}

/* ── Contact Us Cards ──────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 3rem;
}

.contact-card {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.contact-card:hover {
  border-color: var(--strong, rgba(255, 255, 255, 0.2));
  transform: translateY(-2px);
}

.contact-card h2,
.contact-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text, #f5f5f7);
  border-bottom: none;
  padding-bottom: 0;
}

.contact-card p {
  color: var(--secondary, #a1a1aa);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.contact-card .contact-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--red, #ff003c);
  text-decoration: none;
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

.contact-card .contact-link:hover {
  text-decoration: underline;
}

html[data-theme="light"] .contact-card .contact-link {
  color: var(--red3, #d90033);
}

/* ── Global ISP Performance Index Shell ────────────────────── */
.directory-shell {
  width: 100%;
  max-width: 1120px;
  margin: 40px auto 80px;
  padding: 0 24px;
  box-sizing: border-box;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header .subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--secondary, #a1a1aa);
  max-width: 860px;
  margin-bottom: 0.75rem;
}

.page-header .last-updated {
  font-size: 13px;
  color: var(--secondary, #71717a);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

/* Inactive Leaderboard Ad Reservation Container */
.ad-wrapper-leaderboard {
  min-height: 90px;
  margin: 1.75rem 0 2rem;
  background: var(--surface, rgba(255, 255, 255, 0.02));
  border: 1px dashed var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary, #71717a);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  contain: layout;
}

.ad-label {
  opacity: 0.6;
}

/* Key Findings Grid */
.key-findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.finding-card {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 1.35rem 1.25rem;
  text-align: center;
}

.finding-stat {
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 750;
  color: var(--text, #f5f5f7);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.finding-stat span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--secondary, #a1a1aa);
}

.finding-label {
  font-size: 13px;
  color: var(--secondary, #a1a1aa);
  font-weight: 500;
}

/* Call To Action Buttons */
.cta-wrapper {
  margin: 2rem 0;
  text-align: center;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: #c4002e;
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 650;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px rgba(196, 0, 46, 0.25);
}

.cta-button:hover,
.cta-button:focus-visible {
  background: #a30026;
  transform: translateY(-1px);
}

html[data-theme="light"] .cta-button {
  background: #b8002b;
}

html[data-theme="light"] .cta-button:hover,
html[data-theme="light"] .cta-button:focus-visible {
  background: #960023;
}

/* Region Filter Tabs */
.region-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  padding-bottom: 0.75rem;
}

.region-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--secondary, #a1a1aa);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.region-tab:hover {
  color: var(--text, #f5f5f7);
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
}

.region-tab.active {
  background: var(--surface, #141416);
  color: var(--text, #f5f5f7);
  border-color: var(--line, rgba(255, 255, 255, 0.16));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .region-tab.active {
  background: #ffffff;
  color: #1d1d1f;
  border-color: #d1d5db;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.filter-bar select {
  background: var(--surface, #141416);
  color: var(--text, #f5f5f7);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.16));
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
  font-family: inherit;
}

html[data-theme="light"] .filter-bar select {
  background: #ffffff;
  color: #1d1d1f;
  border-color: #d1d5db;
}

.record-count {
  font-size: 13px;
  color: var(--secondary, #a1a1aa);
  margin-left: auto;
  font-weight: 500;
}

/* ISP Table */
.isp-table-wrapper {
  margin: 1rem 0 2.5rem;
}

.isp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.isp-table th {
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  color: var(--text, #f5f5f7);
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  text-align: left;
}

.isp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--secondary, #a1a1aa);
  vertical-align: middle;
}

.isp-table tr:hover td {
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
}

.isp-name a {
  color: var(--text, #f5f5f7);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.isp-name a:hover {
  color: var(--red, #ff003c);
}

html[data-theme="light"] .isp-name a {
  color: #1d1d1f;
}

html[data-theme="light"] .isp-name a:hover {
  color: var(--red3, #d90033);
}

.isp-type {
  font-size: 12px;
  color: var(--secondary, #71717a);
  margin-top: 2px;
}

.speed-cell {
  min-width: 120px;
}

.speed-val {
  display: block;
  font-weight: 600;
  color: var(--text, #f5f5f7);
  margin-bottom: 4px;
}

html[data-theme="light"] .speed-val {
  color: #1d1d1f;
}

.speed-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.1));
  border-radius: 3px;
  overflow: hidden;
}

.speed-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff003c, #ff4d6d);
  border-radius: 3px;
}

html[data-theme="light"] .speed-bar {
  background: linear-gradient(90deg, #d90033, #e11d48);
}

/* Ranks */
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  color: var(--secondary, #a1a1aa);
}

.rank-1 {
  background: rgba(255, 215, 0, 0.18);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.4);
}
.rank-2 {
  background: rgba(192, 192, 192, 0.18);
  color: #e0e0e0;
  border: 1px solid rgba(192, 192, 192, 0.4);
}
.rank-3 {
  background: rgba(205, 127, 50, 0.18);
  color: #cd7f32;
  border: 1px solid rgba(205, 127, 50, 0.4);
}

/* Latency badges */
.ping-good {
  color: #10b981;
  font-weight: 650;
}
.ping-ok {
  color: #f59e0b;
  font-weight: 650;
}
.ping-bad {
  color: #ef4444;
  font-weight: 650;
}

html[data-theme="light"] .ping-good {
  color: #047857;
}
html[data-theme="light"] .ping-ok {
  color: #b45309;
}
html[data-theme="light"] .ping-bad {
  color: #b91c1c;
}

/* Score badges */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-weight: 750;
  font-size: 14px;
}

.score-a {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.score-b {
  background: rgba(59, 130, 246, 0.18);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.score-c {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.score-d {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

html[data-theme="light"] .score-a {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
html[data-theme="light"] .score-b {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}
html[data-theme="light"] .score-c {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
html[data-theme="light"] .score-d {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

/* FAQ Section */
.faq-section {
  margin: 3rem 0;
}

.faq-item {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: var(--surface, #141416);
  overflow: hidden;
}

.faq-question {
  padding: 1.15rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text, #f5f5f7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--secondary, #a1a1aa);
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question::after {
  content: "−";
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--secondary, #a1a1aa);
  font-size: 14px;
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Editorial Context, Related Reading & Methodology Note */
.editorial-section {
  margin: 2.5rem 0;
}

.related-reading {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2.5rem 0;
}

.related-reading h3 {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--text, #f5f5f7);
}

.related-reading ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-reading li {
  margin-bottom: 0.75rem;
}

.related-reading li:last-child {
  margin-bottom: 0;
}

.methodology-note {
  background: var(--surface, #141416);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-left: 3px solid var(--red, #ff003c);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0;
  color: var(--secondary, #a1a1aa);
  font-size: 13px;
  line-height: 1.7;
}

html[data-theme="light"] .methodology-note {
  border-left-color: var(--red3, #d90033);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .key-findings {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar select {
    width: 100%;
  }
  .record-count {
    margin-left: 0;
    text-align: right;
  }
}

/* Site Brand Logo Layout Stability - Synchronized with Canonical shared.css */
.site-brand__logo,
.brand-logo,
.site-logo-img {
  aspect-ratio: 84 / 46;
  width: auto;
  height: 46px;
}

@media (max-width: 768px) {
  .site-brand__logo,
  .brand-logo,
  .site-logo-img {
    height: 40px;
    width: auto;
    max-width: 85px;
  }
}

@media (max-width: 380px) {
  .site-brand__logo,
  .brand-logo,
  .site-logo-img {
    height: 36px;
    width: auto;
    max-width: 75px;
  }
}

