/* ==========================================================================
   Patient Reviews archive (content-patient-reviews.php)
   Stars use Font Awesome (fa fa-star / fa-star-o).
   ========================================================================== */

.thg-pr-archive {
    --thg-pr-navy:       var(--lmh-primary-info);
    --thg-pr-navy-dark:  #003355;
    --thg-pr-star:       #F9D255;
    --thg-pr-star-empty: #e4e5e4;
    --thg-pr-chip-bg:    rgba(196, 214, 0, .18);
    --thg-pr-card:       #ffffff;
    --thg-pr-border:     var(--lmh-bg-gray);
    --thg-pr-text:       var(--lmh-primary-info);
    --thg-pr-text-muted: var(--lmh-text-muted);
    --thg-pr-text-light: #98a1a3;
    --thg-pr-surface:    #f5f6f7;
    background: #ffffff;
}
.thg-pr-archive .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.thg-pr-archive [hidden] { display: none !important; }
.thg-pr-archive__top-wrap {
    background: var(--lmh-primary-info);
    color: #fff;
    padding: 56px 0;
}
.thg-pr-archive__top {
    text-align: center;
    padding-top: 0;
    padding-bottom: 0;
}
.thg-pr-archive__filter-wrap {
    background: #707372;
    color: #fff;
    padding: 32px 0;
}
.thg-pr-archive__results-wrap {
    background: var(--lmh-bg-gray);
    padding: 32px 0 64px;
}
.thg-pr-archive .thg-pr-archive__intro { margin-bottom: 0; color: #fff; }
.thg-pr-archive .thg-pr-archive__intro p {
    color: #fff;
    margin: 0 auto 14px;
    max-width: 760px;
    font-size: 16px;
    line-height: 1.6;
}
.thg-pr-archive .thg-pr-archive__intro p:last-child { margin-bottom: 0; }
.thg-pr-archive .thg-pr-archive__lead {
    font-family: 'Tangerine', cursive;
    font-size: clamp(48px, 9vw, 90px);
    font-weight: 700;
    color: var(--lmh-primary-success);
    line-height: 1.05;
    max-width: none;
    margin: 4px 0 16px;
}
.thg-pr-archive .thg-pr-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: 0;
}

/* ---------- Stars (Font Awesome) ---------- */
.thg-pr-stars { display: inline-flex; gap: 2px; line-height: 1; }
.thg-pr-star { color: var(--thg-pr-star); font-size: 16px; }
.thg-pr-star--empty { color: var(--thg-pr-star-empty); }
.thg-pr-stars--lg .thg-pr-star { font-size: 22px; }

/* ---------- Provider selector (typeahead + ratings) ---------- */
.thg-pr-selector {
    background: transparent;
    color: #fff;
    padding: 0;
    margin: 0;
}
.thg-pr-selector__heading {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: left;
}
.thg-pr-selector__heading-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

/* Approach B: collapsible "Instructions" toggle next to the heading */
.thg-pr-instructions-toggle {
    color: #fff;
}
.thg-pr-instructions-toggle__summary {
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.thg-pr-instructions-toggle__summary::-webkit-details-marker { display: none; }
.thg-pr-instructions-toggle__summary::after {
    content: "\25BE";
    font-size: 12px;
    transition: transform .15s ease;
}
.thg-pr-instructions-toggle[open] .thg-pr-instructions-toggle__summary::after {
    transform: rotate(180deg);
}
.thg-pr-instructions-toggle__summary:hover,
.thg-pr-instructions-toggle__summary:focus { color: var(--lmh-primary-success); }
.thg-pr-instructions-toggle__panel {
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    width: 100%;

    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    opacity: 0;
    margin: 0 0 0;
    transform: translateY(-4px);
    transition:
        grid-template-rows .28s ease,
        opacity .22s ease,
        transform .28s ease,
        margin .28s ease;
    pointer-events: none;
}
.thg-pr-instructions-toggle__panel > * {
    min-height: 0;
    overflow: hidden;
    margin: 0;
}
.thg-pr-selector:has(.thg-pr-instructions-toggle[open]) .thg-pr-instructions-toggle__panel {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
    margin: 6px 0 16px;
    pointer-events: auto;
}
.thg-pr-instructions-toggle__panel .thg-pr-instructions__list,
.thg-pr-instructions-toggle__panel .thg-pr-instructions__list li,
.thg-pr-instructions-toggle__panel .thg-pr-instructions__list strong {
    color: #fff;
}
@media (prefers-reduced-motion: reduce) {
    .thg-pr-instructions-toggle__panel { transition: none; }
}

.thg-pr-instructions__list {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}
.thg-pr-instructions__list li { margin-bottom: 4px; }
.thg-pr-instructions__list li:last-child { margin-bottom: 0; }
.thg-pr-instructions__list strong { font-weight: 700; }

/* Press Ganey block at the bottom of the page */
.thg-pr-archive__press-ganey-wrap {
    background: #ffffff;
    padding: 32px 0 56px;
    border-top: 1px solid var(--thg-pr-border);
}
.thg-pr-press-ganey {
    max-width: 900px;
    margin: 0 auto;
    color: var(--thg-pr-text);
}
.thg-pr-press-ganey__heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--thg-pr-navy);
}
.thg-pr-press-ganey p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.thg-pr-selector__row {
    display: grid;
    grid-template-columns: 1fr 300px 200px;
    gap: 12px;
}
.thg-pr-selector__input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--thg-pr-text);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23647288' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.thg-pr-selector__input:focus { outline: 2px solid var(--lmh-primary-success); }

