/* Cyclists Hub Review box: front-end styles. Body rules are scoped as ".chrb .chrb-body …" so they
   outrank theme rules like ".entry-content p" / ".entry-content ul" margins and link underlines.
   Visual language follows the Cyclists Hub tools (tire pressure calculator): 5/10px radii, soft navy shadows. */

.chrb {
    --chrb-main: #1d3461;
    --chrb-main-dark: #1a2f58;
    --chrb-medium: #247ba0;
    --chrb-sky: #7fd3ef;
    --chrb-light: #e7f8ff;
    --chrb-tint: #f7fbfd;
    --chrb-cta: #ff1861;
    --chrb-cta-dark: #e01050;
    --chrb-border: #e0e6ef;
    --chrb-good: #00de00;   /* same green as /ratings/wheels/ stars and score badges */
    --chrb-mid: #ffa500;
    --chrb-bad: #ff0000;
    --chrb-radius: 5px;
    --chrb-radius-lg: 10px;
    --chrb-shadow-1: 0 1px 2px #1d34610f, 0 2px 8px #1d34610d;
    --chrb-shadow-2: 0 2px 4px #1d346112, 0 8px 24px #1d346114;
    --chrb-shadow-cta: 0 4px 14px #ff186159;
    --chrb-shadow-cta-hover: 0 8px 22px #ff186173;
    --chrb-ease: cubic-bezier(.22, 1, .36, 1);

    container-type: inline-size;
    margin: 0 0 2em;
    border: 1px solid var(--chrb-border);
    border-radius: var(--chrb-radius-lg);
    background: #fff;
    box-shadow: var(--chrb-shadow-2);
    color: var(--chrb-main);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.chrb *,
.chrb *::before,
.chrb *::after {
    box-sizing: border-box;
}

.chrb-good { --chrb-band: var(--chrb-good); }
.chrb-mid  { --chrb-band: var(--chrb-mid); }
.chrb-bad  { --chrb-band: var(--chrb-bad); }

/* ---------- Header: overall score ---------- */

.chrb-overall {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 16px;
    padding: 14px 16px;
    border-radius: var(--chrb-radius-lg) var(--chrb-radius-lg) 0 0;
    background: linear-gradient(135deg, var(--chrb-main) 0%, var(--chrb-main-dark) 100%);
    color: #fff;
    text-align: center;
}

.chrb-overall-score {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.chrb-overall-score small {
    margin-left: 3px;
    font-size: 18px;
    font-weight: 500;
    opacity: .9;
}

.chrb-overall-label {
    font-size: 20px;
    font-weight: 700;
}

.chrb-stars {
    position: relative;
    display: inline-block;
    color: var(--chrb-band);
    font-size: 22px;
    letter-spacing: 2px;
    line-height: 1;
}

.chrb-stars-base { color: rgba(255, 255, 255, .22); }

.chrb-stars-fill {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    white-space: nowrap;
}

.chrb .chrb-overall a.chrb-edit,
.chrb .chrb-overall a.chrb-edit:visited {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 2px 10px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.chrb .chrb-overall a.chrb-edit:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.chrb-draft {
    padding: 2px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--chrb-main);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ---------- Body ---------- */

.chrb-body {
    padding: 20px 24px 24px;
}

/* ---------- Criteria grid ---------- */

.chrb .chrb-body .chrb-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 32px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.chrb .chrb-body .chrb-crit {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 6px 8px;
    border-radius: var(--chrb-radius);
    transition: background-color .2s var(--chrb-ease);
}

.chrb .chrb-body .chrb-crit:hover {
    background: var(--chrb-tint);
}

.chrb .chrb-body .chrb-crit-score {
    flex: 0 0 40px;
    padding: 3px 0;
    border-radius: var(--chrb-radius);
    background: var(--chrb-band);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.chrb .chrb-body .chrb-crit-label {
    font-size: 16px;
    font-weight: 500;
}

.chrb .chrb-body button.chrb-info {
    box-sizing: border-box;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
    box-shadow: none;
    border: 1.5px solid var(--chrb-medium);
    border-radius: 50%;
    background: transparent;
    color: var(--chrb-medium);
    font: 700 11px/1 'Roboto', sans-serif;
    cursor: pointer;
    transition: background-color .2s var(--chrb-ease), color .2s var(--chrb-ease);
}

.chrb .chrb-body button.chrb-info svg {
    display: block;
    flex: none;
}

.chrb .chrb-body button.chrb-info:hover,
.chrb .chrb-body button.chrb-info[aria-expanded="true"] {
    background: var(--chrb-medium);
    color: #fff;
}

.chrb .chrb-body button.chrb-info:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(127, 211, 239, .5);
}

@container (min-width: 820px) {
    .chrb .chrb-body .chrb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; }
    .chrb .chrb-body .chrb-method { grid-column: 1 / -1; }
}

/* Methodology note fills the empty cell after the last criterion (2 columns), or its own row (3 columns). */
.chrb .chrb-body .chrb-method {
    display: block;
    align-self: center;
    margin: 0;
    padding: 6px 8px;
    color: var(--chrb-main);
    font-size: 14px;
}

.chrb .chrb-body .chrb-method a {
    color: var(--chrb-medium);
    font-weight: 500;
}

/* ---------- Tooltip ---------- */

.chrb .chrb-body .chrb-tip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: min(340px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid var(--chrb-border);
    border-radius: var(--chrb-radius-lg);
    background: #fff;
    box-shadow: 0 4px 8px #1d346114, 0 16px 40px #1d34611f;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.chrb .chrb-body .chrb-tip[hidden] { display: none; }

.chrb .chrb-body .chrb-tip-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.chrb .chrb-body .chrb-tip p {
    margin: 0 0 10px;
}

.chrb .chrb-body .chrb-tip-level {
    padding: 6px 10px;
    border-radius: var(--chrb-radius);
    background: var(--chrb-light);
}

.chrb .chrb-body .chrb-range {
    position: relative;
    height: 6px;
    margin: 18px 0 6px;
    border-radius: 999px;
    background: #eef2f6;
}

.chrb .chrb-body .chrb-range-band {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: #c3dfec;
}

.chrb .chrb-body .chrb-range-avg {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    background: var(--chrb-main);
}

.chrb .chrb-body .chrb-range-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--chrb-band);
    box-shadow: 0 0 0 1px var(--chrb-main);
}

.chrb .chrb-body .chrb-range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--chrb-main);
    font-size: 12px;
}

