@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:ital,wght@0,400;0,600;0,700;0,800;1,600&display=swap');

/* ==========================================================================
   TIJUANA — bold Mexican poster / lucha-libre energy.
   Vibrant pink + turquoise + sunflower-yellow on warm cream.
   Thick black outlines, blocky offset shadows (neo-brutalist poster feel).
   Archivo Black display headings, Archivo body. High contrast, punchy.
   ========================================================================== */

:root {
  --ink: #1b1410;            /* near-black ink for outlines & text */
  --ink-soft: #5c4a3c;       /* warm brown-gray */
  --line: #1b1410;           /* borders are BLACK in this identity */
  --bg: #fff7ea;             /* warm cream */
  --bg-soft: #ffeccb;        /* deeper cream / sand */
  --accent: #e5007e;         /* hot Tijuana pink */
  --accent-soft: #ffd9ee;    /* pale pink wash */
  --good: #0a7d63;           /* deep turquoise-green */
  --good-bg: #baf3e2;        /* turquoise wash */
  --mid: #9a5a00;            /* burnt sunflower */
  --mid-bg: #ffe08a;         /* sunflower yellow */
  --bad: #c81d25;            /* lucha red */
  --bad-bg: #ffd2cf;         /* pale red */
  --unknown: #6f6357;        /* muted taupe */

  /* extra identity tokens (decorative only) */
  --turq: #00b5ad;           /* bright turquoise */
  --turq-soft: #c9f5f2;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-pink: 4px 4px 0 var(--accent);

  --max-width: 76rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  /* subtle confetti-dot poster texture */
  background-image:
    radial-gradient(var(--turq-soft) 1.5px, transparent 1.6px),
    radial-gradient(var(--accent-soft) 1.5px, transparent 1.6px);
  background-size: 34px 34px, 34px 34px;
  background-position: 0 0, 17px 17px;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
main.container { padding-top: 1.75rem; padding-bottom: 3.5rem; }

a { color: var(--accent); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 3px; }

h1, h2, h3 {
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
}
h1 {
  font-size: 2.3rem; line-height: 1.02; margin: 0.6rem 0 0.9rem;
  text-shadow: 3px 3px 0 var(--accent);
}
h2 {
  font-size: 1.5rem; line-height: 1.05; margin: 2.25rem 0 0.6rem;
  color: var(--accent);
}
h3 { font-size: 1.15rem; line-height: 1.1; margin: 1.35rem 0 0.45rem; }
p { margin: 0.5rem 0 1rem; }

.lead { font-size: 1.12rem; color: var(--ink); font-weight: 600; max-width: 52rem; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 3px solid var(--line);
  background: var(--turq);
}
.site-header .container {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem;
  padding-top: 0.9rem; padding-bottom: 0.85rem;
}
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand-name {
  font-family: "Archivo Black", sans-serif;
  font-weight: 900; font-size: 1.35rem; letter-spacing: 0.01em;
  text-transform: uppercase; line-height: 1;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--bg);
}
.brand-tagline { font-size: 0.78rem; color: var(--ink); font-weight: 700; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; font-size: 0.9rem; font-weight: 700; }
.site-nav a {
  text-decoration: none; color: var(--ink); text-transform: uppercase;
  padding: 0.2rem 0.55rem; border: 2px solid transparent; border-radius: 999px;
  letter-spacing: 0.02em;
}
.site-nav a:hover { color: var(--ink); background: var(--mid-bg); border-color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--bg); background: var(--accent); border-color: var(--ink);
}

.lang-switcher { margin-left: auto; font-size: 0.85rem; white-space: nowrap; font-weight: 700; }
.lang-switcher a { text-decoration: none; color: var(--ink); }
.lang-switcher a:hover { color: var(--accent); text-decoration: underline; }
.lang-current { font-weight: 900; color: var(--bg); background: var(--accent); border: 2px solid var(--ink); padding: 0 0.35rem; border-radius: 5px; }
.lang-sep { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  margin-top: 1.5rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: var(--mid-bg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 1.6rem;
  position: relative;
}
.hero::before {
  content: "★"; position: absolute; top: -0.8rem; right: 1.2rem;
  font-size: 1.6rem; color: var(--accent);
  text-shadow: 2px 2px 0 var(--ink);
}
.hero h1 { max-width: 46rem; text-shadow: 3px 3px 0 var(--turq); }
.hero-links { font-size: 0.95rem; font-weight: 700; }

/* ---------- Profile controls ---------- */
.ranking-controls { margin: 1.75rem 0 1rem; }
.profile-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.profile-btn {
  font: inherit; font-weight: 800; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.02em;
  padding: 0.4rem 0.95rem;
  border: 2.5px solid var(--ink); border-radius: 999px;
  background: var(--bg); color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.profile-btn:hover { background: var(--turq-soft); }
.profile-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.profile-btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--ink); color: var(--bg);
  box-shadow: 3px 3px 0 var(--ink);
}
.profile-desc { min-height: 1.4em; margin: 0.7rem 0 0; font-size: 0.92rem; color: var(--ink-soft); font-weight: 600; }