/* Typeahead */
.thg-pr-typeahead { position: relative; }
.thg-pr-typeahead__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--thg-pr-text-muted);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}
.thg-pr-typeahead__input {
    width: 100%;
    padding: 12px 42px 12px 42px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--thg-pr-text);
}
.thg-pr-typeahead__input:focus { outline: 2px solid var(--lmh-primary-success); }
.thg-pr-typeahead__clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border: 0;
    background: var(--thg-pr-border);
    color: var(--thg-pr-text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.thg-pr-typeahead__clear:hover { background: #d8dee7; color: var(--thg-pr-navy); }
.thg-pr-typeahead__list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    color: var(--thg-pr-text);
    box-shadow: 0 16px 40px rgba(10, 61, 98, .25);
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
    z-index: 30;
    font-size: 15px;
}
.thg-pr-typeahead__list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px 42px;
    cursor: pointer;
    border-bottom: 1px solid var(--thg-pr-border);
}
.thg-pr-typeahead__list li:last-child { border-bottom: 0; }
.thg-pr-typeahead__list li:hover,
.thg-pr-typeahead__list li.is-active { background: var(--thg-pr-chip-bg); color: var(--thg-pr-navy); }
.thg-pr-typeahead__list li.thg-pr-typeahead__empty {
    color: var(--thg-pr-text-muted);
    cursor: default;
    justify-content: center;
}
.thg-pr-typeahead__list li.thg-pr-typeahead__empty:hover { background: transparent; }
.thg-pr-typeahead__name mark { background: transparent; color: var(--thg-pr-navy); font-weight: 700; padding: 0; }
.thg-pr-typeahead__count {
    color: var(--thg-pr-text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

/* ---------- Provider card ---------- */
.thg-pr-provider-card {
    background: var(--thg-pr-card);
    padding: 28px;
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 32px;
    align-items: center;
    margin-bottom: 12px;
    border: 1px solid var(--thg-pr-border);
}
.thg-pr-provider-card__photo {
    width: 160px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    background: var(--thg-pr-surface);
    display: block;
}
.thg-pr-provider-card__info h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--thg-pr-navy);
    margin: 0 0 4px;
}
.thg-pr-provider-card__rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--thg-pr-text-muted);
}
.thg-pr-provider-card__rating strong { color: var(--thg-pr-text); font-weight: 700; }
.thg-pr-provider-card__bio {
    color: var(--thg-pr-text-muted);
    font-size: 14px;
    margin: 0;
}

/* ---------- Specialty carousel ---------- */
.thg-pr-carousel {
    background: var(--thg-pr-card);
    border: 1px solid var(--thg-pr-border);
    padding: 24px;
    margin-bottom: 24px;
}
.thg-pr-carousel__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.thg-pr-carousel__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--thg-pr-navy);
    margin: 0;
}
.thg-pr-carousel__meta {
    color: var(--thg-pr-text-muted);
    font-size: 13px;
}
.thg-pr-carousel__nav {
    margin-left: auto;
    display: inline-flex;
    gap: 8px;
}
.thg-pr-carousel__btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--thg-pr-border);
    background: #fff;
    color: var(--thg-pr-navy);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.thg-pr-carousel__btn:hover {
    background: var(--thg-pr-navy);
    color: #fff;
}
.thg-pr-carousel__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px;
    margin: -2px;
}
.thg-pr-carousel__viewport::-webkit-scrollbar { display: none; }
.thg-pr-carousel__track {
    display: flex;
    gap: 16px;
}
.thg-pr-pcard {
    flex: 0 0 calc((100% - 32px) / 3);
    min-width: 0;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--thg-pr-border);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.thg-pr-pcard__photo-link { line-height: 0; text-decoration: none; }