.chrb .chrb-body .chrb-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 10px 0 0;
    text-align: center;
}

.chrb .chrb-body .chrb-stats dt {
    color: var(--chrb-main);
    font-size: 11px;
    line-height: 1.3;
    text-transform: uppercase;
}

.chrb .chrb-body .chrb-stats dd {
    margin: 0;
    font-weight: 700;
}

/* ---------- Specs: one compact strip ---------- */

.chrb .chrb-body .chrb-specs {
    display: flex;
    flex-wrap: nowrap;   /* always one row; long labels (Czech) wrap inside their cell instead */
    margin: 0 0 20px;
    padding: 0;
    border-radius: var(--chrb-radius);
    background: var(--chrb-light);
}

.chrb .chrb-body .chrb-spec {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    align-content: center;
    gap: 0 6px;
    min-width: 0;
    padding: 8px 14px;
    border-right: 1px solid #c3dfec;
}

.chrb .chrb-body .chrb-spec dd {
    white-space: nowrap;
}

.chrb .chrb-body .chrb-spec-alt {
    font-weight: 500;
}

.chrb .chrb-body .chrb-spec:last-child {
    border-right: 0;
}

.chrb .chrb-body .chrb-spec dt {
    color: var(--chrb-medium);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.chrb .chrb-body .chrb-spec dd {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

/* ---------- Summary, Buy if / Avoid if ---------- */

.chrb .chrb-body .chrb-summary-title {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 700;
}

.chrb .chrb-body .chrb-summary {
    margin: 0 0 16px;
    font-size: 17px;
}

.chrb .chrb-body .chrb-verdict {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 20px;
}

.chrb .chrb-body .chrb-verdict-col {
    padding: 0;
}

.chrb .chrb-body .chrb-verdict-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
}

.chrb .chrb-body .chrb-verdict ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.chrb .chrb-body .chrb-verdict li {
    position: relative;
    margin: 0 0 6px;
    padding-left: 26px;
}

.chrb .chrb-body .chrb-verdict li:last-child {
    margin-bottom: 0;
}

.chrb .chrb-body .chrb-verdict li::before {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--chrb-band);
    font-weight: 700;
}