.table-filter { margin-top: 0.9rem; }
.table-filter input {
  font: inherit; font-size: 0.95rem; width: 100%; max-width: 20rem;
  padding: 0.5rem 0.8rem; border: 2.5px solid var(--ink); border-radius: 8px;
  background: var(--bg); box-shadow: var(--shadow);
}
.table-filter input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-pink); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 3px solid var(--line); border-radius: 12px;
  background: var(--bg); box-shadow: var(--shadow-lg);
}
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 2px solid var(--line); vertical-align: top; }
thead th {
  font-family: "Archivo Black", sans-serif;
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--bg); background: var(--ink); border-bottom: 3px solid var(--line);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.ranking-table tbody tr:hover { background: var(--mid-bg); }
.ranking-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-soft) 45%, transparent); }
.ranking-table tbody tr:nth-child(even):hover { background: var(--mid-bg); }
.rank-cell {
  font-family: "Archivo Black", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--accent); width: 2.4rem; font-size: 1.05rem;
}
.name-cell a { font-weight: 800; text-decoration: none; color: var(--ink); }
.name-cell a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.score-cell { white-space: nowrap; }
.th-sub { font-size: 0.7em; color: var(--bg); opacity: 0.85; margin-left: 0.15em; text-transform: none; }
.cat-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cat-max { color: var(--ink-soft); font-size: 0.8em; }
.flags-cell .flag-count { color: var(--bad); font-weight: 800; }
.flags-cell .flag-none { color: var(--ink-soft); }
.table-note { margin-top: 0.85rem; max-width: 52rem; }

.excluded-note { margin-top: 1rem; font-size: 0.92rem; }
.excluded-note summary { cursor: pointer; color: var(--accent); font-weight: 700; }

/* ---------- Score badges ---------- */
.score-badge {
  display: inline-block; min-width: 2.6em; text-align: center;
  padding: 0.15em 0.5em; border-radius: 7px;
  border: 2px solid var(--ink);
  font-family: "Archivo Black", sans-serif;
  font-weight: 900; font-variant-numeric: tabular-nums;
  box-shadow: 2px 2px 0 var(--ink);
}
.score-high { background: var(--good-bg); color: var(--good); }
.score-mid { background: var(--mid-bg); color: var(--mid); }
.score-low { background: var(--bad-bg); color: var(--bad); }
.score-na { background: var(--bg-soft); color: var(--unknown); }

/* ---------- Bars ---------- */
.bar {
  background: var(--bg-soft); border: 2px solid var(--ink); border-radius: 999px;
  height: 0.75rem; overflow: hidden; min-width: 6rem; flex: 1;
}
.bar-fill {
  background: linear-gradient(90deg, var(--turq), var(--accent));
  height: 100%;
}

/* ---------- Cards ---------- */
.cards-section { margin-top: 2.75rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; }
.clinic-card {
  border: 3px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem;
  background: var(--bg); box-shadow: var(--shadow-lg);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.clinic-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--accent); }
