/**
 * HP Remedy Groups — Frontend styles
 * Scope everything under .hprg-* to avoid conflicts.
 */

/* ==========================================================================
   Page shell / wrap
   ========================================================================== */

.hprg-archive-wrap,
.hprg-single-wrap {
    max-width: 1100px;
    margin: 2rem auto 3rem;
    padding: 0 1rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Inner card so it matches the Sides-of-the-body layout */
.hprg-archive-inner,
.hprg-single-inner {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 1.75rem 1.75rem 2.25rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

/* Fallback if templates don’t yet have *-inner wrappers */
.hprg-archive-wrap > :not(.hprg-archive-inner),
.hprg-single-wrap > :not(.hprg-single-inner) {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 1.75rem 1.75rem 2.25rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.hprg-breadcrumbs {
    font-size: 0.82rem;
    margin: -0.25rem 0 1.25rem;
    color: #64748b;
}

.hprg-breadcrumbs a {
    color: #0f766e;
    text-decoration: none;
}

.hprg-breadcrumbs a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Page titles + intro
   ========================================================================== */

.hprg-page-title {
    font-size: 1.75rem;
    font-weight: 650;
    margin: 0 0 0.25rem;
    color: #0f172a;
}

.hprg-page-intro {
    margin: 0 0 1.5rem;
    color: #4b5563;
    font-size: 0.95rem;
    max-width: 720px;
}

/* ==========================================================================
   Archive header + search + stats
   ========================================================================== */

.hprg-archive-header {
    margin-bottom: 1.75rem;
}

.hprg-archive-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #0f172a;
}

.hprg-archive-intro {
    margin: 0 0 1.1rem;
    color: #4b5563;
    font-size: 0.95rem;
    max-width: 720px;
}

/* Small stats strip: X groups / Y remedies / “Showing n of x” */

.hprg-archive-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1.25rem;
    align-items: center;
    margin-bottom: 0.9rem;
    font-size: 0.86rem;
    color: #64748b;
}

.hprg-stat strong {
    font-weight: 600;
    margin-right: 0.25rem;
    color: #0f172a;
}

.hprg-search-summary {
    margin-left: auto;
    font-style: italic;
    color: #475569;
}

/* Search box container */

.hprg-search {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 0.9rem 1rem 1rem;
    background: #f9fafb;
}

.hprg-search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #475569;
}

/* Input with icon */

.hprg-search-input-wrap {
    position: relative;
    margin-top: 0.1rem;
}

.hprg-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.65;
}

.hprg-search-input {
    width: 100%;
    padding: 0.55rem 0.9rem 0.55rem 2.1rem; /* space for icon */
    border-radius: 999px;
    border: 1px solid #d0d7de;
    font-size: 0.95rem;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
    background-color: #f9fafb;
}

.hprg-search-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.18);
    background-color: #ffffff;
}

/* Inline “no results” message area */

.hprg-search-results {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.hprg-search-no-results {
    margin: 0;
    padding: 0.25rem 0;
    color: #b91c1c;
}

/* Tag chips under the search box */

.hprg-tag-chips {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.hprg-tag-chips-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-right: 0.35rem;
}

.hprg-tag-chip {
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: #334155;
    transition:
        background-color 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.08s ease;
}

.hprg-tag-chip:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* Highlight state for filtered cards */

.hprg-card-highlight {
    border-color: #0ea5e9;
    box-shadow:
        0 0 0 1px rgba(14, 165, 233, 0.35),
        0 8px 24px rgba(15, 23, 42, 0.12);
}


/* ==========================================================================
   Archive groups grid
   ========================================================================== */

.hprg-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 680px) {
    .hprg-groups-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Group card */

.hprg-group-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 0.9rem 1rem 1rem;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.hprg-group-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.hprg-group-card-title {
    font-weight: 650;
    font-size: 1.02rem;
}

.hprg-group-card-title a {
    text-decoration: none;
    color: #0f172a;
}

.hprg-group-card-title a:hover {
    text-decoration: underline;
}

.hprg-group-count {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}

.hprg-group-tags {
    font-size: 0.8rem;
    color: #6b7280;
}

.hprg-group-tags .hprg-tag-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    margin-right: 0.2rem;
    margin-bottom: 0.2rem;
}

.hprg-group-footer {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.5rem;
}

.hprg-group-view-link {
    font-size: 0.85rem;
    text-decoration: none;
    color: #0284c7;
}

.hprg-group-view-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Single group: meta + headline
   ========================================================================== */

.hprg-group-meta-card {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.6rem;
    background: #f8fafc;
}

.hprg-group-meta-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.7rem;
    font-weight: 650;
    color: #0f172a;
}

.hprg-group-meta-summary {
    margin: 0 0 0.6rem;
    color: #4b5563;
    font-size: 0.95rem;
}

.hprg-badges-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.hprg-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    background: #e0f2fe;
    color: #0369a1;
}

/* ==========================================================================
   Remedy sections
   ========================================================================== */

.hprg-remedy-section {
    margin-bottom: 1.9rem;
}