.chrb .chrb-body .chrb-buy-if li::before { content: '\2713'; }
.chrb .chrb-body .chrb-avoid-if li::before { content: '\2717'; }

/* ---------- CTA ---------- */

.chrb .chrb-body .chrb-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 16px;
}

.chrb .chrb-cta-row a.chrb-cta,
.chrb .chrb-cta-row a.chrb-cta:visited {
    display: inline-block;
    min-width: 160px;
    padding: 8px 24px;
    text-align: center;
    letter-spacing: 1px;
    line-height: 1.4;
    border-radius: var(--chrb-radius);
    background: var(--chrb-cta);
    box-shadow: var(--chrb-shadow-cta);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s var(--chrb-ease), box-shadow .2s var(--chrb-ease), background-color .2s var(--chrb-ease);
}

.chrb .chrb-cta-row a.chrb-cta:hover,
.chrb .chrb-cta-row a.chrb-cta:focus-visible {
    text-decoration: none;
    background: var(--chrb-cta-dark);
    box-shadow: var(--chrb-shadow-cta-hover);
    color: #fff;
    transform: translateY(-1px);
}

.chrb .chrb-body .chrb-promo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--chrb-main);
    font-size: 15px;
}

.chrb .chrb-body .chrb-code {
    padding: 7px 12px;
    border: 1.5px dashed var(--chrb-cta);
    border-radius: var(--chrb-radius);
    background: #fff0f5;
    color: var(--chrb-main);
    font: 700 15px/1.2 'Roboto', sans-serif;
    letter-spacing: .5px;
    cursor: pointer;
}

.chrb .chrb-body .chrb-promo strong {
    color: var(--chrb-main);
    font-weight: 700;
}

.chrb .chrb-body .chrb-code[data-copied]::after {
    content: ' \2713';
    color: var(--chrb-cta);
}

@media (prefers-reduced-motion: reduce) {
    .chrb * { transition: none !important; }
}

/* ---------- Tablet and mobile: promo line centred above a full-width button ---------- */

@media (max-width: 1024px) {
    .chrb .chrb-body .chrb-cta-row { justify-content: center; }
    .chrb .chrb-body .chrb-promo { flex-wrap: wrap; justify-content: center; width: 100%; text-align: center; }
    .chrb .chrb-body .chrb-cta-row a.chrb-cta { width: 100%; }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .chrb .chrb-overall a.chrb-edit { position: static; transform: none; }
    .chrb-overall { padding: 14px 16px; }
    .chrb-body { padding: 16px; }
    .chrb .chrb-body .chrb-grid,
    .chrb .chrb-body .chrb-verdict { grid-template-columns: 1fr; }
    .chrb .chrb-body .chrb-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chrb .chrb-body .chrb-spec { flex-direction: column; align-items: flex-start; align-content: flex-start; gap: 0; padding: 5px 10px; }
    .chrb .chrb-body .chrb-spec dt { font-size: 11px; }
    .chrb .chrb-body .chrb-spec dd { white-space: normal; }
    .chrb .chrb-body .chrb-spec:nth-child(2n) { border-right: 0; }
    .chrb .chrb-body .chrb-spec:nth-child(-n+2) { border-bottom: 1px solid #c3dfec; }
    .chrb .chrb-body .chrb-tip { width: 100%; }
}