.clinic-card:nth-child(3n+2) { background: var(--turq-soft); }
.clinic-card:nth-child(3n) { background: var(--accent-soft); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.card-head h3 { margin: 0; font-size: 1.05rem; }
.card-head a { text-decoration: none; color: var(--ink); }
.card-head a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.card-summary { font-size: 0.88rem; color: var(--ink-soft); font-weight: 600; }
.card-bars { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.7rem 0; }
.card-bar-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.card-bar-label { flex: 0 0 9.5rem; color: var(--ink-soft); font-weight: 600; }
.card-bar-pts { flex: 0 0 3.2rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; }
.card-meta { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Clinic page ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.5rem; font-weight: 700; }
.clinic-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap;
  border: 3px solid var(--line); border-radius: 14px; background: var(--mid-bg);
  box-shadow: var(--shadow-lg); padding: 1.2rem 1.3rem; margin-top: 0.5rem;
}
.clinic-headline { font-size: 1.05rem; max-width: 46rem; font-weight: 600; }
.clinic-score-big {
  font-family: "Archivo Black", sans-serif;
  font-size: 2.2rem; display: flex; align-items: baseline; gap: 0.3rem;
}
.clinic-score-big .score-badge { padding: 0.15em 0.55em; box-shadow: 3px 3px 0 var(--ink); }
.score-of { color: var(--ink-soft); font-size: 1rem; font-weight: 700; }

.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  display: inline-flex; align-items: baseline; gap: 0.5em;
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 0.3rem 0.8rem;
  font-size: 0.85rem; font-weight: 700; background: var(--bg);
  box-shadow: 2px 2px 0 var(--ink);
}
.chip-ranked { background: var(--turq-soft); border-color: var(--ink); }
.chip-rank { font-weight: 900; color: var(--accent); font-family: "Archivo Black", sans-serif; }
.chip-excluded { color: var(--ink-soft); background: var(--bg-soft); }
.chip-excluded .chip-rank { color: var(--unknown); font-weight: 700; }
.chip-score { color: var(--ink-soft); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
@media (max-width: 44rem) { .two-col { grid-template-columns: 1fr; } }
.plus-list li::marker { color: var(--good); content: "▲ "; }
.minus-list li::marker { color: var(--bad); content: "▼ "; }

.cat-section { margin-top: 1.75rem; }
.cat-section-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  border-bottom: 3px solid var(--line); padding-bottom: 0.4rem;
}
.cat-section-head h3 { margin: 0; }
.cat-section-score { display: flex; align-items: center; gap: 0.6rem; min-width: 14rem; font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 700; }

.crit-table { font-size: 0.9rem; }
.crit-table td { padding: 0.4rem 0.55rem; }
.crit-status { width: 1.6rem; }
.crit-pts { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; width: 4rem; }
.crit-note { color: var(--ink-soft); font-size: 0.85em; }
.crit-unknown .crit-label { color: var(--unknown); }

.status { font-weight: 900; font-family: "Archivo Black", sans-serif; }
.st-earned { color: var(--good); }
.st-partial { color: var(--mid); }
.st-missed { color: var(--bad); }
.st-unknown { color: var(--unknown); }

.flag-list { list-style: none; padding: 0; }
.flag {
  padding: 0.6rem 0.85rem; border: 2.5px solid var(--ink); border-left-width: 8px;
  border-left-color: var(--bad); background: var(--bad-bg); border-radius: 8px;
  margin-bottom: 0.6rem; font-size: 0.92rem; font-weight: 600;
  box-shadow: 3px 3px 0 var(--ink);
}
.flag-low { border-left-color: var(--mid); background: var(--mid-bg); }
.flag-sev {
  text-transform: uppercase; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.06em;
  margin-right: 0.35rem; font-family: "Archivo Black", sans-serif;
}

.unknown-list { columns: 2; column-gap: 2rem; font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 44rem) { .unknown-list { columns: 1; } }

.kv-table th { width: 9rem; font-weight: 800; color: var(--ink); background: var(--bg); }
.src-id { font-variant-numeric: tabular-nums; color: var(--ink-soft); width: 3rem; }
.src-ref { font-size: 0.82em; text-decoration: none; color: var(--accent); font-weight: 700; }
.src-manual { color: var(--ink-soft); font-style: italic; }
.sources-table td { word-break: break-word; }
:target { background: var(--mid-bg); box-shadow: inset 0 0 0 3px var(--accent); transition: background 0.6s; }

