:root {
    --vhr-navy: #0d1b2a;
    --vhr-dark: #1b2838;
    --vhr-accent: #e8871e;
    --vhr-accent-hover: #d07418;
}
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
.navbar { background-color: var(--vhr-navy) !important; }
.navbar .nav-link.active {
    color: var(--vhr-accent) !important;
}
.navbar .nav-link:active,
.navbar a.nav-link:active,
.navbar a.btn:active,
.navbar a:active {
    color: var(--vhr-accent) !important;
    background-color: transparent !important;
}
.navbar .dropdown-item.active {
    background-color: transparent;
    color: var(--vhr-accent) !important;
    border-left: 3px solid var(--vhr-accent);
    padding-left: calc(1rem - 3px);
    font-weight: 600;
}
.nav-display-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.btn-accent {
    background-color: var(--vhr-accent);
    border-color: var(--vhr-accent);
    color: #fff;
    font-weight: 600;
}
.btn-accent:hover {
    background-color: var(--vhr-accent-hover);
    border-color: var(--vhr-accent-hover);
    color: #fff;
}
.btn-outline-navy {
    color: var(--vhr-navy);
    border-color: var(--vhr-navy);
    background-color: transparent;
    font-weight: 600;
}
.btn-outline-navy:hover {
    background-color: var(--vhr-navy);
    border-color: var(--vhr-navy);
    color: #fff;
}
.hero {
    background: linear-gradient(135deg, var(--vhr-navy) 0%, var(--vhr-dark) 100%);
    color: #fff;
    padding: 5rem 1rem;
}
.hero-stats {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.02em;
}
.hero-stats span {
    color: #fff;
    font-weight: 600;
}
.star-filled { color: #f5a623; }
.star-empty { color: #ccc; }

/* Score colour utilities — apply to any element regardless of base class */
.cat-high { color: #1a7a3c; }
.cat-mid  { color: #9a6200; }
.cat-low  { color: #c0392b; }
.rating-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.rating-bar-fill {
    height: 100%;
    background-color: #f5a623;
    border-radius: 4px;
}
footer { background-color: var(--vhr-navy); }

/* ── Provider table ─────────────────────────────────────────── */
.provider-table-wrap {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e8ecf0;
}

.provider-table {
    font-size: 0.82rem;
    margin: 0;
    background: #fff;
}

.provider-table-head th {
    background-color: var(--vhr-navy);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.6rem 0.75rem;
    border: none;
    white-space: nowrap;
}

.provider-table-head th i {
    opacity: 0.65;
    font-size: 0.68rem;
}

.provider-th-rank   { width: 3rem; }
.provider-th-score  { width: 6rem; }
.provider-th-cat    { width: 6.5rem; }
.provider-th-reviews { width: 5rem; }
.provider-th-info   { font-size: 0.65rem; opacity: 0.7; }
.provider-table-head th.active-sort-col,
.review-table-head th.active-sort-col   { background-color: #2a3643 !important; }
.provider-sort-indicator { font-size: 0.6rem; opacity: 0.85; margin-left: 0.2rem; vertical-align: middle; }

.provider-row td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.provider-row:last-child td { border-bottom: none; }

.provider-row:hover td { background-color: #f8f9fc; }

/* Top-3 row accents */
.provider-row-gold   td:first-child { border-left: 4px solid #f5c518; }
.provider-row-silver td:first-child { border-left: 4px solid #b0b0b0; }
.provider-row-bronze td:first-child { border-left: 4px solid #cd7f32; }
.provider-row-gold   { background-color: #fffdf2; }
.provider-row-silver { background-color: #fafafa; }
.provider-row-bronze { background-color: #fdf8f3; }

.provider-td-rank { text-align: center; width: 3rem; padding-left: 0.75rem !important; }

.provider-td-name { min-width: 200px; }

.provider-name-link {
    font-size: 0.9rem;
    color: var(--vhr-navy);
    text-decoration: none;
}

.provider-name-link:hover { color: var(--vhr-accent); }

.provider-ext-link { font-size: 0.72rem; }

/* Category score value in table cells */
.provider-cat-value {
    font-size: 0.8rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.2rem;
}

.provider-cat-value.cat-high { color: #1a7a3c; }
.provider-cat-value.cat-mid  { color: #9a6200; }
.provider-cat-value.cat-low  { color: #c0392b; }

.provider-cat-bar {
    width: 100%;
    margin: 0 auto;
}

.provider-review-pill {
    display: inline-block;
    background: #e9ecef;
    border-radius: 20px;
    padding: 0.1rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #495057;
}

a.provider-review-pill:hover {
    background: #dee2e6;
    color: #212529;
}

.provider-no-data {
    font-size: 0.78rem;
    color: #adb5bd;
}

.provider-td-actions { white-space: nowrap; min-width: 130px; }

.provider-blurb {
    font-size: 0.72rem;
    color: #6c757d;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Homepage provider card description — 3-line clamp, no mid-word cuts */
.provider-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Latest Reviews comment snippet — 3-line clamp, no mid-word cuts */
.review-snippet-clamp {
    font-size: 0.8rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Circular rank bubble */
.rank-bubble {
    width: 2.3rem; height: 2.3rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem; font-weight: 700; flex-shrink: 0;
}
.rank-bubble.gold   { background: #fff8e1; color: #b8860b; border: 2px solid #f5c518; }
.rank-bubble.silver { background: #f5f5f5; color: #5a5a5a; border: 2px solid #b0b0b0; }
.rank-bubble.bronze { background: #fdf1e8; color: #8b4513; border: 2px solid #cd7f32; }
.rank-bubble.plain  { background: #f8f9fa; color: #adb5bd; border: 2px solid #e9ecef; }

/* CSS star-fill widget (purely presentational) */
.star-track {
    position: relative;
    display: inline-block;
    color: #ddd;
    font-size: 1rem;
    letter-spacing: 1px;
    line-height: 1;
}
.star-track::before { content: "★★★★★"; }
.star-fill {
    position: absolute;
    top: 0; left: 0;
    overflow: hidden;
    color: #f5a623;
    white-space: nowrap;
}
.star-fill::before { content: "★★★★★"; }

/* Colour-coded rating bars */
.rating-bar-fill.bar-high { background-color: #28a745; }
.rating-bar-fill.bar-mid  { background-color: #f5a623; }
.rating-bar-fill.bar-low  { background-color: #e8471e; }

/* Providers page consistency helpers */
.provider-search-suggestions {
    display: none;
    top: 100%;
    max-height: 220px;
    overflow-y: auto;
}

.provider-size-select {
    width: auto;
}

.provider-name-block {
    min-width: 0;
}

.top-rated-badge {
    font-size: 0.63rem;
    background: #fff8e1;
    color: #b8860b;
    border: 1px solid #f5c518;
}

/* Overall score value — larger version of the category value pattern */
.provider-score-value {
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}
.provider-score-value .provider-score-denom {
    font-size: 0.7rem;
    font-weight: 400;
    color: #6c757d;
    margin-left: 0.1rem;
}
.provider-score-value.cat-high { color: #1a7a3c; }
.provider-score-value.cat-mid  { color: #9a6200; }
.provider-score-value.cat-low  { color: #c0392b; }

.provider-star-mini {
    font-size: 0.78rem !important;
    margin: 0.15rem 0 0.1rem;
}



/* Pill-style action links */
.provider-action-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    text-decoration: none;
    border: 1.5px solid;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}

.provider-action-pill-primary {
    color: var(--vhr-accent);
    border-color: var(--vhr-accent);
}

.provider-action-pill-primary:hover {
    background: var(--vhr-accent);
    color: #fff;
}

.provider-action-pill-secondary {
    color: #5f6c7a;
    border-color: #ced4da;
}

.provider-action-pill-secondary:hover {
    background: #f0f2f4;
    color: #3a454f;
    border-color: #adb5bd;
}

.provider-overall-score {
    font-size: 1.35rem;
}

/* ── Review table (reviews listing page) ─────────────────────── */
.review-reviewer-name {
    font-size: 0.78rem;
    color: var(--vhr-navy);
}

.review-provider-link {
    color: var(--vhr-navy);
    text-decoration: none;
    font-size: 0.9rem;
}

.review-provider-link:hover { color: var(--vhr-accent); }

.review-table-wrap {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid #e8ecf0;
}

.review-table { font-size: 0.82rem; }

.review-table-head th {
    background: var(--vhr-navy);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    white-space: nowrap;
    padding: 0.65rem 0.6rem;
}

.review-row:hover { background-color: #f8f9fc; }

.review-th-reviewer { min-width: 10rem; }
.review-th-provider { min-width: 8rem; }
.review-th-date     { width: 6.5rem; white-space: nowrap; }
.review-th-score    { width: 5.5rem; }
.review-th-cat      { width: 4rem; }
.review-th-comment  { min-width: 12rem; }

.review-td-reviewer,
.review-td-provider,
.review-td-date {
    padding: 0.6rem 0.75rem;
}

.review-td-comment {
    max-width: 18rem;
    padding: 0.6rem 0.75rem;
}

.review-snippet-link {
    color: #495057;
    font-size: 0.8rem;
    line-height: 1.45;
    text-decoration: none;
    display: block;
}

/* ── Display name queue table ───────────────────────────────── */
.dn-table-wrap {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid #e8ecf0;
}

.dn-table-wrap thead th {
    background: var(--vhr-navy);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    white-space: nowrap;
    padding: 0.65rem 0.75rem;
}

.dn-table-wrap tbody tr:hover { background-color: #f8f9fc; }
.dn-table-wrap tbody td        { font-size: 0.82rem; border-bottom: 1px solid #f0f2f5; padding: 0.6rem 0.75rem; }
.dn-table-wrap tbody tr:last-child td { border-bottom: none; }

.review-snippet-link:hover { color: var(--vhr-navy); }

.review-td-actions { width: 7rem; padding: 0.5rem; }

/* Suppress the 6 category columns on small screens */
@media (max-width: 767.98px) {
    .review-th-cat,
    .review-td-cat { display: none; }
}

/* Comment text — pre-wrap preserves line breaks; full text shown for SEO */
.review-comment-text {
    font-size: 0.875rem;
    line-height: 1.65;
    color: #343a40;
}

/* Suppress empty spacer paragraphs generated by the rich text editor (e.g. <p><br></p>). */
.review-comment-text p:empty,
.review-comment-text p:has(> br:only-child) {
    display: none;
}

/* Remove spacing between bold headings and the paragraph that follows them so they
   read as a heading + body on consecutive lines rather than separate paragraphs. */
.review-comment-text p:has(> strong:only-child) {
    margin-bottom: 0;
}
.review-comment-text p:has(> strong:only-child) + p {
    margin-top: 0;
}

/* Small hosting-type label badge */
.review-type-badge {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background-color: #e9ecef !important;
    color: #495057 !important;
    border-radius: 20px;
}

/* ── Pagination (shared across all listing pages) ─────────────── */
.pagination .page-link {
    color: var(--vhr-navy);
    border-color: #dee2e6;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pagination .page-link:hover {
    background-color: #f0f2f5;
    border-color: #c5ccd6;
    color: var(--vhr-navy);
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13,27,42,0.2);
    outline: none;
}

.pagination .page-item.active .page-link {
    background-color: var(--vhr-navy);
    border-color: var(--vhr-navy);
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}

.pagination .page-item.disabled .page-link {
    color: #adb5bd;
    background-color: #fff;
    border-color: #dee2e6;
    pointer-events: none;
}

/* ── Admin / Moderator secondary navigation ───────────────────── */
.admin-subnav {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e8ecf0;
}

.admin-subnav-pills {
    gap: 0.2rem;
    flex-wrap: wrap;
}

.admin-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #495057;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.admin-subnav-link:hover {
    background: #e9ecef;
    color: var(--vhr-navy);
}

.admin-subnav-link.active {
    background: var(--vhr-navy);
    color: #fff;
}

.admin-subnav-link.active:hover {
    background: #1b2d42;
    color: #fff;
}

.admin-subnav-link i {
    font-size: 0.85rem;
}

/* ── Admin tables — shared navy header (click-stats, claims, admin-reviews, articles) ─── */
.click-stats-table-wrap,
.claim-table-wrap,
.admin-reviews-table-wrap,
.article-table-wrap {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid #e8ecf0;
}

.click-stats-table-wrap thead th,
.claim-table-wrap thead th,
.admin-reviews-table-wrap thead th,
.article-table-wrap thead th,
.admin-table-head th {
    background: var(--vhr-navy);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    white-space: nowrap;
    padding: 0.65rem 0.75rem;
}

.click-stats-table-wrap tbody tr:hover,
.claim-table-wrap tbody tr:hover,
.admin-reviews-table-wrap tbody tr:hover,
.article-table-wrap tbody tr:hover { background-color: #f8f9fc; }

.click-stats-table-wrap tbody td,
.claim-table-wrap tbody td,
.admin-reviews-table-wrap tbody td,
.article-table-wrap tbody td { font-size: 0.82rem; border-bottom: 1px solid #f0f2f5; padding: 0.6rem 0.75rem; }

.click-stats-table-wrap tbody tr:last-child td,
.claim-table-wrap tbody tr:last-child td,
.admin-reviews-table-wrap tbody tr:last-child td,
.article-table-wrap tbody tr:last-child td { border-bottom: none; }
/* ── EasyMDE editor — Bootstrap Icons toolbar and site theming ─ */
/*
 * EasyMDE's default CSS was built for Font Awesome. We use Bootstrap Icons
 * (already loaded via WebJars) by setting className on each toolbar button.
 * BI renders its icons via the button's ::before pseudo-element, so the
 * display, sizing, centering, and colour rules here override EasyMDE's
 * defaults to make the toolbar look correct and match the site design.
 *
 * These overrides apply to both the admin article editor and the public
 * review write/edit editors — both use EasyMDE with BI class names.
 */

/* Container — stack toolbar + editor as a single bordered unit */
.EasyMDEContainer {
    display: flex;
    flex-direction: column;
}

/* Toolbar wrapper */
.editor-toolbar {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 4px 8px;
    line-height: normal;
    overflow: visible;
}

/* CodeMirror text area — connect seamlessly under the toolbar */
.EasyMDEContainer .CodeMirror {
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0;
    font-size: 0.9rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.6;
    color: #212529;
    background: #fff;
}

/* Status bar */
.editor-statusbar {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #6c757d;
}

/* Toolbar buttons — flex-centred so BI ::before icon centres correctly */
.editor-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 2px 1px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #343a40;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

/* BI sets vertical-align: -.125em on ::before — neutralise inside flex button */
.editor-toolbar button::before {
    vertical-align: baseline;
}

.editor-toolbar button:hover {
    background-color: rgba(13, 27, 42, 0.07);
    border-color: rgba(13, 27, 42, 0.18);
    color: var(--vhr-navy);
}

/* Active = button is currently toggled on (e.g. Bold mode active) */
.editor-toolbar button.active,
.editor-toolbar button:active {
    background-color: var(--vhr-navy);
    border-color: var(--vhr-navy);
    color: #fff;
}

/* Active state: BI ::before inherits color — no extra rule needed */

/* Separators — EasyMDE renders <i class="separator">|</i>; replace the
   pipe character with a slim visual divider using a right border. */
.editor-toolbar i.separator {
    display: inline-block;
    width: 0;
    height: 18px;
    margin: 0 5px;
    border-right: 1px solid #dee2e6;
    vertical-align: middle;
    font-style: normal;
    color: transparent;
    overflow: hidden;
}

/* Fullscreen mode — keep the toolbar and editor flush */
.editor-toolbar.fullscreen {
    border-radius: 0;
}

/* Validation error state — apply to both toolbar and editor borders */
textarea.is-invalid + .EasyMDEContainer .editor-toolbar {
    border-color: var(--bs-danger, #dc3545);
    border-bottom-color: rgba(220, 53, 69, 0.25);
}
/* When the hidden underlying <textarea> carries Bootstrap's .is-invalid class
   (set server-side on validation failure), apply a red border to the visible
   EasyMDE editor container so the error state is visually obvious. */
textarea.is-invalid + .EasyMDEContainer .CodeMirror {
    border-color: var(--bs-danger, #dc3545);
}

/* ── EasyMDE live preview pane — GFM tables, code, and typography ─ */
/* The preview pane (toggle preview / side-by-side mode) renders Markdown
   using EasyMDE's built-in JS renderer. Apply the same table and content
   styles here as the public article page so the editor WYSIWYG matches. */
.editor-preview,
.editor-preview-side {
    background: #fff;
    border: 1px solid #ced4da;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #212529;
}
.editor-preview-side {
    border-left: none;
}

/* Tables inside preview */
.editor-preview table,
.editor-preview-side table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    border: 1px solid #e8ecf0;
}
.editor-preview table thead th,
.editor-preview-side table thead th {
    background: var(--vhr-navy);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.editor-preview table tbody td,
.editor-preview-side table tbody td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: top;
}
.editor-preview table tbody tr:hover,
.editor-preview-side table tbody tr:hover { background: #f8f9fc; }
.editor-preview table tbody tr:last-child td,
.editor-preview-side table tbody tr:last-child td { border-bottom: none; }

/* Code blocks inside preview */
.editor-preview pre,
.editor-preview-side pre {
    background: #f6f8fa;
    border: 1px solid #e8ecf0;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
}
.editor-preview code,
.editor-preview-side code {
    background: #f0f2f5;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.85em;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.editor-preview pre code,
.editor-preview-side pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
}

/* ── Article body — GFM table rendering ─────────────────────── */
/* CommonMark's TablesExtension emits bare <table> elements without Bootstrap
   classes. These rules apply site-consistent table styling automatically,
   matching the admin data-table look used across the rest of the site.
   Strikethrough (<del>) uses a muted colour to remain legible. */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid #e8ecf0;
}
.article-body table thead th {
    background: var(--vhr-navy);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.6rem 0.75rem;
    text-align: left;
    white-space: nowrap;
}
.article-body table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: top;
}
.article-body table tbody tr:hover { background-color: #f8f9fc; }
.article-body table tbody tr:last-child td { border-bottom: none; }
.article-body del { color: #6c757d; }
