/* Pattaya Dental Rating — research-style, no marketing gloss. */

:root {
  --ink: #1c2733;
  --ink-soft: #51606f;
  --line: #dde4ea;
  --bg: #ffffff;
  --bg-soft: #f5f8fa;
  --accent: #0e5a6d;
  --accent-soft: #e3eff2;
  --good: #1e7d4f;
  --good-bg: #e4f3ea;
  --mid: #9a6b0a;
  --mid-bg: #faf0d7;
  --bad: #a33c2e;
  --bad-bg: #f9e6e2;
  --unknown: #6b7683;
  --max-width: 76rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
main.container { padding-top: 1.5rem; padding-bottom: 3rem; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
p { margin: 0.5rem 0 1rem; }
.lead { font-size: 1.06rem; color: var(--ink-soft); 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: 1px solid var(--line); background: var(--bg); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 2rem; padding-top: 1rem; padding-bottom: 0.9rem; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand-tagline { font-size: 0.78rem; color: var(--ink-soft); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.92rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.lang-switcher { margin-left: auto; font-size: 0.85rem; white-space: nowrap; }
.lang-switcher a { text-decoration: none; color: var(--ink-soft); }
.lang-switcher a:hover { color: var(--accent); text-decoration: underline; }
.lang-current { font-weight: 700; color: var(--accent); }
.lang-sep { color: var(--line); }

/* Hero */
.hero h1 { max-width: 46rem; }
.hero-links { font-size: 0.95rem; }

/* Profile controls */
.ranking-controls { margin: 1.5rem 0 1rem; }
.profile-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.profile-btn {
  font: inherit; font-size: 0.88rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink-soft);
  cursor: pointer;
}
.profile-btn:hover { border-color: var(--accent); color: var(--accent); }
.profile-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.profile-desc { min-height: 1.4em; margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.table-filter { margin-top: 0.75rem; }
.table-filter input {
  font: inherit; font-size: 0.92rem; width: 100%; max-width: 20rem;
  padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 6px;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); border-bottom: 2px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.ranking-table tbody tr:hover { background: var(--bg-soft); }
.rank-cell { font-variant-numeric: tabular-nums; color: var(--ink-soft); width: 2.2rem; }
.name-cell a { font-weight: 600; text-decoration: none; }
.name-cell a:hover { text-decoration: underline; }
.score-cell { white-space: nowrap; }
.th-sub { font-size: 0.7em; color: var(--ink-soft); 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: 600; }
.flags-cell .flag-none { color: var(--ink-soft); }
.table-note { margin-top: 0.75rem; max-width: 52rem; }

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

/* Score badges */
.score-badge {
  display: inline-block; min-width: 2.6em; text-align: center;
  padding: 0.12em 0.45em; border-radius: 6px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.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: 1px solid var(--line); border-radius: 4px; height: 0.6rem; overflow: hidden; min-width: 6rem; flex: 1; }
.bar-fill { background: var(--accent); height: 100%; }

/* Cards */
.cards-section { margin-top: 2.5rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.clinic-card { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; background: var(--bg); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.card-head h3 { margin: 0; font-size: 1rem; }
.card-head a { text-decoration: none; }
.card-head a:hover { text-decoration: underline; }
.card-summary { font-size: 0.88rem; color: var(--ink-soft); }
.card-bars { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.6rem 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); }
.card-bar-pts { flex: 0 0 3.2rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.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; }
.clinic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.clinic-headline { font-size: 1.02rem; max-width: 46rem; }
.clinic-score-big { font-size: 1.9rem; display: flex; align-items: baseline; gap: 0.2rem; }
.clinic-score-big .score-badge { padding: 0.15em 0.5em; }
.score-of { color: var(--ink-soft); font-size: 1rem; }

.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: baseline; gap: 0.5em; border: 1px solid var(--line); border-radius: 8px; padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.chip-ranked { background: var(--accent-soft); border-color: transparent; }
.chip-rank { font-weight: 700; color: var(--accent); }
.chip-excluded { color: var(--ink-soft); }
.chip-excluded .chip-rank { color: var(--unknown); font-weight: 400; }
.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); }
.minus-list li::marker { color: var(--bad); }

.cat-section { margin-top: 1.5rem; }
.cat-section-head { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.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; }
.crit-table { font-size: 0.9rem; }
.crit-table td { padding: 0.35rem 0.5rem; }
.crit-status { width: 1.6rem; }
.crit-pts { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-soft); width: 4rem; }
.crit-note { color: var(--ink-soft); font-size: 0.85em; }
.crit-unknown .crit-label { color: var(--unknown); }

.status { font-weight: 700; }
.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.5rem 0.75rem; border-left: 3px solid var(--bad); background: var(--bad-bg); border-radius: 0 6px 6px 0; margin-bottom: 0.5rem; font-size: 0.92rem; }
.flag-low { border-left-color: var(--mid); background: var(--mid-bg); }
.flag-sev { text-transform: uppercase; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; margin-right: 0.3rem; }

.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: 600; color: var(--ink-soft); }
.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); }
.src-manual { color: var(--ink-soft); font-style: italic; }
.sources-table td { word-break: break-word; }
:target { background: var(--mid-bg); transition: background 0.6s; }

.report-cta { margin-top: 2.5rem; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; background: var(--bg-soft); }

/* Buttons & forms */
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  border: none; border-radius: 6px; padding: 0.5rem 1.1rem;
  font: inherit; font-size: 0.95rem; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--bg); color: var(--accent); border: 1px solid var(--accent); }
.report-form { max-width: 36rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; }
.form-row .check-label { font-weight: 400; }
.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.45rem 0.65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}

/* Methodology */
.formula {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.75rem 1rem; font-size: 0.9rem; overflow-x: auto;
}
.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.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 2rem; font-size: 0.85rem; color: var(--ink-soft); }
.site-footer .container { padding-top: 1.25rem; padding-bottom: 1.5rem; }
.site-footer p { max-width: 60rem; }