.thg-pr-pcard__photo {
    width: 140px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    background: var(--thg-pr-surface);
    display: block;
}
.thg-pr-pcard__name {
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--thg-pr-navy);
    line-height: 1.2;
}
.thg-pr-pcard__rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--thg-pr-text-muted);
    font-size: 13px;
}
.thg-pr-pcard__rating-text strong { color: var(--thg-pr-text); font-weight: 700; }
.thg-pr-pcard__buttons {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}
.thg-pr-pcard__btn,
.thg-pr-pcard__btn-reviews {
    justify-content: center;
}
.thg-pr-pcard__btn-reviews { padding: 10px 18px; font-size: 14px; }

@media (max-width: 900px) {
    .thg-pr-pcard { flex: 0 0 calc((100% - 16px) / 2); }
}
@media (max-width: 575.98px) {
    .thg-pr-pcard { flex: 0 0 100%; }
    .thg-pr-carousel__head { flex-wrap: wrap; }
    .thg-pr-carousel__nav  { margin-left: 0; }
}

/* ---------- Stats panel ---------- */
.thg-pr-stats {
    background: var(--thg-pr-card);
    border: 1px solid var(--thg-pr-border);
    padding: 28px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: center;
}
.thg-pr-stats__score {
    text-align: center;
    padding-right: 24px;
    border-right: 1px solid var(--thg-pr-border);
}
.thg-pr-stats__big-number {
    font-size: 64px;
    font-weight: 800;
    color: var(--thg-pr-navy);
    line-height: 1;
    letter-spacing: -2px;
}
.thg-pr-stats__score .thg-pr-stars { justify-content: center; margin: 10px 0 6px; }
.thg-pr-stats__total { font-size: 13px; color: var(--thg-pr-text-muted); }
.thg-pr-stats__distribution { display: flex; flex-direction: column; gap: 8px; }
.thg-pr-stats__row {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .12s;
}
.thg-pr-stats__row:hover { background: var(--thg-pr-surface); }
.thg-pr-stats__row-label {
    color: var(--thg-pr-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.thg-pr-stats__row-label .fa-star { color: var(--thg-pr-star); font-size: 12px; }
.thg-pr-stats__bar {
    background: var(--thg-pr-border);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
}
.thg-pr-stats__bar-fill {
    background: var(--lmh-primary-success);
    height: 100%;
    border-radius: 4px;
    display: block;
    transition: width .5s ease;
}
.thg-pr-stats__row-count {
    color: var(--thg-pr-text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- Toolbar ---------- */
.thg-pr-toolbar {
    background: var(--thg-pr-card);
    padding: 16px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--thg-pr-border);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.thg-pr-toolbar__item { display: inline-flex; }
.thg-pr-select {
    padding: 10px 32px 10px 14px;
    border: 1px solid var(--thg-pr-border);
    background: var(--thg-pr-surface);
    font-family: inherit;
    font-size: 14px;
    color: var(--thg-pr-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23647288' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.thg-pr-view-toggle {
    display: inline-flex;
    border: 1px solid var(--thg-pr-border);
    overflow: hidden;
    margin-left: auto;
}
.thg-pr-view-toggle__btn {
    padding: 9px 12px;
    background: var(--thg-pr-surface);
    border: none;
    cursor: pointer;
    color: var(--thg-pr-text-muted);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.thg-pr-view-toggle__btn.is-active { background: var(--thg-pr-navy); color: #fff; }

/* ---------- Active filters ---------- */
.thg-pr-active-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
    flex-wrap: wrap;
}
.thg-pr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--thg-pr-chip-bg);
    color: var(--thg-pr-navy);
    padding: 5px 10px 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.thg-pr-chip button {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--thg-pr-navy);
    padding: 0;
    font-size: 14px;
    line-height: 1;
}
.thg-pr-results-count { color: var(--thg-pr-text-muted); font-size: 13px; margin-left: auto; }
.thg-pr-results-count strong { color: var(--thg-pr-text); font-weight: 700; }

/* ---------- Reviews grid ---------- */
.thg-pr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.thg-pr-grid--list { grid-template-columns: 1fr; }
.thg-pr-review {
    background: var(--thg-pr-card);
    border: 1px solid var(--thg-pr-border);
    padding: 18px;
    transition: border-color .15s;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.thg-pr-grid--list .thg-pr-review {
    display: grid;
    grid-template-columns: 130px 1fr 110px;
    gap: 20px;
    align-items: center;
}
.thg-pr-review:hover { border-color: var(--thg-pr-navy); }
.thg-pr-review__header {
    display: flex;
    justify-content: flex-start;
}
.thg-pr-review__text {
    font-size: 14px;
    color: var(--thg-pr-text);
    line-height: 1.55;
    min-height: 42px;
    margin: 0;
    padding: 24px 0;
}
.thg-pr-grid--list .thg-pr-review__text { min-height: 0; }
.thg-pr-review__date {
    font-size: 14px;
    font-weight: 700;
    color: var(--lmh-text-muted);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #707372;
    font-variant-numeric: tabular-nums;
}
.thg-pr-grid--list .thg-pr-review__date {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
    text-align: right;
}

/* ---------- Pagination ---------- */
.thg-pr-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
    font-size: 14px;
}
.thg-pr-pagination .page-numbers {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--thg-pr-card);
    border: 1px solid var(--thg-pr-border);
    color: var(--thg-pr-text);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all .12s;
}
.thg-pr-pagination .page-numbers:hover { border-color: var(--thg-pr-navy); color: var(--thg-pr-navy); }
.thg-pr-pagination .page-numbers.current {
    background: var(--thg-pr-navy);
    color: #fff;
    border-color: var(--thg-pr-navy);
}
.thg-pr-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--thg-pr-text-muted);
}

/* ---------- Loading state ---------- */
[data-thg-pr-results] { transition: opacity .2s ease; }
[data-thg-pr-results].is-loading { opacity: .45; pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .thg-pr-stats { grid-template-columns: 1fr; gap: 24px; }
    .thg-pr-stats__score {
        padding-right: 0;
        padding-bottom: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--thg-pr-border);
    }
    .thg-pr-selector__row { grid-template-columns: 1fr; }
    .thg-pr-grid { grid-template-columns: repeat(2, 1fr); }
    .thg-pr-provider-card {
        grid-template-columns: 140px 1fr;
        gap: 24px;
    }
    .thg-pr-provider-card__photo { width: 140px; }
    .thg-pr-provider-card .btn.btn-lmh-details {
        grid-column: 1 / -1;
        justify-self: start;
    }
}
@media (max-width: 640px) {
    .thg-pr-archive__top-wrap     { padding: 36px 0 28px; }
    .thg-pr-archive__filter-wrap  { padding: 24px 0; }
    .thg-pr-archive__results-wrap { padding: 24px 0 48px; }
    .thg-pr-archive__press-ganey-wrap { padding: 24px 0 40px; }
    .thg-pr-press-ganey__heading { font-size: 18px; }
    .thg-pr-press-ganey p { font-size: 14px; }
    .thg-pr-instructions__list { font-size: 14px; }
    .thg-pr-archive .thg-pr-page-title { font-size: 16px; letter-spacing: .04em; }
    .thg-pr-archive .thg-pr-archive__intro p { font-size: 15px; line-height: 1.55; }
    .thg-pr-selector__heading { font-size: 22px; }
    .thg-pr-grid { grid-template-columns: 1fr; }
    .thg-pr-toolbar { gap: 8px; padding: 12px; }
    .thg-pr-view-toggle { margin-left: 0; }
    .thg-pr-active-filters { font-size: 12px; }
    .thg-pr-results-count { margin-left: 0; flex-basis: 100%; }
    .thg-pr-provider-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px 20px;
        gap: 14px;
        justify-items: center;
    }
    .thg-pr-provider-card__photo { width: 130px; }
    .thg-pr-provider-card__info h2 { text-align: center; font-size: 20px; }
    .thg-pr-provider-card__rating { justify-content: center; flex-wrap: wrap; }
    .thg-pr-provider-card__bio { text-align: center; }
    .thg-pr-provider-card .btn.btn-lmh-details { justify-self: center; }
    .thg-pr-stats { padding: 20px; gap: 20px; }
    .thg-pr-stats__big-number { font-size: 48px; }
    .thg-pr-carousel { padding: 18px; }
    .thg-pr-pagination .page-numbers { min-width: 34px; height: 34px; padding: 0 8px; }
}