.report-cta {
  margin-top: 2.75rem; border: 3px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.4rem; background: var(--turq-soft); box-shadow: var(--shadow-lg);
}

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-block; background: var(--accent); color: var(--bg);
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 0.55rem 1.3rem;
  font: inherit; font-weight: 900; font-size: 0.95rem; text-transform: uppercase;
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.btn:hover { background: var(--ink); color: var(--mid-bg); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn-secondary { background: var(--bg); color: var(--ink); border: 2.5px solid var(--ink); }
.btn-secondary:hover { background: var(--mid-bg); color: var(--ink); }

.report-form { max-width: 36rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-size: 0.9rem; font-weight: 800; margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.02em; }
.form-row .check-label { font-weight: 600; text-transform: none; }
.form-row input[type="url"], .form-row input[type="email"], .form-row select, .form-row textarea {
  width: 100%; font: inherit; font-size: 0.95rem;
  padding: 0.5rem 0.7rem; border: 2.5px solid var(--ink); border-radius: 8px; background: var(--bg);
  box-shadow: var(--shadow);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--shadow-pink);
}

/* ---------- Methodology ---------- */
.formula {
  background: var(--ink); color: var(--mid-bg); border: 3px solid var(--line); border-radius: 10px;
  padding: 0.85rem 1.1rem; font-size: 0.9rem; overflow-x: auto; box-shadow: var(--shadow);
  font-weight: 600;
}
.method-table td, .method-table th { font-size: 0.9rem; }
.profile-matrix td, .profile-matrix th { white-space: nowrap; }
.profile-matrix td:last-child, .profile-matrix th:last-child { white-space: normal; min-width: 14rem; }

/* ---------- Home audit block ---------- */
.home-audit { margin-top: 2.75rem; border-top: 3px solid var(--line); padding-top: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 3px solid var(--line); background: var(--accent); color: var(--bg);
  margin-top: 2.5rem; font-size: 0.85rem; font-weight: 600;
}
.site-footer .container { padding-top: 1.4rem; padding-bottom: 1.75rem; }
.site-footer p { max-width: 60rem; }
.site-footer a { color: var(--bg); text-decoration-color: var(--mid-bg); }
.site-footer a:hover { color: var(--mid-bg); }

/* ---------- Licensing & Credentials ---------- */
#licensing .lic-missing { color: var(--bad); font-weight: 700; }
.doctors-table { margin-top: 0.6rem; font-size: 0.92rem; }
.doctors-table th {
  font-family: "Archivo Black", sans-serif;
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bg); background: var(--ink);
}
.doctors-table td .lic-missing { color: var(--bad); font-size: 0.9em; font-weight: 700; }

/* ---------- Feedback form (unified) ---------- */
.req { color: var(--bad); font-weight: 900; }
.contact-fieldset {
  border: 3px solid var(--line); border-radius: 12px; padding: 0.6rem 1.1rem 1.1rem; margin: 1.35rem 0;
  background: var(--bg); box-shadow: var(--shadow);
}
.contact-fieldset legend {
  font-family: "Archivo Black", sans-serif; font-weight: 900; padding: 0.1rem 0.6rem;
  text-transform: uppercase; background: var(--mid-bg); border: 2.5px solid var(--ink); border-radius: 8px;
}
.contacts-hint { margin: 0.35rem 0 0.85rem; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--bad); font-size: 0.9rem; margin-top: 0.4rem; font-weight: 700; }
.form-status { min-height: 1.2em; font-size: 0.95rem; margin-top: 0.5rem; }
.form-ok { color: var(--good); font-weight: 900; }
.form-err { color: var(--bad); font-weight: 800; }
.cf-turnstile { margin: 1rem 0; }

/* ---------- Data banner (if present) ---------- */
.data-banner {
  border: 3px solid var(--line); border-radius: 12px; background: var(--mid-bg);
  padding: 0.75rem 1rem; margin: 1rem 0; font-weight: 700; box-shadow: var(--shadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  h1 { font-size: 1.75rem; text-shadow: 2px 2px 0 var(--accent); }
  h2 { font-size: 1.25rem; }
  .hero { padding: 1.15rem 1.15rem; box-shadow: var(--shadow); }
  .clinic-score-big { font-size: 1.7rem; }
  .site-header .container { gap: 0.4rem 1rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .clinic-card:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #000; }
  body, .hero, .clinic-card, .clinic-head, .table-wrap, .contact-fieldset,
  .flag, .report-cta, .data-banner, .score-badge, .profile-btn, .btn, .chip {
    box-shadow: none !important;
  }
  .site-header, .site-footer { background: #fff; color: #000; border-color: #000; }
  a { color: #000; }
  h1, h2 { text-shadow: none; color: #000; }
  .formula { background: #fff; color: #000; }
}