.hprg-remedy-section h2 {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: #0f172a;
}

.hprg-remedy-section .hprg-muted {
    margin-bottom: 0.65rem;
}

/* --- Key remedy list (textbook-style list with notes) -------------------- */

/* Style for Key Remedies → remedy name link */
.hprg-key-remedy-list a.hprg-remedy-link {
    font-size: 1.05rem;      /* increase size */
    font-weight: 650;        /* make slightly bold */
    color: #34A853;          /* darker readable color */
    letter-spacing: 0.2px;   /* optional */
}

.hprg-key-remedy-list a.hprg-remedy-link:hover {
    text-decoration: underline;
    color: #4285F4; /* optional hover color */
}


.hprg-key-remedy-list {
    list-style: none;
    margin: 0.35rem 0 1.1rem;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.hprg-key-remedy-list li {
    padding: 0.55rem 0.85rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.95rem;
    color: #111827;
    line-height: 1.5;
}

.hprg-key-remedy-list li:first-child {
    border-top: none;
}

.hprg-key-remedy-list a {
    font-weight: 600;
    color: #0369a1;
    text-decoration: none;
    margin-right: 0.3rem;
}

.hprg-key-remedy-list a:hover {
    text-decoration: underline;
}

.hprg-key-remedy-note {
    display: inline-block;
    font-size: 0.9rem;
    color: #4b5563;
}


/* --- Pill list for “other noted remedies” -------------------------------- */

.hprg-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.hprg-remedy-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #d4d4d8;
    background: #ffffff;
    font-size: 0.86rem;
    line-height: 1.2;
    text-decoration: none;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.hprg-remedy-pill:hover {
    border-color: #0ea5e9;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
    text-decoration: none;
}

.hprg-remedy-pill span.hprg-remedy-note {
    margin-left: 0.25rem;
    font-size: 0.76rem;
    color: #6b7280;
}

/* ==========================================================================
   Usage + safety sections (info cards grid)
   ========================================================================== */

.hprg-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.hprg-info-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 1rem 1.15rem;
    background-color: #ffffff;
    font-size: 0.94rem;
    color: #111827;
    line-height: 1.6;
}

.hprg-info-card h2 {
    font-size: 1.08rem;
    font-weight: 600;
    margin: 0 0 0.55rem;
    color: #0f172a;
}

.hprg-info-card ol {
    margin: 0.25rem 0 0.25rem 1.15rem;
    padding: 0;
}

.hprg-info-card ol li {
    margin-bottom: 0.4rem;
}

.hprg-info-card strong {
    font-weight: 600;
}

.hprg-info-card-muted {
    background-color: #f9fafb;
}

/* Backwards-compatible names from earlier version */
.hprg-usage-section {
    margin-bottom: 1.9rem;
}

.hprg-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #0f172a;
}

.hprg-usage-list {
    margin: 0.25rem 0 0.75rem 1.2rem;
    padding: 0;
    font-size: 0.95rem;
    color: #374151;
}

.hprg-usage-list li {
    margin-bottom: 0.35rem;
}

.hprg-safe-note {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
}

/* ==========================================================================
   Related groups
   ========================================================================== */

.hprg-related-groups {
    margin-top: 2rem;
    padding-top: 1.1rem;
    border-top: 1px solid #e5e7eb;
}

.hprg-related-groups h2 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.hprg-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.94rem;
}

.hprg-related-list li {
    margin: 0.25rem 0;
}

.hprg-related-list a {
    text-decoration: none;
    color: #0f172a;
}

.hprg-related-list a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Small muted notes
   ========================================================================== */

.hprg-muted {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ==========================================================================
   New archive layout: hero + two-column main + sidebar + pagination
   ========================================================================== */

.hprg-archive-shell {
    /* uses same max-width / padding as .hprg-archive-wrap via existing rules */
}

/* Hero / intro at the top of the card */
.hprg-archive-hero {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.hprg-hero-main {
    flex: 2;
}

.hprg-archive-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: #0f172a;
}

.hprg-archive-intro {
    margin: 0;
    color: #4b5563;
    font-size: 0.96rem;
    max-width: 720px;
}

/* Stat tiles on the right */
.hprg-hero-stats {
    flex: 1.1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: stretch;
}

.hprg-stat {
    min-width: 120px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.55rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.hprg-stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.hprg-stat-value {
    font-size: 1.1rem;
    font-weight: 650;
    color: #0f172a;
}

.hprg-stat-inline .hprg-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    font-style: italic;
}


/* Tools list base */
.hprg-tools-nav {
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.hprg-tools-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hprg-tool-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3); /* slate-400-ish */
}

.hprg-tool-item:last-child {
    border-bottom: none;
}

.hprg-tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.18s ease, transform 0.18s ease;
}

.hprg-tool-icon {
    display: inline-flex;
    width: 1.6rem;
    justify-content: center;
    font-size: 1.2rem;
}

.hprg-tool-label {
    display: inline-block;
}

.hprg-tool-note {
    display: block;
    font-size: 0.8rem;
    color: #64748b; /* slate-500 */
    margin-left: 2.1rem; /* align under label, after icon */
    margin-top: 0.1rem;
}

/* Hover / focus state */
.hprg-tool-link:hover,
.hprg-tool-link:focus {
    color: #0f766e; /* teal-ish accent */
    transform: translateX(1px);
    outline: none;
}

.hprg-tool-link:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

/* More tools toggle button */
.hprg-tools-more-toggle {
    margin-top: 0.35rem;
    border: none;
    background: transparent;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a; /* slate-900 */
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.hprg-tools-more-toggle:hover .hprg-tools-more-label {
    text-decoration: underline;
}

.hprg-tools-more-icon {
    transition: transform 0.18s ease;
}

.hprg-tools-more-toggle[aria-expanded="true"] .hprg-tools-more-icon {
    transform: rotate(180deg);
}

/* Compact mode: hide "more" tools until expanded */
.hprg-tools-list--compact [data-hprg-more="1"] {
    display: none;
}

/* When expanded: show them again */
.hprg-tools-list--expanded [data-hprg-more="1"] {
    display: block;
}

/* Recommended for you block */
.hprg-tools-recommended {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

.hprg-tools-recommended-title {
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
    font-weight: 700;
    color: #0f172a;
}

.hprg-tools-recommended-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hprg-tools-recommended-list li {
    padding: 0.25rem 0;
}

.hprg-tools-recommended-list a {
    font-size: 0.88rem;
    text-decoration: none;
}

.hprg-tools-recommended-list a:hover,
.hprg-tools-recommended-list a:focus {
    text-decoration: underline;
}

/* Mobile tweaks: slightly tighter vertical spacing */
@media (max-width: 768px) {
    .hprg-tool-item {
        padding: 0.45rem 0;
    }

    .hprg-tool-note {
        font-size: 0.78rem;
        margin-left: 2rem;
    }

    .hprg-sidebar-card.hprg-sidebar-ads {
        padding-bottom: 0.75rem;
    }
}

/* ==========================================================================
   Main layout: content + sidebar
   ========================================================================== */

.hprg-archive-main {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr);
    gap: 1.75rem;
    align-items: flex-start;
}

/* Main column (search + grid + pagination) */
.hprg-main-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sidebar column */
.hprg-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cards inside sidebar */
.hprg-sidebar-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.9rem 1rem 1rem;
    font-size: 0.9rem;
    color: #111827;
    line-height: 1.5;
}

.hprg-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
    color: #0f172a;
}

.hprg-sidebar-list {
    margin: 0.25rem 0 0.25rem 1.1rem;
    padding: 0;
}

.hprg-sidebar-list li {
    margin-bottom: 0.35rem;
}

.hprg-sidebar-text {
    margin: 0 0 0.5rem;
    color: #4b5563;
    font-size: 0.9rem;
}

/* Sidebar chips reuse existing tag-chip styles */
.hprg-sidebar-chips .hprg-tag-chips {
    margin-top: 0.35rem;
}

.hprg-sidebar-ads .hprg-ad-slot {
    margin-top: 0.45rem;
}

/* Placeholder for AdSense / internal banner */
.hprg-ad-slot-sidebar {
    min-height: 120px;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: #9ca3af;
}

/* ==========================================================================
   Search block (within main column)
   ========================================================================== */

.hprg-search-block {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 1rem 1.1rem 1.15rem;
}

.hprg-search-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #0f172a;
}

.hprg-search-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Reuse existing .hprg-search-input-wrap / .hprg-search-input / .hprg-search-results */

/* ==========================================================================
   Section title above grid
   ========================================================================== */

.hprg-groups-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hprg-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
}

/* ==========================================================================
   Pagination styling
   ========================================================================== */

.hprg-pagination {
    margin-top: 1.6rem;
    text-align: center;
}

.hprg-pagination .page-numbers {
    display: inline-block;
    margin: 0 0.12rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 0.86rem;
    text-decoration: none;
    color: #374151;
    background: #ffffff;
}

.hprg-pagination .page-numbers:hover {
    border-color: #0ea5e9;
    color: #0f172a;
}

.hprg-pagination .page-numbers.current {
    border-color: #0ea5e9;
    background: #0ea5e9;
    color: #ffffff;
    font-weight: 600;
}

.hprg-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    color: #9ca3af;
}


/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 900px) {
    .hprg-info-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .hprg-archive-wrap,
    .hprg-single-wrap {
        margin: 1.25rem auto 2rem;
        padding: 0 0.75rem;
    }

    .hprg-archive-wrap > *,
    .hprg-single-wrap > *,
    .hprg-archive-inner,
    .hprg-single-inner {
        padding: 1.25rem 1.25rem 1.75rem;
        border-radius: 14px;
    }

    .hprg-group-meta-card h1 {
        font-size: 1.45rem;
    }
}

@media (max-width: 480px) {
    .hprg-page-title {
        font-size: 1.5rem;
    }
}

    .hprg-archive-stats {
        flex-direction: column;
        align-items: flex-start;
    }

    .hprg-search-summary {
        margin-left: 0;
    }

